PxControllerDesc Class Reference

Descriptor class for a character controller. More...

#include <PxController.h>

Inheritance diagram for PxControllerDesc:
Collaboration diagram for PxControllerDesc:

Public Member Functions

virtual PX_INLINE bool isValid () const
 returns true if the current settings are valid More...
 
PX_INLINE PxControllerShapeType::Enum getType () const
 Returns the character controller type. More...
 

Public Attributes

PxExtendedVec3 position
 The position of the character. More...
 
PxVec3 upDirection
 Specifies the 'up' direction. More...
 
PxF32 slopeLimit
 The maximum slope which the character can walk up. More...
 
PxF32 invisibleWallHeight
 Height of invisible walls created around non-walkable triangles. More...
 
PxF32 maxJumpHeight
 Maximum height a jumping character can reach. More...
 
PxF32 contactOffset
 The contact offset used by the controller. More...
 
PxF32 stepOffset
 Defines the maximum height of an obstacle which the character can climb. More...
 
PxF32 density
 Density of underlying kinematic actor. More...
 
PxF32 scaleCoeff
 Scale coefficient for underlying kinematic actor. More...
 
PxF32 volumeGrowth
 Cached volume growth. More...
 
PxUserControllerHitReportreportCallback
 Specifies a user report callback. More...
 
PxControllerBehaviorCallbackbehaviorCallback
 Specifies a user behavior callback. More...
 
PxControllerNonWalkableMode::Enum nonWalkableMode
 The non-walkable mode controls if a character controller slides or not on a non-walkable part. More...
 
PxMaterialmaterial
 The material for the actor associated with the controller. More...
 
bool registerDeletionListener
 Use a deletion listener to get informed about released objects and clear internal caches if needed. More...
 
void * userData
 User specified data associated with the controller. More...
 

Protected Member Functions

PX_INLINE PxControllerDesc (PxControllerShapeType::Enum)
 constructor sets to default. More...
 
virtual PX_INLINE ~PxControllerDesc ()
 
PX_INLINE PxControllerDesc (const PxControllerDesc &)
 copy constructor. More...
 
PX_INLINE PxControllerDescoperator= (const PxControllerDesc &)
 assignment operator. More...
 
PX_INLINE void copy (const PxControllerDesc &)
 

Protected Attributes

const PxControllerShapeType::Enum mType
 The type of the controller. This gets set by the derived class' ctor, the user should not have to change it. More...
 

Detailed Description

Descriptor class for a character controller.

See also
PxBoxController PxCapsuleController

Member Function Documentation

◆ getType()

PX_INLINE PxControllerShapeType::Enum PxControllerDesc::getType ( ) const
inline

Returns the character controller type.

Returns
The controllers type.
See also
PxControllerType PxCapsuleControllerDesc PxBoxControllerDesc

Member Data Documentation

◆ behaviorCallback

PxControllerBehaviorCallback* PxControllerDesc::behaviorCallback

Specifies a user behavior callback.

This behavior callback is called to customize the controller's behavior w.r.t. touched shapes.

Setting this to NULL disables the callback.

Default: NULL

See also
PxControllerBehaviorCallback

Referenced by copy(), and PxControllerDesc().

◆ contactOffset

PxF32 PxControllerDesc::contactOffset

The contact offset used by the controller.

Specifies a skin around the object within which contacts will be generated. Use it to avoid numerical precision issues.

This is dependant on the scale of the users world, but should be a small, positive non zero value.

Default: 0.1

Referenced by copy(), isValid(), and PxControllerDesc().

◆ density

PxF32 PxControllerDesc::density

Density of underlying kinematic actor.

The CCT creates a PhysX's kinematic actor under the hood. This controls its density.

Default: 10.0

Referenced by copy(), isValid(), and PxControllerDesc().

◆ invisibleWallHeight

PxF32 PxControllerDesc::invisibleWallHeight

Height of invisible walls created around non-walkable triangles.

The library can automatically create invisible walls around non-walkable triangles defined by the 'slopeLimit' parameter. This defines the height of those walls. If it is 0.0, then no extra triangles are created.

Default: 0.0

See also
upDirection slopeLimit maxJumpHeight

Referenced by copy(), and PxControllerDesc().

◆ material

PxMaterial* PxControllerDesc::material

The material for the actor associated with the controller.

The controller internally creates a rigid body actor. This parameter specifies the material of the actor.

Default: NULL

See also
PxMaterial

Referenced by copy(), isValid(), and PxControllerDesc().

◆ maxJumpHeight

PxF32 PxControllerDesc::maxJumpHeight

Maximum height a jumping character can reach.

This is only used if invisible walls are created ('invisibleWallHeight' is non zero).

When a character jumps, the non-walkable triangles he might fly over are not found by the collision queries (since the character's bounding volume does not touch them). Thus those non-walkable triangles do not create invisible walls, and it is possible for a jumping character to land on a non-walkable triangle, while he wouldn't have reached that place by just walking.

The 'maxJumpHeight' variable is used to extend the size of the collision volume downward. This way, all the non-walkable triangles are properly found by the collision queries and it becomes impossible to 'jump over' invisible walls.

If the character in your game can not jump, it is safe to use 0.0 here. Otherwise it is best to keep this value as small as possible, since a larger collision volume means more triangles to process.

Default: 0.0

See also
upDirection slopeLimit invisibleWallHeight

Referenced by copy(), and PxControllerDesc().

◆ mType

const PxControllerShapeType::Enum PxControllerDesc::mType
protected

The type of the controller. This gets set by the derived class' ctor, the user should not have to change it.

Referenced by isValid().

◆ nonWalkableMode

PxControllerNonWalkableMode::Enum PxControllerDesc::nonWalkableMode

The non-walkable mode controls if a character controller slides or not on a non-walkable part.

This is only used when slopeLimit is non zero.

Default: PxControllerNonWalkableMode::ePREVENT_CLIMBING

See also
PxControllerNonWalkableMode

Referenced by copy(), and PxControllerDesc().

◆ position

PxExtendedVec3 PxControllerDesc::position

The position of the character.

Note
The character's initial position must be such that it does not overlap the static geometry.

Default: Zero

Referenced by copy(), isValid(), and PxControllerDesc().

◆ registerDeletionListener

bool PxControllerDesc::registerDeletionListener

Use a deletion listener to get informed about released objects and clear internal caches if needed.

If a character controller registers a deletion listener, it will get informed about released objects. That allows the controller to invalidate cached data that connects to a released object. If a deletion listener is not registered, PxController::invalidateCache has to be called manually after objects have been released.

See also
PxController::invalidateCache

Default: true

Referenced by copy(), and PxControllerDesc().

◆ reportCallback

PxUserControllerHitReport* PxControllerDesc::reportCallback

Specifies a user report callback.

This report callback is called when the character collides with shapes and other characters.

Setting this to NULL disables the callback.

Default: NULL

See also
PxUserControllerHitReport

Referenced by copy(), and PxControllerDesc().

◆ scaleCoeff

PxF32 PxControllerDesc::scaleCoeff

Scale coefficient for underlying kinematic actor.

The CCT creates a PhysX's kinematic actor under the hood. This controls its scale factor. This should be a number a bit smaller than 1.0.

Default: 0.8

Referenced by copy(), isValid(), and PxControllerDesc().

◆ slopeLimit

PxF32 PxControllerDesc::slopeLimit

The maximum slope which the character can walk up.

In general it is desirable to limit where the character can walk, in particular it is unrealistic for the character to be able to climb arbitary slopes.

The limit is expressed as the cosine of desired limit angle. A value of 0 disables this feature.

Warning
It is currently enabled for static actors only (not for dynamic/kinematic actors), and not supported for spheres or capsules.

Default: 0.707

See also
upDirection invisibleWallHeight maxJumpHeight

Referenced by copy(), isValid(), and PxControllerDesc().

◆ stepOffset

PxF32 PxControllerDesc::stepOffset

Defines the maximum height of an obstacle which the character can climb.

A small value will mean that the character gets stuck and cannot walk up stairs etc, a value which is too large will mean that the character can climb over unrealistically high obstacles.

Default: 0.5

See also
upDirection

Referenced by copy(), PxBoxControllerDesc::isValid(), PxCapsuleControllerDesc::isValid(), isValid(), and PxControllerDesc().

◆ upDirection

PxVec3 PxControllerDesc::upDirection

Specifies the 'up' direction.

In order to provide stepping functionality the SDK must be informed about the up direction.

Default: (0, 1, 0)

Referenced by copy(), and PxControllerDesc().

◆ userData

void* PxControllerDesc::userData

User specified data associated with the controller.

Default: NULL

Referenced by copy(), and PxControllerDesc().

◆ volumeGrowth

PxF32 PxControllerDesc::volumeGrowth

Cached volume growth.

Amount of space around the controller we cache to improve performance. This is a scale factor that should be higher than 1.0f but not too big, ideally lower than 2.0f.

Default: 1.5

Referenced by copy(), isValid(), and PxControllerDesc().


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