private void CreatePyramid() { var boxMesh = new BoxMesh(BoxSize, new Material(ShaderFlags.LitTextured, "BoxDiffuse")); for (int height = 0; height < PyramidSize; height++) for (int width = height; width < PyramidSize; width++) { var box = new PhysicalEntity3D(); box.Position = new Vector3D( (width - height * 0.5f) * BoxSize.X * 1.1f - BoxSize.X * 1.1f * PyramidSize / 2.0f + 1.1f, 0.0f, 1.0f + height * BoxSize.Z * 1.0f); var shape = new PhysicsShape(ShapeType.Box) { Size = BoxSize }; box.PhysicsBody = physics.CreateBody(shape, box.Position, box.Mass, 0.0f); box.AddChild(new Model(new ModelData(boxMesh), Vector3D.Zero)); } }
protected PhysicsBody(PhysicsShape shape) { Shape = shape; }
public abstract PhysicsBody CreateBody(PhysicsShape shape, Vector3D initialPosition, float mass, float restitution);