|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.math.Ray
public class Ray
Defines a 3-dimensional ray.
This class guarantees that its direction vector is always normalized.
Field Summary | ||
---|---|---|
static float |
INTERSECTS_NONE
Represents when a 3d entity does not intersect a ray. |
Constructor Summary | ||
---|---|---|
Ray(Ray ray)
Constructs a new ray from the given ray. |
||
Ray(Vector3f origin,
Vector3f direction)
Constructs a new ray initialized to the specified values. |
Method Summary | ||
---|---|---|
boolean |
equals(Object obj)
Determines if the specified object is of type Ray and all of its elements are equal to the elements of this ray. |
|
boolean |
equals(Ray ray)
Returns true if all elements of the specified ray are equal to the elements of this ray. |
|
void |
getDirection(Vector3f direction)
Gets the ray's direction in the given vector. |
|
void |
getOrigin(Vector3f origin)
Gets the ray's origin in the given point. |
|
int |
hashCode()
Returns a hash code based on the elements of this ray. |
|
float |
intersects(Bounds bounds)
Tests whether this ray intersects the specified bounds. |
|
float |
intersects(Frustum frustum)
Tests whether this ray intersects the specified frustum. |
|
float |
intersects(Plane plane)
Tests whether this ray intersects the specified plane. |
|
void |
set(Ray ray)
Sets this ray to the given ray. |
|
void |
set(Vector3f origin,
Vector3f direction)
Sets this ray to the specified values. |
|
void |
setDirection(float dx,
float dy,
float dz)
Sets the ray's direction to the specified values. |
|
void |
setDirection(Vector3f direction)
Sets the ray's direction to the given vector. |
|
void |
setOrigin(float ox,
float oy,
float oz)
Sets the ray's origin to the specified values. |
|
void |
setOrigin(Vector3f origin)
Sets the ray's origin to the given point. |
|
String |
toString()
Returns a String representation of this ray. |
|
void |
transform(Matrix4f matrix)
Transforms this ray by the given transformation matrix. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final float INTERSECTS_NONE
Constructor Detail |
---|
public Ray(Vector3f origin, Vector3f direction)
origin
- The ray's origin.direction
- The ray's direction.
NullPointerException
- If origin
or direction
is null
.
IllegalArgumentException
- If direction
is equal to the zero vector.public Ray(Ray ray)
ray
- The ray to copy.
NullPointerException
- If ray
is null
.Method Detail |
---|
public void getDirection(Vector3f direction)
direction
- The vector to store the ray's direction in.
NullPointerException
- If direction
is null
.public void getOrigin(Vector3f origin)
origin
- The point to store the ray's origin in.
NullPointerException
- If origin
is null
.public float intersects(Bounds bounds)
bounds
- The bounding object to test intersection with.
Ray.INTERSECTS_NONE
if this ray does not intersect the bounding object.
NullPointerException
- If bounds
is null
.public float intersects(Frustum frustum)
frustum
- The frustum to test intersection with.
Ray.INTERSECTS_NONE
if this ray does not intersect the frustum.
NullPointerException
- If frustum
is null
.public float intersects(Plane plane)
plane
- The plane to test intersection with.
Ray.INTERSECTS_NONE
if this ray does not intersect the plane.
NullPointerException
- If plane
is null
.public void set(Vector3f origin, Vector3f direction)
origin
- The ray's origin.direction
- The ray's direction.
NullPointerException
- If origin
or direction
is null
.
IllegalArgumentException
- If direction
is equal to the zero vector.public void set(Ray ray)
ray
- The ray to set to.
NullPointerException
- If ray
is null
.public void setDirection(Vector3f direction)
direction
- The new direction vector.
NullPointerException
- If direction
is null
.
IllegalArgumentException
- If direction
is equal to the zero vector.public void setDirection(float dx, float dy, float dz)
dx
- The x coordinate of the new direction vector.dy
- The y coordinate of the new direction vector.dz
- The z coordinate of the new direction vector.
IllegalArgumentException
- If the given direction vector is equal to the zero vector.public void setOrigin(Vector3f origin)
origin
- The new origin.
NullPointerException
- If origin
is null
.public void setOrigin(float ox, float oy, float oz)
ox
- The x coordinate of the new origin.oy
- The y coordinate of the new origin.oz
- The z coordinate of the new origin.public void transform(Matrix4f matrix)
matrix
- The transformation matrix to transform by.
NullPointerException
- If matrix
is null
.public boolean equals(Object obj)
equals
in class Object
obj
- The object to compare.
true
if this ray is equal to obj
;
false
otherwise.
NullPointerException
- If obj
is null
.Boolean.hashCode()
,
Hashtable
public boolean equals(Ray ray)
ray
- The ray to compare.
true
if this ray is equal to ray
;
false
otherwise.
NullPointerException
- If ray
is null
.public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
Hashtable
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal