Package org.gnome.graphene
Class Frustum
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.graphene.Frustum
- All Implemented Interfaces:
Proxy
A 3D volume delimited by 2D clip planes.
The contents of the graphene_frustum_t
are private, and should not be
modified directly.
-
Constructor Summary
ConstructorDescriptionFrustum()
Allocate a new Frustum.Allocate a new Frustum.Frustum
(MemorySegment address) Create a Frustum proxy instance for the provided memory address.Allocate a new Frustum with the fields set to the provided values.Allocate a new Frustum with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescriptionstatic Frustum
alloc()
Allocates a newgraphene_frustum_t
structure.boolean
containsPoint
(Point3D point) Checks whether a point is inside the volume defined by the givengraphene_frustum_t
.boolean
Checks whether the two givengraphene_frustum_t
are equal.void
free()
Frees the resources allocated by graphene_frustum_alloc().static MemoryLayout
The memory layout of the native struct.void
Retrieves the planes that define the givengraphene_frustum_t
.static Type
getType()
Get the GType of the Frustum classInitializes the givengraphene_frustum_t
using the provided clipping planes.initFromFrustum
(Frustum src) Initializes the givengraphene_frustum_t
using the clipping planes of anothergraphene_frustum_t
.initFromMatrix
(Matrix matrix) Initializes agraphene_frustum_t
using the givenmatrix
.boolean
intersectsBox
(Box box) Checks whether the givenbox
intersects a plane of agraphene_frustum_t
.boolean
intersectsSphere
(Sphere sphere) Checks whether the givensphere
intersects a plane of agraphene_frustum_t
.Plane[]
Read the value of the fieldplanes
.void
writePlanes
(Plane[] planes, Arena _arena) Write a value in the fieldplanes
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Frustum
Create a Frustum proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
Frustum
Allocate a new Frustum.- Parameters:
arena
- to control the memory allocation scope
-
Frustum
public Frustum()Allocate a new Frustum. The memory is allocated withArena.ofAuto()
. -
Frustum
-
Frustum
Allocate a new Frustum with the fields set to the provided values. The memory is allocated withArena.ofAuto()
.- Parameters:
planes
- value for the fieldplanes
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readPlanes
Read the value of the fieldplanes
.- Returns:
- The value of the field
planes
-
writePlanes
-
alloc
Allocates a newgraphene_frustum_t
structure.The contents of the returned structure are undefined.
- Returns:
- the newly allocated
graphene_frustum_t
structure. Use graphene_frustum_free() to free the resources allocated by this function.
-
containsPoint
Checks whether a point is inside the volume defined by the givengraphene_frustum_t
.- Parameters:
point
- agraphene_point3d_t
- Returns:
true
if the point is inside the frustum
-
equal
Checks whether the two givengraphene_frustum_t
are equal.- Parameters:
b
- agraphene_frustum_t
- Returns:
true
if the given frustums are equal
-
free
public void free()Frees the resources allocated by graphene_frustum_alloc(). -
getPlanes
Retrieves the planes that define the givengraphene_frustum_t
.- Parameters:
planes
- return location for an array of 6graphene_plane_t
-
init
Initializes the givengraphene_frustum_t
using the provided clipping planes.- Parameters:
p0
- a clipping planep1
- a clipping planep2
- a clipping planep3
- a clipping planep4
- a clipping planep5
- a clipping plane- Returns:
- the initialized frustum
-
initFromFrustum
-
initFromMatrix
-
intersectsBox
Checks whether the givenbox
intersects a plane of agraphene_frustum_t
.- Parameters:
box
- agraphene_box_t
- Returns:
true
if the box intersects the frustum
-
intersectsSphere
Checks whether the givensphere
intersects a plane of agraphene_frustum_t
.- Parameters:
sphere
- agraphene_sphere_t
- Returns:
true
if the sphere intersects the frustum
-