Package physx.physics

Class PxMaterial


public class PxMaterial extends PxBaseMaterial
Material class to represent a set of surface properties.
See Also:
  • Field Details

    • SIZEOF

      public static final int SIZEOF
    • ALIGNOF

      public static final int ALIGNOF
      See Also:
  • Constructor Details

    • PxMaterial

      protected PxMaterial()
    • PxMaterial

      protected PxMaterial(long address)
  • Method Details

    • wrapPointer

      public static PxMaterial wrapPointer(long address)
    • arrayGet

      public static PxMaterial arrayGet(long baseAddress, int index)
    • getUserData

      public NativeObject getUserData()
      Returns:
      WebIDL type: VoidPtr
    • setUserData

      public void setUserData(NativeObject value)
      Parameters:
      value - WebIDL type: VoidPtr
    • setDynamicFriction

      public void setDynamicFriction(float coef)
      Sets the coefficient of dynamic friction.

      The coefficient of dynamic friction should be in [0, PX_MAX_F32). If set to greater than staticFriction, the effective value of staticFriction will be increased to match.

      Sleeping: Does NOT wake any actors which may be affected.

      Parameters:
      coef - Coefficient of dynamic friction. Range: [0, PX_MAX_F32)
      See Also:
    • getDynamicFriction

      public float getDynamicFriction()
      Retrieves the DynamicFriction value.
      Returns:
      The coefficient of dynamic friction.
      See Also:
    • setStaticFriction

      public void setStaticFriction(float coef)
      Sets the coefficient of static friction

      The coefficient of static friction should be in the range [0, PX_MAX_F32)

      Sleeping: Does NOT wake any actors which may be affected.

      Parameters:
      coef - Coefficient of static friction. Range: [0, PX_MAX_F32)
      See Also:
    • getStaticFriction

      public float getStaticFriction()
      Retrieves the coefficient of static friction.
      Returns:
      The coefficient of static friction.
      See Also:
    • setRestitution

      public void setRestitution(float coef)
      Sets the coefficient of restitution or the spring stiffness for compliant contact

      A coefficient of 0 makes the object bounce as little as possible, higher values up to 1.0 result in more bounce. If a negative value is provided it is interpreted as stiffness term for an implicit spring simulated at the contact site, with the spring positional error defined by the contact separation value. Higher stiffness terms produce stiffer springs that behave more like a rigid contact.

      Sleeping: Does NOT wake any actors which may be affected.

      See Also:
    • getRestitution

      public float getRestitution()
      Retrieves the coefficient of restitution.

      See #setRestitution.

      Returns:
      The coefficient of restitution.
      See Also:
    • setFlag

      public void setFlag(PxMaterialFlagEnum flag, boolean b)
      Raises or clears a particular material flag.

      See the list of flags #PxMaterialFlag

      Default: eIMPROVED_PATCH_FRICTION

      Sleeping: Does NOT wake any actors which may be affected.

      Parameters:
      flag - The PxMaterial flag to raise(set) or clear.
      b - New state of the flag
      See Also:
    • setFlags

      public void setFlags(PxMaterialFlags flags)
      sets all the material flags.

      See the list of flags #PxMaterialFlag

      Default: eIMPROVED_PATCH_FRICTION

      Sleeping: Does NOT wake any actors which may be affected.

      Parameters:
      flags - All PxMaterial flags
      See Also:
    • getFlags

      public PxMaterialFlags getFlags()
      Retrieves the flags. See #PxMaterialFlag.
      Returns:
      The material flags.
      See Also:
    • setFrictionCombineMode

      public void setFrictionCombineMode(PxCombineModeEnum combMode)
      Sets the friction combine mode.

      See the enum ::PxCombineMode .

      Default: PxCombineMode::eAVERAGE

      Sleeping: Does NOT wake any actors which may be affected.

      Parameters:
      combMode - Friction combine mode to set for this material. See #PxCombineMode.
      See Also:
    • getFrictionCombineMode

      public PxCombineModeEnum getFrictionCombineMode()
      Retrieves the friction combine mode.

      See #setFrictionCombineMode.

      Returns:
      The friction combine mode for this material.
      See Also:
    • setRestitutionCombineMode

      public void setRestitutionCombineMode(PxCombineModeEnum combMode)
      Sets the restitution combine mode.

      See the enum ::PxCombineMode .

      Default: PxCombineMode::eAVERAGE

      Sleeping: Does NOT wake any actors which may be affected.

      Parameters:
      combMode - Restitution combine mode for this material. See #PxCombineMode.
      See Also:
    • getRestitutionCombineMode

      public PxCombineModeEnum getRestitutionCombineMode()
      Retrieves the restitution combine mode.

      See #setRestitutionCombineMode.

      Returns:
      The coefficient of restitution combine mode for this material.
      See Also: