|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.math.Plane
public class Plane
A plane defined via a unit length normal and the distance from the origin, as you learned in your math class.
Nested Class Summary | |
---|---|
static class |
Plane.PlaneSide
Enum specifying on which side a point lies respective to the plane and it's normal. |
Field Summary | |
---|---|
float |
d
|
Vector3 |
normal
|
Constructor Summary | |
---|---|
Plane(Vector3 normal,
float d)
Constructs a new plane based on the normal and distance to the origin. |
|
Plane(Vector3 normal,
Vector3 point)
Constructs a new plane based on the normal and a point on the plane. |
|
Plane(Vector3 point1,
Vector3 point2,
Vector3 point3)
Constructs a new plane out of the three given points that are considered to be on the plane. |
Method Summary | |
---|---|
float |
distance(Vector3 point)
Calculates the shortest signed distance between the plane and the given point. |
float |
getD()
|
Vector3 |
getNormal()
|
boolean |
isFrontFacing(Vector3 direction)
Returns whether the plane is facing the direction vector. |
void |
set(float nx,
float ny,
float nz,
float d)
Sets the plane normal and distance |
void |
set(Plane plane)
Sets this plane from the given plane |
void |
set(Vector3 point,
Vector3 normal)
Sets the plane to the given point and normal. |
void |
set(Vector3 point1,
Vector3 point2,
Vector3 point3)
Sets the plane normal and distance to the origin based on the three given points which are considered to be on the plane. |
Plane.PlaneSide |
testPoint(Vector3 point)
Returns on which side the given point lies relative to the plane and its normal. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final Vector3 normal
public float d
Constructor Detail |
---|
public Plane(Vector3 normal, float d)
normal
- The plane normald
- The distance to the originpublic Plane(Vector3 normal, Vector3 point)
normal
- The normalpoint
- The point on the planepublic Plane(Vector3 point1, Vector3 point2, Vector3 point3)
point1
- The first pointpoint2
- The second pointpoint3
- The third pointMethod Detail |
---|
public void set(Vector3 point1, Vector3 point2, Vector3 point3)
point1
- point2
- point3
- public void set(float nx, float ny, float nz, float d)
nx
- normal x-componentny
- normal y-componentnz
- normal z-componentd
- distance to originpublic float distance(Vector3 point)
point
- The point
public Plane.PlaneSide testPoint(Vector3 point)
point
- The point
public boolean isFrontFacing(Vector3 direction)
direction
- the direction
public Vector3 getNormal()
public float getD()
public void set(Vector3 point, Vector3 normal)
point
- the point on the planenormal
- the normal of the planepublic void set(Plane plane)
plane
- the planepublic java.lang.String toString()
toString
in class java.lang.Object
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |