Compare commits

..

1 Commits

Author SHA1 Message Date
12e518af0e Update Drone.cs 2025-06-27 12:12:24 +03:00

View File

@ -293,6 +293,7 @@ namespace DroneSimulator
Vector4 ori = GetOrientation();
Orientation = ori;
float range = 0;
if (PosXYZ.Z <= 0)
{
@ -336,19 +337,19 @@ namespace DroneSimulator
float tilt = MathF.Sqrt((ori.X * ori.X) + (ori.Y * ori.Y)) * TO_RADI;
if (tilt < 90 && ori.W > 0) LaserRange = PosXYZ.Z / MathF.Cos(tilt);
range = PosXYZ.Z / MathF.Cos(tilt);
if (tilt < 90 && ori.W > 0) LaserRange = range;
else LaserRange = float.MaxValue;
}
RealAcc.Update(Acc, tick);
RealGyr.Update(Gyr, tick);
RealRange.Update(LaserRange, tick);
RealBar.Update(PosXYZ.Z, tick);
RealPos.Update(PosXYZ, tick);
bool of = RealOF.Update(new Vector2(SpdXYZ.X - Gyr.Y, SpdXYZ.Y + Gyr.X), LaserRange, tick);
bool of = RealOF.Update(new Vector2(SpdXYZ.X * range - Gyr.Y, SpdXYZ.Y * range + Gyr.X), LaserRange, tick);
if(of) lock (this)
{