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 TypeMethodDescriptionAccess the body filter.Access the broadphase-layer filter.intReturn the object layer used for collision detection when no filters are overridden.Access the object-layer filter.intCount the active references to the nativeVehicleCollisionTester.voidsetBodyFilter(BodyFilter filter) Replace the body filter.voidReplace the broadphase-layer filter.voidMark the nativeVehicleCollisionTesteras embedded.voidsetObjectLayer(int objectLayer) Replace the object layer used for collision detection when no filters are overridden.voidReplace the object-layer filter.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 current tester.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
-
setBodyFilter
Replace the body filter.- Parameters:
filter- the desired filter, ornullfor none (default=null)
-
setBroadPhaseLayerFilter
Replace the broadphase-layer filter.- Parameters:
filter- the desired filter, ornullfor none (default=null)
-
setObjectLayer
public void setObjectLayer(int objectLayer) Replace the object layer used for collision detection when no filters are overridden.- Parameters:
objectLayer- the index of the desired layer (default=-1)
-
setObjectLayerFilter
Replace the object-layer filter.- Parameters:
filter- the desired filter, ornullfor none (default=null)
-
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)
-
getBodyFilter
Access the body filter. The tester is unaffected.- Specified by:
getBodyFilterin interfaceConstVehicleCollisionTester- Returns:
- a new JVM object with the pre-existing native object assigned, or
nullif none
-
getBroadPhaseLayerFilter
Access the broadphase-layer filter. The tester is unaffected.- Specified by:
getBroadPhaseLayerFilterin interfaceConstVehicleCollisionTester- Returns:
- a new JVM object with the pre-existing native object assigned, or
nullif none
-
getObjectLayer
public int getObjectLayer()Return the object layer used for collision detection when no filters are overridden. The tester is unaffected.- Specified by:
getObjectLayerin interfaceConstVehicleCollisionTester- Returns:
- the index of the layer
-
getObjectLayerFilter
Access the object-layer filter. The tester is unaffected.- Specified by:
getObjectLayerFilterin interfaceConstVehicleCollisionTester- Returns:
- a new JVM object with the pre-existing native object assigned, or
nullif none
-
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 current tester.
-