PxMaterial Class Referenceabstract

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

#include <PxMaterial.h>

Inheritance diagram for PxMaterial:
Collaboration diagram for PxMaterial:

Public Member Functions

virtual void release ()=0
 Decrements the reference count of a material and releases it if the new reference count is zero. More...
 
virtual PxU32 getReferenceCount () const =0
 Returns the reference count of the material. More...
 
virtual void acquireReference ()=0
 Acquires a counted reference to a material. More...
 
virtual void setDynamicFriction (PxReal coef)=0
 Sets the coefficient of dynamic friction. More...
 
virtual PxReal getDynamicFriction () const =0
 Retrieves the DynamicFriction value. More...
 
virtual void setStaticFriction (PxReal coef)=0
 Sets the coefficient of static friction. More...
 
virtual PxReal getStaticFriction () const =0
 Retrieves the coefficient of static friction. More...
 
virtual void setRestitution (PxReal rest)=0
 Sets the coefficient of restitution. More...
 
virtual PxReal getRestitution () const =0
 Retrieves the coefficient of restitution. More...
 
virtual void setFlag (PxMaterialFlag::Enum flag, bool b)=0
 Raises or clears a particular material flag. More...
 
virtual void setFlags (PxMaterialFlags flags)=0
 sets all the material flags. More...
 
virtual PxMaterialFlags getFlags () const =0
 Retrieves the flags. See PxMaterialFlag. More...
 
virtual void setFrictionCombineMode (PxCombineMode::Enum combMode)=0
 Sets the friction combine mode. More...
 
virtual PxCombineMode::Enum getFrictionCombineMode () const =0
 Retrieves the friction combine mode. More...
 
virtual void setRestitutionCombineMode (PxCombineMode::Enum combMode)=0
 Sets the restitution combine mode. More...
 
virtual PxCombineMode::Enum getRestitutionCombineMode () const =0
 Retrieves the restitution combine mode. More...
 
virtual const char * getConcreteTypeName () const
 Returns string name of dynamic type. More...
 
- Public Member Functions inherited from PxBase
template<class T >
T * is ()
 
template<class T >
const T * is () const
 
PX_FORCE_INLINE PxType getConcreteType () const
 Returns concrete type of object. More...
 
PX_FORCE_INLINE void setBaseFlag (PxBaseFlag::Enum flag, bool value)
 Set PxBaseFlag. More...
 
PX_FORCE_INLINE void setBaseFlags (PxBaseFlags inFlags)
 Set PxBaseFlags. More...
 
PX_FORCE_INLINE PxBaseFlags getBaseFlags () const
 Returns PxBaseFlags. More...
 
virtual bool isReleasable () const
 Whether the object is subordinate. More...
 

Public Attributes

void * userData
 user can assign this to whatever, usually to create a 1:1 relationship with a user object. More...
 

Protected Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from PxBase
PxType mConcreteType
 
PxBaseFlags mBaseFlags
 

Detailed Description

Material class to represent a set of surface properties.

See also
PxPhysics.createMaterial

Constructor & Destructor Documentation

◆ PxMaterial() [1/2]

PX_INLINE PxMaterial::PxMaterial ( PxType  concreteType,
PxBaseFlags  baseFlags 
)
inlineprotected

◆ PxMaterial() [2/2]

PX_INLINE PxMaterial::PxMaterial ( PxBaseFlags  baseFlags)
inlineprotected

◆ ~PxMaterial()

virtual PxMaterial::~PxMaterial ( )
inlineprotectedvirtual

Member Function Documentation

◆ acquireReference()

virtual void PxMaterial::acquireReference ( )
pure virtual

Acquires a counted reference to a material.

This method increases the reference count of the material by 1. Decrement the reference count by calling release()

◆ getConcreteTypeName()

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

Returns string name of dynamic type.

Returns
Class name of most derived type of this object.

Implements PxBase.

◆ getDynamicFriction()

virtual PxReal PxMaterial::getDynamicFriction ( ) const
pure virtual

Retrieves the DynamicFriction value.

Returns
The coefficient of dynamic friction.
See also
setDynamicFriction

◆ getFlags()

virtual PxMaterialFlags PxMaterial::getFlags ( ) const
pure virtual

Retrieves the flags. See PxMaterialFlag.

Returns
The material flags.
See also
PxMaterialFlag setFlags()

◆ getFrictionCombineMode()

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

Retrieves the friction combine mode.

See setFrictionCombineMode.

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

◆ getReferenceCount()

virtual PxU32 PxMaterial::getReferenceCount ( ) const
pure virtual

Returns the reference count of the material.

At creation, the reference count of the material is 1. Every shape referencing this material increments the count by 1. When the reference count reaches 0, and only then, the material gets destroyed automatically.

Returns
the current reference count.

◆ getRestitution()

virtual PxReal PxMaterial::getRestitution ( ) const
pure virtual

Retrieves the coefficient of restitution.

See setRestitution.

Returns
The coefficient of restitution.
See also
setRestitution()

◆ getRestitutionCombineMode()

virtual PxCombineMode::Enum 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()

◆ getStaticFriction()

virtual PxReal PxMaterial::getStaticFriction ( ) const
pure virtual

Retrieves the coefficient of static friction.

Returns
The coefficient of static friction.
See also
setStaticFriction

◆ isKindOf()

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

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

Reimplemented from PxBase.

References PxBase::isKindOf().

◆ release()

virtual void PxMaterial::release ( )
pure virtual

Decrements the reference count of a material and releases it if the new reference count is zero.

See also
PxPhysics.createMaterial()

Implements PxBase.

◆ setDynamicFriction()

virtual void 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()

◆ setFlag()

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

Raises or clears a particular material flag.

See the list of flags PxMaterialFlag

Default: no flags are set

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

◆ setFlags()

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

sets all the material flags.

See the list of flags PxMaterialFlag

Default: no flags are set

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

Parameters
[in]flagsAll PxMaterial flags
See also
getFlags() setFlag() PxMaterialFlag

◆ setFrictionCombineMode()

virtual void 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()

◆ setRestitution()

virtual void 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.

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

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

◆ setRestitutionCombineMode()

virtual void 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()

◆ setStaticFriction()

virtual void 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()

Member Data Documentation

◆ userData

void* PxMaterial::userData

user can assign this to whatever, usually to create a 1:1 relationship with a user object.


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