Historique des modifications - Message

Message #8838

Sujet: Sélection de SceneNode avec une caméra de type WOW


Type Date Auteur Contenu
Dernière modification 18-09-2010 16:49:32 TUpac
J'aime bien discuter sur les forums mais la franchement c'est le tuto officiel 7 (livré dans le sdk)
allez ! je file le bout interressant:

Code c++ :

// All intersections in this example are done with a ray cast out from the camera to
                // a distance of 1000.  You can easily modify this to check (e.g.) a bullet
                // trajectory or a sword's position, or create a ray from a mouse click position using
                // ISceneCollisionManager::getRayFromScreenCoordinates()
                core::line3d<f32> ray;
                ray.start = camera->getPosition();
                ray.end = ray.start + (camera->getTarget() - ray.start).normalize() * 1000.0f;

                // Tracks the current intersection point with the level or a mesh
                core::vector3df intersection;
                // Used to show with triangle has been hit
                core::triangle3df hitTriangle;

                // This call is all you need to perform ray/triangle collision on every scene node
                // that has a triangle selector, including the Quake level mesh.  It finds the nearest
                // collision point/triangle, and returns the scene node containing that point.
                // Irrlicht provides other types of selection, including ray/triangle selector,
                // ray/box and ellipse/triangle selector, plus associated helpers.
                // See the methods of ISceneCollisionManager
                scene::ISceneNode * selectedSceneNode =
                        collMan->getSceneNodeAndCollisionPointFromRay(
                                        ray,
                                        intersection, // This will be the position of the collision
                                        hitTriangle, // This will be the triangle hit in the collision
                                        IDFlag_IsPickable, // This ensures that only nodes that we have
                                                        // set up to be pickable are considered
                                        0); // Check the entire scene (this is actually the implicit default)

                // If the ray hit anything, move the billboard to the collision position
                // and draw the triangle that was hit.
                if(selectedSceneNode)
                {................

Création du message 18-09-2010 16:48:08 TUpac
J'aime bien discuter sur les forums mais la franchement c'est le tuto officiel 7 (livré dans le sdk)
allez ! je file le bout interressant:

Code c++ :

// All intersections in this example are done with a ray cast out from the camera to
                // a distance of 1000.  You can easily modify this to check (e.g.) a bullet
                // trajectory or a sword's position, or create a ray from a mouse click position using
                // ISceneCollisionManager::getRayFromScreenCoordinates()
                core::line3d<f32> ray;
                ray.start = camera->getPosition();
                ray.end = ray.start + (camera->getTarget() - ray.start).normalize() * 1000.0f;

                // Tracks the current intersection point with the level or a mesh
                core::vector3df intersection;
                // Used to show with triangle has been hit
                core::triangle3df hitTriangle;

                // This call is all you need to perform ray/triangle collision on every scene node
                // that has a triangle selector, including the Quake level mesh.  It finds the nearest
                // collision point/triangle, and returns the scene node containing that point.
                // Irrlicht provides other types of selection, including ray/triangle selector,
                // ray/box and ellipse/triangle selector, plus associated helpers.
                // See the methods of ISceneCollisionManager
                scene::ISceneNode * selectedSceneNode =
                        collMan->getSceneNodeAndCollisionPointFromRay(
                                        ray,
                                        intersection, // This will be the position of the collision
                                        hitTriangle, // This will be the triangle hit in the collision
                                        IDFlag_IsPickable, // This ensures that only nodes that we have
                                                        // set up to be pickable are considered
                                        0); // Check the entire scene (this is actually the implicit default)

                // If the ray hit anything, move the billboard to the collision position
                // and draw the triangle that was hit.
                if(selectedSceneNode)
                {................


Retour

Options Liens officiels Caractéristiques Statistiques Communauté
Préférences cookies
Corrections
irrlicht
irrklang
irredit
irrxml
Propulsé par Django
xhtml 1.0
css 2.1
884 membres
1440 sujets
11337 messages
Dernier membre inscrit: Saidov17
112 invités en ligne
membre en ligne: -
RSS Feed