public void Set(b2Shape shape, int index) { switch (shape.ShapeType) { case b2ShapeType.e_circle: { b2CircleShape circle = (b2CircleShape)shape; m_buffer[0] = circle.Position; m_vertices = m_buffer; m_count = 1; m_radius = circle.Radius; } break; case b2ShapeType.e_polygon: { b2PolygonShape polygon = (b2PolygonShape)shape; m_vertices = polygon.Vertices; m_count = polygon.VertexCount; m_radius = polygon.Radius; } break; case b2ShapeType.e_chain: { b2ChainShape chain = (b2ChainShape)shape; Debug.Assert(0 <= index && index < chain.Count); m_buffer[0] = chain.Vertices[index]; if (index + 1 < chain.Count) { m_buffer[1] = chain.Vertices[index + 1]; } else { m_buffer[1] = chain.Vertices[0]; } m_vertices = m_buffer; m_count = 2; m_radius = chain.Radius; } break; case b2ShapeType.e_edge: { b2EdgeShape edge = (b2EdgeShape)shape; m_buffer[0] = edge.Vertex1; m_buffer[1] = edge.Vertex2; m_vertices = m_buffer; m_count = 2; m_radius = edge.Radius; } break; default: Debug.Assert(false); break; } }
public override void Evaluate(b2Manifold manifold, b2Transform xfA, b2Transform xfB) { b2ChainShape chain = (b2ChainShape)m_fixtureA.GetShape(); b2EdgeShape edge = new b2EdgeShape(); chain.GetChildEdge(edge, m_indexA); Utils.b2CollideEdgeAndPolygon(manifold, edge, xfA, (b2PolygonShape)m_fixtureB.GetShape(), xfB); }
/// Initialize the proxy using the given shape. The shape /// must remain in scope while the proxy is in use. public void Set(b2Shape shape, int index) { switch (shape.GetType()) { case b2Shape.Type.e_circle: { b2CircleShape circle = (b2CircleShape)shape; m_vertices = new [] { circle.m_p }; m_count = 1; m_radius = circle.m_radius; } break; case b2Shape.Type.e_polygon: { b2PolygonShape polygon = (b2PolygonShape)shape; m_vertices = (b2Vec2[])polygon.m_vertices.Clone(); m_count = polygon.m_count; m_radius = polygon.m_radius; } break; case b2Shape.Type.e_chain: { b2ChainShape chain = (b2ChainShape)shape; Debug.Assert(0 <= index && index < chain.m_count); m_buffer[0] = chain.m_vertices[index]; if (index + 1 < chain.m_count) { m_buffer[1] = chain.m_vertices[index + 1]; } else { m_buffer[1] = chain.m_vertices[0]; } m_vertices = m_buffer; m_count = 2; m_radius = chain.m_radius; } break; case b2Shape.Type.e_edge: { b2EdgeShape edge = (b2EdgeShape)shape; m_vertices = new [] { edge.m_vertex1, edge.m_vertex2 }; m_count = 2; m_radius = edge.m_radius; } break; default: Debug.Assert(false); break; } }
public override void Evaluate(ref b2Manifold manifold, ref b2Transform xfA, ref b2Transform xfB) { b2ChainShape chain = (b2ChainShape)m_fixtureA.Shape; b2EdgeShape edge; edge = chain.GetChildEdge(m_indexA); b2Collision.b2CollideEdgeAndPolygon(ref manifold, edge, ref xfA, (b2PolygonShape)m_fixtureB.Shape, ref xfB); }
/// Implement b2Shape. Vertices are cloned using b2Alloc. public override b2Shape Clone() { b2ChainShape clone = new b2ChainShape(); clone.CreateChain(m_vertices, m_count); clone.m_prevVertex = m_prevVertex; clone.m_nextVertex = m_nextVertex; clone.m_hasPrevVertex = m_hasPrevVertex; clone.m_hasNextVertex = m_hasNextVertex; return(clone); }
/// Evaluate this contact with your own manifold and transforms. public void Evaluate(b2Manifold manifold, ref b2Transform xfA, ref b2Transform xfB) { switch (_type) { case ContactType.b2CircleContact: b2Collision.b2CollideCircles(manifold, (b2CircleShape)FixtureA.Shape, ref xfA, (b2CircleShape)FixtureB.Shape, ref xfB); break; case ContactType.b2PolygonAndCircleContact: b2Collision.b2CollidePolygonAndCircle(manifold, (b2PolygonShape)FixtureA.Shape, ref xfA, (b2CircleShape)FixtureB.Shape, ref xfB); break; case ContactType.b2PolygonContact: b2Collision.b2CollidePolygons(manifold, (b2PolygonShape)FixtureA.Shape, ref xfA, (b2PolygonShape)FixtureB.Shape, ref xfB); break; case ContactType.b2EdgeAndCircleContact: b2Collision.b2CollideEdgeAndCircle(manifold, (b2EdgeShape)FixtureA.Shape, ref xfA, (b2CircleShape)FixtureB.Shape, ref xfB); break; case ContactType.b2EdgeAndPolygonContact: b2Collision.b2CollideEdgeAndPolygon(manifold, (b2EdgeShape)FixtureA.Shape, ref xfA, (b2PolygonShape)FixtureB.Shape, ref xfB); break; case ContactType.b2ChainAndCircleContact: b2ChainShape chain = (b2ChainShape)FixtureA.Shape; b2EdgeShape edge; edge = chain.GetChildEdge(m_indexA); b2Collision.b2CollideEdgeAndCircle(manifold, edge, ref xfA, (b2CircleShape)FixtureB.Shape, ref xfB); break; case ContactType.b2ChainAndPolygonContact: chain = (b2ChainShape)FixtureA.Shape; edge = chain.GetChildEdge(m_indexA); b2Collision.b2CollideEdgeAndPolygon(manifold, edge, ref xfA, (b2PolygonShape)FixtureB.Shape, ref xfB); break; default: throw new ArgumentOutOfRangeException(); } }
public Pinball() { // Ground body b2Body ground; { b2BodyDef bd = new b2BodyDef(); ground = m_world.CreateBody(bd); b2Vec2[] vs = new b2Vec2[5]; vs[0].Set(0.0f, -2.0f); vs[1].Set(8.0f, 6.0f); vs[2].Set(8.0f, 20.0f); vs[3].Set(-8.0f, 20.0f); vs[4].Set(-8.0f, 6.0f); b2ChainShape loop = new b2ChainShape(); loop.CreateLoop(vs, 5); b2FixtureDef fd = new b2FixtureDef(); fd.shape = loop; fd.density = 0.0f; ground.CreateFixture(fd); } // Flippers { b2Vec2 p1 = new b2Vec2(-2.0f, 0.0f); b2Vec2 p2 = new b2Vec2(2.0f, 0.0f); b2BodyDef bd = new b2BodyDef(); bd.type = b2BodyType.b2_dynamicBody; bd.position = p1; b2Body leftFlipper = m_world.CreateBody(bd); bd.position = p2; b2Body rightFlipper = m_world.CreateBody(bd); b2PolygonShape box = new b2PolygonShape(); box.SetAsBox(1.75f, 0.1f); b2FixtureDef fd = new b2FixtureDef(); fd.shape = box; fd.density = 1.0f; leftFlipper.CreateFixture(fd); rightFlipper.CreateFixture(fd); b2RevoluteJointDef jd = new b2RevoluteJointDef(); jd.BodyA = ground; jd.localAnchorB.SetZero(); jd.enableMotor = true; jd.maxMotorTorque = 1000.0f; jd.enableLimit = true; jd.motorSpeed = 0.0f; jd.localAnchorA = p1; jd.BodyB = leftFlipper; jd.lowerAngle = -30.0f * b2Settings.b2_pi / 180.0f; jd.upperAngle = 5.0f * b2Settings.b2_pi / 180.0f; m_leftJoint = (b2RevoluteJoint)m_world.CreateJoint(jd); jd.motorSpeed = 0.0f; jd.localAnchorA = p2; jd.BodyB = rightFlipper; jd.lowerAngle = -5.0f * b2Settings.b2_pi / 180.0f; jd.upperAngle = 30.0f * b2Settings.b2_pi / 180.0f; m_rightJoint = (b2RevoluteJoint)m_world.CreateJoint(jd); } // Circle character { b2BodyDef bd = new b2BodyDef(); bd.position.Set(1.0f, 15.0f); bd.type = b2BodyType.b2_dynamicBody; bd.bullet = true; m_ball = m_world.CreateBody(bd); b2CircleShape shape = new b2CircleShape(); shape.Radius = 0.2f; b2FixtureDef fd = new b2FixtureDef(); fd.shape = shape; fd.density = 1.0f; m_ball.CreateFixture(fd); } m_button = false; }
public void DrawShape(b2Fixture fixture, b2Transform xf, b2Color color) { switch (fixture.ShapeType) { case b2ShapeType.e_circle: { b2CircleShape circle = (b2CircleShape)fixture.Shape; b2Vec2 center = b2Math.b2Mul(xf, circle.Position); float radius = circle.Radius; b2Vec2 axis = b2Math.b2Mul(xf.q, new b2Vec2(1.0f, 0.0f)); m_debugDraw.DrawSolidCircle(center, radius, axis, color); } break; case b2ShapeType.e_edge: { b2EdgeShape edge = (b2EdgeShape)fixture.Shape; b2Vec2 v1 = b2Mul(xf, edge.m_vertex1); b2Vec2 v2 = b2Mul(xf, edge.m_vertex2); m_debugDraw.DrawSegment(v1, v2, color); } break; case b2ShapeType.e_chain: { b2ChainShape chain = (b2ChainShape)fixture.Shape; int count = chain.Count; b2Vec2[] vertices = chain.Vertices; b2Vec2 v1 = b2Math.b2Mul(xf, vertices[0]); for (int i = 1; i < count; ++i) { b2Vec2 v2 = b2Math.b2Mul(xf, vertices[i]); m_debugDraw.DrawSegment(v1, v2, color); m_debugDraw.DrawCircle(v1, 0.05f, color); v1 = v2; } } break; case b2ShapeType.e_polygon: { b2PolygonShape poly = (b2PolygonShape)fixture.Shape; int vertexCount = poly.VertexCount; b2Vec2[] vertices = new b2Vec2[b2Settings.b2_maxPolygonVertices]; for (int i = 0; i < vertexCount; ++i) { vertices[i] = b2Math.b2Mul(xf, poly.Vertices[i]); } m_debugDraw.DrawSolidPolygon(vertices, vertexCount, color); } break; default: break; } }
public virtual void Dump(int bodyIndex) { System.Diagnostics.Debug.WriteLine(" b2FixtureDef fd;"); System.Diagnostics.Debug.WriteLine(" fd.friction = {0:N5};", m_friction); System.Diagnostics.Debug.WriteLine(" fd.restitution = {0:N5};", m_restitution); System.Diagnostics.Debug.WriteLine(" fd.density = {0:N5};", m_density); System.Diagnostics.Debug.WriteLine(" fd.isSensor = {0};", m_isSensor); System.Diagnostics.Debug.WriteLine(" fd.filter.categoryBits = {0};", m_filter.categoryBits); System.Diagnostics.Debug.WriteLine(" fd.filter.maskBits = {0};", m_filter.maskBits); System.Diagnostics.Debug.WriteLine(" fd.filter.groupIndex = {0};", m_filter.groupIndex); switch (m_shape.ShapeType) { case b2ShapeType.e_circle: { b2CircleShape s = (b2CircleShape)m_shape; System.Diagnostics.Debug.WriteLine(" b2CircleShape shape;"); System.Diagnostics.Debug.WriteLine(" shape.m_radius = {0:N5};", s.Radius); System.Diagnostics.Debug.WriteLine(" shape.m_p.Set({0:N5}, {0:N5});", s.Position.x, s.Position.y); } break; case b2ShapeType.e_edge: { b2EdgeShape s = (b2EdgeShape)m_shape; System.Diagnostics.Debug.WriteLine(" b2EdgeShape shape;"); System.Diagnostics.Debug.WriteLine(" shape.m_radius = {0:N5};", s.Radius); System.Diagnostics.Debug.WriteLine(" shape.m_vertex0.Set({0:N5}, {0:N5});", s.Vertex0.x, s.Vertex0.y); System.Diagnostics.Debug.WriteLine(" shape.m_vertex1.Set({0:N5}, {0:N5});", s.Vertex1.x, s.Vertex1.y); System.Diagnostics.Debug.WriteLine(" shape.m_vertex2.Set({0:N5}, {0:N5});", s.Vertex2.x, s.Vertex2.y); System.Diagnostics.Debug.WriteLine(" shape.m_vertex3.Set({0:N5}, {0:N5});", s.Vertex3.x, s.Vertex3.y); System.Diagnostics.Debug.WriteLine(" shape.m_hasVertex0 = {0};", s.HasVertex0); System.Diagnostics.Debug.WriteLine(" shape.m_hasVertex3 = {0};", s.HasVertex3); } break; case b2ShapeType.e_polygon: { b2PolygonShape s = (b2PolygonShape)m_shape; System.Diagnostics.Debug.WriteLine(" b2PolygonShape shape;"); System.Diagnostics.Debug.WriteLine(" b2Vec2 vs[{0}];", b2Settings.b2_maxPolygonVertices); for (int i = 0; i < s.VertexCount; ++i) { System.Diagnostics.Debug.WriteLine(" vs[{0}].Set({0:N5}, {0:N5});", i, s.Vertices[i].x, s.Vertices[i].y); } System.Diagnostics.Debug.WriteLine(" shape.Set(vs, {0});", s.VertexCount); } break; case b2ShapeType.e_chain: { b2ChainShape s = (b2ChainShape)m_shape; System.Diagnostics.Debug.WriteLine(" b2ChainShape shape;"); System.Diagnostics.Debug.WriteLine(" b2Vec2 vs[{0}];", s.Count); for (int i = 0; i < s.Count; ++i) { System.Diagnostics.Debug.WriteLine(" vs[{0}].Set({0:N5}, {0:N5});", i, s.Vertices[i].x, s.Vertices[i].y); } System.Diagnostics.Debug.WriteLine(" shape.CreateChain(vs, {0});", s.Count); System.Diagnostics.Debug.WriteLine(" shape.PrevVertex.Set({0:N5}, {0:N5});", s.PrevVertex.x, s.PrevVertex.y); System.Diagnostics.Debug.WriteLine(" shape.NextVertex.Set({0:N5}, {0:N5});", s.NextVertex.x, s.NextVertex.y); System.Diagnostics.Debug.WriteLine(" shape.m_hasPrevVertex = {0};", s.HasPrevVertex); System.Diagnostics.Debug.WriteLine(" shape.m_hasNextVertex = {0};", s.HasNextVertex); } break; default: return; } System.Diagnostics.Debug.WriteLine(""); System.Diagnostics.Debug.WriteLine(" fd.shape = shape;"); System.Diagnostics.Debug.WriteLine(""); System.Diagnostics.Debug.WriteLine(" bodies[{0}].CreateFixture(fd);", bodyIndex); }
public CharacterCollision() { // Ground body { b2BodyDef bd = new b2BodyDef(); b2Body ground = m_world.CreateBody(bd); b2EdgeShape shape = new b2EdgeShape(); shape.Set(new b2Vec2(-20.0f, 0.0f), new b2Vec2(20.0f, 0.0f)); ground.CreateFixture(shape, 0.0f); } // Collinear edges with no adjacency information. // This shows the problematic case where a box shape can hit // an internal vertex. { b2BodyDef bd = new b2BodyDef(); b2Body ground = m_world.CreateBody(bd); b2EdgeShape shape = new b2EdgeShape(); shape.Set(new b2Vec2(-8.0f, 1.0f), new b2Vec2(-6.0f, 1.0f)); ground.CreateFixture(shape, 0.0f); shape.Set(new b2Vec2(-6.0f, 1.0f), new b2Vec2(-4.0f, 1.0f)); ground.CreateFixture(shape, 0.0f); shape.Set(new b2Vec2(-4.0f, 1.0f), new b2Vec2(-2.0f, 1.0f)); ground.CreateFixture(shape, 0.0f); } // Chain shape { b2BodyDef bd = new b2BodyDef(); bd.angle = 0.25f * b2Settings.b2_pi; b2Body ground = m_world.CreateBody(bd); b2Vec2[] vs = new b2Vec2[4]; vs[0].Set(5.0f, 7.0f); vs[1].Set(6.0f, 8.0f); vs[2].Set(7.0f, 8.0f); vs[3].Set(8.0f, 7.0f); b2ChainShape shape = new b2ChainShape(); shape.CreateChain(vs, 4); ground.CreateFixture(shape, 0.0f); } // Square tiles. This shows that adjacency shapes may // have non-smooth collision. There is no solution // to this problem. { b2BodyDef bd = new b2BodyDef(); b2Body ground = m_world.CreateBody(bd); b2PolygonShape shape = new b2PolygonShape(); shape.SetAsBox(1.0f, 1.0f, new b2Vec2(4.0f, 3.0f), 0.0f); ground.CreateFixture(shape, 0.0f); shape.SetAsBox(1.0f, 1.0f, new b2Vec2(6.0f, 3.0f), 0.0f); ground.CreateFixture(shape, 0.0f); shape.SetAsBox(1.0f, 1.0f, new b2Vec2(8.0f, 3.0f), 0.0f); ground.CreateFixture(shape, 0.0f); } // Square made from an edge loop. Collision should be smooth. { b2BodyDef bd = new b2BodyDef(); b2Body ground = m_world.CreateBody(bd); b2Vec2[] vs = new b2Vec2[4]; vs[0].Set(-1.0f, 3.0f); vs[1].Set(1.0f, 3.0f); vs[2].Set(1.0f, 5.0f); vs[3].Set(-1.0f, 5.0f); b2ChainShape shape = new b2ChainShape(); shape.CreateLoop(vs, 4); ground.CreateFixture(shape, 0.0f); } // Edge loop. Collision should be smooth. { b2BodyDef bd = new b2BodyDef(); bd.position.Set(-10.0f, 4.0f); b2Body ground = m_world.CreateBody(bd); b2Vec2[] vs = new b2Vec2[10]; vs[0].Set(0.0f, 0.0f); vs[1].Set(6.0f, 0.0f); vs[2].Set(6.0f, 2.0f); vs[3].Set(4.0f, 1.0f); vs[4].Set(2.0f, 2.0f); vs[5].Set(0.0f, 2.0f); vs[6].Set(-2.0f, 2.0f); vs[7].Set(-4.0f, 3.0f); vs[8].Set(-6.0f, 2.0f); vs[9].Set(-6.0f, 0.0f); b2ChainShape shape = new b2ChainShape(); shape.CreateLoop(vs, 10); ground.CreateFixture(shape, 0.0f); } // Square character 1 { b2BodyDef bd = new b2BodyDef(); bd.position.Set(-3.0f, 8.0f); bd.type = b2BodyType.b2_dynamicBody; bd.fixedRotation = true; bd.allowSleep = false; b2Body body = m_world.CreateBody(bd); b2PolygonShape shape = new b2PolygonShape(); shape.SetAsBox(0.5f, 0.5f); b2FixtureDef fd = new b2FixtureDef(); fd.Defaults(); fd.shape = shape; fd.density = 20.0f; body.CreateFixture(fd); } // Square character 2 { b2BodyDef bd = new b2BodyDef(); bd.position.Set(-5.0f, 5.0f); bd.type = b2BodyType.b2_dynamicBody; bd.fixedRotation = true; bd.allowSleep = false; b2Body body = m_world.CreateBody(bd); b2PolygonShape shape = new b2PolygonShape(); shape.SetAsBox(0.25f, 0.25f); b2FixtureDef fd = new b2FixtureDef(); fd.Defaults(); fd.shape = shape; fd.density = 20.0f; body.CreateFixture(fd); } // Hexagon character { b2BodyDef bd = new b2BodyDef(); bd.position.Set(-5.0f, 8.0f); bd.type = b2BodyType.b2_dynamicBody; bd.fixedRotation = true; bd.allowSleep = false; b2Body body = m_world.CreateBody(bd); float angle = 0.0f; float delta = b2Settings.b2_pi / 3.0f; b2Vec2[] vertices = new b2Vec2[6]; for (int i = 0; i < 6; ++i) { vertices[i].Set(0.5f * (float)Math.Cos(angle), 0.5f * (float)Math.Sin(angle)); angle += delta; } b2PolygonShape shape = new b2PolygonShape(); shape.Set(vertices, 6); b2FixtureDef fd = new b2FixtureDef(); fd.Defaults(); fd.shape = shape; fd.density = 20.0f; body.CreateFixture(fd); } // Circle character { b2BodyDef bd = new b2BodyDef(); bd.position.Set(3.0f, 5.0f); bd.type = b2BodyType.b2_dynamicBody; bd.fixedRotation = true; bd.allowSleep = false; b2Body body = m_world.CreateBody(bd); b2CircleShape shape = new b2CircleShape(); shape.Radius = 0.5f; b2FixtureDef fd = new b2FixtureDef(); fd.shape = shape; fd.density = 20.0f; body.CreateFixture(fd); } // Circle character { b2BodyDef bd = new b2BodyDef(); bd.position.Set(-7.0f, 6.0f); bd.type = b2BodyType.b2_dynamicBody; bd.allowSleep = false; m_character = m_world.CreateBody(bd); b2CircleShape shape = new b2CircleShape(); shape.Radius = 0.25f; b2FixtureDef fd = new b2FixtureDef(); fd.Defaults(); fd.shape = shape; fd.density = 20.0f; fd.friction = 1.0f; m_character.CreateFixture(fd); } }
/// Dump this fixture to the log file. public void Dump(int bodyIndex) { Utils.b2Log(" b2FixtureDef fd;\n"); Utils.b2Log(" fd.friction = %.15lef;\n", m_friction); Utils.b2Log(" fd.restitution = %.15lef;\n", m_restitution); Utils.b2Log(" fd.density = %.15lef;\n", m_density); Utils.b2Log(" fd.isSensor = bool(%d);\n", m_isSensor); Utils.b2Log(" fd.filter.categoryBits = uint16(%d);\n", m_filter.categoryBits); Utils.b2Log(" fd.filter.maskBits = uint16(%d);\n", m_filter.maskBits); Utils.b2Log(" fd.filter.groupIndex = int16(%d);\n", m_filter.groupIndex); switch (m_shape.m_type) { case b2Shape.Type.e_circle: { b2CircleShape s = (b2CircleShape)m_shape; Utils.b2Log(" b2CircleShape shape;\n"); Utils.b2Log(" shape.m_radius = %.15lef;\n", s.m_radius); Utils.b2Log(" shape.m_p.Set(%.15lef, %.15lef);\n", s.m_p.x, s.m_p.y); } break; case b2Shape.Type.e_edge: { b2EdgeShape s = (b2EdgeShape)m_shape; Utils.b2Log(" b2EdgeShape shape;\n"); Utils.b2Log(" shape.m_radius = %.15lef;\n", s.m_radius); Utils.b2Log(" shape.m_vertex0.Set(%.15lef, %.15lef);\n", s.m_vertex0.x, s.m_vertex0.y); Utils.b2Log(" shape.m_vertex1.Set(%.15lef, %.15lef);\n", s.m_vertex1.x, s.m_vertex1.y); Utils.b2Log(" shape.m_vertex2.Set(%.15lef, %.15lef);\n", s.m_vertex2.x, s.m_vertex2.y); Utils.b2Log(" shape.m_vertex3.Set(%.15lef, %.15lef);\n", s.m_vertex3.x, s.m_vertex3.y); Utils.b2Log(" shape.m_hasVertex0 = bool(%d);\n", s.m_hasVertex0); Utils.b2Log(" shape.m_hasVertex3 = bool(%d);\n", s.m_hasVertex3); } break; case b2Shape.Type.e_polygon: { b2PolygonShape s = (b2PolygonShape)m_shape; Utils.b2Log(" b2PolygonShape shape;\n"); Utils.b2Log(" b2Vec2 vs[%d];\n", Settings.b2_maxPolygonVertices); for (int i = 0; i < s.m_count; ++i) { Utils.b2Log(" vs[%d].Set(%.15lef, %.15lef);\n", i, s.m_vertices[i].x, s.m_vertices[i].y); } Utils.b2Log(" shape.Set(vs, %d);\n", s.m_count); } break; case b2Shape.Type.e_chain: { b2ChainShape s = (b2ChainShape)m_shape; Utils.b2Log(" b2ChainShape shape;\n"); Utils.b2Log(" b2Vec2 vs[%d];\n", s.m_count); for (int i = 0; i < s.m_count; ++i) { Utils.b2Log(" vs[%d].Set(%.15lef, %.15lef);\n", i, s.m_vertices[i].x, s.m_vertices[i].y); } Utils.b2Log(" shape.CreateChain(vs, %d);\n", s.m_count); Utils.b2Log(" shape.m_prevVertex.Set(%.15lef, %.15lef);\n", s.m_prevVertex.x, s.m_prevVertex.y); Utils.b2Log(" shape.m_nextVertex.Set(%.15lef, %.15lef);\n", s.m_nextVertex.x, s.m_nextVertex.y); Utils.b2Log(" shape.m_hasPrevVertex = bool(%d);\n", s.m_hasPrevVertex); Utils.b2Log(" shape.m_hasNextVertex = bool(%d);\n", s.m_hasNextVertex); } break; default: return; } Utils.b2Log("\n"); Utils.b2Log(" fd.shape = &shape;\n"); Utils.b2Log("\n"); Utils.b2Log(" bodies[%d]->CreateFixture(&fd);\n", bodyIndex); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(b2ChainShape obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }