IPhysicsEnginePlugin.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /** How a specific axis can be constrained */
  2. export var PhysicsConstraintAxisLimitMode;
  3. (function (PhysicsConstraintAxisLimitMode) {
  4. /*
  5. * The axis is not restricted at all
  6. */
  7. PhysicsConstraintAxisLimitMode[PhysicsConstraintAxisLimitMode["FREE"] = 0] = "FREE";
  8. /*
  9. * The axis has a minimum/maximum limit
  10. */
  11. PhysicsConstraintAxisLimitMode[PhysicsConstraintAxisLimitMode["LIMITED"] = 1] = "LIMITED";
  12. /*
  13. * The axis allows no relative movement of the pivots
  14. */
  15. PhysicsConstraintAxisLimitMode[PhysicsConstraintAxisLimitMode["LOCKED"] = 2] = "LOCKED";
  16. })(PhysicsConstraintAxisLimitMode || (PhysicsConstraintAxisLimitMode = {}));
  17. /** The constraint specific axis to use when setting Friction, `ConstraintAxisLimitMode`, max force, ... */
  18. export var PhysicsConstraintAxis;
  19. (function (PhysicsConstraintAxis) {
  20. /*
  21. * Translation along the primary axis of the constraint (i.e. the
  22. * direction specified by PhysicsConstraintParameters.axisA/axisB)
  23. */
  24. PhysicsConstraintAxis[PhysicsConstraintAxis["LINEAR_X"] = 0] = "LINEAR_X";
  25. /*
  26. * Translation along the second axis of the constraint (i.e. the
  27. * direction specified by PhysicsConstraintParameters.perpAxisA/perpAxisB)
  28. */
  29. PhysicsConstraintAxis[PhysicsConstraintAxis["LINEAR_Y"] = 1] = "LINEAR_Y";
  30. /*
  31. * Translation along the third axis of the constraint. This axis is
  32. * computed from the cross product of axisA/axisB and perpAxisA/perpAxisB)
  33. */
  34. PhysicsConstraintAxis[PhysicsConstraintAxis["LINEAR_Z"] = 2] = "LINEAR_Z";
  35. /*
  36. * Rotation around the primary axis of the constraint (i.e. the
  37. * axis specified by PhysicsConstraintParameters.axisA/axisB)
  38. */
  39. PhysicsConstraintAxis[PhysicsConstraintAxis["ANGULAR_X"] = 3] = "ANGULAR_X";
  40. /*
  41. * Rotation around the second axis of the constraint (i.e. the
  42. * axis specified by PhysicsConstraintParameters.perpAxisA/perpAxisB)
  43. */
  44. PhysicsConstraintAxis[PhysicsConstraintAxis["ANGULAR_Y"] = 4] = "ANGULAR_Y";
  45. /*
  46. * Rotation around the third axis of the constraint. This axis is
  47. * computed from the cross product of axisA/axisB and perpAxisA/perpAxisB)
  48. */
  49. PhysicsConstraintAxis[PhysicsConstraintAxis["ANGULAR_Z"] = 5] = "ANGULAR_Z";
  50. /*
  51. * A 3D distance limit; similar to specifying the LINEAR_X/Y/Z axes
  52. * individually, but the distance calculation uses all three axes
  53. * simultaneously, instead of individually.
  54. */
  55. PhysicsConstraintAxis[PhysicsConstraintAxis["LINEAR_DISTANCE"] = 6] = "LINEAR_DISTANCE";
  56. })(PhysicsConstraintAxis || (PhysicsConstraintAxis = {}));
  57. /** Type of Constraint */
  58. export var PhysicsConstraintType;
  59. (function (PhysicsConstraintType) {
  60. /**
  61. * A ball and socket constraint will attempt to line up the pivot
  62. * positions in each body, and have no restrictions on rotation
  63. */
  64. PhysicsConstraintType[PhysicsConstraintType["BALL_AND_SOCKET"] = 1] = "BALL_AND_SOCKET";
  65. /**
  66. * A distance constraint will attempt to keep the pivot locations
  67. * within a specified distance.
  68. */
  69. PhysicsConstraintType[PhysicsConstraintType["DISTANCE"] = 2] = "DISTANCE";
  70. /**
  71. * A hinge constraint will keep the pivot positions aligned as well
  72. * as two angular axes. The remaining angular axis will be free to rotate.
  73. */
  74. PhysicsConstraintType[PhysicsConstraintType["HINGE"] = 3] = "HINGE";
  75. /**
  76. * A slider constraint allows bodies to translate along one axis and
  77. * rotate about the same axis. The remaining two axes are locked in
  78. * place
  79. */
  80. PhysicsConstraintType[PhysicsConstraintType["SLIDER"] = 4] = "SLIDER";
  81. /**
  82. * A lock constraint will attempt to keep the pivots completely lined
  83. * up between both bodies, allowing no relative movement.
  84. */
  85. PhysicsConstraintType[PhysicsConstraintType["LOCK"] = 5] = "LOCK";
  86. /*
  87. * A prismatic will lock the rotations of the bodies, and allow translation
  88. * only along one axis
  89. */
  90. PhysicsConstraintType[PhysicsConstraintType["PRISMATIC"] = 6] = "PRISMATIC";
  91. /*
  92. * A generic constraint; this starts with no limits on how the bodies can
  93. * move relative to each other, but limits can be added via the PhysicsConstraint
  94. * interfaces. This can be used to specify a large variety of constraints
  95. */
  96. PhysicsConstraintType[PhysicsConstraintType["SIX_DOF"] = 7] = "SIX_DOF";
  97. })(PhysicsConstraintType || (PhysicsConstraintType = {}));
  98. /** Type of Shape */
  99. export var PhysicsShapeType;
  100. (function (PhysicsShapeType) {
  101. PhysicsShapeType[PhysicsShapeType["SPHERE"] = 0] = "SPHERE";
  102. PhysicsShapeType[PhysicsShapeType["CAPSULE"] = 1] = "CAPSULE";
  103. PhysicsShapeType[PhysicsShapeType["CYLINDER"] = 2] = "CYLINDER";
  104. PhysicsShapeType[PhysicsShapeType["BOX"] = 3] = "BOX";
  105. PhysicsShapeType[PhysicsShapeType["CONVEX_HULL"] = 4] = "CONVEX_HULL";
  106. PhysicsShapeType[PhysicsShapeType["CONTAINER"] = 5] = "CONTAINER";
  107. PhysicsShapeType[PhysicsShapeType["MESH"] = 6] = "MESH";
  108. PhysicsShapeType[PhysicsShapeType["HEIGHTFIELD"] = 7] = "HEIGHTFIELD";
  109. })(PhysicsShapeType || (PhysicsShapeType = {}));
  110. /** Optional motor which attempts to move a body at a specific velocity, or at a specific position */
  111. export var PhysicsConstraintMotorType;
  112. (function (PhysicsConstraintMotorType) {
  113. PhysicsConstraintMotorType[PhysicsConstraintMotorType["NONE"] = 0] = "NONE";
  114. PhysicsConstraintMotorType[PhysicsConstraintMotorType["VELOCITY"] = 1] = "VELOCITY";
  115. PhysicsConstraintMotorType[PhysicsConstraintMotorType["POSITION"] = 2] = "POSITION";
  116. })(PhysicsConstraintMotorType || (PhysicsConstraintMotorType = {}));
  117. export var PhysicsEventType;
  118. (function (PhysicsEventType) {
  119. PhysicsEventType["COLLISION_STARTED"] = "COLLISION_STARTED";
  120. PhysicsEventType["COLLISION_CONTINUED"] = "COLLISION_CONTINUED";
  121. PhysicsEventType["COLLISION_FINISHED"] = "COLLISION_FINISHED";
  122. PhysicsEventType["TRIGGER_ENTERED"] = "TRIGGER_ENTERED";
  123. PhysicsEventType["TRIGGER_EXITED"] = "TRIGGER_EXITED";
  124. })(PhysicsEventType || (PhysicsEventType = {}));
  125. /**
  126. * Indicates how the body will behave.
  127. */
  128. export var PhysicsMotionType;
  129. (function (PhysicsMotionType) {
  130. PhysicsMotionType[PhysicsMotionType["STATIC"] = 0] = "STATIC";
  131. PhysicsMotionType[PhysicsMotionType["ANIMATED"] = 1] = "ANIMATED";
  132. PhysicsMotionType[PhysicsMotionType["DYNAMIC"] = 2] = "DYNAMIC";
  133. })(PhysicsMotionType || (PhysicsMotionType = {}));
  134. /**
  135. * Controls the body sleep mode.
  136. */
  137. export var PhysicsActivationControl;
  138. (function (PhysicsActivationControl) {
  139. PhysicsActivationControl[PhysicsActivationControl["SIMULATION_CONTROLLED"] = 0] = "SIMULATION_CONTROLLED";
  140. PhysicsActivationControl[PhysicsActivationControl["ALWAYS_ACTIVE"] = 1] = "ALWAYS_ACTIVE";
  141. PhysicsActivationControl[PhysicsActivationControl["ALWAYS_INACTIVE"] = 2] = "ALWAYS_INACTIVE";
  142. })(PhysicsActivationControl || (PhysicsActivationControl = {}));
  143. //# sourceMappingURL=IPhysicsEnginePlugin.js.map