java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.PhysicsMaterial
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstPhysicsMaterial,ConstSerializableObject,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
PhysicsMaterialSimple
Surface properties of (part of) a
Shape.-
Method Summary
Modifier and TypeMethodDescriptionCopy the debug color.Return the debug name.intCount the active references to the nativePhysicsMaterial.voidsaveBinaryState(StreamOut stream) Save the material to the specified binary stream.static ConstPhysicsMaterialsDefault()Return the default material, used when a shape has no material defined.voidMark the nativePhysicsMaterialas embedded.protected final voidsetVirtualAddressAsCoOwner(long materialVa) Assign a native object (assuming there's none already assigned) and designate the JVM object as a co-owner.static PhysicsMaterialResultsRestoreFromBinaryState(StreamIn stream) Read a material from the specified binary stream.toRef()Create a counted reference to the nativePhysicsMaterial.toRefC()Create a counted reference to the nativePhysicsMaterial.Methods inherited from class com.github.stephengold.joltjni.SerializableObject
getRttiMethods 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, targetVaMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstSerializableObject
getRtti
-
Method Details
-
sDefault
Return the default material, used when a shape has no material defined.- Returns:
- a new immutable JVM object with the pre-existing native object assigned
-
sRestoreFromBinaryState
Read a material from the specified binary stream.- Parameters:
stream- where to read objects (not null)- Returns:
- a new object
-
setVirtualAddressAsCoOwner
protected final void setVirtualAddressAsCoOwner(long materialVa) Assign a native object (assuming there's none already assigned) and designate the JVM object as a co-owner.- Parameters:
materialVa- the virtual address of the native object to assign (not zero)
-
getDebugColor
Copy the debug color. The material is unaffected.- Specified by:
getDebugColorin interfaceConstPhysicsMaterial- Returns:
- a new object
-
getDebugName
Return the debug name. The material is unaffected.- Specified by:
getDebugNamein interfaceConstPhysicsMaterial- Returns:
- a string of text or
null
-
saveBinaryState
Save the material to the specified binary stream. The material is unaffected.- Specified by:
saveBinaryStatein interfaceConstPhysicsMaterial- Parameters:
stream- the stream to write to (not null)
-
toRefC
Create a counted reference to the nativePhysicsMaterial.- Specified by:
toRefCin interfaceConstPhysicsMaterial- Returns:
- a new JVM object with a new native object assigned
-
getRefCount
public int getRefCount()Count the active references to the nativePhysicsMaterial. The material is unaffected.- Specified by:
getRefCountin interfaceRefTarget- Returns:
- the count (≥0)
-
setEmbedded
public void setEmbedded()Mark the nativePhysicsMaterialas embedded.- Specified by:
setEmbeddedin interfaceRefTarget
-
toRef
Create a counted reference to the nativePhysicsMaterial.
-