Package physx.common

Class PxRefCounted

Direct Known Subclasses:
PxBaseMaterial, PxConvexMesh, PxHeightField, PxShape, PxTetrahedronMesh, PxTriangleMesh

public class PxRefCounted extends PxBase
Base class for ref-counted objects.
  • 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

      public static PxRefCounted wrapPointer(long address)
    • arrayGet

      public static PxRefCounted arrayGet(long baseAddress, int index)
    • 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()