(def *B2MotorJointDef)
| 94 | } |
| 95 | |
| 96 | func MakeB2MotorJoint(def *B2MotorJointDef) *B2MotorJoint { |
| 97 | |
| 98 | res := B2MotorJoint{ |
| 99 | B2Joint: MakeB2Joint(def), |
| 100 | } |
| 101 | |
| 102 | res.M_linearOffset = def.LinearOffset |
| 103 | res.M_angularOffset = def.AngularOffset |
| 104 | |
| 105 | res.M_linearImpulse.SetZero() |
| 106 | res.M_angularImpulse = 0.0 |
| 107 | |
| 108 | res.M_maxForce = def.MaxForce |
| 109 | res.M_maxTorque = def.MaxTorque |
| 110 | res.M_correctionFactor = def.CorrectionFactor |
| 111 | |
| 112 | return &res |
| 113 | } |
| 114 | |
| 115 | func (joint *B2MotorJoint) InitVelocityConstraints(data B2SolverData) { |
| 116 | joint.M_indexA = joint.M_bodyA.M_islandIndex |
no test coverage detected