NTRT Simulator
Version: Master
|
#include <tgBulletSpringCableAnchor.h>
Public Member Functions | |
tgBulletSpringCableAnchor (btRigidBody *body, btVector3 pos, btVector3 cn=btVector3(0.0, 0.0, 0.0), bool perm=true, bool slide=false, btPersistentManifold *m=NULL) | |
virtual | ~tgBulletSpringCableAnchor () |
virtual btVector3 | getWorldPosition () const |
virtual bool | setWorldPosition (btVector3 &newPos) |
virtual btVector3 | getRelativePosition () const |
virtual btVector3 | getContactNormal () const |
bool | updateManifold (btPersistentManifold *m) |
btPersistentManifold * | getManifold () const |
std::pair< btScalar, btVector3 > | getManifoldDistance (btPersistentManifold *m) const |
const btVector3 & | getForce () const |
Public Attributes | |
btRigidBody *const | attachedBody |
const bool | permanent |
const bool | sliding |
Protected Attributes | |
btVector3 | force |
Friends | |
class | tgBulletContactSpringCable |
A class that allows tgBulletSpringCable and tgBulletContactSpringCable to attach to btRigidBodies Anchors track a specific point on a body as that body translates and rotates. They can either be 'non-sliding' which typically means a pin jointed anchor (and are typically permanent), or sliding, which means they track a specific contact point within a btPersistentManifold.
Definition at line 53 of file tgBulletSpringCableAnchor.h.
tgBulletSpringCableAnchor::tgBulletSpringCableAnchor | ( | btRigidBody * | body, |
btVector3 | pos, | ||
btVector3 | cn = btVector3(0.0, 0.0, 0.0) , |
||
bool | perm = true , |
||
bool | slide = false , |
||
btPersistentManifold * | m = NULL |
||
) |
The only constructor. At a minimum requires a body and a position on that body to track. Sliding anchors require additional data
[in] | body | - a pointer to the btRigidBody this is attached to |
[in] | pos | - The position in world coordinates where this attaches |
[in] | cn | - A btVector3 that specifies the direction of contact Only requried for sliding anchors |
[in] | perm | - Whether or not this anchor can be deleted in the middle of a simulation |
[in] | slide | - Whether this represents a pin joint or a sliding contact |
[in] | m | - a btPersistenManifold that is used to track contacts |
Definition at line 44 of file tgBulletSpringCableAnchor.cpp.
|
virtual |
Destructor, nothing to delete
Definition at line 69 of file tgBulletSpringCableAnchor.cpp.
|
virtual |
Return an up to date contact normal based on the rigid body's btTransform
Implements tgSpringCableAnchor.
Definition at line 203 of file tgBulletSpringCableAnchor.cpp.
|
inlineinherited |
Definition at line 107 of file tgSpringCableAnchor.h.
|
inline |
Return a pointer to our btPersistentManifold (typically so something can compare getManifoldDistance with a new manifold)
Definition at line 126 of file tgBulletSpringCableAnchor.h.
std::pair< btScalar, btVector3 > tgBulletSpringCableAnchor::getManifoldDistance | ( | btPersistentManifold * | m | ) | const |
A pair of the distance between the current world position and this manifolds contact point, as well as the contact normal of this manifold
Definition at line 273 of file tgBulletSpringCableAnchor.cpp.
|
virtual |
Get the position of the point in body coordinaates
Implements tgSpringCableAnchor.
Definition at line 76 of file tgBulletSpringCableAnchor.cpp.
|
virtual |
Return the current position of the anchor in world coordinates Uses attachedRelativeOriginalPosition and the attachedBody's btTransform
Implements tgSpringCableAnchor.
Definition at line 83 of file tgBulletSpringCableAnchor.cpp.
|
virtual |
Update attachedRelativeOriginalPosition based on the sliding of the string. This also checks if the new sliding position is still on the body.
Implements tgSpringCableAnchor.
Definition at line 89 of file tgBulletSpringCableAnchor.cpp.
bool tgBulletSpringCableAnchor::updateManifold | ( | btPersistentManifold * | m | ) |
Update our manifold pointer. This memory is often reassigned so the new manifold is accepted if our old manifold no longer contains our rigid body. It is also accepted if its contact point is closer than our manifold's
Definition at line 218 of file tgBulletSpringCableAnchor.cpp.
btRigidBody* const tgBulletSpringCableAnchor::attachedBody |
The rigid body we affect Address should never be changed, body is not const
Definition at line 137 of file tgBulletSpringCableAnchor.h.
|
protectedinherited |
Store force so we can normalize it appropreately. Set and accessed directly by MuscleNP
Definition at line 132 of file tgSpringCableAnchor.h.
|
inherited |
A boolean value indicating whether this a temporary or permanent contact if permanent do not delete it until teardown!!
Definition at line 116 of file tgSpringCableAnchor.h.
|
inherited |
How the force is applied to the rigid body. True applies along the contact normal, false is applied towards the next anchor. Application depends on other classes
Definition at line 124 of file tgSpringCableAnchor.h.