PeriDyno 0.9.2
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
dyno::Vechicle< TDataType > Class Template Reference

#include <Vechicle.h>

Inheritance diagram for dyno::Vechicle< TDataType >:
Inheritance graph
[legend]
Collaboration diagram for dyno::Vechicle< TDataType >:
Collaboration graph
[legend]

Public Types

typedef TDataType::Real Real
 
typedef TDataType::Coord Coord
 
typedef TDataType::Matrix Matrix
 
typedef Pair< uint, uintBindingPair
 
- Public Types inherited from dyno::RigidBodySystem< TDataType >
typedef TDataType::Real Real
 
typedef TDataType::Coord Coord
 
typedef TDataType::Matrix Matrix
 
typedef dyno::TSphere3D< RealSphere3D
 
typedef dyno::TOrientedBox3D< RealBox3D
 
typedef dyno::Quat< RealTQuat
 
typedef dyno::TContactPair< RealContactPair
 
typedef BallAndSocketJoint< RealBallAndSocketJoint
 
typedef SliderJoint< RealSliderJoint
 
typedef HingeJoint< RealHingeJoint
 
typedef FixedJoint< RealFixedJoint
 
typedef PointJoint< RealPointJoint
 
- Public Types inherited from dyno::Node
template<class T >
using SPtr = std::shared_ptr< T >
 
- Public Types inherited from dyno::OBase
typedef std::vector< FBase * > FieldVector
 
typedef std::map< FieldID, FBase * > FieldMap
 

Public Member Functions

 Vechicle ()
 
 ~Vechicle () override
 
void bind (std::shared_ptr< PdActor > actor, Pair< uint, uint > shapeId)
 
 DEF_INSTANCE_IN (TextureMesh, TextureMesh, "Texture mesh of the vechicle")
 
 DEF_INSTANCE_IN (TriangleSet< TDataType >, TriangleSet, "TriangleSet of the boundary")
 
 DEF_ARRAYLIST_STATE (Transform3f, InstanceTransform, DeviceType::GPU, "Instance transforms")
 
- Public Member Functions inherited from dyno::RigidBodySystem< TDataType >
 RigidBodySystem ()
 
 ~RigidBodySystem () override
 
std::shared_ptr< PdActoraddBox (const BoxInfo &box, const RigidBodyInfo &bodyDef, const Real density=Real(100))
 
std::shared_ptr< PdActoraddSphere (const SphereInfo &sphere, const RigidBodyInfo &bodyDef, const Real density=Real(100))
 
std::shared_ptr< PdActoraddTet (const TetInfo &tet, const RigidBodyInfo &bodyDef, const Real density=Real(100))
 
std::shared_ptr< PdActoraddCapsule (const CapsuleInfo &capsule, const RigidBodyInfo &bodyDef, const Real density=Real(100))
 
BallAndSocketJointcreateBallAndSocketJoint (std::shared_ptr< PdActor > actor1, std::shared_ptr< PdActor > actor2)
 
SliderJointcreateSliderJoint (std::shared_ptr< PdActor > actor1, std::shared_ptr< PdActor > actor2)
 
HingeJointcreateHingeJoint (std::shared_ptr< PdActor > actor1, std::shared_ptr< PdActor > actor2)
 
FixedJointcreateFixedJoint (std::shared_ptr< PdActor > actor1, std::shared_ptr< PdActor > actor2)
 
FixedJointcreateUnilateralFixedJoint (std::shared_ptr< PdActor > actor1)
 
PointJointcreatePointJoint (std::shared_ptr< PdActor > actor1)
 
Mat3f pointInertia (Coord v1)
 
 DEF_VAR (bool, FrictionEnabled, true, "A toggle to control the friction")
 
 DEF_VAR (bool, GravityEnabled, true, "A toggle to control the gravity")
 
 DEF_VAR (Real, GravityValue, 9.8, "")
 
 DEF_VAR (Real, FrictionCoefficient, 2.0, "")
 
 DEF_VAR (Real, Slop, 0.001, "")
 
 DEF_INSTANCE_STATE (DiscreteElements< TDataType >, Topology, "Topology")
 
 DEF_ARRAY_STATE (Real, Mass, DeviceType::GPU, "Mass of rigid bodies")
 Particle position.
 
 DEF_ARRAY_STATE (Coord, Center, DeviceType::GPU, "Center of rigid bodies")
 Particle position.
 
 DEF_ARRAY_STATE (Coord, Offset, DeviceType::GPU, "Offset of barycenters")
 The initial offset of barycenters.
 
 DEF_ARRAY_STATE (Coord, Velocity, DeviceType::GPU, "Velocity of rigid bodies")
 Particle position.
 
 DEF_ARRAY_STATE (Coord, AngularVelocity, DeviceType::GPU, "Angular velocity of rigid bodies")
 Particle position.
 
 DEF_ARRAY_STATE (Matrix, RotationMatrix, DeviceType::GPU, "Rotation matrix of rigid bodies")
 Particle position.
 
 DEF_ARRAY_STATE (Matrix, Inertia, DeviceType::GPU, "Inertia matrix")
 
 DEF_ARRAY_STATE (TQuat, Quaternion, DeviceType::GPU, "Quaternion")
 
 DEF_ARRAY_STATE (CollisionMask, CollisionMask, DeviceType::GPU, "Collision mask for each rigid body")
 
 DEF_ARRAY_STATE (Attribute, Attribute, DeviceType::GPU, "Rigid body attributes")
 
 DEF_ARRAY_STATE (Matrix, InitialInertia, DeviceType::GPU, "Initial inertia matrix")
 
int getSamplingPointSize ()
 
DArray2D< Vec3fgetSamples ()
 
DArray2D< Vec3fgetNormals ()
 
- Public Member Functions inherited from dyno::Node
 Node ()
 
 ~Node () override
 
void setName (std::string name)
 
std::string getName () override
 
virtual std::string getNodeType ()
 
bool isAutoSync ()
 
void setAutoSync (bool con)
 Whether the node can be automatically synchronized when its ancestor is updated.
 
virtual bool isActive ()
 Check the state of dynamics.
 
virtual void setActive (bool active)
 Set the state of dynamics.
 
virtual bool isVisible ()
 Check the visibility of context.
 
virtual void setVisible (bool visible)
 Set the visibility of context.
 
virtual Real getDt ()
 Simulation timestep.
 
void setDt (Real dt)
 
void setSceneGraph (SceneGraph *scn)
 
SceneGraphgetSceneGraph ()
 
std::vector< NodePort * > & getImportNodes ()
 
std::vector< NodePort * > & getExportNodes ()
 
bool addModule (std::shared_ptr< Module > module)
 Add a module to m_module_list and other special module lists.
 
bool deleteModule (std::shared_ptr< Module > module)
 
template<class TModule >
bool addModule (std::shared_ptr< TModule > tModule)
 Add a speical kind of module.
 
template<class TModule >
bool deleteModule (std::shared_ptr< TModule > tModule)
 
std::list< std::shared_ptr< Module > > & getModuleList ()
 
bool hasModule (std::string name)
 
std::shared_ptr< ModulegetModule (std::string name)
 Get a module by its name.
 
template<class TModule >
std::shared_ptr< TModulegetModule ()
 Get the Module by the module class name.
 
template<class TModule >
std::shared_ptr< TModulegetModule (std::string name)
 
std::shared_ptr< PipelineresetPipeline ()
 
std::shared_ptr< AnimationPipelineanimationPipeline ()
 
std::shared_ptr< GraphicsPipelinegraphicsPipeline ()
 
template<class TModule >
std::shared_ptr< TModuleaddModule (std::string name)
 
void update ()
 Called every time interval.
 
void updateGraphicsContext ()
 
void reset ()
 
virtual NBoundingBox boundingBox ()
 
bool connect (NodePort *nPort)
 
bool disconnect (NodePort *nPort)
 
bool attachField (FBase *field, std::string name, std::string desc, bool autoDestroy=true) override
 Attach a field to Node.
 
std::vector< NodePort * > & getAllNodePorts ()
 
uint sizeOfNodePorts ()
 
uint sizeOfImportNodes () const
 
uint sizeOfExportNodes () const
 
void setForceUpdate (bool b)
 
 DEF_VAR_STATE (Real, ElapsedTime, 0, "Elapsed Time")
 
 DEF_VAR_STATE (Real, TimeStep, Real(0.033), "Time step size")
 
 DEF_VAR_STATE (uint, FrameNumber, 0, "Frame number")
 
- Public Member Functions inherited from dyno::OBase
 OBase ()
 
 ~OBase () override
 
virtual std::string caption ()
 Return the caption.
 
virtual bool captionVisible ()
 Whether to hide the caption in the GUI.
 
virtual std::string description ()
 Return a description for the node or module, override this function to support user-defined description.
 
bool addField (FBase *data)
 Add a field to Base FieldID will be set to the name of Field by default.
 
bool addField (FieldID name, FBase *data)
 Add a field to Base.
 
bool addFieldAlias (FieldID name, FBase *data)
 
bool addFieldAlias (FieldID name, FBase *data, FieldMap &fieldAlias)
 
bool findField (FBase *data)
 Find a field by its pointer.
 
bool findFieldAlias (const FieldID name)
 Find a field by its name.
 
bool findFieldAlias (const FieldID name, FieldMap &fieldAlias)
 Find a field in fieldAlias by its name This function is typically called by other functions.
 
bool removeField (FBase *data)
 Remove a field by its pointer.
 
bool removeFieldAlias (const FieldID name)
 Remove a field by its name.
 
bool removeFieldAlias (const FieldID name, FieldMap &fieldAlias)
 
FBasegetField (const FieldID name)
 Return a field by its name.
 
std::vector< FBase * > & getAllFields ()
 
template<typename T >
TgetField (FieldID name)
 
bool isAllFieldsReady ()
 Check the completeness of all required fields.
 
std::vector< FieldIDgetFieldAlias (FBase *data)
 
int getFieldAliasCount (FBase *data)
 
void setBlockCoord (float x, float y)
 
float bx ()
 
float by ()
 
bool findInputField (FBase *field)
 
bool addInputField (FBase *field)
 
bool removeInputField (FBase *field)
 
std::vector< FBase * > & getInputFields ()
 
bool findOutputField (FBase *field)
 
bool addOutputField (FBase *field)
 
bool addToOutput (FBase *field)
 
bool removeOutputField (FBase *field)
 
bool removeFromOutput (FBase *field)
 
std::vector< FBase * > & getOutputFields ()
 
bool findParameter (FBase *field)
 
bool addParameter (FBase *field)
 
bool removeParameter (FBase *field)
 
std::vector< FBase * > & getParameters ()
 
- Public Member Functions inherited from dyno::Object
 Object ()
 
virtual ~Object ()
 
ObjectId objectId ()
 

Protected Member Functions

void resetStates () override
 
void updateStates () override
 
void updateInstanceTransform ()
 
- Protected Member Functions inherited from dyno::RigidBodySystem< TDataType >
void updateTopology () override
 
- Protected Member Functions inherited from dyno::Node
bool appendExportNode (NodePort *nodePort)
 
bool removeExportNode (NodePort *nodePort)
 
virtual void preUpdateStates ()
 
virtual void postUpdateStates ()
 
virtual bool validateInputs ()
 
virtual bool requireUpdate ()
 
void tick ()
 notify all state and output fields are updated
 

Private Attributes

std::vector< Pair< uint, uint > > mBindingPair
 
std::vector< std::shared_ptr< PdActor > > mActors
 
DArray< MatrixmInitialRot
 
DArray< BindingPairmBindingPairDevice
 
DArray< intmBindingTagDevice
 

Additional Inherited Members

- Static Public Member Functions inherited from dyno::Object
static bool registerClass (ClassInfo *ci)
 
static ObjectcreateObject (std::string name)
 
static std::map< std::string, ClassInfo * > * getClassMap ()
 
static ObjectId baseId ()
 Base Id.
 
- Public Attributes inherited from dyno::RigidBodySystem< TDataType >
int m_numOfSamples
 
DArray2D< Vec3fm_deviceSamples
 
DArray2D< Vec3fm_deviceNormals
 
std::vector< Vec3fsamples
 
std::vector< Vec3fnormals
 
