irr::scene::ICameraSceneNode* cam
= SceneManager
->addCameraSceneNode
(node
, irr::core::vector3df
(10,10,40),node
->getPosition
()); CSceneNodeAnimatorCameraTrackball
*cam_animator
= new CSceneNodeAnimatorCameraTrackball
(VideoDriver
, Irr_Device
->getCursorControl
(), 50,4,6); cam
->addAnimator
(cam_animator
); cam_animator
->drop
(); irr::scene::ITriangleSelector *terrain_selector
= SceneManager
->createTerrainTriangleSelector
(terrain
, 0); terrain
->setTriangleSelector
(terrain_selector
); irr::scene::ITriangleSelector *node_selector
= SceneManager
->createTriangleSelectorFromBoundingBox
(node
); node
->setTriangleSelector
(node_selector
); irr::scene::IMetaTriangleSelector *meta_cam
= SceneManager
->createMetaTriangleSelector
(); meta_cam
->addTriangleSelector
(terrain_selector
); meta_cam
->addTriangleSelector
(node_selector
); irr::scene::ISceneNodeAnimator
*colli_cam_anim
= SceneManager
->createCollisionResponseAnimator
(meta_cam
, cam
, irr::core::vector3df
(10, 20, 10), irr::core::vector3df
(0,0,0), irr::core::vector3df
(0,0,0)); cam
->addAnimator
(colli_cam_anim
); colli_cam_anim
->drop
(); const irr::core::aabbox3d<irr::f32
>& box
= node
->getBoundingBox
(); irr::core::vector3df radius
= box
.MaxEdge
- box
.getCenter
(); irr::f32 ellipseYOffset
= (box
.MaxEdge
.Y
+ box
.MinEdge
.Y
)*0.5f; irr::scene::ISceneNodeAnimator
*colli_node_anim
= SceneManager
->createCollisionResponseAnimator
(terrain_selector
, node
, radius
, irr::core::vector3df
(0,-10,0),irr::core::vector3df
(0,ellipseYOffset
,0)); node
->addAnimator
(colli_node_anim
); colli_node_anim
->drop
(); terrain_selector
->drop
(); node_selector
->drop
(); meta_cam
->drop
();