chrono::irrlicht::ChIrrNode Class Reference

Description

Class for Irrlicht visualization.

It will be managed by a ChIrrNodeAsset asset to be added among the ChBody assets. Such ChIrrNode can automatically be populated with Irrlicht meshes, each inside a ChIrrNodeProxyToAsset, that will correspond to shapes that have been added as ChVisualization assets in ChBody.

Example: (with ascii art, with –> shared pointer, ...> raw pointer)

CHRONO side IRRLICHT side ChBody <....................... ChIrrNodeAsset -----—> ChIrrNode ChBoxShape <-----------— ChIrrNodeProxyToAsset IMeshSceneNode ChSphereShape <---------— ChIrrNodeProxyToAsset IMeshSceneNode

#include <ChIrrNode.h>

Inherits ISceneNode.

Public Member Functions

 ~ChIrrNode ()
 Destructor.
 
virtual void OnRegisterSceneNode ()
 
virtual void render ()
 
virtual const
irr::core::aabbox3d< irr::f32 > & 
getBoundingBox () const
 
virtual void setMaterialTexture (irr::s32 textureLayer, irr::video::ITexture *texture)
 
ISceneNode * clone (ISceneNode *newParent, irr::scene::ISceneManager *newManager)
 
bool SetupClones ()
 This function is needed only when using the 'clones' feature, i.e. More...
 
void OnAnimate (irr::u32 timeMs)
 
std::weak_ptr< ChPhysicsItemGetPhysicsItem ()
 Returns reference to the pointer which references the ChPhysicsItem (ex. More...
 
virtual bool IsChronoControlled () const
 Returns true if the node is moved by Chrono::Engine simulation system.
 
virtual void SetChronoControlled (const bool &controlled)
 Set true if the node must be moved by Chrono::Engine simulation system (it follows a ChPhysicsItem that contains a ChIrrNodeAsset, proxy to this). More...
 
virtual void UpdateAssetsProxies ()
 Updates the children Irr mesh nodes to reflect the ChVisualization assets, by spawning the Update() command to all children ChIrrNodeProxyToAsset.
 
virtual
irr::scene::ESCENE_NODE_TYPE 
getType () const
 

Public Attributes

irr::scene::ISceneNode * parent
 Build a scene node for the Irrlicht Engine. More...
 
irr::scene::ISceneNode
irr::scene::ISceneManager * 
mgr
 the Irrlicht scene manager
 
irr::scene::ISceneNode
irr::scene::ISceneManager
irr::s32 
id
 < the Irrlicht identifier
 

Member Function Documentation

std::weak_ptr<ChPhysicsItem> chrono::irrlicht::ChIrrNode::GetPhysicsItem ( )

Returns reference to the pointer which references the ChPhysicsItem (ex.

a ChBody) wrapped by this scene node.

virtual void chrono::irrlicht::ChIrrNode::SetChronoControlled ( const bool &  controlled)
virtual

Set true if the node must be moved by Chrono::Engine simulation system (it follows a ChPhysicsItem that contains a ChIrrNodeAsset, proxy to this).

bool chrono::irrlicht::ChIrrNode::SetupClones ( )

This function is needed only when using the 'clones' feature, i.e.

shapes in assets define a sample that must be cloned (ex in ChParticleClones)

Member Data Documentation

irr::scene::ISceneNode* chrono::irrlicht::ChIrrNode::parent

Build a scene node for the Irrlicht Engine.

This scene node also has a pointer to a rigid body for the Chrono::Engine multibody simulation. To delete a ChIrrSceneNode node from an Irrlicht scene, use the remove() function from the Irrlicht side (it won't delete the C::E body, though), or better delete the corresponding ChIrrlichtObj asset from the C::E side, or delete the full C::E body. the parent node in Irrlicht hierarchy