public TrackingCamera(Game game, Tank target) : base(game) { _target = target; _pitch = MathHelper.ToRadians(45); _yaw = 0; _distance = 10; }
public Bullet(Game game, Tank owner, Vector3 position, Vector3 velocity) : base(game) { Owner = owner; Position = position; Velocity = velocity; IsDead = false; }
public TankController(Game1 game, Tank tank) : base(game) { _tank = tank; }
public TankControllerAI(Game1 game, Tank tank) : base(game, tank) { }
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; }