|
AGX Dynamics 2.42.3.1
|
Branch is a part of the Tree, with a body and a constraint to its parent. More...
#include <Tree.h>
Inheritance diagram for agxModel::Tree::Branch:Public Types | |
| enum | MaxLoadType { TRANSLATIONAL = 0 , ROTATIONAL } |
Public Member Functions | |
| Branch () | |
| Default constructor. | |
| Branch (const agx::AffineMatrix4x4 &transform) | |
| Construct branch given transform. | |
| Branch (const agx::Vec3 &start, const agx::Vec3 &end) | |
| Construct branch given start- and end point in world. | |
| bool | addBranch (agxModel::Tree::Branch *branch) |
| Add child branch to this branch. | |
| AGXSTREAM_DECLARE_SERIALIZABLE_BASE (Branch) | |
| virtual agxModel::Tree::Branch * | clone () |
| virtual agx::ConstraintRef | createConstraintWithParent () const |
| Creates the constraint with this branch's parent. | |
| agxModel::Tree::Branch * | getBranch (size_t i) const |
| agx::Constraint * | getConstraint () const |
| agx::Vec2 | getCurrentLoad () const |
| agx::Real | getCurrentRotationalLoad () const |
| agx::Real | getCurrentTranslationalLoad () const |
| agx::Referenced * | getCustomData () const |
| agx::Vec3 | getDirection () const |
| virtual agx::Real | getLength (const agxCollide::Geometry *geometry) const |
| Calculates and returns an estimated length of this branch. | |
| agx::Vec3 | getLocalDirection () const |
| agx::Vec2 | getMaxLoad () const |
| agx::Real | getMaxRotationalLoad () const |
| agx::Real | getMaxTranslationalLoad () const |
| size_t | getNumBranches () const |
| agxModel::Tree::Branch * | getParent () const |
| agx::RigidBody * | getRigidBody () const |
| bool | removeBranch (agxModel::Tree::Branch *branch) |
| Remove a child branch. | |
| bool | removeBranch (size_t index) |
| Remove child given index. | |
| void | setCustomData (agx::Referenced *customData) |
| Assign custom/user data of any type. | |
| void | setMaxLoad (agx::Real translational, agx::Real rotational) |
| Assign max load for this branch (connection at start). | |
| void | setMaxRotationalLoad (agx::Real maxLoad) |
| Assign rotational max load for this branch. | |
| void | setMaxTranslationalLoad (agx::Real maxLoad) |
| Assign translational max load for this branch. | |
| virtual agxCollide::Shape * | splitShape (agxCollide::Shape *shapeInBranch, agx::Real shapePosition, agxModel::Tree::Branch *newBranch, agx::Real &newBelowLength, agx::Real &newAboveLength) |
| This branch is about to be divided into two branches (cut)! | |
Public Member Functions inherited from agx::Referenced | |
| Referenced () | |
| Default constructor. | |
| Referenced (const Referenced &) | |
| template<typename T > | |
| T * | as () |
| Subclass casting. | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. | |
| template<typename T > | |
| const T * | asSafe () const |
| int | getReferenceCount () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. | |
| Referenced & | operator= (const Referenced &) |
| Assignment operator. Will increment the number of references to the referenced object. | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
Public Member Functions inherited from agxStream::Serializable | |
| virtual | ~Serializable () |
| Destructor for normal C++ use but hidden from SWIG bindings. | |
| virtual const char * | getClassName () const |
| bool | getEnableSerialization () const |
| bool | getEnableUuidGeneration () |
| agx::UInt32 | getIndex () const |
| This index is given at creation of this object. | |
| virtual StorageAgent * | getStorageAgent () const =0 |
| agx::Uuid | getUuid () const |
| bool | isFinished () const |
| void | setEnableSerialization (bool flag) |
| Set to false to disable serialization of this object. | |
| void | setFinished () |
| Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. | |
| void | setUuid (const agx::Uuid &uuid) |
| Explicitly set a Uuid on a serializable object. | |
Static Public Member Functions | |
| static agxStream::Serializable * | create (agxStream::InputArchive &) |
Static Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Static Public Member Functions inherited from agxStream::Serializable | |
| static void | setEnableUuidGeneration (bool flag) |
| Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. | |
Protected Member Functions | |
| virtual | ~Branch () |
| void | setConstraint (agx::Constraint *constraint) |
| Assign constraint attached at start point of this branch. | |
| void | setParent (agxModel::Tree::Branch *parent) |
| Assign parent to this branch. | |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Protected Member Functions inherited from agxStream::Serializable | |
| Serializable () | |
| Default constructor. | |
| Serializable (const Serializable &other) | |
| Copy constructor. | |
| void | generateUuid () |
Protected Attributes | |
| BranchContainer | m_branches |
| agx::ConstraintRef | m_constraint |
| agx::ref_ptr< agx::Referenced > | m_customData |
| agx::Vec2 | m_maxLoad |
| BranchObs | m_parent |
| agx::RigidBodyRef | m_rb |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Additional Inherited Members | |
Static Protected Member Functions inherited from agx::Referenced | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. | |
Branch is a part of the Tree, with a body and a constraint to its parent.
Definition at line 55 of file agxModel/Tree.h.
| Enumerator | |
|---|---|
| TRANSLATIONAL | |
| ROTATIONAL | |
Definition at line 58 of file agxModel/Tree.h.
| agxModel::Tree::Branch::Branch | ( | ) |
Default constructor.
Construct branch given start- and end point in world.
The rigid body model frame will be located at start, and rotated so that z-axis points toward end.
| start | - start position, in world, for this branch |
| end | - end position, in world, for this branch |
| agxModel::Tree::Branch::Branch | ( | const agx::AffineMatrix4x4 & | transform | ) |
Construct branch given transform.
The rigid body will initially have this transform, i.e., this is the model frame during initialize.
| transform | - model frame transform |
|
protectedvirtual |
| bool agxModel::Tree::Branch::addBranch | ( | agxModel::Tree::Branch * | branch | ) |
Add child branch to this branch.
This branch will be parent to branch and later attached to it with a constraint.
| branch | - child branch |
| agxModel::Tree::Branch::AGXSTREAM_DECLARE_SERIALIZABLE_BASE | ( | Branch | ) |
|
virtual |
Reimplemented in agxModel::Deformable1DNode.
|
inlinestatic |
Definition at line 238 of file agxModel/Tree.h.
|
virtual |
Creates the constraint with this branch's parent.
Default is lock joint along this branch direction.
Reimplemented in agxModel::Deformable1DNode.
| agxModel::Tree::Branch * agxModel::Tree::Branch::getBranch | ( | size_t | i | ) | const |
i | agx::Constraint * agxModel::Tree::Branch::getConstraint | ( | ) | const |
| agx::Vec2 agxModel::Tree::Branch::getCurrentLoad | ( | ) | const |
| agx::Real agxModel::Tree::Branch::getCurrentRotationalLoad | ( | ) | const |
| agx::Real agxModel::Tree::Branch::getCurrentTranslationalLoad | ( | ) | const |
| agx::Referenced * agxModel::Tree::Branch::getCustomData | ( | ) | const |
| agx::Vec3 agxModel::Tree::Branch::getDirection | ( | ) | const |
|
virtual |
Calculates and returns an estimated length of this branch.
Default this method can estimate the length of the first shape in geometry of shape types: agxCollide::Shape::CYLINDER and agxCollide::Shape::CAPSULE.
Reimplemented in agxModel::Deformable1DNode.
| agx::Vec3 agxModel::Tree::Branch::getLocalDirection | ( | ) | const |
| agx::Vec2 agxModel::Tree::Branch::getMaxLoad | ( | ) | const |
| agx::Real agxModel::Tree::Branch::getMaxRotationalLoad | ( | ) | const |
| agx::Real agxModel::Tree::Branch::getMaxTranslationalLoad | ( | ) | const |
| size_t agxModel::Tree::Branch::getNumBranches | ( | ) | const |
| agxModel::Tree::Branch * agxModel::Tree::Branch::getParent | ( | ) | const |
| agx::RigidBody * agxModel::Tree::Branch::getRigidBody | ( | ) | const |
| bool agxModel::Tree::Branch::removeBranch | ( | agxModel::Tree::Branch * | branch | ) |
Remove a child branch.
Parent will be set to 0 for branch.
| branch | - child branch |
| bool agxModel::Tree::Branch::removeBranch | ( | size_t | index | ) |
Remove child given index.
Parent will be set to 0 for branch at index.
| index | - index of branch to remove |
|
protected |
Assign constraint attached at start point of this branch.
| constraint | - constraint attached at start point of this branch |
| void agxModel::Tree::Branch::setCustomData | ( | agx::Referenced * | customData | ) |
Assign custom/user data of any type.
Only constraint is that the class inherits agx::Referenced for easier memory managment.
| customData | - custom/user data for this branch |
Assign max load for this branch (connection at start).
Maximum load is divided into two parts, translational and rotational, units force. When/if the constraint exceeds one of these values an event is fired.
| translational | - translational max load, unit force (default: infinity = disabled) |
| rotational | - rotational max load, unit force (default: infinity = disabled) |
| void agxModel::Tree::Branch::setMaxRotationalLoad | ( | agx::Real | maxLoad | ) |
Assign rotational max load for this branch.
| maxLoad | - rotational max load, unit force (default: infinity = disabled) |
| void agxModel::Tree::Branch::setMaxTranslationalLoad | ( | agx::Real | maxLoad | ) |
Assign translational max load for this branch.
| maxLoad | - translational max load, unit force (default: infinity = disabled) |
|
protected |
Assign parent to this branch.
| parent | - parent branch |
|
virtual |
This branch is about to be divided into two branches (cut)!
Split a shape in this branch (shapeInBranch is part of a geometry of this branch rigid body) at a distance along the shape. Creates a new shape and also returns the new length from start to shapePosition, newBelowLength, and new length from newBelowLength to end, newAboveLength. The new shape will belong to newBranch after this call.
Default this method supports shape types: agxCollide::Shape::CYLINDER and agxCollide::Shape::CAPSULE.
| shapeInBranch | - a shape in a geometry in this branch rigid body | |
| shapePosition | - a distance along shapeInBranch y-axis (because normally cylinder or capsule) | |
| newBranch | - the branch the new shape will belong to | |
| [out] | newBelowLength | - new length of this branch (along y-axis) |
| [out] | newAboveLength | - new length of the new shape |
newAboveLength of length Reimplemented in agxModel::Deformable1DNode.
|
protected |
Definition at line 258 of file agxModel/Tree.h.
|
protected |
Definition at line 262 of file agxModel/Tree.h.
|
protected |
Definition at line 259 of file agxModel/Tree.h.
|
protected |
Definition at line 263 of file agxModel/Tree.h.
|
protected |
Definition at line 257 of file agxModel/Tree.h.
|
protected |
Definition at line 261 of file agxModel/Tree.h.