RavEngine
Loading...
Searching...
No Matches
physx::PxMaterial Class Referenceabstract

Material class to represent a set of surface properties. More...

#include <PxMaterial.h>

Inheritance diagram for physx::PxMaterial:
[legend]
Collaboration diagram for physx::PxMaterial:
[legend]

Public Member Functions

virtual void setDynamicFriction (PxReal coef)=0
 Sets the coefficient of dynamic friction.
 
virtual PxReal getDynamicFriction () const =0
 Retrieves the DynamicFriction value.
 
virtual void setStaticFriction (PxReal coef)=0
 Sets the coefficient of static friction.
 
virtual PxReal getStaticFriction () const =0
 Retrieves the coefficient of static friction.
 
virtual void setRestitution (PxReal rest)=0
 Sets the coefficient of restitution.
 
virtual PxReal getRestitution () const =0
 Retrieves the coefficient of restitution.

 
virtual void setDamping (PxReal damping)=0
 Sets the coefficient of damping.
 
virtual PxReal getDamping () const =0
 Retrieves the coefficient of damping.
 
virtual void setFlag (PxMaterialFlag::Enum flag, bool b)=0
 Raises or clears a particular material flag.
 
virtual void setFlags (PxMaterialFlags flags)=0
 sets all the material flags.
 
virtual PxMaterialFlags getFlags () const =0
 Retrieves the flags. See #PxMaterialFlag.
 
virtual void setFrictionCombineMode (PxCombineMode::Enum combMode)=0
 Sets the friction combine mode.
 
virtual PxCombineMode::Enum getFrictionCombineMode () const =0
 Retrieves the friction combine mode.
 
virtual void setRestitutionCombineMode (PxCombineMode::Enum combMode)=0
 Sets the restitution combine mode.
 
virtual PxCombineMode::Enum getRestitutionCombineMode () const =0
 Retrieves the restitution combine mode.
 
virtual const char * getConcreteTypeName () const PX_OVERRIDE
 Returns string name of dynamic type.
 
- Public Member Functions inherited from physx::PxBaseMaterial
PX_INLINE PxBaseMaterial (PxType concreteType, PxBaseFlags baseFlags)
 
PX_INLINE PxBaseMaterial (PxBaseFlags baseFlags)
 
- Public Member Functions inherited from physx::PxRefCounted
virtual void release ()=0
 Decrements the reference count of the object and releases it if the new reference count is zero.

 
virtual PxU32 getReferenceCount () const =0
 Returns the reference count of the object.
 
virtual void acquireReference ()=0
 Acquires a counted reference to this object.
 
- Public Member Functions inherited from physx::PxBase
template<class T >
T * is ()
 
template<class T >
const T * is () const
 
PX_FORCE_INLINE PxType getConcreteType () const
 Returns concrete type of object.
 
PX_FORCE_INLINE void setBaseFlag (PxBaseFlag::Enum flag, bool value)
 Set PxBaseFlag

 
PX_FORCE_INLINE void setBaseFlags (PxBaseFlags inFlags)
 Set PxBaseFlags

 
PX_FORCE_INLINE PxBaseFlags getBaseFlags () const
 Returns PxBaseFlags.
 
virtual bool isReleasable () const
 Whether the object is subordinate.
 

Protected Member Functions

PX_INLINE PxMaterial (PxType concreteType, PxBaseFlags baseFlags)
 
PX_INLINE PxMaterial (PxBaseFlags baseFlags)
 
virtual bool isKindOf (const char *name) const
 Returns whether a given type name matches with the type of this instance.
 
- Protected Member Functions inherited from physx::PxRefCounted
virtual void onRefCountZero ()
 
PX_INLINE PxRefCounted (PxType concreteType, PxBaseFlags baseFlags)
 
PX_INLINE PxRefCounted (PxBaseFlags baseFlags)
 
- Protected Member Functions inherited from physx::PxBase
PX_INLINE PxBase (PxType concreteType, PxBaseFlags baseFlags)
 Constructor setting concrete type and base flags.
 
PX_INLINE PxBase (PxBaseFlags baseFlags)
 Deserialization constructor setting base flags.
 
virtual ~PxBase ()
 Destructor.
 
template<class T >
bool typeMatch () const
 

Additional Inherited Members

- Public Attributes inherited from physx::PxBaseMaterial
void * userData
 user can assign this to whatever, usually to create a 1:1 relationship with a user object.
 
- Protected Attributes inherited from physx::PxBase
PxType mConcreteType
 
PxBaseFlags mBaseFlags
 
PxU32 mBuiltInRefCount
 

Detailed Description

Material class to represent a set of surface properties.

See also
PxPhysics.createMaterial

Member Function Documentation

◆ getConcreteTypeName()

virtual const char * physx::PxMaterial::getConcreteTypeName ( ) const
inlinevirtual

Returns string name of dynamic type.

Returns
Class name of most derived type of this object.

Implements physx::PxBase.

◆ getDamping()

virtual PxReal physx::PxMaterial::getDamping ( ) const
pure virtual

Retrieves the coefficient of damping.

See setDamping.

Returns
The coefficient of damping.
See also
setDamping()

Implemented in physx::NpMaterial.

◆ getDynamicFriction()

virtual PxReal physx::PxMaterial::getDynamicFriction ( ) const
pure virtual

Retrieves the DynamicFriction value.

Returns
The coefficient of dynamic friction.
See also
setDynamicFriction

Implemented in physx::NpMaterial.

◆ getFlags()

virtual PxMaterialFlags physx::PxMaterial::getFlags ( ) const
pure virtual

Retrieves the flags. See #PxMaterialFlag.

Returns
The material flags.
See also
PxMaterialFlag setFlags()

Implemented in physx::NpMaterial.

◆ getFrictionCombineMode()

virtual PxCombineMode::Enum physx::PxMaterial::getFrictionCombineMode ( ) const
pure virtual

Retrieves the friction combine mode.

See setFrictionCombineMode.

Returns
The friction combine mode for this material.
See also
PxCombineMode setFrictionCombineMode()

Implemented in physx::NpMaterial.

◆ getRestitution()

virtual PxReal physx::PxMaterial::getRestitution ( ) const
pure virtual

Retrieves the coefficient of restitution.

See setRestitution.

Returns
The coefficient of restitution.
See also
setRestitution()

Implemented in physx::NpMaterial.

◆ getRestitutionCombineMode()

virtual PxCombineMode::Enum physx::PxMaterial::getRestitutionCombineMode ( ) const
pure virtual

Retrieves the restitution combine mode.

See setRestitutionCombineMode.

Returns
The coefficient of restitution combine mode for this material.
See also
PxCombineMode setRestitutionCombineMode getRestitution()

Implemented in physx::NpMaterial.

◆ getStaticFriction()

virtual PxReal physx::PxMaterial::getStaticFriction ( ) const
pure virtual

Retrieves the coefficient of static friction.

Returns
The coefficient of static friction.
See also
setStaticFriction

Implemented in physx::NpMaterial.

◆ isKindOf()

virtual bool physx::PxMaterial::isKindOf ( const char *  superClass) const
inlineprotectedvirtual

Returns whether a given type name matches with the type of this instance.

Reimplemented from physx::PxBaseMaterial.

◆ setDamping()

virtual void physx::PxMaterial::setDamping ( PxReal  damping)
pure virtual

Sets the coefficient of damping.

This property only affects the simulation if PxMaterialFlag::eCOMPLIANT_CONTACT is raised. Damping works together with spring stiffness (set through a negative restitution value). Spring stiffness corrects positional error while damping resists relative velocity. Setting a high damping coefficient can produce spongy contacts.

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

Parameters
[in]dampingCoefficient of damping. Range: [0,INF]
See also
getDamping()

Implemented in physx::NpMaterial.

◆ setDynamicFriction()

virtual void physx::PxMaterial::setDynamicFriction ( PxReal  coef)
pure virtual

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
[in]coefCoefficient of dynamic friction. Range: [0, PX_MAX_F32)
See also
getDynamicFriction()

Implemented in physx::NpMaterial.

◆ setFlag()

virtual void physx::PxMaterial::setFlag ( PxMaterialFlag::Enum  flag,
bool  b 
)
pure virtual

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
[in]flagThe PxMaterial flag to raise(set) or clear.
[in]bNew state of the flag
See also
getFlags() setFlags() PxMaterialFlag

Implemented in physx::NpMaterial.

◆ setFlags()

virtual void physx::PxMaterial::setFlags ( PxMaterialFlags  flags)
pure virtual

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
[in]flagsAll PxMaterial flags
See also
getFlags() setFlag() PxMaterialFlag

Implemented in physx::NpMaterial.

◆ setFrictionCombineMode()

virtual void physx::PxMaterial::setFrictionCombineMode ( PxCombineMode::Enum  combMode)
pure virtual

Sets the friction combine mode.

See the enum ::PxCombineMode .

Default: PxCombineMode::eAVERAGE

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

Parameters
[in]combModeFriction combine mode to set for this material. See #PxCombineMode.
See also
PxCombineMode getFrictionCombineMode setStaticFriction() setDynamicFriction()

Implemented in physx::NpMaterial.

◆ setRestitution()

virtual void physx::PxMaterial::setRestitution ( PxReal  rest)
pure virtual

Sets the coefficient of restitution.

A coefficient of 0 makes the object bounce as little as possible, higher values up to 1.0 result in more bounce.

This property is overloaded when PxMaterialFlag::eCOMPLIANT_CONTACT flag is enabled. This permits negative values for restitution to be provided. The negative values are converted into spring stiffness terms 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.

Parameters
[in]restCoefficient of restitution. Range: [-INF,1]
See also
getRestitution()

Implemented in physx::NpMaterial.

◆ setRestitutionCombineMode()

virtual void physx::PxMaterial::setRestitutionCombineMode ( PxCombineMode::Enum  combMode)
pure virtual

Sets the restitution combine mode.

See the enum ::PxCombineMode .

Default: PxCombineMode::eAVERAGE

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

Parameters
[in]combModeRestitution combine mode for this material. See #PxCombineMode.
See also
PxCombineMode getRestitutionCombineMode() setRestitution()

Implemented in physx::NpMaterial.

◆ setStaticFriction()

virtual void physx::PxMaterial::setStaticFriction ( PxReal  coef)
pure virtual

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
[in]coefCoefficient of static friction. Range: [0, PX_MAX_F32)
See also
getStaticFriction()

Implemented in physx::NpMaterial.


The documentation for this class was generated from the following file: