Fixed wrong angle calculation.
Contributed by Sahar.
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user