java.lang.Object
physx.NativeObject
physx.common.PxBase
physx.common.PxRefCounted
- Direct Known Subclasses:
PxBaseMaterial,PxConvexMesh,PxHeightField,PxShape,PxTetrahedronMesh,PxTriangleMesh
Base class for ref-counted objects.
-
Nested Class Summary
Nested classes/interfaces inherited from class physx.NativeObject
NativeObject.Allocator<T> -
Field Summary
FieldsFields inherited from class physx.NativeObject
address, isExternallyAllocated, SIZEOF_BYTE, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_POINTER, SIZEOF_SHORT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAcquires a counted reference to this object.static PxRefCountedarrayGet(long baseAddress, int index) intReturns the reference count of the object.static PxRefCountedwrapPointer(long address) Methods inherited from class physx.common.PxBase
getBaseFlags, getConcreteType, getConcreteTypeName, isReleasable, release, setBaseFlag, setBaseFlagsMethods inherited from class physx.NativeObject
checkNotNull, equals, getAddress, hashCode
-
Field Details
-
SIZEOF
public static final int SIZEOF -
ALIGNOF
public static final int ALIGNOF- See Also:
-
-
Constructor Details
-
PxRefCounted
protected PxRefCounted() -
PxRefCounted
protected PxRefCounted(long address)
-
-
Method Details
-
wrapPointer
-
arrayGet
-
getReferenceCount
public int getReferenceCount()Returns the reference count of the object.At creation, the reference count of the object is 1. Every other object referencing this object increments the count by 1. When the reference count reaches 0, and only then, the object gets destroyed automatically.
- Returns:
- the current reference count.
-
acquireReference
public void acquireReference()Acquires a counted reference to this object.This method increases the reference count of the object by 1. Decrement the reference count by calling release()
-