Open 3D Engine AzFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Physics::CharacterRequests Class Referenceabstract

Messages serviced by character controllers. More...

#include <CharacterBus.h>

Inherits AZ::ComponentBus.

Public Member Functions

virtual AZ::Vector3 GetBasePosition () const =0
 Gets the base position of the character.
 
virtual void SetBasePosition (const AZ::Vector3 &position)=0
 
virtual AZ::Vector3 GetCenterPosition () const =0
 Gets the position of the center of the character.
 
virtual float GetStepHeight () const =0
 Gets the step height (the parameter which affects how high the character can step).
 
virtual void SetStepHeight (float stepHeight)=0
 
virtual AZ::Vector3 GetUpDirection () const =0
 Gets the character's up direction (the direction used by various controller logic, for example stepping).
 
virtual void SetUpDirection (const AZ::Vector3 &upDirection)=0
 
virtual float GetSlopeLimitDegrees () const =0
 Gets the maximum slope which the character can climb, in degrees.
 
virtual void SetSlopeLimitDegrees (float slopeLimitDegrees)=0
 
virtual float GetMaximumSpeed () const =0
 
virtual void SetMaximumSpeed (float maximumSpeed)=0
 
virtual AZ::Vector3 GetVelocity () const =0
 Gets the observed velocity of the character, which may differ from the desired velocity if the character is obstructed.
 
virtual void AddVelocity (const AZ::Vector3 &velocity)
 
virtual void AddVelocityForTick (const AZ::Vector3 &velocity)=0
 
virtual void AddVelocityForPhysicsTimestep (const AZ::Vector3 &velocity)=0
 
virtual bool IsPresent () const
 
virtual CharacterGetCharacter ()=0
 Gets a pointer to the Character object owned by the controller.
 

Detailed Description

Messages serviced by character controllers.

Member Function Documentation

◆ AddVelocityForPhysicsTimestep()

virtual void Physics::CharacterRequests::AddVelocityForPhysicsTimestep ( const AZ::Vector3 &  velocity)
pure virtual

Queues up a request to apply a velocity to the character, lasting for the duration of the physics timestep. All requests received are accumulated (so for example, the effects of animation and gravity can be applied in two separate requests), and the accumulated velocity is used when the character updates. Velocities added this way will apply until the end of the physics timestep. Obstacles may prevent the actual movement from exactly matching the requested movement.

Parameters
velocityThe velocity to be added to the accumulated requests, lasting for the duration of a physics timestep.

◆ AddVelocityForTick()

virtual void Physics::CharacterRequests::AddVelocityForTick ( const AZ::Vector3 &  velocity)
pure virtual

Queues up a request to apply a velocity to the character, lasting for the duration of the tick. All requests received are accumulated (so for example, the effects of animation and gravity can be applied in two separate requests), and the accumulated velocity is used when the character updates. Velocities added this way will apply until the end of the tick. Obstacles may prevent the actual movement from exactly matching the requested movement.

Parameters
velocityThe velocity to be added to the accumulated requests, lasting for the duration of the tick.

◆ GetMaximumSpeed()

virtual float Physics::CharacterRequests::GetMaximumSpeed ( ) const
pure virtual

Gets the maximum speed. If the accumulated requested velocity for the character exceeds this magnitude, it will be clamped.

◆ IsPresent()

virtual bool Physics::CharacterRequests::IsPresent ( ) const
inlinevirtual

Check if there is a character physics component present. Return true in the request handler implementation in order for things like the animation system to work properly.

◆ SetBasePosition()

virtual void Physics::CharacterRequests::SetBasePosition ( const AZ::Vector3 &  position)
pure virtual

Directly moves (teleports) the character to a new base position.

Parameters
positionThe new base position for the character.

◆ SetMaximumSpeed()

virtual void Physics::CharacterRequests::SetMaximumSpeed ( float  maximumSpeed)
pure virtual

Sets the maximum speed. If the accumulated requested velocity for the character exceeds this magnitude, it will be clamped. Values below 0 will be treated as 0.

Parameters
maximumSpeedThe new value for the maximum speed.

◆ SetSlopeLimitDegrees()

virtual void Physics::CharacterRequests::SetSlopeLimitDegrees ( float  slopeLimitDegrees)
pure virtual

Sets the maximum slope which the character can climb, in degrees.

Parameters
slopeLimitDegreesthe new slope limit value (in degrees, should be between 0 and 90).

◆ SetStepHeight()

virtual void Physics::CharacterRequests::SetStepHeight ( float  stepHeight)
pure virtual

Sets the step height (the parameter which affects how high the character can step).

Parameters
stepHeightThe new value for the step height parameter.

◆ SetUpDirection()

virtual void Physics::CharacterRequests::SetUpDirection ( const AZ::Vector3 &  upDirection)
pure virtual

Sets the character's up direction (the direction used by various controller logic, for example stepping).

Parameters
upDirectionThe new value for the up direction.

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