コード例 #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
		public void DisposalDisposesMissile()
		{
			var missile = new PhysicalEntity3D();
			var grenade = new Projectile(Vector3D.Zero, Vector3D.Zero, missile, 1, 0.2f);
			grenade.IsActive = false;
			Assert.IsFalse(missile.IsActive);
		}