|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.badlogic.gdx.math.collision.Ray
public class Ray
Encapsulates a ray having a starting position and a unit length direction.
Field Summary | |
---|---|
Vector3 |
direction
|
Vector3 |
origin
|
Constructor Summary | |
---|---|
Ray(Vector3 origin,
Vector3 direction)
Constructor, sets the starting position of the ray and the direction. |
Method Summary | |
---|---|
Ray |
cpy()
|
Vector3 |
getEndPoint(float distance)
Deprecated. Use getEndPoint(Vector3, float) instead. Returns the endpoint given the distance. This is calculated as
startpoint + distance * direction. |
Vector3 |
getEndPoint(Vector3 out,
float distance)
Returns the endpoint given the distance. |
Ray |
mul(Matrix4 matrix)
Multiplies the ray by the given matrix. |
Ray |
set(float x,
float y,
float z,
float dx,
float dy,
float dz)
Sets this ray from the given starting position and direction. |
Ray |
set(Ray ray)
Sets the starting position and direction from the given ray |
Ray |
set(Vector3 origin,
Vector3 direction)
Sets the starting position and the direction of this ray. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final Vector3 origin
public final Vector3 direction
Constructor Detail |
---|
public Ray(Vector3 origin, Vector3 direction)
origin
- The starting positiondirection
- The directionMethod Detail |
---|
public Ray cpy()
@Deprecated public Vector3 getEndPoint(float distance)
getEndPoint(Vector3, float)
instead. Returns the endpoint given the distance. This is calculated as
startpoint + distance * direction.
distance
- The distance from the end point to the start point.
public Vector3 getEndPoint(Vector3 out, float distance)
out
- The vector to set to the resultdistance
- The distance from the end point to the start point.
public Ray mul(Matrix4 matrix)
matrix
- The matrix
public String toString()
toString
in class Object
public Ray set(Vector3 origin, Vector3 direction)
origin
- The starting positiondirection
- The direction
public Ray set(float x, float y, float z, float dx, float dy, float dz)
x
- The x-component of the starting positiony
- The y-component of the starting positionz
- The z-component of the starting positiondx
- The x-component of the directiondy
- The y-component of the directiondz
- The z-component of the direction
public Ray set(Ray ray)
ray
- The ray
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |