Package physx.physics

Class PxArticulationDrive

java.lang.Object
physx.NativeObject
physx.physics.PxArticulationDrive

public class PxArticulationDrive extends NativeObject
Data structure for articulation joint drive configuration.
See Also:
  • Field Details

    • SIZEOF

      public static final int SIZEOF
    • ALIGNOF

      public static final int ALIGNOF
      See Also:
  • Constructor Details

    • PxArticulationDrive

      protected PxArticulationDrive(long address)
    • PxArticulationDrive

      public PxArticulationDrive()
    • PxArticulationDrive

      public PxArticulationDrive(float stiffness, float damping, float maxForce, PxArticulationDriveTypeEnum driveType)
      Parameters:
      stiffness - WebIDL type: float
      damping - WebIDL type: float
      maxForce - WebIDL type: float
      driveType - WebIDL type: PxArticulationDriveTypeEnum [enum]
  • Method Details

    • wrapPointer

      public static PxArticulationDrive wrapPointer(long address)
    • arrayGet

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

      public static PxArticulationDrive createAt(long address)
      Parameters:
      address - Pre-allocated memory, where the object is created.
      Returns:
      Stack allocated object of PxArticulationDrive
    • createAt

      public static <T> PxArticulationDrive createAt(T allocator, NativeObject.Allocator<T> allocate)
      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.
      Returns:
      Stack allocated object of PxArticulationDrive
    • createAt

      public static PxArticulationDrive createAt(long address, float stiffness, float damping, float maxForce, PxArticulationDriveTypeEnum driveType)
      Parameters:
      address - Pre-allocated memory, where the object is created.
      stiffness - WebIDL type: float
      damping - WebIDL type: float
      maxForce - WebIDL type: float
      driveType - WebIDL type: PxArticulationDriveTypeEnum [enum]
      Returns:
      Stack allocated object of PxArticulationDrive
    • createAt

      public static <T> PxArticulationDrive createAt(T allocator, NativeObject.Allocator<T> allocate, float stiffness, float damping, float maxForce, PxArticulationDriveTypeEnum driveType)
      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
      maxForce - WebIDL type: float
      driveType - WebIDL type: PxArticulationDriveTypeEnum [enum]
      Returns:
      Stack allocated object of PxArticulationDrive
    • destroy

      public void destroy()
    • getStiffness

      public float getStiffness()
      The drive stiffness, i.e. the proportional gain of the implicit PD controller.

      See manual for further information, and the drives' implicit spring-damper (i.e. PD control) implementation in particular.

      Units: (distance = linear scene units)
      Rotational axis: torque/rad if driveType = PxArticulationDriveType::eFORCE; or (rad/s^2)/rad if driveType = PxArticulationDriveType::eACCELERATION
      Translational axis: force/distance if driveType = PxArticulationDriveType::eFORCE; or (distance/s^2)/distance if driveType = PxArticulationDriveType::eACCELERATION
      Range: [0, PX_MAX_F32]
      Default: 0.0f

    • setStiffness

      public void setStiffness(float value)
      The drive stiffness, i.e. the proportional gain of the implicit PD controller.

      See manual for further information, and the drives' implicit spring-damper (i.e. PD control) implementation in particular.

      Units: (distance = linear scene units)
      Rotational axis: torque/rad if driveType = PxArticulationDriveType::eFORCE; or (rad/s^2)/rad if driveType = PxArticulationDriveType::eACCELERATION
      Translational axis: force/distance if driveType = PxArticulationDriveType::eFORCE; or (distance/s^2)/distance if driveType = PxArticulationDriveType::eACCELERATION
      Range: [0, PX_MAX_F32]
      Default: 0.0f

    • getDamping

      public float getDamping()
      The drive damping, i.e. the derivative gain of the implicit PD controller.

      See manual for further information, and the drives' implicit spring-damper (i.e. PD control) implementation in particular.

      Units: (distance = linear scene units)
      Rotational axis: torque/(rad/s) if driveType = PxArticulationDriveType::eFORCE; or (rad/s^2)/(rad/s) if driveType = PxArticulationDriveType::eACCELERATION
      Translational axis: force/(distance/s) if driveType = PxArticulationDriveType::eFORCE; or (distance/s^2)/(distance/s) if driveType = PxArticulationDriveType::eACCELERATION
      Range: [0, PX_MAX_F32]
      Default: 0.0f

    • setDamping

      public void setDamping(float value)
      The drive damping, i.e. the derivative gain of the implicit PD controller.

      See manual for further information, and the drives' implicit spring-damper (i.e. PD control) implementation in particular.

      Units: (distance = linear scene units)
      Rotational axis: torque/(rad/s) if driveType = PxArticulationDriveType::eFORCE; or (rad/s^2)/(rad/s) if driveType = PxArticulationDriveType::eACCELERATION
      Translational axis: force/(distance/s) if driveType = PxArticulationDriveType::eFORCE; or (distance/s^2)/(distance/s) if driveType = PxArticulationDriveType::eACCELERATION
      Range: [0, PX_MAX_F32]
      Default: 0.0f

    • getMaxForce

      public float getMaxForce()
      The drive force limit.

      - The limit is enforced regardless of the drive type #PxArticulationDriveType. - The limit corresponds to a force (linear axis) or torque (rotational axis) if PxArticulationFlag::eDRIVE_LIMITS_ARE_FORCES is set, and to an impulse (force|torque * dt) otherwise.

      Range: [0, PX_MAX_F32]
      Default: 0.0f

    • setMaxForce

      public void setMaxForce(float value)
      The drive force limit.

      - The limit is enforced regardless of the drive type #PxArticulationDriveType. - The limit corresponds to a force (linear axis) or torque (rotational axis) if PxArticulationFlag::eDRIVE_LIMITS_ARE_FORCES is set, and to an impulse (force|torque * dt) otherwise.

      Range: [0, PX_MAX_F32]
      Default: 0.0f

    • getDriveType

      public PxArticulationDriveTypeEnum getDriveType()
      The drive type.
    • setDriveType

      public void setDriveType(PxArticulationDriveTypeEnum value)
      The drive type.