|
AGXDynamics
2.31.1.0
|
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::Vec3 &start, const agx::Vec3 &end) | |
| Construct branch given start- and end point in world. More... | |
| Branch (const agx::AffineMatrix4x4 &transform) | |
| Construct branch given transform. More... | |
| bool | addBranch (agxModel::Tree::Branch *branch) |
| Add child branch to this branch. 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 |
| 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 |
| int | getReferenceCount () const |
| agx::RigidBody * | getRigidBody () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. 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 | 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... | |
| 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... | |
Static Public Member Functions | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Protected Member Functions | |
| virtual | ~Branch () |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
| 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... | |
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 | |
| BranchContainer | m_branches |
| agx::ConstraintRef | m_constraint |
| agx::ref_ptr< agx::Referenced > | m_customData |
| agx::Vec2 | m_maxLoad |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| BranchObs | m_parent |
| agx::RigidBodyRef | m_rb |
| AtomicValue | m_refCount |
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 |
|
protectedinherited |
|
inherited |
Subclass casting.
Template type must match actual type, dynamic_cast assertion will fail otherwise.
Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().
|
inherited |
|
inherited |
Safe subclass casting, return nullptr if template type does not match.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
|
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.
|
protectedinherited |
| 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 |
|
staticprotectedinherited |
| 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 |
|
inherited |
| agx::RigidBody* agxModel::Tree::Branch::getRigidBody | ( | ) | const |
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::Buffer::getElement(), and agx::Object::getResource().
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.
Referenced by agxData::Val< UInt >::Val().
| 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 |
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
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) |
Assign rotational max load for this branch.
| maxLoad | - rotational max load, unit force (default: infinity = disabled) |
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.
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.
|
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.
|
staticinherited |
|
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.
|
mutableprotectedinherited |
Definition at line 240 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
protected |
Definition at line 251 of file agxModel/Tree.h.
|
protected |
Definition at line 255 of file agxModel/Tree.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.