Class PxSpring

java.lang.Object
physx.NativeObject
physx.extensions.PxSpring
Direct Known Subclasses:
PxD6JointDrive

public class PxSpring extends NativeObject
  • Field Details

    • SIZEOF

      public static final int SIZEOF
    • ALIGNOF

      public static final int ALIGNOF
      See Also:
  • Constructor Details

    • PxSpring

      protected PxSpring()
    • PxSpring

      protected PxSpring(long address)
    • PxSpring

      public PxSpring(float stiffness, float damping)
      Parameters:
      stiffness - WebIDL type: float
      damping - WebIDL type: float
  • Method Details

    • wrapPointer

      public static PxSpring wrapPointer(long address)
    • arrayGet

      public static PxSpring arrayGet(long baseAddress, int index)
    • createAt

      public static PxSpring createAt(long address, float stiffness, float damping)
      Parameters:
      address - Pre-allocated memory, where the object is created.
      stiffness - WebIDL type: float
      damping - WebIDL type: float
      Returns:
      Stack allocated object of PxSpring
    • createAt

      public static <T> PxSpring createAt(T allocator, NativeObject.Allocator<T> allocate, float stiffness, float damping)
      Type Parameters:
      T - Allocator class, e.g. LWJGL's MemoryStack.
      Parameters:
      allocator - Object to use for allocation, e.g. an instance of LWJGL's MemoryStack.
      allocate - Method to call on allocator to obtain the target address, e.g. MemoryStack::nmalloc.
      stiffness - WebIDL type: float
      damping - WebIDL type: float
      Returns:
      Stack allocated object of PxSpring
    • destroy

      public void destroy()
    • getStiffness

      public float getStiffness()
      the spring strength of the drive: that is, the force proportional to the position error
    • setStiffness

      public void setStiffness(float value)
      the spring strength of the drive: that is, the force proportional to the position error
    • getDamping

      public float getDamping()
      the damping strength of the drive: that is, the force proportional to the velocity error
    • setDamping

      public void setDamping(float value)
      the damping strength of the drive: that is, the force proportional to the velocity error