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

Function MakeB2WheelJoint

DynamicsB2JointWheel.go:172–203  ·  view source on GitHub ↗
(def *B2WheelJointDef)

Source from the content-addressed store, hash-verified

170}
171
172func MakeB2WheelJoint(def *B2WheelJointDef) *B2WheelJoint {
173 res := B2WheelJoint{
174 B2Joint: MakeB2Joint(def),
175 }
176
177 res.M_localAnchorA = def.LocalAnchorA
178 res.M_localAnchorB = def.LocalAnchorB
179 res.M_localXAxisA = def.LocalAxisA
180 res.M_localYAxisA = B2Vec2CrossScalarVector(1.0, res.M_localXAxisA)
181
182 res.M_mass = 0.0
183 res.M_impulse = 0.0
184 res.M_motorMass = 0.0
185 res.M_motorImpulse = 0.0
186 res.M_springMass = 0.0
187 res.M_springImpulse = 0.0
188
189 res.M_maxMotorTorque = def.MaxMotorTorque
190 res.M_motorSpeed = def.MotorSpeed
191 res.M_enableMotor = def.EnableMotor
192
193 res.M_frequencyHz = def.FrequencyHz
194 res.M_dampingRatio = def.DampingRatio
195
196 res.M_bias = 0.0
197 res.M_gamma = 0.0
198
199 res.M_ax.SetZero()
200 res.M_ay.SetZero()
201
202 return &res
203}
204
205func (joint *B2WheelJoint) InitVelocityConstraints(data B2SolverData) {
206

Callers 1

B2JointCreateFunction · 0.85

Calls 3

MakeB2JointFunction · 0.85
B2Vec2CrossScalarVectorFunction · 0.85
SetZeroMethod · 0.45

Tested by

no test coverage detected