예제 #1
0
파일: Game.cs 프로젝트: whztt07/DeltaEngine
		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));
				}
		}
예제 #2
0
		protected PhysicsBody(PhysicsShape shape)
		{
			Shape = shape;
		}
예제 #3
0
		public abstract PhysicsBody CreateBody(PhysicsShape shape, Vector3D initialPosition,
			float mass, float restitution);
예제 #4
0
 public abstract PhysicsBody CreateBody(PhysicsShape shape, Vector3D initialPosition,
                                        float mass, float restitution);
예제 #5
0
 protected PhysicsBody(PhysicsShape shape)
 {
     Shape = shape;
 }