Package org.gnome.graphene
Class Frustum
java.lang.Object
org.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.
- Since:
- 1.2
-
Constructor Summary
ConstructorsConstructorDescriptionFrustum()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 Frustumalloc()Allocates a newgraphene_frustum_tstructure.booleancontainsPoint(Point3D point) Checks whether a point is inside the volume defined by the givengraphene_frustum_t.booleanChecks whether the two givengraphene_frustum_tare equal.voidfree()Frees the resources allocated by graphene_frustum_alloc().static MemoryLayoutThe memory layout of the native struct.voidRetrieves the planes that define the givengraphene_frustum_t.static @Nullable TypegetType()Get the GType of the Frustum classInitializes the givengraphene_frustum_tusing the provided clipping planes.initFromFrustum(Frustum src) Initializes the givengraphene_frustum_tusing the clipping planes of anothergraphene_frustum_t.initFromMatrix(Matrix matrix) Initializes agraphene_frustum_tusing the givenmatrix.booleanintersectsBox(Box box) Checks whether the givenboxintersects a plane of agraphene_frustum_t.booleanintersectsSphere(Sphere sphere) Checks whether the givensphereintersects a plane of agraphene_frustum_t.@Nullable Plane @Nullable []Read the value of the fieldplanes.voidwritePlanes(@Nullable Plane @Nullable [] planes, Arena _arena) Write a value in the fieldplanes.Methods inherited from class org.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_tstructure.The contents of the returned structure are undefined.
- Returns:
- the newly allocated
graphene_frustum_tstructure. Use graphene_frustum_free() to free the resources allocated by this function. - Since:
- 1.2
-
containsPoint
Checks whether a point is inside the volume defined by the givengraphene_frustum_t.- Parameters:
point- agraphene_point3d_t- Returns:
trueif the point is inside the frustum- Since:
- 1.2
-
equal
Checks whether the two givengraphene_frustum_tare equal.- Parameters:
b- agraphene_frustum_t- Returns:
trueif the given frustums are equal- Since:
- 1.6
-
free
public void free()Frees the resources allocated by graphene_frustum_alloc().- Since:
- 1.2
-
getPlanes
-
init
Initializes the givengraphene_frustum_tusing 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
- Since:
- 1.2
-
initFromFrustum
-
initFromMatrix
-
intersectsBox
Checks whether the givenboxintersects a plane of agraphene_frustum_t.- Parameters:
box- agraphene_box_t- Returns:
trueif the box intersects the frustum- Since:
- 1.2
-
intersectsSphere
Checks whether the givensphereintersects a plane of agraphene_frustum_t.- Parameters:
sphere- agraphene_sphere_t- Returns:
trueif the sphere intersects the frustum- Since:
- 1.2
-