- Public Attributes inherited from dyno::Node
std::string m_node_name
 
- Protected Attributes inherited from dyno::OBase
std::vector< FBase * > fields_input
 
std::vector< FBase * > fields_output
 
std::vector< FBase * > fields_param
 

Detailed Description

template<typename TDataType>
class dyno::Vechicle< TDataType >

Definition at line 13 of file Vechicle.h.

Member Typedef Documentation

◆ BindingPair

Definition at line 20 of file Vechicle.h.

◆ Coord

template<typename TDataType >
typedef TDataType::Coord dyno::Vechicle< TDataType >::Coord

Definition at line 18 of file Vechicle.h.

◆ Matrix

template<typename TDataType >
typedef TDataType::Matrix dyno::Vechicle< TDataType >::Matrix

Definition at line 19 of file Vechicle.h.

◆ Real

template<typename TDataType >
typedef TDataType::Real dyno::Vechicle< TDataType >::Real

Definition at line 17 of file Vechicle.h.

Constructor & Destructor Documentation

◆ Vechicle()

template<typename TDataType >
dyno::Vechicle< TDataType >::Vechicle ( )

Definition at line 25 of file Vechicle.cpp.

Here is the call graph for this function:

◆ ~Vechicle()

template<typename TDataType >
dyno::Vechicle< TDataType >::~Vechicle ( )
override

Definition at line 98 of file Vechicle.cpp.

Member Function Documentation

◆ bind()

template<typename TDataType >
void dyno::Vechicle< TDataType >::bind ( std::shared_ptr< PdActor actor,
Pair< uint, uint shapeId 
)

Definition at line 187 of file Vechicle.cpp.

Here is the caller graph for this function:

◆ DEF_ARRAYLIST_STATE()

template<typename TDataType >
dyno::Vechicle< TDataType >::DEF_ARRAYLIST_STATE ( Transform3f  ,
InstanceTransform  ,
DeviceType::GPU  ,
"Instance transforms"   
)

◆ DEF_INSTANCE_IN() [1/2]

template<typename TDataType >
dyno::Vechicle< TDataType >::DEF_INSTANCE_IN ( TextureMesh  ,
TextureMesh  ,
"Texture mesh of the vechicle"   
)

◆ DEF_INSTANCE_IN() [2/2]

template<typename TDataType >
dyno::Vechicle< TDataType >::DEF_INSTANCE_IN ( TriangleSet< TDataType ,
TriangleSet  ,
"TriangleSet of the boundary"   
)

◆ resetStates()

template<typename TDataType >
void dyno::Vechicle< TDataType >::resetStates ( )
overrideprotectedvirtual

Reimplemented from dyno::RigidBodySystem< TDataType >.

Definition at line 104 of file Vechicle.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateInstanceTransform()

template<typename TDataType >
void dyno::Vechicle< TDataType >::updateInstanceTransform ( )
protected

Definition at line 174 of file Vechicle.cpp.

Here is the call graph for this function:

◆ updateStates()

template<typename TDataType >
void dyno::Vechicle< TDataType >::updateStates ( )
overrideprotectedvirtual

Reimplemented from dyno::Node.

Definition at line 166 of file Vechicle.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ mActors

template<typename TDataType >
std::vector<std::shared_ptr<PdActor> > dyno::Vechicle< TDataType >::mActors
private

Definition at line 45 of file Vechicle.h.

◆ mBindingPair

template<typename TDataType >
std::vector<Pair<uint, uint> > dyno::Vechicle< TDataType >::mBindingPair
private

Definition at line 43 of file Vechicle.h.

◆ mBindingPairDevice

template<typename TDataType >
DArray<BindingPair> dyno::Vechicle< TDataType >::mBindingPairDevice
private

Definition at line 49 of file Vechicle.h.

◆ mBindingTagDevice

template<typename TDataType >
DArray<int> dyno::Vechicle< TDataType >::mBindingTagDevice
private

Definition at line 50 of file Vechicle.h.

◆ mInitialRot

template<typename TDataType >
DArray<Matrix> dyno::Vechicle< TDataType >::mInitialRot
private

Definition at line 47 of file Vechicle.h.


The documentation for this class was generated from the following files: