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

Function B2JointCreate

DynamicsB2Joint.go:249–359  ·  view source on GitHub ↗
(def B2JointDefInterface)

Source from the content-addressed store, hash-verified

247}
248
249func B2JointCreate(def B2JointDefInterface) B2JointInterface { // def should be back by pointer; a pointer is returned
250
251 var joint *B2Joint = nil
252
253 switch def.GetType() {
254 case B2JointType.E_distanceJoint:
255 {
256 if typeddef, ok := def.(*B2DistanceJointDef); ok {
257 return MakeB2DistanceJoint(typeddef)
258 }
259
260 B2Assert(false)
261 }
262
263 case B2JointType.E_mouseJoint:
264 {
265 if typeddef, ok := def.(*B2MouseJointDef); ok {
266 return MakeB2MouseJoint(typeddef)
267 }
268
269 B2Assert(false)
270 }
271
272 case B2JointType.E_prismaticJoint:
273 {
274 if typeddef, ok := def.(*B2PrismaticJointDef); ok {
275 return MakeB2PrismaticJoint(typeddef)
276 }
277
278 B2Assert(false)
279 }
280
281 case B2JointType.E_revoluteJoint:
282 {
283 if typeddef, ok := def.(*B2RevoluteJointDef); ok {
284 return MakeB2RevoluteJoint(typeddef)
285 }
286
287 B2Assert(false)
288 }
289
290 case B2JointType.E_pulleyJoint:
291 {
292 if typeddef, ok := def.(*B2PulleyJointDef); ok {
293 return MakeB2PulleyJoint(typeddef)
294 }
295
296 B2Assert(false)
297 }
298
299 case B2JointType.E_gearJoint:
300 {
301 if typeddef, ok := def.(*B2GearJointDef); ok {
302 return MakeB2GearJoint(typeddef)
303 }
304
305 B2Assert(false)
306 }

Callers 1

CreateJointMethod · 0.85

Calls 13

MakeB2DistanceJointFunction · 0.85
B2AssertFunction · 0.85
MakeB2MouseJointFunction · 0.85
MakeB2PrismaticJointFunction · 0.85
MakeB2RevoluteJointFunction · 0.85
MakeB2PulleyJointFunction · 0.85
MakeB2GearJointFunction · 0.85
MakeB2WheelJointFunction · 0.85
MakeB2WeldJointFunction · 0.85
MakeB2FrictionJointFunction · 0.85
MakeB2RopeJointFunction · 0.85
MakeB2MotorJointFunction · 0.85

Tested by

no test coverage detected