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 (std::weak_ptr< ChPhysicsItem > mphysicsitem, irr::scene::ISceneNode *parent, irr::scene::ISceneManager *mgr, irr::s32 id)
 Build a scene node for the Irrlicht Engine. More...
 
 ~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 simulation system.
 
virtual void SetChronoControlled (const bool &controlled)
 Set true if the node must be moved by Chrono simulation system (it follows a ChPhysicsItem that contains a ChIrrNodeAsset, proxy to this).
 
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
 

Constructor & Destructor Documentation

◆ ChIrrNode()

chrono::irrlicht::ChIrrNode::ChIrrNode ( std::weak_ptr< ChPhysicsItem mphysicsitem,
irr::scene::ISceneNode *  parent,
irr::scene::ISceneManager *  mgr,
irr::s32  id 
)

Build a scene node for the Irrlicht Engine.

This scene node also has a pointer to a rigid body for the Chrono 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.

Parameters
mphysicsitempointer to the Chrono item (es. rigid body)
parentthe parent node in Irrlicht hierarchy
mgrthe Irrlicht scene manager
idthe Irrlicht identifier

Member Function Documentation

◆ GetPhysicsItem()

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

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

a ChBody) wrapped by this scene node.

◆ SetupClones()

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)


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_irrlicht/ChIrrNode.h
  • /builds/uwsbel/chrono/src/chrono_irrlicht/ChIrrNode.cpp