addBox2D v API Documentation : addBox2D\Dynamics\Joints\b2FrictionJointDef.js

API Documentation for:
Show:

File:addBox2D\Dynamics\Joints\b2FrictionJointDef.js

  1. //################################################################################################//
  2. //################################################################################################//
  3. // //
  4. // ██████ ██ ██ ██ ██ ██ ██ █████ ████ //
  5. // ██ ██ ██ ██ ██ ██ ██ //
  6. // ██ ████ ██ █████ █████ ██ █████ █████ ██ █████ ██ █████ █████ ██ ██ █████ ██ //
  7. // █████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ █████ //
  8. // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ █████ ██ //
  9. // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ //
  10. // ██ ██ ██ █████ ████ ██ █████ ██ ██ █████ █████ ██ ██ ██ ████ █████ █████ ██ //
  11. // //
  12. //################################################################################################//
  13. //################################################################################################//
  14.  
  15. // CLASS CONSTRUCTOR
  16.  
  17. /**
  18. * Friction joint definition.
  19. *
  20. * Class constructor function
  21. * @class b2FrictionJointDef
  22. * @constructor
  23. * @module Joints
  24. */
  25. function b2FrictionJointDef() {
  26.  
  27. /**
  28. * Invokes parent class constructor function reference.
  29. */
  30. this.constructor( b2Joint.e_frictionJoint );
  31.  
  32. ////////////////////////////////////////////////////////////////////////////////////////////////////
  33. // //
  34. // ██████ ██ ██ //
  35. // ██ ██ ██ //
  36. // ██ ██ ████ █████ █████ █████ ████ █████ ██ █████ █████ //
  37. // ██████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ //
  38. // ██ ██ ██ ██ ██ ██ █████ ██ ██ ██ █████ █████ //
  39. // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ //
  40. // ██ ██ █████ █████ █████ ██ ████ ██ █████ █████ //
  41. // ██ //
  42. // ██ //
  43. // //
  44. ////////////////////////////////////////////////////////////////////////////////////////////////////
  45.  
  46. // property DECLARATIONS
  47.  
  48. /**
  49. * The local anchor point relative to bodyA's origin.
  50. *
  51. * @public
  52. * @property localAnchorA
  53. * @type {b2Vec2}
  54. */
  55. this.localAnchorA = new b2Vec2;
  56.  
  57. /**
  58. * The local anchor point relative to bodyB's origin.
  59. *
  60. * @public
  61. * @property localAnchorB
  62. * @type {b2Vec2}
  63. */
  64. this.localAnchorB = new b2Vec2;
  65.  
  66. // property INITIALISATIONS
  67.  
  68. /**
  69. * @public
  70. * @property type
  71. * @type {int}
  72. * @default b2Joint.e_frictionJoint
  73. */
  74. // @this.constructor( b2Joint.e_frictionJoint ) above.
  75.  
  76. /**
  77. * The maximum friction force in N.
  78. *
  79. * @public
  80. * @property maxForce
  81. * @type {float}
  82. * @default 0.0
  83. */
  84. this.maxForce = 0.0;
  85.  
  86. /**
  87. * The maximum friction torque in N-m.
  88. *
  89. * @public
  90. * @property maxTorque
  91. * @type {float}
  92. * @default 0.0
  93. */
  94. this.maxTorque = 0.0;
  95.  
  96.  
  97. ////////////////////////////////////////////////////////////////////////////////////////////////////
  98. // //
  99. // ██ ██ ██ ██ //
  100. // ██ ██ ██ //
  101. // ██ █████ █████ █████ ████ ██ █████ █████ █████ █████ █████ //
  102. // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ //
  103. // ██ ██ ██ ██ ██ █████ ██ ██ ██ █████ ██ ██ ██ █████ //
  104. // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ //
  105. // ██ ██ ██ ██ ██ █████ ██ ██ ████ █████ ██ ██ █████ █████ //
  106. // //
  107. ////////////////////////////////////////////////////////////////////////////////////////////////////
  108.  
  109. } b2FrictionJointDef.prototype = p = new b2JointDef; Box2D.b2FrictionJointDef = b2FrictionJointDef;
  110.  
  111. ////////////////////////////////////////////////////////////////////////////////////////////////////
  112. // //
  113. // ██ ██ ██ ██ ██ //
  114. // ███ ███ ██ ██ ██ //
  115. // ███████ █████ █████ █████ █████ █████ █████ //
  116. // ██ █ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ //
  117. // ██ ██ █████ ██ ██ ██ ██ ██ ██ ██ █████ //
  118. // ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ //
  119. // ██ ██ █████ ████ ██ ██ █████ █████ █████ //
  120. // //
  121. ////////////////////////////////////////////////////////////////////////////////////////////////////
  122.  
  123. // INSTANCE METHODS
  124.  
  125. /**
  126. * @public
  127. * @method initialize
  128. * @param {b2Body} bodyA
  129. * @param {b2Body} bodyB
  130. * @param {b2Vec2} anchor
  131. * @return {void}
  132. */
  133. p.initialize = function ( bodyA, bodyB, anchor ) {
  134. this.bodyA = bodyA;
  135. this.bodyB = bodyB;
  136. this.bodyA.getLocalPoint( anchor, this.localAnchorA );
  137. this.bodyB.getLocalPoint( anchor, this.localAnchorB );
  138. };
  139.