コード例 #1
0
ファイル: TrackingCamera.cs プロジェクト: KepAmun/SpeedCanyon
        public TrackingCamera(Game game, Tank target)
            : base(game)
        {
            _target = target;

            _pitch = MathHelper.ToRadians(45);
            _yaw = 0;
            _distance = 10;
        }
コード例 #2
0
ファイル: Bullet.cs プロジェクト: KepAmun/SpeedCanyon
        public Bullet(Game game, Tank owner, Vector3 position, Vector3 velocity)
            : base(game)
        {
            Owner = owner;
            Position = position;
            Velocity = velocity;

            IsDead = false;
        }
コード例 #3
0
ファイル: TankController.cs プロジェクト: KepAmun/SpeedCanyon
 public TankController(Game1 game, Tank tank)
     : base(game)
 {
     _tank = tank;
 }
コード例 #4
0
 public TankControllerAI(Game1 game, Tank tank)
     : base(game, tank)
 {
 }
コード例 #5
0
ファイル: Tank.cs プロジェクト: KepAmun/SpeedCanyon
        public bool Collides(Tank otherTank)
        {
            bool result = false;

            int[] collisionMeshIndices = { 0, 1, 4, 5, 10, 11 };

            for (int i = 0; i < 6; i++)
            {
                ModelMesh mesh = _tankModel.Meshes[collisionMeshIndices[i]];

                BoundingSphere boundingSphere = mesh.BoundingSphere;

                boundingSphere = boundingSphere.Transform(_boneTransforms[mesh.ParentBone.Index]);

                for (int c = 0; c < 6; c++)
                {
                    ModelMesh otherMesh = otherTank._tankModel.Meshes[collisionMeshIndices[c]];

                    BoundingSphere otherBoundingSphere = otherMesh.BoundingSphere;

                    otherBoundingSphere = otherBoundingSphere.Transform(otherTank._boneTransforms[otherMesh.ParentBone.Index]);

                    if (boundingSphere.Contains(otherBoundingSphere) != ContainmentType.Disjoint)
                    {
                        result = true;
                        break;
                    }
                }

                if (result == true)
                    break;
            }

            return result;
        }