void
dxJointHinge2::setRelativeValues()
{
    dVector3 anchor;
    dJointGetHinge2Anchor(this, anchor);
    setAnchors( this, anchor[0], anchor[1], anchor[2], anchor1, anchor2 );

    dVector3 axis;

    if ( node[0].body )
    {
        dJointGetHinge2Axis1(this, axis);
        setAxes( this, axis[0],axis[1],axis[2], axis1, NULL );
    }

    if ( node[0].body )
    {
        dJointGetHinge2Axis2(this, axis);
        setAxes( this, axis[0],axis[1],axis[2], NULL, axis2 );
    }

    dVector3 ax1, ax2;
    getAxisInfo( ax1, ax2, axis, s0, c0 );

    makeV1andV2();
    makeW1andW2();
}
/***************************************************************************\
*                              Field Get	                               *
\***************************************************************************/
Vec3f PhysicsHinge2Joint::getAnchor(void)
{
	PhysicsHinge2JointPtr tmpPtr(*this);
	dVector3 a;
	dJointGetHinge2Anchor(tmpPtr->id, a);
	return Vec3f(a[0], a[1], a[2]);
}
Example #3
0
void CHinge2Joint::RenderDebug()
{
	if (IsAttached())
	{
		matrix44 Tfm;
		dVector3 CurrAnchor;
		dJointGetHinge2Anchor(ODEJointID, CurrAnchor);
		Tfm.scale(vector3(0.1f, 0.1f, 0.1f));
		Tfm.translate(vector3(CurrAnchor[0], CurrAnchor[1], CurrAnchor[2]));
		nGfxServer2::Instance()->DrawShape(nGfxServer2::Sphere, Tfm, GetDebugVisualizationColor());
	}
}
Example #4
0
static void get_phys_joint_anchor(dJointID j, float *v)
{
    dVector3 V = { 0, 0, 0 };

    switch (dJointGetType(j))
    {
    case dJointTypeBall:      dJointGetBallAnchor     (j, V); break;
    case dJointTypeHinge:     dJointGetHingeAnchor    (j, V); break;
    case dJointTypeHinge2:    dJointGetHinge2Anchor   (j, V); break;
    case dJointTypeUniversal: dJointGetUniversalAnchor(j, V); break;
    default: break;
    }

    v[0] = (float) V[0];
    v[1] = (float) V[1];
    v[2] = (float) V[2];
}
void TSRODESteeringJoint::GetAnchor( TSRVector3& _vAnchor )
{
	dJointGetHinge2Anchor( m_ODEJoint.m_JointID, _vAnchor.v );
}