|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.java.joglutils.msg.math.PlaneUV
public class PlaneUV
This differs from the Plane class in that it maintains an origin and orthonormal U, V axes in the plane so that it can project a 3D point to a 2D one. U cross V = normal. U and V coordinates are computed with respect to the origin.
Constructor Summary | |
---|---|
PlaneUV()
Default constructor initializes normal to (0, 1, 0), origin to (0, 0, 0), U axis to (1, 0, 0) and V axis to (0, 0, -1). |
|
PlaneUV(Vec3f normal,
Vec3f origin)
Takes normal vector and a point which the plane goes through (which becomes the plane's "origin"). |
|
PlaneUV(Vec3f normal,
Vec3f origin,
Vec3f uAxis)
Takes normal vector, point which plane goes through, and the "u" axis in the plane. |
|
PlaneUV(Vec3f normal,
Vec3f origin,
Vec3f uAxis,
Vec3f vAxis)
Takes normal vector, point which plane goes through, and both the u and v axes. |
Method Summary | |
---|---|
Vec3f |
getNormal()
Normal, U and V axes are normalized internally, so, for example, normal is not necessarily equal to plane.setNormal(normal); plane.getNormal(); |
Vec3f |
getOrigin()
|
Vec3f |
getUAxis()
|
Vec3f |
getVAxis()
|
boolean |
intersectRay(Vec3f rayStart,
Vec3f rayDirection,
IntersectionPoint intPt,
Vec2f uvCoords)
Intersect a ray with this plane, outputting not only the 3D intersection point but also the U, V coordinates of the intersection. |
void |
projectPoint(Vec3f point,
Vec3f projPt,
Vec2f uvCoords)
Project a point onto the plane |
void |
setNormal(Vec3f normal)
This version sets the normal vector and generates new U and V axes. |
void |
setNormalAndU(Vec3f normal,
Vec3f uAxis)
This version computes the V axis from (normal cross U). |
void |
setNormalAndUV(Vec3f normal,
Vec3f uAxis,
Vec3f vAxis)
Normal, U and V axes must be orthogonal and satisfy U cross V = normal, do not need to be unit length but must not be the zero vector. |
void |
setOrigin(Vec3f origin)
Set the origin, through which this plane goes and with respect to which U and V coordinates are computed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PlaneUV()
public PlaneUV(Vec3f normal, Vec3f origin)
public PlaneUV(Vec3f normal, Vec3f origin, Vec3f uAxis)
public PlaneUV(Vec3f normal, Vec3f origin, Vec3f uAxis, Vec3f vAxis)
Method Detail |
---|
public void setOrigin(Vec3f origin)
public Vec3f getOrigin()
public void setNormalAndUV(Vec3f normal, Vec3f uAxis, Vec3f vAxis)
public void setNormal(Vec3f normal)
public void setNormalAndU(Vec3f normal, Vec3f uAxis)
public Vec3f getNormal()
plane.setNormal(normal); plane.getNormal();
public Vec3f getUAxis()
public Vec3f getVAxis()
public void projectPoint(Vec3f point, Vec3f projPt, Vec2f uvCoords)
public boolean intersectRay(Vec3f rayStart, Vec3f rayDirection, IntersectionPoint intPt, Vec2f uvCoords)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |