|
AGXDynamics
2.31.1.0
|
#include <TerrainParticles.h>
Inheritance diagram for agxModel::ConvexSoil:Public Types | |
| enum | MotionControl { STATIC = 1, KINEMATICS = 2, DYNAMICS = 3 } |
| The MotionControl enumeration indicates what makes a RigidBody move. More... | |
Public Member Functions | |
| ConvexSoil (const agx::Vec3Vector *vertices, const agx::UInt32Vector *indices) | |
| Create a convex body representing digged up soil. More... | |
| bool | add (agxCollide::Geometry *geometry, const agx::AffineMatrix4x4 &localTransform, bool incrementalMassCalculation=false) |
| Connect a geometry to this rigid body. More... | |
| bool | add (agxCollide::Geometry *geometry, bool incrementalMassCalculation=false) |
| Add a geometry to this rigid body. More... | |
| bool | addAttachment (agx::Frame *frame, const agx::String &name) |
| Add a named attachment frame to this rigid body. More... | |
| void | addForce (const agx::Vec3 &force) |
Add the specified force, given in world coordinate frame, that will be affecting this body in the next solve. More... | |
| void | addForce (agx::Real fx, agx::Real fy, agx::Real fz) |
Add the specified force, fx fy fz, given in world coordinate frame, that will be affecting this body in the next solve. More... | |
| void | addForceAtLocalCmPosition (const agx::Vec3 &force, const agx::Vec3 &position) |
| Add a force given in world coordinate frame, applied at a point specified in the local Center of Mass coordinate frame. More... | |
| void | addForceAtLocalCmPosition (agx::Real fx, agx::Real fy, agx::Real fz, agx::Real px, agx::Real py, agx::Real pz) |
| Add a force given in world coordinate frame, applied at a point specified in the local Center of Mass coordinate frame. More... | |
| void | addForceAtLocalPosition (const agx::Vec3 &force, const agx::Vec3 &position) |
| Add a force, given in the world coordinate frame, applied at a point specified in the local Model coordinate frame. More... | |
| void | addForceAtLocalPosition (agx::Real fx, agx::Real fy, agx::Real fz, agx::Real px, agx::Real py, agx::Real pz) |
| Add a force given in world coordinate frame, applied at a point specified in local coordinate model frame. More... | |
| void | addForceAtPosition (const agx::Vec3 &force, const agx::Vec3 &position) |
| Add a force, given in the World coordinate frame, applied at a point specified in world coordinate frame. More... | |
| void | addForceAtPosition (agx::Real fx, agx::Real fy, agx::Real fz, agx::Real px, agx::Real py, agx::Real pz) |
| Add a force, given in the world coordinate frame, applied at a point specified in the world coordinate frame. More... | |
| void | addLocalTorque (agx::Real tx, agx::Real ty, agx::Real tz) |
| Adds the specified torque, given in Center of Mass coordinate frame that will be affecting this body in the next solve. More... | |
| void | addLocalTorque (const agx::Vec3 &torque) |
Adds the specified torque, given in Center of Mass coordinate frame that will be affecting this body in the next solve. More... | |
| void | addTorque (const agx::Vec3 &torque) |
Adds the specified torque, given in world coordinate frame, that will be affecting this body in the next solve. More... | |
| void | addTorque (agx::Real tx, agx::Real ty, agx::Real tz) |
Adds the specified torque, given in world coordinate frame, that will be affecting this body in the next solve. More... | |
| template<typename T > | |
| T * | as () |
| Subclass casting. More... | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. More... | |
| template<typename T > | |
| const T * | asSafe () const |
| agx::Vec3 | calculateCenterOfMassOffset (agx::Real mass=agx::Real()) const |
| Calculate the center of mass offset of this rigid body using the volume and density of the added geometries. More... | |
| agx::Real | calculateMass () const |
| Calculate the mass of this rigid body using the volume and density of added geometries. More... | |
| RigidBody * | clone () const |
| Create a clone of the rigid body. More... | |
| agx::Vec3 | getAcceleration () const |
| Will always be 0 for KINEMATIC and STATIC bodies. More... | |
| agx::Vec3 | getAngularAcceleration () const |
| Will always be 0 for KINEMATIC and STATIC bodies. More... | |
| agx::Vec3 | getAngularMomentum () const |
| agx::Vec3 | getAngularVelocity () const |
| Angular velocity in world coordinate frame. More... | |
| agx::Vec3f | getAngularVelocityDamping () const |
| agx::Vec3f | getAngularVelocityZeroDamping () const |
| Frame * | getAttachment (const agx::String &name) |
| Access a named attachment frame. More... | |
| agx::RigidBody::AutoSleepProperties & | getAutoSleepProperties () |
| const agx::RigidBody::AutoSleepProperties & | getAutoSleepProperties () const |
| agx::AutoSleepThreshold * | getAutoSleepThreshold () |
| Returns custom auto-sleep parameters for this rigid body. More... | |
| const agx::AutoSleepThreshold * | getAutoSleepThreshold () const |
| Returns custom auto-sleep parameters for this rigid body. More... | |
| agx::MergeSplitBodyStorage * | getBodyStorage () |
| Internal method. More... | |
| const agx::MergeSplitBodyStorage * | getBodyStorage () const |
| Internal method. More... | |
| const char * | getClassName () const override |
| agx::Frame * | getCmFrame () |
| Return the center of mass (CM) frame of this rigid body. More... | |
| const agx::Frame * | getCmFrame () const |
| Return the center of mass (CM) frame of this rigid body. More... | |
| agx::Vec3 | getCmLocalTranslate () const |
| agx::Vec3 | getCmPosition () const |
| agx::Quat | getCmRotation () const |
| const agx::AffineMatrix4x4 & | getCmTransform () const |
| Convenience methods for center of mass frame. More... | |
| agx::Referenced * | getCustomData () const |
| bool | getEnable () const |
| Access the state enable flag. More... | |
| bool | getEnableSerialization () const |
| bool | getEnableUuidGeneration () |
| agx::Physics::RigidBodyPtr | getEntity () const |
| Internal method. More... | |
| agx::Vec3 | getForce () const |
| agx::Frame * | getFrame () |
| Returns the model frame containing model the transformation and utilities to manipulate position, rotation etc. More... | |
| const agx::Frame * | getFrame () const |
| Returns the model frame containing model the transformation and utilities to manipulate position, rotation etc. More... | |
| const agxCollide::GeometryRefVector & | getGeometries () const |
| const agxCollide::Geometry * | getGeometry (const agx::Name &name) const |
| Find (linear search) the first Geometry in the RigidBody with a matching name. More... | |
| agxCollide::Geometry * | getGeometry (const agx::Name &name) |
| Find (linear search) the first Geometry in the RigidBody with a matching name. More... | |
| bool | getHandleAsParticle () const |
| agx::UInt32 | getId () const |
| Internal method. More... | |
| agx::UInt32 | getIndex () const |
| This index is given at creation of this object. More... | |
| agx::Vec3 | getLastForce () const |
| Access the summed force applied to this rigid body last time the system was integrated. More... | |
| agx::Vec3 | getLastTorque () const |
| Access the summed torque applied to this rigid body last time the system was integrated. More... | |
| agx::Vec3 | getLinearMomentum () const |
| agx::Vec3f | getLinearVelocityDamping () const |
| agx::Vec3f | getLinearVelocityZeroDamping () const |
| agx::Vec3 | getLocalPosition () const |
| agx::Quat | getLocalRotation () const |
| const agx::AffineMatrix4x4 & | getLocalTransform () const |
| const agx::MassProperties * | getMassProperties () const |
| agx::MassProperties * | getMassProperties () |
| agx::AffineMatrix4x4 | getMergedWorldTransform () const |
| If a body (child) is merged into a (parent) body the child will not get its transform (getTransform, getPosition, getRotation) updated by the ordinary integration method (as it is disabled). More... | |
| agx::RigidBody::MergeSplitProperties & | getMergeSplitProperties () |
| const agx::RigidBody::MergeSplitProperties & | getMergeSplitProperties () const |
| agx::MergeSplitThreshold * | getMergeSplitThreshold () |
| Returns custom merge-split parameters for this rigid body. More... | |
| const agx::MergeSplitThreshold * | getMergeSplitThreshold () const |
| Returns custom merge-split parameters for this rigid body. More... | |
| agx::Vec3 | getModelAcceleration (const agx::Vec3 &relPos=agx::Vec3()) const |
Calculates the linear acceleration at the given point relPos. More... | |
| agx::Vec3 | getModelVelocity (const agx::Vec3 &relPos=agx::Vec3()) const |
Calculates the linear velocity at the given point relPos. More... | |
| agx::RigidBody::MotionControl | getMotionControl () const |
| const agx::Name & | getName () const |
| agx::UInt16 | getNumConstraints () const |
| const agxCollide::GeometryRefVector & | getOriginalGeometries () const |
| Merge-split related. More... | |
| SoilParticle * | getParent () const |
| agx::Frame * | getParentFrame () |
| const agx::Frame * | getParentFrame () const |
| agx::Vec3 | getPosition () const |
| Current model frame position, given in world coordinate frame. More... | |
| agx::Real | getPotentialEnergy () const |
| agx::PropertyContainer * | getPropertyContainer () const |
| Access property container of this rigid body. More... | |
| agx::Real | getRadius () const |
| int | getReferenceCount () const |
| agx::Quat | getRotation () const |
| Current model frame rotation, given in world coordinate frame. More... | |
| agx::Real | getRotationalEnergy () const |
| bool | getSeedContact () const |
| agxStream::StorageAgent * | getStorageAgent () const override |
| agx::DynamicsSystem * | getSystem () |
| const agx::DynamicsSystem * | getSystem () const |
| agx::Vec3 | getTorque () const |
| agx::Real | getTotalEnergy () const |
| const agx::AffineMatrix4x4 & | getTransform () const |
| Current model frame transform, given in world coordinate frame. More... | |
| agx::Real | getTranslationalEnergy () const |
| ParticleAttributes::SoilType | getType () const |
| agx::Uuid | getUuid () const |
| agx::Vec3 | getVelocity () const |
| Velocity of center of mass frame origin, in world coordinate frame. More... | |
| virtual agx::Real | getVolume () const override |
| bool | hasBodyStorage () const |
| bool | hasConstraints () const |
| bool | hasParent () const |
| bool | hasPropertyContainer () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. More... | |
| bool | isEnabled () const |
| Access the state enable flag. More... | |
| bool | isFinished () const |
| bool | isMerged () const |
| bool | isParent () const |
| bool | isPowerlineBody () const |
| void | moveTo (const agx::AffineMatrix4x4 &target, agx::Real t) |
| Utility method to calculate and assign linear- and angular velocity given a target transform and the time it should take to get there. More... | |
| void | moveTo (const agx::Vec3 &targetPosition, const agx::Quat &targetRotation, agx::Real t) |
| Utility method to calculate and assign linear- and angular velocity given a target transform and the time it should take to get there. More... | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
| bool | remove (agxCollide::Geometry *geometry, bool incrementalMassCalculation=false) |
Remove geometry if geometry is part of this rigid body. More... | |
| bool | removeAttachment (const agx::String &name) |
| Remove an attachment from the rigid body. More... | |
| virtual void | restore (agxStream::InputArchive &in) override |
| void | setAngularVelocity (const agx::Vec3 &angularVelocity) |
| Set the angular velocity of the center of mass of this rigid body. More... | |
| void | setAngularVelocity (agx::Real vx, agx::Real vy, agx::Real vz) |
| Set the angular velocity of the center of mass of this rigid body. More... | |
| void | setAngularVelocityDamping (float damping) |
| Set angular velocity damping for the body in all directions x, y and z. More... | |
| void | setAngularVelocityDamping (const agx::Vec3f &damping) |
| Give angular velocity damping in each direction, given in local body coordinate frame. More... | |
| void | setAngularVelocityZeroDamping (const agx::Vec3f &dir) |
| Specify a vector (in body coordinates) along which no angular velocity damping should occur. More... | |
| void | setAutoSleepThreshold (agx::AutoSleepThreshold *threshold) |
| Assign custom auto-sleep parameters to this rigid body. More... | |
| void | setCmLocalTranslate (const agx::Vec3 &translate) |
| Sets the local offset of the center of mass position to the model origin (in model frame coordinates). More... | |
| void | setCmPosition (const agx::Vec3 &p, bool synchronizeModel=true) |
| Assign new center of mass position, given in world coordinate frame. More... | |
| void | setCmRotation (const agx::Quat &q) |
| Assign new center of mass rotation, given in world coordinate frame. More... | |
| void | setCmRotation (const agx::EulerAngles &e) |
| Assign new center of mass rotation, given in world coordinate frame. More... | |
| void | setCmRotation (const agx::OrthoMatrix3x3 &m) |
| Assign new center of mass rotation, given in world coordinate frame. More... | |
| void | setCmTransform (const agx::AffineMatrix4x4 &matrix, bool synchronizeModel=true) |
| Assign new center of mass transform, given in world coordinate frame. More... | |
| void | setCustomData (agx::Referenced *data) |
| It's possible to derive from agx::Referenced and implement a reference counted object and associate it to this rigid body via this method. More... | |
| void | setEnable (bool enable) |
| Change state enable of this rigid body. More... | |
| void | setEnableSerialization (bool flag) |
| Set to false to disable serialization of this object. More... | |
| void | setEntity (agx::Physics::RigidBodyPtr entity) |
| Internal method. More... | |
| void | setFinished () |
| Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. More... | |
| void | setForce (const agx::Vec3 &force) |
| Explicitly set the force, given in world coordinate frame, that will be affecting this body in the next solve. More... | |
| void | setForce (agx::Real fx, agx::Real fy, agx::Real fz) |
| Explicitly set the force, given in world coordinate frame, that will be affecting this body in the next solve. More... | |
| void | setHandleAsParticle (bool handleAsParticle) |
| Set this, six degrees of freedom, rigid body to be handled as a three degrees of freedom particle (rotational degrees of freedom ignored). More... | |
| void | setInertiaTensor (const agx::SPDMatrix3x3 &inertiaTensor, const agx::AffineMatrix4x4 &cmLocalTransform=agx::AffineMatrix4x4(), bool autogenerateCmOffset=false, bool autogenerateInertia=false) |
| Convenience method for setting the inertia tensor from extern calculations given in local center of mass coordinate frame. More... | |
| void | setInertiaTensor (const agx::Vec3 &inertiaDiagonal, const agx::AffineMatrix4x4 &cmLocalTransform=agx::AffineMatrix4x4(), bool autogenerateCmOffset=false, bool autogenerateInertia=false) |
| Convenience method for setting the inertia tensor from extern calculations, in diagonal form, given in local center of mass coordinate frame. More... | |
| void | setIsPowerlineBody (bool isHydraulicBody) |
| Internal method. More... | |
| void | setLinearVelocityDamping (float damping) |
| Set linear velocity damping for the body in all directions x, y and z. More... | |
| void | setLinearVelocityDamping (const agx::Vec3f &damping) |
| Give linear velocity damping in each direction, given in local body coordinate frame. More... | |
| void | setLinearVelocityZeroDamping (const agx::Vec3f &dir) |
| Specify a vector (in body coordinates) along which no linear velocity damping should occur. More... | |
| void | setLocalPosition (const agx::Vec3 &p) |
| Set the position of the body relative to its model frame's parent frame. More... | |
| void | setLocalPosition (agx::Real x, agx::Real y, agx::Real z) |
| Set the position of the body relative to its model frame's parent frame. More... | |
| void | setLocalRotation (const agx::Quat &q) |
| Set the rotation of the body relative to its model frame's parent frame. More... | |
| void | setLocalRotation (const agx::EulerAngles &e) |
| Set the rotation of the body relative to its model frame's parent frame. More... | |
| void | setLocalTransform (const agx::AffineMatrix4x4 &matrix) |
| Assign the local transformation matrix for this body, ignoring any eventual parent transformation. More... | |
| void | setMergeSplitThreshold (agx::MergeSplitThreshold *threshold) |
| Assign custom merge-split parameters to this rigid body. More... | |
| void | setMotionControl (agx::RigidBody::MotionControl control) |
| Assign new motion control state to this rigid body. More... | |
| void | setName (const agx::Name &name) |
| Assign new name to this rigid body. More... | |
| void | setParent (SoilParticle *parent) |
| Set a parent to the particle in a soil particle contact graph. More... | |
| bool | setParentFrame (agx::Frame *frame) |
| Set the parent frame of this body's model frame. More... | |
| void | setPosition (const agx::Vec3 &p) |
| Set the position of the model frame in world coordinates. More... | |
| void | setPosition (agx::Real x, agx::Real y, agx::Real z) |
| Set the position of the model frame in world coordinates. More... | |
| void | setPropertyContainer (agx::PropertyContainer *container) |
| Assign new property container. More... | |
| void | setRotation (const agx::Quat &q) |
| Set the rotation of the body relative to world frame. More... | |
| void | setRotation (const agx::EulerAngles &e) |
| Set the rotation of the body relative to world frame. More... | |
| void | setRotation (const agx::OrthoMatrix3x3 &m) |
| Set the rotation of the body relative to world frame. More... | |
| void | setSeedContact () |
| Set that this particle is a seed. More... | |
| void | setTorque (const agx::Vec3 &torque) |
| Explicitly set the torque, given in world coordinate frame, that will be affecting this body in the next solve. More... | |
| void | setTorque (agx::Real tx, agx::Real ty, agx::Real tz) |
| Explicitly set the torque, given in world coordinate frame, that will be affecting this body in the next solve. More... | |
| void | setTransform (const agx::AffineMatrix4x4 &matrix) |
| Set the transform of the body. More... | |
| void | setUuid (const agx::Uuid &uuid) |
| Explicitly set a Uuid on a serializable object. More... | |
| void | setVelocity (const agx::Vec3 &velocity) |
| Set the linear velocity of the center of mass of this rigid body. More... | |
| void | setVelocity (agx::Real vx, agx::Real vy, agx::Real vz) |
| Set the linear velocity of the center of mass of this rigid body. More... | |
| void | setVelocityDamping (float damping) |
| Set both linear- and angular velocity damping in all directions. More... | |
| virtual void | store (agxStream::OutputArchive &out) const override |
| void | transfer (agxData::EntityStorage *storage) |
| Internal method. More... | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
| void | updateMassProperties () |
| Method to explicitly update mass properties. More... | |
| void | updateMassProperties (agx::UInt32 mask) |
| Method to explicitly update mass properties. More... | |
Static Public Member Functions | |
| static agxStream::Serializable * | create () |
| static agxStream::Serializable * | create (agxStream::InputArchive &) |
| static const char * | getConstructClassId () |
| static void | setEnableUuidGeneration (bool flag) |
| Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. More... | |
| static bool | shouldIgnoreGravity (agx::RigidBodyState state) |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Protected Member Functions | |
| ConvexSoil () | |
| void | allocateObserverVector () const |
| void | clearBodyStorage () |
| Clear the BodyStorage for this RigidBody. More... | |
| void | deleteUsingDeleteHandler () const |
| void | generateUuid () |
| void | incrementalMassPropertyUpdate (agx::UInt32 mask, int sign, const agxCollide::Geometry *geometry) |
Will calculate new mass properties for this rigid body as the previously calculated one +/- the specified geometry. More... | |
| void | setBodyStorage (agx::MergeSplitBodyStorage *bodyStorage) |
| Give this body a storage for merge-split. More... | |
| void | setId (agx::UInt32 id) |
| Assign dynamics system unique id to this rigid body. More... | |
| void | setSystem (agx::DynamicsSystem *system) |
| Assign dynamics system where this body belongs to. More... | |
Static Protected Member Functions | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More... | |
Protected Attributes | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
| ParticleAttributes::SoilType | m_type |
Definition at line 242 of file TerrainParticles.h.
|
inherited |
The MotionControl enumeration indicates what makes a RigidBody move.
There are three forms of motion allowed:
Definition at line 63 of file RigidBody.h.
| agxModel::ConvexSoil::ConvexSoil | ( | const agx::Vec3Vector * | vertices, |
| const agx::UInt32Vector * | indices | ||
| ) |
Create a convex body representing digged up soil.
|
inlineprotected |
Definition at line 257 of file TerrainParticles.h.
|
inherited |
Connect a geometry to this rigid body.
The frame of the geometry will be attached as a child to the model frame of the rigid body. The inertia, mass, and center of mass offset will be automatically recalculated using the material and volume of the geometry. However, any parameter explicitly set in the MassProperties (with auto generation flag disabled) will not be recalculated/updated.
incrementalMassCalculation: Incremental mass properties calculation is computationally less expensive but may cause numerical drift if this method is used many times. If false, the current set of geometries will be used to calculate the mass properties, which in some extreme cases can be more computationally expensive (or cause general overhead). | geometry | - the geometry to add |
| localTransform | - the relative transform to where the geometry should be placed relative model coordinate frame of this rigid body |
| incrementalMassCalculation | - false for full recalculation of mass properties, true for incremental calculation (see note) |
Referenced by agxVehicle::utils::createGeometryBox().
|
inherited |
Add a geometry to this rigid body.
The frame of the geometry will be attached as a child to the model frame of this rigid body. The inertia, mass, and center of mass offset will be automatically recalculated using the material and volume of the geometry. However, any parameter explicitly set in the MassProperties (with auto generation flag disabled) will not be recalculated/updated. The local transformation in the geometry (geometry->getLocalTransform()) will be used to transform the geometry relative to the RigidBody.
incrementalMassCalculation: Incremental mass properties calculation is computationally less expensive but may cause numerical drift if this method is used many times. If false, the current set of geometries will be used to calculate the mass properties, which in some extreme cases can be more computationally expensive (or cause general overhead). | geometry | - the geometry to add |
| incrementalMassCalculation | - false for full recalculation of mass properties, true for incremental calculation (see note) |
|
inherited |
Add a named attachment frame to this rigid body.
Add the specified force, given in world coordinate frame, that will be affecting this body in the next solve.
The force will be applied to the Center of Mass.
| force | - the force, given in world coordinate frame |
Add the specified force, fx fy fz, given in world coordinate frame, that will be affecting this body in the next solve.
The force will be applied to the Center of Mass.
| fx,fy,fz | - the force, given in world coordinate frame |
Definition at line 1659 of file RigidBody.h.
|
inherited |
Add a force given in world coordinate frame, applied at a point specified in the local Center of Mass coordinate frame.
If the position is different from (0,0,0) (CoM), this method will also introduce a torque.
| force | - the force, given in world coordinate frame, to be added to the already previously added forces |
| position | - the position in local center of mass coordinate frame where the force should be applied |
|
inlineinherited |
Add a force given in world coordinate frame, applied at a point specified in the local Center of Mass coordinate frame.
If the position is different from (0,0,0) (CoM), this method will also introduce a torque.
| fx,fy,fz | - the force, given in world coordinate frame, to be added to the already previously added forces |
| px,py,pz | - the position in local center of mass coordinate frame where the force should be applied |
Definition at line 1674 of file RigidBody.h.
|
inherited |
Add a force, given in the world coordinate frame, applied at a point specified in the local Model coordinate frame.
If the position is different from the center of mass, a torque will be calculated and added as well.
| force | - the force, given in world coordinate frame, to be added to the already previously added forces |
| position | - the position given in local coordinate frame where the force should be applied |
|
inlineinherited |
Add a force given in world coordinate frame, applied at a point specified in local coordinate model frame.
If the position is different from the center of mass, a torque will be calculated and added as well.
| fx,fy,fz | - the force, given in world coordinate frame, to be added to the already previously added forces |
| px,py,pz | - the position given in local coordinate frame where the force should be applied |
Definition at line 1669 of file RigidBody.h.
|
inherited |
Add a force, given in the World coordinate frame, applied at a point specified in world coordinate frame.
If the position is different from the center of mass, a torque will be calculated and added as well.
| force | - the force, given in world coordinate frame, to be added to the already previously added forces |
| position | - the position given in world coordinate frame where the force should be applied |
|
inlineinherited |
Add a force, given in the world coordinate frame, applied at a point specified in the world coordinate frame.
If the position is different from the center of mass, a torque will be calculated and added as well.
| fx,fy,fz | - the force, given in world coordinate frame, to be added to the already previously added forces |
| px,py,pz | - the position given in world coordinate frame where the force should be applied |
Definition at line 1664 of file RigidBody.h.
Adds the specified torque, given in Center of Mass coordinate frame that will be affecting this body in the next solve.
| tx,ty,tz | - the torque, given in local coordinate frame |
Definition at line 1684 of file RigidBody.h.
Adds the specified torque, given in Center of Mass coordinate frame that will be affecting this body in the next solve.
| torque | - the torque |
Adds the specified torque, given in world coordinate frame, that will be affecting this body in the next solve.
| torque | - the torque, given in world coordinate frame |
Adds the specified torque, given in world coordinate frame, that will be affecting this body in the next solve.
| tx,ty,tz | - the torque, given in world coordinate frame |
Definition at line 1679 of file RigidBody.h.
|
protectedinherited |
|
inherited |
Subclass casting.
Template type must match actual type, dynamic_cast assertion will fail otherwise.
Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), agx::InternalData::getOrCreate(), and agx::InternalData::hasData().
|
inherited |
|
inherited |
Safe subclass casting, return nullptr if template type does not match.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
|
inherited |
Calculate the center of mass offset of this rigid body using the volume and density of the added geometries.
| mass | - if 0, the mass will be recalculated given the added geometries density and volume |
|
inherited |
Calculate the mass of this rigid body using the volume and density of added geometries.
|
protectedinherited |
Clear the BodyStorage for this RigidBody.
hasBodyStorage() will return false after this.
|
inherited |
Create a clone of the rigid body.
|
inlinestatic |
Definition at line 255 of file TerrainParticles.h.
|
inlinestatic |
Definition at line 255 of file TerrainParticles.h.
|
protectedinherited |
|
protectedinherited |
|
inherited |
Will always be 0 for KINEMATIC and STATIC bodies.
Definition at line 1604 of file RigidBody.h.
|
inherited |
Will always be 0 for KINEMATIC and STATIC bodies.
Definition at line 1609 of file RigidBody.h.
|
inherited |
|
inherited |
Angular velocity in world coordinate frame.
Definition at line 1510 of file RigidBody.h.
Referenced by agxCollide::GeometryContact::calculateRelativeVelocity().
|
inherited |
|
inherited |
|
inherited |
Access a named attachment frame.
| name | - name of the attachment |
name if it exist - otherwise null
|
inherited |
Definition at line 1595 of file RigidBody.h.
|
inherited |
Definition at line 1599 of file RigidBody.h.
|
inherited |
Returns custom auto-sleep parameters for this rigid body.
Auto-sleep threshold is by default 0 (global/default settings).
Definition at line 1460 of file RigidBody.h.
|
inherited |
Returns custom auto-sleep parameters for this rigid body.
Auto-sleep threshold is by default 0 (global/default settings).
Definition at line 1465 of file RigidBody.h.
|
inherited |
Internal method.
|
inherited |
Internal method.
|
inlineoverridevirtual |
Reimplemented from agxModel::SoilParticle.
Definition at line 255 of file TerrainParticles.h.
|
inherited |
Return the center of mass (CM) frame of this rigid body.
The CM frame is a child frame of the model frame. The center of mass offset is automatically calculated as geometries are added/removed, but this can be disabled in the mass properties of the rigid body.
Definition at line 1490 of file RigidBody.h.
|
inherited |
Return the center of mass (CM) frame of this rigid body.
The CM frame is a child frame of the model frame. The center of mass offset is automatically calculated as geometries are added/removed, but this can be disabled in the mass properties of the rigid body.
Definition at line 1495 of file RigidBody.h.
|
inherited |
Definition at line 1515 of file RigidBody.h.
|
inherited |
Definition at line 1520 of file RigidBody.h.
Referenced by agxCollide::GeometryContact::calculateRelativeVelocity().
|
inherited |
Definition at line 1525 of file RigidBody.h.
References agx::QuatT< T >::getRotate().
|
inherited |
Convenience methods for center of mass frame.
The bool flag of the mutator(set) methods indicates if the update should sync back to the model frame (i.e. the model is updated using the relative change in center of mass while the local center of mass values are unchanged), or if the update only affects the local center of mass frame (which is analogous to the normal frame interface).
Definition at line 1500 of file RigidBody.h.
|
inlinestatic |
Definition at line 255 of file TerrainParticles.h.
|
inherited |
|
staticprotectedinherited |
|
inherited |
Access the state enable flag.
Definition at line 1423 of file RigidBody.h.
Referenced by agxCollide::Space::canCollide().
|
inherited |
Definition at line 273 of file Serializable.h.
|
inherited |
|
inlineinherited |
Internal method.
Data access.
Definition at line 1450 of file RigidBody.h.
Referenced by agx::MergedBody::findMergedBodyIndex(), and agx::MergedBody::isRoot().
|
inherited |
|
inherited |
Returns the model frame containing model the transformation and utilities to manipulate position, rotation etc.
Definition at line 1480 of file RigidBody.h.
Referenced by agxModel::NodeAttachment::createFromWorld(), and agxCable::SegmentAttachment::createFromWorld().
|
inherited |
Returns the model frame containing model the transformation and utilities to manipulate position, rotation etc.
Definition at line 1485 of file RigidBody.h.
|
inherited |
|
inherited |
Find (linear search) the first Geometry in the RigidBody with a matching name.
| name | - name of geometry to search for |
|
inherited |
Find (linear search) the first Geometry in the RigidBody with a matching name.
| name | - name of geometry to search for |
|
inherited |
Definition at line 1540 of file RigidBody.h.
|
inherited |
Internal method.
The id this rigid body has in a system. This value may change when any other body is removed from a system.
Definition at line 1455 of file RigidBody.h.
|
inherited |
This index is given at creation of this object.
It is guaranteed to be unique for the lifetime of this library instance. As long as the application is running. This value is not serialized or restored. A new object will always get a new index no matter how it is created.
Definition at line 247 of file Serializable.h.
|
inherited |
Access the summed force applied to this rigid body last time the system was integrated.
|
inherited |
Access the summed torque applied to this rigid body last time the system was integrated.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Definition at line 1535 of file RigidBody.h.
|
inherited |
Definition at line 1530 of file RigidBody.h.
|
inherited |
If a body (child) is merged into a (parent) body the child will not get its transform (getTransform, getPosition, getRotation) updated by the ordinary integration method (as it is disabled).
Therefore if the world transformation of the child is needed, it can be accessed through this method. If the body is not merged, it will return getTransform().
|
inherited |
Definition at line 1560 of file RigidBody.h.
|
inherited |
Definition at line 1565 of file RigidBody.h.
|
inherited |
Returns custom merge-split parameters for this rigid body.
Merge-split threshold object is by default 0 (global/default settings).
Definition at line 1470 of file RigidBody.h.
|
inherited |
Returns custom merge-split parameters for this rigid body.
Merge-split threshold object is by default 0 (global/default settings).
Definition at line 1475 of file RigidBody.h.
|
inherited |
Calculates the linear acceleration at the given point relPos.
The point relPos must be given in model coordinate frame. The resulting linear acceleration is given in world coordinate frame.
| relPos | - relative position given in model frame coordinates |
relPos
|
inherited |
Calculates the linear velocity at the given point relPos.
The point relPos must be given in model coordinate frame. The resulting linear velocity is given in world coordinate frame.
| relPos | - relative position given in model frame coordinates |
relPos
|
inherited |
Definition at line 1433 of file RigidBody.h.
|
inherited |
Referenced by agxOSG::FilterContactByName::match().
|
inherited |
Definition at line 1619 of file RigidBody.h.
|
inherited |
Merge-split related.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Current model frame position, given in world coordinate frame.
Definition at line 1634 of file RigidBody.h.
|
inherited |
|
inherited |
Access property container of this rigid body.
This method will create a new property container object if one hasn't been assigned before. Hence it is recommended to use hasPropertyContainer before calling this method.
Definition at line 1443 of file RigidBody.h.
|
inherited |
|
inherited |
|
inherited |
Current model frame rotation, given in world coordinate frame.
Definition at line 1639 of file RigidBody.h.
References agx::QuatT< T >::getRotate().
|
inherited |
|
inherited |
|
inlineoverridevirtual |
Reimplemented from agxModel::SoilParticle.
Definition at line 255 of file TerrainParticles.h.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Current model frame transform, given in world coordinate frame.
Definition at line 1629 of file RigidBody.h.
Referenced by agxVehicle::Wheel::attachConstraint(), agxCable::SegmentAttachment::createFromWorld(), and agxModel::NodeAttachment::createFromWorld().
|
inherited |
|
inherited |
|
inherited |
Definition at line 268 of file Serializable.h.
Referenced by agxSDK::UuidHashCollisionFilter::match().
|
inherited |
Velocity of center of mass frame origin, in world coordinate frame.
Definition at line 1505 of file RigidBody.h.
Referenced by agxCollide::GeometryContact::calculateRelativeVelocity().
|
overridevirtual |
Reimplemented from agxModel::SoilParticle.
|
inherited |
|
inherited |
Definition at line 1614 of file RigidBody.h.
|
inherited |
|
inherited |
Definition at line 1438 of file RigidBody.h.
|
protectedinherited |
Will calculate new mass properties for this rigid body as the previously calculated one +/- the specified geometry.
| mask | - Specifies what will be updated |
| sign | - 1 means adding, -1 means removing the geometry. |
| geometry | - The geometry for which the mass properties will be added/removed |
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::EntityStorage::getInstances(), and agx::Object::getResource().
|
inherited |
Access the state enable flag.
Definition at line 1428 of file RigidBody.h.
|
inherited |
Definition at line 252 of file Serializable.h.
References AGX_FORCE_INLINE.
|
inherited |
|
inherited |
|
inlineinherited |
Definition at line 1699 of file RigidBody.h.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
Utility method to calculate and assign linear- and angular velocity given a target transform and the time it should take to get there.
This is basically only valid if motion control is set to KINEMATICS.
| target | - target transform given in world coordinate frame |
| t | - time this rigid body has to reach the target |
|
inherited |
Utility method to calculate and assign linear- and angular velocity given a target transform and the time it should take to get there.
This is basically only valid if motion control is set to KINEMATICS.
| targetPosition | - target position given in world coordinate frame |
| targetRotation | - target rotation given in world coordinate frame |
| t | - time this rigid body has to reach the target |
Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
This method should be used with care, always balanced with the same number of calls to unreference.
|
inherited |
Remove geometry if geometry is part of this rigid body.
incrementalMassCalculation: Incremental mass properties calculation is computationally less expensive but may cause numerical drift if this method is used many times. If false, the current set of geometries will be used to calculate the mass properties, which in some extreme cases can be more computationally expensive (or cause general overhead). | geometry | - geometry to remove |
| incrementalMassCalculation | - false for full recalculation of mass properties, true for incremental calculation (see note) |
|
inherited |
Remove an attachment from the rigid body.
|
overridevirtual |
Reimplemented from agxModel::SoilParticle.
Set the angular velocity of the center of mass of this rigid body.
This is the preferred way of moving KINEMATIC rigid bodies (a more convenient way is using moveTo(...)). The use for DYNAMIC is discouraged except for setting an initial angular velocity. If motion control is set to STATIC then the angular velocity will be set to zero - independent of the value of angularVelocity. This method is seen as an instantaneous change in angular velocity (infinite acceleration), and will therefore not be represented by getAngularAcceleration().
| angularVelocity | - angular velocity given in world coordinate frame |
|
inlineinherited |
Set the angular velocity of the center of mass of this rigid body.
This is the preferred way of moving KINEMATIC rigid bodies (a more convenient way is using moveTo(...)). The use for DYNAMIC is discouraged except for setting an initial angular velocity. If motion control is set to STATIC then the angular velocity will be set to zero - independent of the value of angularVelocity. This method is seen as an instantaneous change in angular velocity (infinite acceleration), and will therefore not be represented by getAngularAcceleration().
| vx,vy,vz | - angular velocity given in world coordinate frame |
Definition at line 1654 of file RigidBody.h.
|
inherited |
Set angular velocity damping for the body in all directions x, y and z.
The unit of this damping is mass over time. Default: 0 (no damping)
| damping | - the damping |
|
inherited |
Give angular velocity damping in each direction, given in local body coordinate frame.
The unit of this damping is mass over time. Default: (0, 0, 0) (no damping).
| damping | - the damping |
|
inherited |
Specify a vector (in body coordinates) along which no angular velocity damping should occur.
Default: (0, 0, 0)
| dir | - direction, given in local body coordinate frame, in which the angular damping should be zero |
|
inherited |
Assign custom auto-sleep parameters to this rigid body.
This object may be shared with other bodies. Default: 0 (global settings)
| threshold | - the auto-sleep threshold |
|
protectedinherited |
Give this body a storage for merge-split.
| bodyStorage | - merge-split body storage for this rigid body |
Sets the local offset of the center of mass position to the model origin (in model frame coordinates).
| translate | The new offset. |
Assign new center of mass position, given in world coordinate frame.
By default the model frame will be updated as well (synchronizeModel).
| p | - new center of mass position given in world coordinate frame |
| synchronizeModel | - default true, if false the model frame will not be updated with this new position |
Assign new center of mass rotation, given in world coordinate frame.
| q | - new center of mass rotation (quaternion) |
|
inherited |
Assign new center of mass rotation, given in world coordinate frame.
| e | - new center of mass rotation (Euler angles) |
|
inherited |
Assign new center of mass rotation, given in world coordinate frame.
| m | - new center of mass rotation (Orthonormal matrix) |
|
inherited |
Assign new center of mass transform, given in world coordinate frame.
By default the model frame will be updated as well (synchronizeModel).
| matrix | - new matrix transform given in world coordinate frame |
| synchronizeModel | - default true, if false the model frame will not be updated with this new transform. |
|
inherited |
It's possible to derive from agx::Referenced and implement a reference counted object and associate it to this rigid body via this method.
If this rigid body is the only one holding a reference to the data, the data will be deleted when this rigid body is deleted.
| data | - custom data |
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
|
inherited |
Change state enable of this rigid body.
Default: true.
| enable | - true to enable, false to disable |
|
inherited |
Set to false to disable serialization of this object.
It will just be ignored during serialization (writing). It is still possible to restore TO this object.
|
staticinherited |
Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
|
inherited |
Internal method.
Data access.
| entity | - new rigid body entity |
|
inherited |
Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
Explicitly set the force, given in world coordinate frame, that will be affecting this body in the next solve.
force. | force | - the force |
Explicitly set the force, given in world coordinate frame, that will be affecting this body in the next solve.
force. | fx,fy,fz | - the force |
Definition at line 1689 of file RigidBody.h.
|
inherited |
Set this, six degrees of freedom, rigid body to be handled as a three degrees of freedom particle (rotational degrees of freedom ignored).
Default: false
| handleAsParticle | - if true this rigid body will be handled as a particle |
|
protectedinherited |
Assign dynamics system unique id to this rigid body.
| id | - index to this rigid body in dynamics system |
|
inherited |
Convenience method for setting the inertia tensor from extern calculations given in local center of mass coordinate frame.
| inertiaTensor | - the externally computed inertia tensor given in local center of mass frame |
| cmLocalTransform | - the frame in which the inertia tensor is given (optional, default: Identity) |
| autogenerateCmOffset | - if true, the center of mass offset will be recalculated when the geometry configuration of the body changes (optional, default: false) |
| autogenerateInertia | - if set to true, the inertia tensor will be recalculated when the geometry configuration of the body changes (optional, default: false) |
|
inherited |
Convenience method for setting the inertia tensor from extern calculations, in diagonal form, given in local center of mass coordinate frame.
| inertiaDiagonal | - the externally computed inertia tensor in diagonal form given in local center of mass coordinate frame defined by cmLocalTransform |
| cmLocalTransform | - the frame in which the inertia tensor is given (optional, default: Identity) |
| autogenerateCmOffset | - if true, the center of mass offset will be recalculated when the geometry configuration of the body changes (optional, default: false) |
| autogenerateInertia | - if set to true, the inertia tensor will be recalculated when the geometry configuration of the body changes (optional, default: false) |
|
inlineinherited |
Internal method.
Definition at line 1704 of file RigidBody.h.
|
inherited |
Set linear velocity damping for the body in all directions x, y and z.
The unit of this damping is mass over time. Default: 0 (no damping)
| damping | - the damping |
|
inherited |
Give linear velocity damping in each direction, given in local body coordinate frame.
The unit of this damping is mass over time. Default: (0, 0, 0) (no damping).
| damping | - the damping |
|
inherited |
Specify a vector (in body coordinates) along which no linear velocity damping should occur.
Default: (0, 0, 0)
| dir | - direction, given in local body coordinate frame, in which the linear damping should be zero |
Set the position of the body relative to its model frame's parent frame.
| p | - local translate of body as a 3D vector |
Set the position of the body relative to its model frame's parent frame.
| x | - local x translate |
| y | - local y translate |
| z | - local z translate |
Set the rotation of the body relative to its model frame's parent frame.
| q | - rotation given as a quaternion |
|
inherited |
Set the rotation of the body relative to its model frame's parent frame.
| e | - rotation given as Euler angles |
|
inherited |
Assign the local transformation matrix for this body, ignoring any eventual parent transformation.
| matrix | - transformation matrix relative to parent transform for the body's model frame |
|
inherited |
Assign custom merge-split parameters to this rigid body.
This object may be shared with other bodies. Default: 0 (global settings)
| threshold | - the merge-split threshold |
|
inherited |
Assign new motion control state to this rigid body.
If new state is STATIC - linear- and angular velocity will be set to zero. Default: DYNAMICS
| control | - new motion control |
Assign new name to this rigid body.
Default: ""
|
inherited |
Set a parent to the particle in a soil particle contact graph.
This is used if the soil particle simulation is activated. if ( USE_SOIL_PARTICLE_SIMULATION == 1 )
|
inherited |
Set the parent frame of this body's model frame.
This means that getLocalTranslate, getLocalRotate, getLocalTransform will be given in the parents coordinate frame. I.e., this frame's transformation will be concatenated with the parents.
| frame | - new parent frame, 0 to remove parent |
Set the position of the model frame in world coordinates.
| p | - desired position in world coordinates. |
Set the position of the model frame in world coordinates.
| x | - desired x-coordinate in world frame |
| y | - desired y-coordinate in world frame |
| z | - desired z-coordinate in world frame |
|
inherited |
Assign new property container.
| container | - property container |
Set the rotation of the body relative to world frame.
| q | - rotation given as a quaternion |
|
inherited |
Set the rotation of the body relative to world frame.
| e | - rotation given as Euler angles |
|
inherited |
Set the rotation of the body relative to world frame.
| m | - rotation given as an orthogonal transformation matrix |
|
inherited |
Set that this particle is a seed.
|
protectedinherited |
Assign dynamics system where this body belongs to.
| system | - dynamics system this body belongs to |
Explicitly set the torque, given in world coordinate frame, that will be affecting this body in the next solve.
torque. | torque | - the torque |
Explicitly set the torque, given in world coordinate frame, that will be affecting this body in the next solve.
torque. | tx,ty,tz | - the torque |
Definition at line 1694 of file RigidBody.h.
|
inherited |
Set the transform of the body.
The model frame will move to the specified transform, which is given in world coordinate frame.
| matrix | - desired transform for the model frame in world coordinates. |
Explicitly set a Uuid on a serializable object.
Use this method with great care, as it can result in non-unique identifiers in the system!
Set the linear velocity of the center of mass of this rigid body.
This is the preferred way of moving KINEMATIC rigid bodies (a more convenient way is using moveTo(...)). The use for DYNAMIC is discouraged except for setting an initial velocity. If motion control is set to STATIC then the linear velocity will be set to zero - independent of the value of velocity. This method is seen as an instantaneous change in velocity (infinite acceleration), and will therefore not be represented by getAcceleration().
| velocity | - velocity given in world coordinate frame |
Set the linear velocity of the center of mass of this rigid body.
This is the preferred way of moving KINEMATIC rigid bodies (a more convenient way is using moveTo(...)). The use for DYNAMIC is discouraged except for setting an initial velocity. If motion control is set to STATIC then the linear velocity will be set to zero - independent of the value of velocity. This method is seen as an instantaneous change in velocity (infinite acceleration), and will therefore not be represented by getAcceleration().
| vx,vy,vz | - velocity given in world coordinate frame |
Definition at line 1649 of file RigidBody.h.
|
inherited |
Set both linear- and angular velocity damping in all directions.
| damping | - the damping |
|
inlinestaticinherited |
state should not be affected by a gravity field. Definition at line 1149 of file RigidBody.h.
|
overridevirtual |
Reimplemented from agxModel::SoilParticle.
|
inherited |
Internal method.
Transfer data from one storage to another.
| storage | - new storage |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
This method should be used with care, always balanced with the same number of calls to reference.
Referenced by agxData::EntityRef< ContactMaterialPtr >::~EntityRef().
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.
|
inherited |
Method to explicitly update mass properties.
E.g., when the density is changed on a material which this rigid body depends on. This method uses the current mass property update mask. I.e., if this rigid body has an explicitly assigned mass, mass will not be updated during this call.
|
inherited |
Method to explicitly update mass properties.
E.g., when the density is changed on a material which this rigid body depends on. This method takes the mass property update mask as argument. I.e., if this rigid body has an explicitly assigned mass, and mask contains agx::MassProperties::MASS, a new mass will be calculated and assigned.
| mask | - bit mask of agx::MassProperties::AutoGenerateFlags which mass properties that should be updated |
|
staticinherited |
|
mutableprotectedinherited |
Definition at line 240 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.
|
protectedinherited |
Definition at line 231 of file TerrainParticles.h.