MCPcopy Create free account
hub / github.com/ByteArena/box2d / MakeB2MotorJoint

Function MakeB2MotorJoint

DynamicsB2JointMotor.go:96–113  ·  view source on GitHub ↗
(def *B2MotorJointDef)

Source from the content-addressed store, hash-verified

94}
95
96func 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
115func (joint *B2MotorJoint) InitVelocityConstraints(data B2SolverData) {
116 joint.M_indexA = joint.M_bodyA.M_islandIndex

Callers 1

B2JointCreateFunction · 0.85

Calls 2

MakeB2JointFunction · 0.85
SetZeroMethod · 0.45

Tested by

no test coverage detected