public Joint CreateJoint(JointDef def) { using (var ptr = new StructToPtrMarshaller(def)) return Joint.FromPtr(NativeMethods.b2world_createjoint(_worldPtr, ptr.Pointer)); }
/// <summary> /// Attach a fixture to this shape. /// </summary> /// <param name="def">The fixture definition to add.</param> /// <returns>The created Fixture object.</returns> public Fixture CreateFixture(FixtureDef def) { def.SetShape(def.Shape.Lock()); Fixture fixture; using (var structPtr = new StructToPtrMarshaller(def.Internal)) fixture = Fixture.FromPtr(NativeMethods.b2body_createfixture(_bodyPtr, structPtr.Pointer)); def.Shape.Unlock(); return fixture; }
public Body CreateBody(BodyDef def) { using (var structPtr = new StructToPtrMarshaller(def)) return Body.FromPtr(NativeMethods.b2world_createbody(_worldPtr, structPtr.Pointer)); }