java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.Geometry
- All Implemented Interfaces:
ConstJoltPhysicsObject
,RefTarget
,AutoCloseable
,Comparable<JoltPhysicsObject>
Triangle batches for multiple levels of detail. (native type:
DebugRenderer::Geometry
)-
Constructor Summary
ConstructorsConstructorDescriptionGeometry
(ConstAaBox bounds) Instantiate a geometry with the specified bounding box. -
Method Summary
Modifier and TypeMethodDescriptionint
Return the number of levels of detail.Access the bounding box.getLod
(int index) Access the specified level of detail.getLod
(Vec3Arg cameraPosition, ConstAaBox worldSpaceBounds, float lodScaleSq) Access the appropriate level of detail for the specified conditions.ConstLod[]
getLods()
Access all the levels of detail.int
Count the active references to the nativeGeometry
.void
Mark the nativeGeometry
as embedded.toRef()
Create a counted reference to the nativeGeometry
.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Constructor Details
-
Geometry
Instantiate a geometry with the specified bounding box.- Parameters:
bounds
- the desired bounding box (not null, unaffected)
-
-
Method Details
-
countLods
public int countLods()Return the number of levels of detail. The geometry is unaffected. (native member: mLODs)- Returns:
- the count (≥0)
-
getBounds
Access the bounding box. The geometry is unaffected. (native field: mBounds)- Returns:
- a new JVM object the pre-existing native object assigned
-
getLod
Access the specified level of detail. The geometry is unaffected. (native field: mLODs)- Parameters:
index
- the index of the level (≥0)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getLod
Access the appropriate level of detail for the specified conditions. The geometry is unaffected. (native method: GetLOD)- Parameters:
cameraPosition
- the location of the camera (not null, unaffected)worldSpaceBounds
- bounds for this geometry (in system coordinates, not null, unaffected)lodScaleSq
- the squared scale of the model matrix- Returns:
- a pre-existing LOD
-
getLods
Access all the levels of detail. The geometry is unaffected.- Returns:
- a new array of new JVM objects with pre-existing native objects assigned
-
getRefCount
public int getRefCount()Count the active references to the nativeGeometry
. The geometry is unaffected.- Specified by:
getRefCount
in interfaceRefTarget
- Returns:
- the count (≥0)
-
setEmbedded
public void setEmbedded()Mark the nativeGeometry
as embedded.- Specified by:
setEmbedded
in interfaceRefTarget
-
toRef
Create a counted reference to the nativeGeometry
.
-