Class ActorVector
java.lang.Object
ActiverseUtils.ActorVector
The ActorVector class represents a 2D vector in the Activerse game engine.
It can represent position, velocity, acceleration, or directional displacement
between two Actor objects.
- Version:
- 1.4.1
- Author:
- Knivier
-
Constructor Summary
ConstructorsConstructorDescriptionActorVector(double x, double y) ActorVector(Actor actor) ActorVector(Actor from, Actor to) -
Method Summary
Modifier and TypeMethodDescriptionadd(ActorVector other) doubleangleBetween(ActorVector other) doubledot(ActorVector other) booleandoublegetX()doublegetY()inthashCode()doublescale(double scalar) subtract(ActorVector other) toAcceleration(double mass) doubletoKineticEnergy(double mass) toString()
-
Constructor Details
-
ActorVector
public ActorVector(double x, double y) -
ActorVector
-
ActorVector
-
-
Method Details
-
getX
public double getX() -
getY
public double getY() -
magnitude
public double magnitude() -
normalize
-
scale
-
add
-
subtract
-
dot
-
angleBetween
-
toAcceleration
-
toKineticEnergy
public double toKineticEnergy(double mass) -
toString
-
equals
-
hashCode
-