Package com.github.stephengold.joltjni
Class VehicleCollisionTester
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.VehicleCollisionTester
- All Implemented Interfaces:
ConstJoltPhysicsObject
,ConstVehicleCollisionTester
,RefTarget
,AutoCloseable
,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
VehicleCollisionTesterCastCylinder
,VehicleCollisionTesterCastSphere
,VehicleCollisionTesterRay
public class VehicleCollisionTester
extends NonCopyable
implements ConstVehicleCollisionTester, RefTarget
Detect collisions between vehicle wheels and the environment.
-
Method Summary
Modifier and TypeMethodDescriptionint
Return the object layer used for collision detection when no filters are overridden.int
Count the active references to the nativeVehicleCollisionTester
.void
Mark the nativeVehicleCollisionTester
as embedded.void
setObjectLayer
(int objectLayer) Alter the object layer used for collision detection when no filters are overridden.protected final void
setVirtualAddressAsCoOwner
(long testerVa) Assign a native object (assuming there's none already assigned) and designate the JVM object as a co-owner.toRef()
Create a counted reference to the nativeVehicleCollisionTester
.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Method Details
-
setObjectLayer
public void setObjectLayer(int objectLayer) Alter the object layer used for collision detection when no filters are overridden.- Parameters:
objectLayer
- the index of the desired layer
-
setVirtualAddressAsCoOwner
protected final void setVirtualAddressAsCoOwner(long testerVa) Assign a native object (assuming there's none already assigned) and designate the JVM object as a co-owner.- Parameters:
testerVa
- the virtual address of the native object to assign (not zero)
-
getObjectLayer
public int getObjectLayer()Return the object layer used for collision detection when no filters are overridden.- Specified by:
getObjectLayer
in interfaceConstVehicleCollisionTester
- Returns:
- the index of the layer
-
getRefCount
public int getRefCount()Count the active references to the nativeVehicleCollisionTester
. The tester is unaffected.- Specified by:
getRefCount
in interfaceRefTarget
- Returns:
- the count (≥0)
-
setEmbedded
public void setEmbedded()Mark the nativeVehicleCollisionTester
as embedded.- Specified by:
setEmbedded
in interfaceRefTarget
-
toRef
Create a counted reference to the nativeVehicleCollisionTester
.
-