JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.math.geom.Frustum.Plane Class Reference

Plane equation := dot(n, x - p) = 0 -> Ax + By + Cz + d == 0. More...

Collaboration diagram for com.jogamp.math.geom.Frustum.Plane:

Public Member Functions

 Plane ()
 
 Plane (final Plane o)
 
Plane set (final Plane o)
 
Plane set (final Vec3f p0, final Vec3f p1, final Vec3f p2)
 Setup of plane using 3 points. More...
 
Plane set (final Vec3f n, final Vec3f p0)
 Setup of plane using given normal and one point on plane. More...
 
Vec4f toVec4f (final Vec4f out)
 Sets the given Vec4f out to ( n, d ). More...
 
void toFloats (final float[] out, final int off)
 Sets the given [float[off]..float[off+4]) out to ( n, d ). More...
 
final float distanceTo (final float x, final float y, final float z)
 Return signed distance of plane to given point. More...
 
final float distanceTo (final Vec3f p)
 Return distance of plane to given point, see distanceTo(float, float, float). More...
 
String toString ()
 

Public Attributes

final Vec3f n
 Normal of the plane. More...
 
float d
 Distance to origin. More...
 

Detailed Description

Plane equation := dot(n, x - p) = 0 -> Ax + By + Cz + d == 0.

In order to work w/ isOutside(..) methods, the normals have to point to the inside of the frustum.

Definition at line 158 of file Frustum.java.

Constructor & Destructor Documentation

◆ Plane() [1/2]

com.jogamp.math.geom.Frustum.Plane.Plane ( )

Definition at line 165 of file Frustum.java.

◆ Plane() [2/2]

com.jogamp.math.geom.Frustum.Plane.Plane ( final Plane  o)

Definition at line 170 of file Frustum.java.

Member Function Documentation

◆ distanceTo() [1/2]

final float com.jogamp.math.geom.Frustum.Plane.distanceTo ( final float  x,
final float  y,
final float  z 
)

Return signed distance of plane to given point.

  • If dist < 0 , then the point p lies in the negative halfspace.
  • If dist = 0 , then the point p lies in the plane.
  • If dist > 0 , then the point p lies in the positive halfspace.

A plane cuts 3D space into 2 half spaces.

Positive halfspace is where the plane’s normals vector points into.

Negative halfspace is the other side of the plane, i.e. *-1

Definition at line 244 of file Frustum.java.

Here is the caller graph for this function:

◆ distanceTo() [2/2]

final float com.jogamp.math.geom.Frustum.Plane.distanceTo ( final Vec3f  p)

Return distance of plane to given point, see distanceTo(float, float, float).

Definition at line 249 of file Frustum.java.

Here is the call graph for this function:

◆ set() [1/3]

Plane com.jogamp.math.geom.Frustum.Plane.set ( final Plane  o)

Definition at line 175 of file Frustum.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set() [2/3]

Plane com.jogamp.math.geom.Frustum.Plane.set ( final Vec3f  n,
final Vec3f  p0 
)

Setup of plane using given normal and one point on plane.

The given normal is mutated, the point not mutated.

Parameters
nnormal to plane pointing to the inside of this frustum
p0point on plane, consider choosing the closest point to origin
Returns
this plane for chaining

Definition at line 206 of file Frustum.java.

Here is the call graph for this function:

◆ set() [3/3]

Plane com.jogamp.math.geom.Frustum.Plane.set ( final Vec3f  p0,
final Vec3f  p1,
final Vec3f  p2 
)

Setup of plane using 3 points.

None of the three points are mutated.

Since this method may not properly define whether the normal points inside the frustum, consider using set(Vec3f, Vec3f).

Parameters
p0point on plane, used as the shared start-point for vec(p0->p1) and vec(p0->p2)
p1point on plane
p2point on plane
Returns
this plane for chaining

Definition at line 192 of file Frustum.java.

Here is the call graph for this function:

◆ toFloats()

void com.jogamp.math.geom.Frustum.Plane.toFloats ( final float[]  out,
final int  off 
)

Sets the given [float[off]..float[off+4]) out to ( n, d ).

Parameters
outthe float[off+4] output array

Definition at line 222 of file Frustum.java.

Here is the caller graph for this function:

◆ toString()

String com.jogamp.math.geom.Frustum.Plane.toString ( )

Definition at line 254 of file Frustum.java.

◆ toVec4f()

Vec4f com.jogamp.math.geom.Frustum.Plane.toVec4f ( final Vec4f  out)

Sets the given Vec4f out to ( n, d ).

Returns out for chaining.

Definition at line 213 of file Frustum.java.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ d

float com.jogamp.math.geom.Frustum.Plane.d

Distance to origin.

Definition at line 163 of file Frustum.java.

◆ n

final Vec3f com.jogamp.math.geom.Frustum.Plane.n

Normal of the plane.

Definition at line 160 of file Frustum.java.


The documentation for this class was generated from the following file: