V-ART
|
Degree Of Freedom - basic component of a Joint. More...
#include <dof.h>
Public Member Functions | |
Dof () | |
Dof (const Dof &dof) | |
Dof (const Point4D &vec, const Point4D &pos, float min, float max) | |
Creates and initializes a DOF. More... | |
~Dof () | |
Dof & | operator= (const Dof &dof) |
void | SetDescription (const std::string &desc) |
const std::string & | GetDescription () const |
Point4D | GetAxis () const |
Point4D | GetOrigin () const |
Point4D | GetPosition () const |
Bezier * | GetEvoluta () |
void | GetLim (Transform *resultPtr) |
const Transform & | GetLim () const |
float | GetMin () const |
float | GetMax () const |
float | GetCurrentMin () const |
float | GetCurrentMax () const |
float | GetRest () const |
Returns DOF's rest position. More... | |
Joint * | GetOwnerJoint () const |
void | SetEvoluta (Bezier *evol) |
void | SetLim (const Transform &t) |
void | SetAxis (Point4D vec) |
void | SetMin (float min) |
Sets DOF's minimal state. More... | |
void | SetMax (float max) |
Sets DOF's maximal state. More... | |
void | SetOwnerJoint (Joint *ow) |
void | MoveTo (float pos) |
Sets DOF's current position. More... | |
void | MoveTo (float pos, unsigned int newPriority) |
Sets DOF's current position. More... | |
float | GetCurrent () const |
Gets DOF's current position. More... | |
void | Move (float variance) |
Changes DOF. More... | |
void | SetRest (float rest) |
void | Set (const Point4D &vec, const Point4D &pos, float min, float max) |
Initializes a DOF previouly created with default constructor. More... | |
void | Rest () |
void | SetRangeModifier (Modifier *m) |
Modifier * | GetRangeModifier () |
void | ApplyTransformTo (Transform *ptrTrans) const |
Apply internal transform to some external transform. More... | |
void | XmlPrintOn (std::ostream &os, unsigned int indent) const |
Outputs XML representation of the scene. More... | |
void | Reconfigure (const Point4D &state, const Point4D &target) |
Reconfigure DOF to match a target direction. More... | |
Public Member Functions inherited from VART::MemoryObj | |
MemoryObj () | |
Default constructor. More... | |
MemoryObj (const VART::MemoryObj &obj) | |
Copy constructor. More... | |
Static Public Member Functions | |
static void | ClearPriorities () |
Resets priorities of all DOF instances. More... | |
Protected Member Functions | |
void | ComputeLIM () |
Protected Attributes | |
Point4D | position |
Together with "axis", defines the rotation axis. Relative to the parent reference system. More... | |
Point4D | axis |
Together with "position", defines the rotation axis. Relative to the parent reference system. More... | |
unsigned int | priority |
Priority of last DOF change. More... | |
Additional Inherited Members | |
Public Attributes inherited from VART::MemoryObj | |
bool | autoDelete |
Degree Of Freedom - basic component of a Joint.
A DOF is an axis of rotation, that may move along a 3D curve (the evoluta). The rotation of a DOF has a limited range that may change according to external elements, this is controlled by the rangeModifier (Modifier). There may exist a hierachy of DOFs, so that by changing one DOF, hierarchically lower DOFs are rotated. DOFs may not be shared among joints because they have a single pointer to the owner joint and because the joint destructor may destroy DOFs marked as autoDelete.
VART::Dof::Dof | ( | const Dof & | dof | ) |
Creates and initializes a DOF.
vec | [in] A vector. Together with "pos", defines the rotation axis. |
pos | [in] A point. Together with "vec", defines the roatation axis. |
min | [in] An angle (radians). Minimal allowed rotation. |
max | [in] An angle (radians). Maximal allowed rotation. The DOF is created so that "current position" refers to zero rotation. If roatation range does not allow zero rotation, then the programmer should manually fix this using MoveTo. |
Definition at line 58 of file dof.cpp.
References VART::Point4D::Normalize().
void VART::Dof::ApplyTransformTo | ( | VART::Transform * | ptrTrans | ) | const |
Apply internal transform to some external transform.
Pre-multiply the internal transform to the argument. As Transform is a pre-multiplication matrix, the resulting transform has the effect of its previous value followed by the DOF's internal transform. This method is called by Joint when it is collection DOFs' transforms in order to compose its final transform.
ptrTrans | [in,out] where to apply internal transform. |
Definition at line 341 of file dof.cpp.
References VART::Transform::CopyMatrix().
|
static |
Resets priorities of all DOF instances.
For every instance of Dof, sets its priority to zero. Should be called at every render cycle, in a z-buffer-like scheme.
Definition at line 418 of file dof.cpp.
Referenced by VART::JointAction::Initializer::Initialize(), and VART::Action::MoveAllActive().
|
protected |
Definition at line 296 of file dof.cpp.
References VART::Point4D::SetW().
VART::Point4D VART::Dof::GetAxis | ( | ) | const |
float VART::Dof::GetCurrent | ( | ) | const |
void VART::Dof::GetLim | ( | VART::Transform * | resultPtr | ) |
Definition at line 140 of file dof.cpp.
References VART::Transform::CopyMatrix().
const VART::Transform & VART::Dof::GetLim | ( | ) | const |
VART::Point4D VART::Dof::GetOrigin | ( | ) | const |
VART::Joint * VART::Dof::GetOwnerJoint | ( | ) | const |
Definition at line 225 of file dof.cpp.
Referenced by VART::OffsetModifier::Modify().
|
inline |
VART::Modifier * VART::Dof::GetRangeModifier | ( | ) |
float VART::Dof::GetRest | ( | ) | const |
|
inline |
Changes DOF.
Changes how much the DOF is "bent"
variance | [in] How much to change the "current position". |
Definition at line 99 of file dof.h.
References MoveTo().
Referenced by VART::PolyaxialJoint::Adduct(), VART::BiaxialJoint::Adduct(), and VART::PolyaxialJoint::Twist().
void VART::Dof::MoveTo | ( | float | pos | ) |
Sets DOF's current position.
pos | [in] A number in the range [0:1] |
A value of zero means minimal rotation (see GetMin, SetMin) around the initial axis position (see GetAxis, GetOrigin, GetEvoluta and related "Set" methods). A value of one means maximal rotation. Other values are linear.
Definition at line 257 of file dof.cpp.
References VART::Point4D::SetW().
Referenced by Move(), VART::BiaxialJoint::SetAdductionTo(), VART::PolyaxialJoint::SetAductionTo(), VART::PolyaxialJoint::SetFlexionTo(), VART::BiaxialJoint::SetFlexionTo(), VART::UniaxialJoint::SetFlexionTo(), and VART::PolyaxialJoint::SetTwistTo().
void VART::Dof::MoveTo | ( | float | pos, |
unsigned int | newPriority | ||
) |
Reconfigure DOF to match a target direction.
Given a state (some direction representing current DOF configuration), puts itself in a configuration that would make state as close as possible to target.
Definition at line 346 of file dof.cpp.
References VART::Point4D::CrossProduct(), and VART::Point4D::DotProduct().
Initializes a DOF previouly created with default constructor.
Newly created DOFs are set at zero rotation. Use GetCurrent to find initial positial.
vec | [in] Rotation vector; |
pos | [in] DOF position (defines an axis along with "vec"); |
min | [in] Minimal bending angle in radians; |
max | [in] Maximal bending angle in radians; |
Definition at line 102 of file dof.cpp.
References VART::Point4D::Normalize().
Referenced by VART::XmlScene::loadDofs().
void VART::Dof::SetAxis | ( | VART::Point4D | vec | ) |
void VART::Dof::SetDescription | ( | const std::string & | desc | ) |
Definition at line 118 of file dof.cpp.
Referenced by VART::XmlScene::loadDofs().
void VART::Dof::SetEvoluta | ( | VART::Bezier * | evol | ) |
void VART::Dof::SetMax | ( | float | max | ) |
Sets DOF's maximal state.
max | [in] An angle in radians (for a rotational dof). |
DOFs translate to simple transforms (usually rotations). They have a minimal and a maximal state. In case of a rotational DOF, the maximal state refers to the maximal angle (in radians) that the DOF may represent as a rotation.
void VART::Dof::SetMin | ( | float | min | ) |
Sets DOF's minimal state.
min | [in] An angle in radians (for a rotational dof). |
DOFs translate to simple transforms (usually rotations). They have a minimal and a maximal state. In case of a rotational DOF, the minimal state refers to the minimal angle (in radians) that the DOF may represent as a rotation.
void VART::Dof::SetOwnerJoint | ( | VART::Joint * | ow | ) |
Definition at line 316 of file dof.cpp.
Referenced by VART::Joint::AddDof(), and VART::Joint::CopyDofListFrom().
void VART::Dof::SetRangeModifier | ( | VART::Modifier * | m | ) |
void VART::Dof::SetRest | ( | float | rest | ) |
Definition at line 321 of file dof.cpp.
Referenced by VART::XmlScene::loadDofs().
void VART::Dof::XmlPrintOn | ( | std::ostream & | os, |
unsigned int | indent | ||
) | const |
|
protected |
Together with "position", defines the rotation axis. Relative to the parent reference system.
Definition at line 155 of file dof.h.
Referenced by Dof(), and operator=().
|
protected |
Together with "axis", defines the rotation axis. Relative to the parent reference system.
Definition at line 153 of file dof.h.
Referenced by Dof(), GetPosition(), and operator=().
|
protected |