Bug fixes
This commit is contained in:
@@ -23,7 +23,7 @@ namespace EvilSatellites
|
||||
public bool IsPlaying;
|
||||
public Vector3 RadarTarget;
|
||||
public Matrix RadarOrientation;
|
||||
|
||||
public float RadarPitch;
|
||||
public Radar(IGameObject owner, IScreen screen)
|
||||
{
|
||||
Owner = owner;
|
||||
@@ -71,11 +71,13 @@ namespace EvilSatellites
|
||||
if (Target == null)
|
||||
{
|
||||
RadarNoise.Pitch = 0.1;
|
||||
RadarPitch = 0.1f;
|
||||
return;
|
||||
}
|
||||
Vector3 radarTarget = (Target.Position - Owner.Position);
|
||||
radarTarget.Normalize();
|
||||
RadarNoise.Pitch = MathHelper.Clamp(0.1f / Vector3.Distance(Owner.Rotation.Forward, radarTarget) * 3f, 0, 1);
|
||||
RadarPitch = MathHelper.Clamp(0.1f / Vector3.Distance(Owner.Rotation.Forward, radarTarget) * 3f, 0, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +88,7 @@ namespace EvilSatellites
|
||||
RadarPosition += RadarDirection;
|
||||
RadarNoise.Position = new System.Numerics.Vector3(RadarPosition.X, RadarPosition.Y, RadarPosition.Z);
|
||||
RadarNoise.Pitch = MathHelper.Clamp(0.1f / Vector3.Distance(Owner.Rotation.Forward, RadarTarget) * 3f, 0, 2);
|
||||
RadarPitch = MathHelper.Clamp(0.1f / Vector3.Distance(Owner.Rotation.Forward, RadarTarget) * 3f, 0, 2);
|
||||
if (Vector3.Distance(RadarPosition, Owner.Position) > 20)
|
||||
{
|
||||
IsPlaying = false;
|
||||
|
||||
Reference in New Issue
Block a user