本文整理汇总了C#中dJointID类的典型用法代码示例。如果您正苦于以下问题:C# dJointID类的具体用法?C# dJointID怎么用?C# dJointID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
dJointID类属于命名空间,在下文中一共展示了dJointID类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateODEJoint
void UpdateODEJoint()
{
bool needCreate = PushedToWorld && !Broken;
bool created = jointID != dJointID.Zero;
if( needCreate == created )
return;
if( needCreate )
{
ODEBody odeBody1 = (ODEBody)Body1;
ODEBody odeBody2 = (ODEBody)Body2;
jointID = Ode.dJointCreateFixed( ( (ODEPhysicsScene)Scene ).worldID, IntPtr.Zero );
Ode.SetJointContactsEnabled( jointID, false );//ContactsEnabled );
Ode.dJointAttach( jointID, odeBody1.bodyID, odeBody2.bodyID );
Ode.dJointSetFixed( jointID );
Ode.BodyDataAddJoint( odeBody1.bodyData, jointID );
Ode.BodyDataAddJoint( odeBody2.bodyData, jointID );
}
else
{
DestroyODEJoint();
}
}
示例2: FreeJointFeedback
internal static void FreeJointFeedback( dJointID jointID )
{
IntPtr jointFeedback = Ode.dJointGetFeedbackAsIntPtr( jointID );
if( jointFeedback != IntPtr.Zero )
{
Ode.dFree( jointFeedback, (uint)Marshal.SizeOf( typeof( Ode.dJointFeedback ) ) );
jointFeedback = IntPtr.Zero;
}
}
示例3: DestroyODEJoint
internal void DestroyODEJoint()
{
if( jointID != dJointID.Zero )
{
ODEBody odeBody1 = (ODEBody)Body1;
ODEBody odeBody2 = (ODEBody)Body2;
Ode.BodyDataRemoveJoint( odeBody1.bodyData, jointID );
Ode.BodyDataRemoveJoint( odeBody2.bodyData, jointID );
Utils.FreeJointFeedback( jointID );
Ode.dJointDestroy( jointID );
jointID = dJointID.Zero;
}
}
示例4: UpdateJointBreakState
internal static bool UpdateJointBreakState( Joint joint, dJointID jointID )
{
if( jointID == dJointID.Zero )
return false;
float force;
float torque;
CalculateJointStress( jointID, out force, out torque );
if( joint.BreakMaxForce != 0 && force >= joint.BreakMaxForce )
return true;
if( joint.BreakMaxTorque != 0 && torque >= joint.BreakMaxTorque )
return true;
return false;
}
示例5: CalculateJointStress
unsafe internal static void CalculateJointStress( dJointID jointID,
out float force, out float torque )
{
IntPtr jointFeedback = Ode.dJointGetFeedbackAsIntPtr( jointID );
if( jointFeedback == IntPtr.Zero )
{
//create jointFeedback and begin use on next simulation step
jointFeedback = Ode.dAlloc( (uint)Marshal.SizeOf( typeof( Ode.dJointFeedback ) ) );
//zero memory
unsafe
{
Ode.dJointFeedback* p = (Ode.dJointFeedback*)jointFeedback;
p->f1 = new Ode.dVector3();
p->t1 = new Ode.dVector3();
p->f2 = new Ode.dVector3();
p->t2 = new Ode.dVector3();
}
Ode.dJointSetFeedbackAsIntPtr( jointID, jointFeedback );
force = 0;
torque = 0;
return;
}
Ode.dJointFeedback* ptr = (Ode.dJointFeedback*)jointFeedback;
Vec3 f1 = Convert.ToNet( ptr->f1 );
Vec3 t1 = Convert.ToNet( ptr->t1 );
Vec3 f2 = Convert.ToNet( ptr->f2 );
Vec3 t2 = Convert.ToNet( ptr->t2 );
// This is a simplification, but it should still work.
force = ( f1 - f2 ).Length();
torque = ( t1 - t2 ).Length();
}
示例6: BodyDataRemoveJoint
public extern static void BodyDataRemoveJoint( IntPtr bodyData, dJointID jointID );
示例7: dJointGetAMotorParam
public extern static dReal dJointGetAMotorParam( dJointID joint, dJointParams parameter );
示例8: dJointGetAMotorAngleRate
public extern static dReal dJointGetAMotorAngleRate( dJointID joint, int anum );
示例9: dJointGetAMotorAxisRel
public extern static int dJointGetAMotorAxisRel( dJointID joint, int anum );
示例10: dJointSetAMotorAxis
public extern static void dJointSetAMotorAxis( dJointID joint, int anum, int rel,
dReal x, dReal y, dReal z );
示例11: dJointSetAMotorNumAxes
public extern static void dJointSetAMotorNumAxes( dJointID joint, int num );
示例12: dJointAddHinge2Torques
public extern static void dJointAddHinge2Torques( dJointID joint, dReal torque1, dReal torque2 );
示例13: dJointGetHinge2Param
public extern static dReal dJointGetHinge2Param( dJointID joint, dJointParams parameter );
示例14: dJointGetHinge2Angle2Rate
public extern static dReal dJointGetHinge2Angle2Rate( dJointID joint );
示例15: dJointGetHinge2Axis2
public extern static void dJointGetHinge2Axis2( dJointID joint, ref dVector3 result );