BulletSim: add new Bullet 2.82 constraint type codes and rename the

BulletSim fixed constraint to not be confused with the native version.
bullet-2.82
Robert Adams 2014-08-21 06:33:04 -07:00
parent 64cf75866e
commit 674be72225
2 changed files with 9 additions and 7 deletions

View File

@ -43,9 +43,11 @@ public enum ConstraintType : int
SLIDER_CONSTRAINT_TYPE, SLIDER_CONSTRAINT_TYPE,
CONTACT_CONSTRAINT_TYPE, CONTACT_CONSTRAINT_TYPE,
D6_SPRING_CONSTRAINT_TYPE, D6_SPRING_CONSTRAINT_TYPE,
GEAR_CONSTRAINT_TYPE, // added in Bullet 2.82
FIXED_CONSTRAINT_TYPE, // added in Bullet 2.82
MAX_CONSTRAINT_TYPE, // last type defined by Bullet MAX_CONSTRAINT_TYPE, // last type defined by Bullet
// //
FIXED_CONSTRAINT_TYPE = 1234 // BulletSim constraint that is fixed and unmoving BS_FIXED_CONSTRAINT_TYPE = 1234 // BulletSim constraint that is fixed and unmoving
} }
// =============================================================================== // ===============================================================================

View File

@ -78,7 +78,7 @@ public sealed class BSLinksetConstraints : BSLinkset
public override void ResetLink() public override void ResetLink()
{ {
// constraintType = ConstraintType.D6_CONSTRAINT_TYPE; // constraintType = ConstraintType.D6_CONSTRAINT_TYPE;
constraintType = ConstraintType.FIXED_CONSTRAINT_TYPE; constraintType = ConstraintType.BS_FIXED_CONSTRAINT_TYPE;
linearLimitLow = OMV.Vector3.Zero; linearLimitLow = OMV.Vector3.Zero;
linearLimitHigh = OMV.Vector3.Zero; linearLimitHigh = OMV.Vector3.Zero;
angularLimitLow = OMV.Vector3.Zero; angularLimitLow = OMV.Vector3.Zero;
@ -115,7 +115,7 @@ public sealed class BSLinksetConstraints : BSLinkset
member.PhysScene.DetailLog("{0},BSLinkInfoConstraint.SetLinkParameters,type={1}", member.LocalID, constraintType); member.PhysScene.DetailLog("{0},BSLinkInfoConstraint.SetLinkParameters,type={1}", member.LocalID, constraintType);
switch (constraintType) switch (constraintType)
{ {
case ConstraintType.FIXED_CONSTRAINT_TYPE: case ConstraintType.BS_FIXED_CONSTRAINT_TYPE:
case ConstraintType.D6_CONSTRAINT_TYPE: case ConstraintType.D6_CONSTRAINT_TYPE:
BSConstraint6Dof constrain6dof = constrain as BSConstraint6Dof; BSConstraint6Dof constrain6dof = constrain as BSConstraint6Dof;
if (constrain6dof != null) if (constrain6dof != null)
@ -179,7 +179,7 @@ public sealed class BSLinksetConstraints : BSLinkset
public override bool ShouldUpdateChildProperties() public override bool ShouldUpdateChildProperties()
{ {
bool ret = true; bool ret = true;
if (constraintType == ConstraintType.FIXED_CONSTRAINT_TYPE) if (constraintType == ConstraintType.BS_FIXED_CONSTRAINT_TYPE)
ret = false; ret = false;
return ret; return ret;
@ -363,7 +363,7 @@ public sealed class BSLinksetConstraints : BSLinkset
switch (linkInfo.constraintType) switch (linkInfo.constraintType)
{ {
case ConstraintType.FIXED_CONSTRAINT_TYPE: case ConstraintType.BS_FIXED_CONSTRAINT_TYPE:
case ConstraintType.D6_CONSTRAINT_TYPE: case ConstraintType.D6_CONSTRAINT_TYPE:
// Relative position normalized to the root prim // Relative position normalized to the root prim
// Essentually a vector pointing from center of rootPrim to center of li.member // Essentually a vector pointing from center of rootPrim to center of li.member
@ -536,7 +536,7 @@ public sealed class BSLinksetConstraints : BSLinkset
{ {
int requestedType = (int)pParams[2]; int requestedType = (int)pParams[2];
DetailLog("{0},BSLinksetConstraint.ChangeLinkType,requestedType={1}", LinksetRoot.LocalID, requestedType); DetailLog("{0},BSLinksetConstraint.ChangeLinkType,requestedType={1}", LinksetRoot.LocalID, requestedType);
if (requestedType == (int)ConstraintType.FIXED_CONSTRAINT_TYPE if (requestedType == (int)ConstraintType.BS_FIXED_CONSTRAINT_TYPE
|| requestedType == (int)ConstraintType.D6_CONSTRAINT_TYPE || requestedType == (int)ConstraintType.D6_CONSTRAINT_TYPE
|| requestedType == (int)ConstraintType.D6_SPRING_CONSTRAINT_TYPE || requestedType == (int)ConstraintType.D6_SPRING_CONSTRAINT_TYPE
|| requestedType == (int)ConstraintType.HINGE_CONSTRAINT_TYPE || requestedType == (int)ConstraintType.HINGE_CONSTRAINT_TYPE
@ -646,7 +646,7 @@ public sealed class BSLinksetConstraints : BSLinkset
case ExtendedPhysics.PHYS_PARAM_LINK_TYPE: case ExtendedPhysics.PHYS_PARAM_LINK_TYPE:
valueInt = (int)pParams[opIndex + 1]; valueInt = (int)pParams[opIndex + 1];
ConstraintType valueType = (ConstraintType)valueInt; ConstraintType valueType = (ConstraintType)valueInt;
if (valueType == ConstraintType.FIXED_CONSTRAINT_TYPE if (valueType == ConstraintType.BS_FIXED_CONSTRAINT_TYPE
|| valueType == ConstraintType.D6_CONSTRAINT_TYPE || valueType == ConstraintType.D6_CONSTRAINT_TYPE
|| valueType == ConstraintType.D6_SPRING_CONSTRAINT_TYPE || valueType == ConstraintType.D6_SPRING_CONSTRAINT_TYPE
|| valueType == ConstraintType.HINGE_CONSTRAINT_TYPE || valueType == ConstraintType.HINGE_CONSTRAINT_TYPE