physuspension.cpp
28 PhySuspension::PhySuspension( const wVector& axis, const wVector& centre, const wVector& x_axis, PhyObject* parent, PhyObject* child, bool cp )
88 priv->joint = NewtonConstraintCreateUserJoint( worldpriv->world, 6, PhyJointPrivate::userBilateralHandler, 0, priv->child, priv->parent );
122 // if it is, we use Newton functions to get the angular velocities (for a better result), otherwise
125 //--- the velocity is calculated projecting the angular velocity of objects on the main axis (z_ax)
163 NewtonUserJointAddLinearRow( priv->joint, &globalMatrixChild.w_pos[0], &globalMatrixParent.w_pos[0], &globalMatrixParent.x_ax[0] );
166 NewtonUserJointAddLinearRow( priv->joint, &globalMatrixChild.w_pos[0], &globalMatrixParent.w_pos[0], &globalMatrixParent.y_ax[0] );
168 NewtonUserJointAddLinearRow( priv->joint, &globalMatrixChild.w_pos[0], &globalMatrixParent.w_pos[0], &globalMatrixParent.z_ax[0] );
180 NewtonUserJointAddLinearRow( priv->joint, &qChild[0], &qParent[0], &globalMatrixParent.x_ax[0] );
182 NewtonUserJointAddLinearRow( priv->joint, &qChild[0], &qParent[0], &globalMatrixParent.y_ax[0] );
virtual wVector getForceOnJoint() const
Returns the force applied to this joint.
Definition: physuspension.cpp:81
wMatrix localMatrixParent
Local frame of the joint respect to the parent matrix.
Definition: physuspension.h:73
virtual wVector centre() const
Return the centre of this joint in world coordinate.
Definition: physuspension.cpp:73
real velocity() const
return the actual relative velocity of bodies along the axis of rotation/translation ...
Definition: phyjoint.h:145
real position() const
return the actual position of bodies For rotational DOF is the angle of rotation For linear DOF is t...
Definition: phyjoint.h:135
const wMatrix & matrix() const
return a reference to the transformation matrix
Definition: wobject.cpp:47
wMatrix localMatrixChild
Local frame of the joint respect to the child matrix.
Definition: physuspension.h:75
void sanitifize()
change the matrix in order to get a valid one that represent the same rotation/translation ...
Definition: wmatrix.h:450
virtual PhyObject * parent()
Return the parent object; (NULL means an object attached to static world; see Netwon Documentation) ...
Definition: phyjoint.h:379
wVectorT< false > scale(real s) const
return a new wVectorT with element scaled by s
Definition: wvector.h:305
float real
virtual void updateJointInfo()
Update the Joint informations (each PhyDOF will be updated)
Definition: physuspension.cpp:93
virtual PhyObject * child()
Return the child object attached to this joint (see Newton Documentation)
Definition: phyjoint.h:371
PhySuspension(const wVector &axis, const wVector ¢re, const wVector &x_axis, PhyObject *parent, PhyObject *child, bool cp=true)
Constructor.
Definition: physuspension.cpp:28