|
AGX Dynamics
2.35.0.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 (const agx::AffineMatrix4x4 &transform) | |
| Construct branch given transform. More... | |
| Branch (const agx::Vec3 &start, const agx::Vec3 &end) | |
| Construct branch given start- and end point in world. More... | |
| bool | addBranch (agxModel::Tree::Branch *branch) |
| Add child branch to this branch. More... | |
| virtual agxModel::Tree::Branch * | clone () |
| virtual agx::ConstraintRef | createConstraintWithParent () const |
| Creates the constraint with this branch's parent. More... | |
| 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. More... | |
| 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. More... | |
| bool | removeBranch (size_t index) |
| Remove child given index. More... | |
| void | setCustomData (agx::Referenced *customData) |
| Assign custom/user data of any type. More... | |
| void | setMaxLoad (agx::Real translational, agx::Real rotational) |
| Assign max load for this branch (connection at start). More... | |
| void | setMaxRotationalLoad (agx::Real maxLoad) |
| Assign rotational max load for this branch. More... | |
| void | setMaxTranslationalLoad (agx::Real maxLoad) |
| Assign translational max load for this branch. More... | |
| 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)! More... | |
Public Member Functions inherited from agx::Referenced | |
| Referenced () | |
| Default constructor. More... | |
| Referenced (const Referenced &) | |
| 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 |
| int | getReferenceCount () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. More... | |
| Referenced & | operator= (const Referenced &) |
| Assignment operator. Will increment the number of references to the referenced object. 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... | |
| 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... | |
Protected Member Functions | |
| virtual | ~Branch () |
| void | setConstraint (agx::Constraint *constraint) |
| Assign constraint attached at start point of this branch. More... | |
| void | setParent (agxModel::Tree::Branch *parent) |
| Assign parent to this branch. More... | |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. More... | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
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 Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
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. More... | |
Branch is a part of the Tree, with a body and a constraint to its parent.
Definition at line 54 of file agxModel/Tree.h.
| Enumerator | |
|---|---|
| TRANSLATIONAL | |
| ROTATIONAL | |
Definition at line 57 of file agxModel/Tree.h.
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 |
|
virtual |
Reimplemented in agxModel::Deformable1DNode.
|
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 252 of file agxModel/Tree.h.
|
protected |
Definition at line 256 of file agxModel/Tree.h.
|
protected |
Definition at line 253 of file agxModel/Tree.h.
|
protected |
Definition at line 257 of file agxModel/Tree.h.
|
protected |
Definition at line 251 of file agxModel/Tree.h.
|
protected |
Definition at line 255 of file agxModel/Tree.h.