NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgSpringCableAnchor Class Referenceabstract

#include <tgSpringCableAnchor.h>

Inheritance diagram for tgSpringCableAnchor:

Public Member Functions

 tgSpringCableAnchor (btVector3 pos, btVector3 cn=btVector3(0.0, 0.0, 0.0), bool perm=true, bool slide=false)
 
virtual ~tgSpringCableAnchor ()
 
virtual btVector3 getWorldPosition () const =0
 
virtual bool setWorldPosition (btVector3 &newPos)=0
 
virtual btVector3 getRelativePosition () const =0
 
virtual btVector3 getContactNormal () const =0
 
const btVector3 & getForce () const
 

Public Attributes

const bool permanent
 
const bool sliding
 

Protected Attributes

btVector3 force
 

Detailed Description

A class that allows attaches tgSpringCables to rigid bodies. Only dependency on Bullet is btScalar and btVector3 (linear algebra)

Definition at line 42 of file tgSpringCableAnchor.h.

Constructor & Destructor Documentation

tgSpringCableAnchor::tgSpringCableAnchor ( btVector3  pos,
btVector3  cn = btVector3(0.0, 0.0, 0.0),
bool  perm = true,
bool  slide = false 
)
inline

The only constructor. At a minimum requires a body and a position on that body to track. Sliding anchors require additional data

Parameters
[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
Note
this does noth

Definition at line 57 of file tgSpringCableAnchor.h.

virtual tgSpringCableAnchor::~tgSpringCableAnchor ( )
inlinevirtual

Virtual destructor, nothing to delete

Definition at line 73 of file tgSpringCableAnchor.h.

Member Function Documentation

virtual btVector3 tgSpringCableAnchor::getContactNormal ( ) const
pure virtual

Return an up to date contact normal based on the rigid body's btTransform

Returns
the contact normal, accounting for any rotation from when the body was first contacted.

Implemented in tgBulletSpringCableAnchor.

const btVector3& tgSpringCableAnchor::getForce ( ) const
inline
Returns
a const reference to the force we just applied (or are about to apply)

Definition at line 107 of file tgSpringCableAnchor.h.

virtual btVector3 tgSpringCableAnchor::getRelativePosition ( ) const
pure virtual

Get the position of the point in body coordinaates

Returns
a btVector3 in body coordinates

Implemented in tgBulletSpringCableAnchor.

virtual btVector3 tgSpringCableAnchor::getWorldPosition ( ) const
pure virtual

Return the current position of the anchor in world coordinates

Implemented in tgBulletSpringCableAnchor.

virtual bool tgSpringCableAnchor::setWorldPosition ( btVector3 &  newPos)
pure virtual

Update attachedRelativeOriginalPosition based on the sliding of the string. This also checks if the new sliding position is still on the body.

Returns
bool returns if this point is actually on the body. The body should be deleted if this returns false

Implemented in tgBulletSpringCableAnchor.

Member Data Documentation

btVector3 tgSpringCableAnchor::force
protected

Store force so we can normalize it appropreately. Set and accessed directly by MuscleNP

Definition at line 132 of file tgSpringCableAnchor.h.

const bool tgSpringCableAnchor::permanent

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.

const bool tgSpringCableAnchor::sliding

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

Todo:
Do we want an internal apply force function? May simplify things (prevent Muscles from needing to include rigid bodies??)

Definition at line 124 of file tgSpringCableAnchor.h.


The documentation for this class was generated from the following file: