Esempio n. 1
0
 public Joint CreateJoint(JointDef def)
 {
     using (var ptr = new StructToPtrMarshaller(def))
         return Joint.FromPtr(NativeMethods.b2world_createjoint(_worldPtr, ptr.Pointer));
 }
Esempio n. 2
0
 /// <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;
 }
Esempio n. 3
0
 public Body CreateBody(BodyDef def)
 {
     using (var structPtr = new StructToPtrMarshaller(def))
         return Body.FromPtr(NativeMethods.b2world_createbody(_worldPtr, structPtr.Pointer));
 }