#include <SIM_ConAnchorSpatial.h>

Public Types | |
| enum | SIM_DOFType { DOF_SPACE = 0, DOF_PLANE = 1, DOF_LINE = 2, DOF_POINT = 3 } |
Public Member Functions | |
| GETSET_DATA_FUNCS_E (SIM_NAME_CONDOF, DOFTypeInput, SIM_DOFType) | |
| GETSET_DATA_FUNCS_V3 (SIM_NAME_CONDIR, DOFVectorInput) | |
| SIM_DOFType | getDOFType () const |
| Overridable get/set for the DOF of the constraint. | |
| void | setDOFType (const SIM_DOFType type) |
| const UT_Vector3 | getDOFVector () const |
| void | setDOFVector (const UT_Vector3 &vector) |
| UT_Vector3 | getPosition (const SIM_Time &time) const |
| Retrieve the world-space position to constrain to. | |
| UT_Vector3 | getVelocity (const SIM_Time &time) const |
| int | getNumConDOFs () const |
| Retrieve number of constrained degrees of freedom. | |
| void | getConDOFFilter (UT_Matrix3 &result, const SIM_Time &time) const |
| void | getUnconDOFFilter (UT_Matrix3 &result, const SIM_Time &time) const |
Protected Member Functions | |
| SIM_ConAnchorSpatial (const SIM_DataFactory *factory) | |
| virtual | ~SIM_ConAnchorSpatial () |
| virtual void | buildAnchorGuideGeometrySubclass (const SIM_Options &options, const GU_DetailHandle &gdh, const SIM_Relationship &rel, const SIM_Time &t) const |
| Default implementation does nothing. | |
| virtual UT_Vector3 | getPositionSubclass (const SIM_Time &time) const =0 |
| virtual UT_Vector3 | getVelocitySubclass (const SIM_Time &) const |
| virtual SIM_DOFType | getDOFTypeSubclass () const |
| virtual const UT_Vector3 | getDOFVectorSubclass () const |
Definition at line 34 of file SIM_ConAnchorSpatial.h.
We categorize constraints by the shape created by sweeping a point through unconstrained space. The numerical representation is thus the number of degrees that have been constrained. "DOF" stands for "degrees of freedom".
| DOF_SPACE | |
| DOF_PLANE | Any point in space is valid. (i.e., constraint has no effect) |
| DOF_LINE | Any point on a plane is valid. |
| DOF_POINT | Any point on a line is valid. |
Definition at line 41 of file SIM_ConAnchorSpatial.h.
| SIM_ConAnchorSpatial::SIM_ConAnchorSpatial | ( | const SIM_DataFactory * | factory | ) | [explicit, protected] |
| virtual SIM_ConAnchorSpatial::~SIM_ConAnchorSpatial | ( | ) | [protected, virtual] |
| virtual void SIM_ConAnchorSpatial::buildAnchorGuideGeometrySubclass | ( | const SIM_Options & | options, | |
| const GU_DetailHandle & | gdh, | |||
| const SIM_Relationship & | rel, | |||
| const SIM_Time & | t | |||
| ) | const [protected, virtual] |
| void SIM_ConAnchorSpatial::getConDOFFilter | ( | UT_Matrix3 & | result, | |
| const SIM_Time & | time | |||
| ) | const |
Returns a matrix that, when multiplied by a vector, gives only the components of the vector that are constrained.
| SIM_DOFType SIM_ConAnchorSpatial::getDOFType | ( | ) | const |
Overridable get/set for the DOF of the constraint.
| virtual SIM_DOFType SIM_ConAnchorSpatial::getDOFTypeSubclass | ( | ) | const [protected, virtual] |
| const UT_Vector3 SIM_ConAnchorSpatial::getDOFVector | ( | ) | const |
| virtual const UT_Vector3 SIM_ConAnchorSpatial::getDOFVectorSubclass | ( | ) | const [protected, virtual] |
| int SIM_ConAnchorSpatial::getNumConDOFs | ( | ) | const |
Retrieve number of constrained degrees of freedom.
| UT_Vector3 SIM_ConAnchorSpatial::getPosition | ( | const SIM_Time & | time | ) | const |
Retrieve the world-space position to constrain to.
| virtual UT_Vector3 SIM_ConAnchorSpatial::getPositionSubclass | ( | const SIM_Time & | time | ) | const [protected, pure virtual] |
Implemented in SIM_ConAnchorObjPointPos, SIM_ConAnchorObjPrimPos, SIM_ConAnchorObjSpacePos, and SIM_ConAnchorWorldSpacePos.
| SIM_ConAnchorSpatial::GETSET_DATA_FUNCS_E | ( | SIM_NAME_CONDOF | , | |
| DOFTypeInput | , | |||
| SIM_DOFType | ||||
| ) |
| SIM_ConAnchorSpatial::GETSET_DATA_FUNCS_V3 | ( | SIM_NAME_CONDIR | , | |
| DOFVectorInput | ||||
| ) |
All constraints are represented by a vector which is interpreted differently depending on how many DOF will be constrained. This is troublesome as it only works in 3d. Ideally, we should specify two types of constraints: If P is the point to constrain, and R the rest point, and V the vector, we have: Normal constraint: dot(V, P) = dot(V, R) This removes one degree of freedom. Equivalent to PLANE. Vector constraint: P - R = s V, for some s This removes all but one degree of freedom. Equivalent to LINE. The result of this is always normalized.
We can then define the UnconDOFFilter which, when applied to a velocity, will cause it to fulfill those conditions. We can then clamp a position P to a rest position R with the filter uF with: P' = (uF * (P - R)) + R (Note that we can also use the ConDOFFilter with the following equation: P' = (F * (R - P)) + P We present it with the unconstrained case to match the rotational case which is harder to rearrange)
This vector is defined in simulation space, and may not be normalized.
| void SIM_ConAnchorSpatial::getUnconDOFFilter | ( | UT_Matrix3 & | result, | |
| const SIM_Time & | time | |||
| ) | const |
Opposite of getConDOFFilter(). getUnconDOFFilter() = identity - getConDOFFilter()
| UT_Vector3 SIM_ConAnchorSpatial::getVelocity | ( | const SIM_Time & | time | ) | const |
| virtual UT_Vector3 SIM_ConAnchorSpatial::getVelocitySubclass | ( | const SIM_Time & | ) | const [protected, virtual] |
Reimplemented in SIM_ConAnchorObjPointPos, SIM_ConAnchorObjPrimPos, SIM_ConAnchorObjSpacePos, and SIM_ConAnchorWorldSpacePos.
| void SIM_ConAnchorSpatial::setDOFType | ( | const SIM_DOFType | type | ) |
| void SIM_ConAnchorSpatial::setDOFVector | ( | const UT_Vector3 & | vector | ) |
1.5.9