|
LazyLib | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectVectorUtils
public class VectorUtils
Contains methods for manipulating Vector2f
s.
Method Summary | |
---|---|
static float |
getAngle(Vector2f from,
Vector2f to)
Returns the angle between two Vector2f s. |
static float |
getCrossProduct(Vector2f vector1,
Vector2f vector2)
Returns the cross product of two Vector2f s. |
static float |
getFacing(Vector2f vector)
Returns the facing of a Vector2f . |
static Vector2f |
rotate(Vector2f toRotate,
float angle,
Vector2f dest)
Rotates a Vector2f by a specified amount. |
static Vector2f |
rotateAroundPivot(Vector2f toRotate,
Vector2f pivotPoint,
float angle,
Vector2f dest)
Rotates a Vector2f by a specified amount around a pivot point. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static float getFacing(Vector2f vector)
Vector2f
.
vector
- The vector to get the facing of.
vector
.
public static float getAngle(Vector2f from, Vector2f to)
Vector2f
s.
from
- The source Vector2f
.to
- The Vector2f
to get the angle to.
from
to to
.
public static float getCrossProduct(Vector2f vector1, Vector2f vector2)
Vector2f
s.
vector1
- The first Vector2f
.vector2
- The second Vector2f
.
public static Vector2f rotate(Vector2f toRotate, float angle, Vector2f dest)
Vector2f
by a specified amount.
toRotate
- The Vector2f
to rotate.angle
- How much to rotate toRotate
, in degrees.dest
- The destination Vector2f
. Can be
toRotate
.
toRotate
placed in dest
.
public static Vector2f rotateAroundPivot(Vector2f toRotate, Vector2f pivotPoint, float angle, Vector2f dest)
Vector2f
by a specified amount around a pivot point.
toRotate
- The Vector2f
to rotate.pivotPoint
- The central point to pivot around.angle
- How much to rotate toRotate
, in degrees.dest
- The destination Vector2f
. Can be
toRotate
.
toRotate
placed in dest
.
|
LazyLib | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |