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 TypeMethodDescriptionintReturn the object layer used for collision detection when no filters are overridden.intCount the active references to the nativeVehicleCollisionTester.voidMark the nativeVehicleCollisionTesteras embedded.voidsetObjectLayer(int objectLayer) Alter the object layer used for collision detection when no filters are overridden.protected final voidsetVirtualAddressAsCoOwner(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, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods 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:
getObjectLayerin interfaceConstVehicleCollisionTester- Returns:
- the index of the layer
-
getRefCount
public int getRefCount()Count the active references to the nativeVehicleCollisionTester. The tester is unaffected.- Specified by:
getRefCountin interfaceRefTarget- Returns:
- the count (≥0)
-
setEmbedded
public void setEmbedded()Mark the nativeVehicleCollisionTesteras embedded.- Specified by:
setEmbeddedin interfaceRefTarget
-
toRef
Create a counted reference to the nativeVehicleCollisionTester.
-