Ejemplo n.º 1
0
        private void CheckShipCollision(Ship ship)
        {
            var intersect = BoundingSphere.Intersects(ship.BoundingSphere);

            // Check for bounding sphere intersection first, in order
            // to optimize performance..
            if (!intersect)
                return;

            // If sphere intersects, than do a more accurate collision check (per-triangle).
            if (ship.HasAtLeastOneTriangleIntersectsBoundingSphere(BoundingSphere))
                ship.Destroy();
        }
Ejemplo n.º 2
0
 private void InitializeShip()
 {
     _ship = new Ship(this, "models/ships/feisar/FeisarShip", "models/SkyGlobeTexture", _shipInfo);
     _ship.SetMaterial(0, new Material { DiffuseColor = Vector3.One });
     _ship.AddWeapon(new LaserCannon(this, TimeSpan.FromSeconds(0.2d), -1, _ship), GestureType.Tap);
     AddComponent(_ship, "Models");
 }