Fixed wrong angle calculation.

Contributed by Sahar.
This commit is contained in:
MobiusDevelopment
2019-10-19 12:40:43 +00:00
parent ee96d3d248
commit 62c1efce6a
16 changed files with 16 additions and 96 deletions

View File

@ -813,12 +813,7 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
*/
public double calculateDirectionTo(ILocational target)
{
int heading = Util.calculateHeadingFrom(this, target) - _heading;
if (heading < 0)
{
heading += 65535;
}
return Util.convertHeadingToDegree(heading);
return Util.calculateAngleFrom(this, target);
}
/**

View File

@ -813,12 +813,7 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
*/
public double calculateDirectionTo(ILocational target)
{
int heading = Util.calculateHeadingFrom(this, target) - _heading;
if (heading < 0)
{
heading += 65535;
}
return Util.convertHeadingToDegree(heading);
return Util.calculateAngleFrom(this, target);
}
/**

View File

@ -813,12 +813,7 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
*/
public double calculateDirectionTo(ILocational target)
{
int heading = Util.calculateHeadingFrom(this, target) - _heading;
if (heading < 0)
{
heading += 65535;
}
return Util.convertHeadingToDegree(heading);
return Util.calculateAngleFrom(this, target);
}
/**

View File

@ -813,12 +813,7 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
*/
public double calculateDirectionTo(ILocational target)
{
int heading = Util.calculateHeadingFrom(this, target) - _heading;
if (heading < 0)
{
heading += 65535;
}
return Util.convertHeadingToDegree(heading);
return Util.calculateAngleFrom(this, target);
}
/**

View File

@ -813,12 +813,7 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
*/
public double calculateDirectionTo(ILocational target)
{
int heading = Util.calculateHeadingFrom(this, target) - _heading;
if (heading < 0)
{
heading += 65535;
}
return Util.convertHeadingToDegree(heading);
return Util.calculateAngleFrom(this, target);
}
/**

View File

@ -813,12 +813,7 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
*/
public double calculateDirectionTo(ILocational target)
{
int heading = Util.calculateHeadingFrom(this, target) - _heading;
if (heading < 0)
{
heading += 65535;
}
return Util.convertHeadingToDegree(heading);
return Util.calculateAngleFrom(this, target);
}
/**

View File

@ -813,12 +813,7 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
*/
public double calculateDirectionTo(ILocational target)
{
int heading = Util.calculateHeadingFrom(this, target) - _heading;
if (heading < 0)
{
heading += 65535;
}
return Util.convertHeadingToDegree(heading);
return Util.calculateAngleFrom(this, target);
}
/**

View File

@ -813,12 +813,7 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
*/
public double calculateDirectionTo(ILocational target)
{
int heading = Util.calculateHeadingFrom(this, target) - _heading;
if (heading < 0)
{
heading += 65535;
}
return Util.convertHeadingToDegree(heading);
return Util.calculateAngleFrom(this, target);
}
/**

View File

@ -846,12 +846,7 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
*/
public double calculateDirectionTo(ILocational target)
{
int heading = Util.calculateHeadingFrom(this, target) - _heading;
if (heading < 0)
{
heading += 65535;
}
return Util.convertHeadingToDegree(heading);
return Util.calculateAngleFrom(this, target);
}
/**

View File

@ -813,12 +813,7 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
*/
public double calculateDirectionTo(ILocational target)
{
int heading = Util.calculateHeadingFrom(this, target) - _heading;
if (heading < 0)
{
heading += 65535;
}
return Util.convertHeadingToDegree(heading);
return Util.calculateAngleFrom(this, target);
}
/**

View File

@ -813,12 +813,7 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
*/
public double calculateDirectionTo(ILocational target)
{
int heading = Util.calculateHeadingFrom(this, target) - _heading;
if (heading < 0)
{
heading += 65535;
}
return Util.convertHeadingToDegree(heading);
return Util.calculateAngleFrom(this, target);
}
/**

View File

@ -813,12 +813,7 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
*/
public double calculateDirectionTo(ILocational target)
{
int heading = Util.calculateHeadingFrom(this, target) - _heading;
if (heading < 0)
{
heading += 65535;
}
return Util.convertHeadingToDegree(heading);
return Util.calculateAngleFrom(this, target);
}
/**

View File

@ -813,12 +813,7 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
*/
public double calculateDirectionTo(ILocational target)
{
int heading = Util.calculateHeadingFrom(this, target) - _heading;
if (heading < 0)
{
heading += 65535;
}
return Util.convertHeadingToDegree(heading);
return Util.calculateAngleFrom(this, target);
}
/**

View File

@ -813,12 +813,7 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
*/
public double calculateDirectionTo(ILocational target)
{
int heading = Util.calculateHeadingFrom(this, target) - _heading;
if (heading < 0)
{
heading += 65535;
}
return Util.convertHeadingToDegree(heading);
return Util.calculateAngleFrom(this, target);
}
/**

View File

@ -813,12 +813,7 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
*/
public double calculateDirectionTo(ILocational target)
{
int heading = Util.calculateHeadingFrom(this, target) - _heading;
if (heading < 0)
{
heading += 65535;
}
return Util.convertHeadingToDegree(heading);
return Util.calculateAngleFrom(this, target);
}
/**

View File

@ -813,12 +813,7 @@ public abstract class WorldObject extends ListenersContainer implements IIdentif
*/
public double calculateDirectionTo(ILocational target)
{
int heading = Util.calculateHeadingFrom(this, target) - _heading;
if (heading < 0)
{
heading += 65535;
}
return Util.convertHeadingToDegree(heading);
return Util.calculateAngleFrom(this, target);
}
/**