mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
BulletSim: add unmanaged and XNA functions for hinge, slider and spring constraints.
This commit is contained in:
@@ -596,6 +596,12 @@ public override bool SetBreakingImpulseThreshold(BulletConstraint constrain, flo
|
||||
return BSAPICPP.SetBreakingImpulseThreshold2(constrainu.ptr, threshold);
|
||||
}
|
||||
|
||||
public override bool HingeSetLimits(BulletConstraint constrain, float low, float high, float softness, float bias, float relaxation)
|
||||
{
|
||||
BulletConstraintUnman constrainu = constrain as BulletConstraintUnman;
|
||||
return BSAPICPP.HingeSetLimits2(constrainu.ptr, low, high, softness, bias, relaxation);
|
||||
}
|
||||
|
||||
public override bool SpringEnable(BulletConstraint constrain, int index, float numericTrueFalse)
|
||||
{
|
||||
BulletConstraintUnman constrainu = constrain as BulletConstraintUnman;
|
||||
@@ -620,6 +626,30 @@ public override bool SpringSetDamping(BulletConstraint constrain, int index, flo
|
||||
return BSAPICPP.ConstraintSpringSetDamping2(constrainu.ptr, index, damping);
|
||||
}
|
||||
|
||||
public override bool SliderSetLimits(BulletConstraint constrain, int lowerUpper, int linAng, float val)
|
||||
{
|
||||
BulletConstraintUnman constrainu = constrain as BulletConstraintUnman;
|
||||
return BSAPICPP.SliderSetLimits2(constrainu.ptr, lowerUpper, linAng, val);
|
||||
}
|
||||
|
||||
public override bool SliderSet(BulletConstraint constrain, int softRestDamp, int dirLimOrtho, int linAng, float val)
|
||||
{
|
||||
BulletConstraintUnman constrainu = constrain as BulletConstraintUnman;
|
||||
return BSAPICPP.SliderSet2(constrainu.ptr, softRestDamp, dirLimOrtho, linAng, val);
|
||||
}
|
||||
|
||||
public override bool SliderMotorEnable(BulletConstraint constrain, int linAng, float numericTrueFalse)
|
||||
{
|
||||
BulletConstraintUnman constrainu = constrain as BulletConstraintUnman;
|
||||
return BSAPICPP.SliderMotorEnable2(constrainu.ptr, linAng, numericTrueFalse);
|
||||
}
|
||||
|
||||
public override bool SliderMotor(BulletConstraint constrain, int forceVel, int linAng, float val)
|
||||
{
|
||||
BulletConstraintUnman constrainu = constrain as BulletConstraintUnman;
|
||||
return BSAPICPP.SliderMotor2(constrainu.ptr, forceVel, linAng, val);
|
||||
}
|
||||
|
||||
public override bool CalculateTransforms(BulletConstraint constrain)
|
||||
{
|
||||
BulletConstraintUnman constrainu = constrain as BulletConstraintUnman;
|
||||
@@ -1624,6 +1654,9 @@ public static extern bool TranslationalLimitMotor2(IntPtr constrain, float enabl
|
||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||
public static extern bool SetBreakingImpulseThreshold2(IntPtr constrain, float threshold);
|
||||
|
||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||
public static extern bool HingeSetLimits2(IntPtr constrain, float low, float high, float softness, float bias, float relaxation);
|
||||
|
||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||
public static extern bool ConstraintSpringEnable2(IntPtr constrain, int index, float numericTrueFalse);
|
||||
|
||||
@@ -1636,6 +1669,18 @@ public static extern bool ConstraintSpringSetStiffness2(IntPtr constrain, int in
|
||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||
public static extern bool ConstraintSpringSetDamping2(IntPtr constrain, int index, float damping);
|
||||
|
||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||
public static extern bool SliderSetLimits2(IntPtr constrain, int lowerUpper, int linAng, float val);
|
||||
|
||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||
public static extern bool SliderSet2(IntPtr constrain, int softRestDamp, int dirLimOrtho, int linAng, float val);
|
||||
|
||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||
public static extern bool SliderMotorEnable2(IntPtr constrain, int linAng, float numericTrueFalse);
|
||||
|
||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||
public static extern bool SliderMotor2(IntPtr constrain, int forceVel, int linAng, float val);
|
||||
|
||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||
public static extern bool CalculateTransforms2(IntPtr constrain);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user