![]() |
Public API Reference |
This is a property class for analog character movement using a joystick or analog pad. More...
#include <propclass/analogmotion.h>
Public Member Functions | |
| virtual void | AddAxis (size_t axis, float value)=0 |
| Increase axis by a value. | |
| CS_DEPRECATED_METHOD_MSG ("Use Set(Minimum|Maximum)TurningSpeed () instead") virtual void SetTurningSpeed(float turnspeed)=0 | |
| Set the turning speed of the character. | |
| CS_DEPRECATED_METHOD_MSG ("Use Get(Minimum|Maximum)TurningSpeed () instead") virtual float GetTurningSpeed() const =0 | |
| Get the turning speed of the character. | |
| virtual void | Enable (bool en=true)=0 |
| Whether this component is updating the player's position every frame. | |
| virtual float | GetAxis (size_t axis) const =0 |
| Get an axis' value. | |
| virtual const csVector2 & | GetAxis () const =0 |
| Get both the axis values as a vector. | |
| virtual float | GetMaximumTurningSpeed () const =0 |
| Get the maximum turning speed of the character. | |
| virtual float | GetMinimumTurningSpeed () const =0 |
| Get the minimum turning speed of the character. | |
| virtual float | GetMovementAcceleration () const =0 |
| Get the movement acceleration of the character for when you start moving. | |
| virtual float | GetMovementDeceleration () const =0 |
| Get the movement deceleration of the character for when you stop moving. | |
| virtual float | GetMovementSpeed () const =0 |
| Get the movement speed of the character. | |
| virtual bool | IsEnabled () const =0 |
| Get whether this component is actively updating the player. | |
| virtual void | SetAxis (size_t axis, float value)=0 |
| Set axis to a value. | |
| virtual void | SetAxis (const csVector2 &axis)=0 |
| Set both the axis values using a vector. | |
| virtual void | SetMaximumTurningSpeed (float turnspeed)=0 |
| Set the maximum turning speed of the character. | |
| virtual void | SetMinimumTurningSpeed (float turnspeed)=0 |
| Set the minimum turning speed of the character. | |
| virtual void | SetMovementAcceleration (float moveaccel)=0 |
| Set the movement acceleration of the character for when you start moving. | |
| virtual void | SetMovementDeceleration (float movedecel)=0 |
| Set the movement deceleration of the character for when you stop moving. | |
| virtual void | SetMovementSpeed (float movespeed)=0 |
| Set the movement speed of the character. | |
This is a property class for analog character movement using a joystick or analog pad.
This property class supports the following actions (add prefix 'cel.move.analog.action.' if you want to access this action through a message):
This property class supports the following properties:
Definition at line 43 of file analogmotion.h.
| virtual void iPcAnalogMotion::AddAxis | ( | size_t | axis, |
| float | value | ||
| ) | [pure virtual] |
Increase axis by a value.
This is for keyboard keys to avoid 'deadlock'
| axis | This is the axis. 0 for left/right axis, 1 for forwards/backwards axis, 2 or above for both together. |
| value | The value to add to it. Anything resulting in the target axis value being out of the range [-1,1] will be clipped. |
| iPcAnalogMotion::CS_DEPRECATED_METHOD_MSG | ( | "Use Set(Minimum|Maximum)TurningSpeed () instead" | ) | [pure virtual] |
Set the turning speed of the character.
| turnspeed | How fast the player turns to face its target. |
| iPcAnalogMotion::CS_DEPRECATED_METHOD_MSG | ( | "Use Get(Minimum|Maximum)TurningSpeed () instead" | ) | const [pure virtual] |
Get the turning speed of the character.
| virtual void iPcAnalogMotion::Enable | ( | bool | en = true | ) | [pure virtual] |
Whether this component is updating the player's position every frame.
Turning this off effectively makes this component deactivated.
| virtual float iPcAnalogMotion::GetAxis | ( | size_t | axis | ) | const [pure virtual] |
Get an axis' value.
| axis | This is the axis. 0 for left/right axis, 1 for forwards/backwards axis. |
| value | The value in the range [-1,1]. |
| virtual const csVector2& iPcAnalogMotion::GetAxis | ( | ) | const [pure virtual] |
Get both the axis values as a vector.
| virtual float iPcAnalogMotion::GetMaximumTurningSpeed | ( | ) | const [pure virtual] |
Get the maximum turning speed of the character.
This is the speed of turning when not moving at all. Turning is decelerating in one direction and accelerating in another. Slower movement means a faster turning speed, and vice versa.
| virtual float iPcAnalogMotion::GetMinimumTurningSpeed | ( | ) | const [pure virtual] |
Get the minimum turning speed of the character.
This is the speed of turning when moving at full speed. Turning is decelerating in one direction and accelerating in another. Faster movement means a slower turning speed, and vice versa.
| virtual float iPcAnalogMotion::GetMovementAcceleration | ( | ) | const [pure virtual] |
Get the movement acceleration of the character for when you start moving.
| virtual float iPcAnalogMotion::GetMovementDeceleration | ( | ) | const [pure virtual] |
Get the movement deceleration of the character for when you stop moving.
| virtual float iPcAnalogMotion::GetMovementSpeed | ( | ) | const [pure virtual] |
Get the movement speed of the character.
| virtual bool iPcAnalogMotion::IsEnabled | ( | ) | const [pure virtual] |
Get whether this component is actively updating the player.
| virtual void iPcAnalogMotion::SetAxis | ( | size_t | axis, |
| float | value | ||
| ) | [pure virtual] |
Set axis to a value.
| axis | This is the axis. 0 for left/right axis, 1 for forwards/backwards axis, 2 or above for both together. |
| value | The value in the range [-1,1] to set it to. Anything else is invalid and is clipped. |
| virtual void iPcAnalogMotion::SetAxis | ( | const csVector2 & | axis | ) | [pure virtual] |
Set both the axis values using a vector.
| virtual void iPcAnalogMotion::SetMaximumTurningSpeed | ( | float | turnspeed | ) | [pure virtual] |
Set the maximum turning speed of the character.
This is the speed of turning when not moving at all. Turning is decelerating in one direction and accelerating in another. Slower movement means a faster turning speed, and vice versa.
| turnspeed | How fast the player turns to face its target. |
| virtual void iPcAnalogMotion::SetMinimumTurningSpeed | ( | float | turnspeed | ) | [pure virtual] |
Set the minimum turning speed of the character.
This is the speed of turning when moving at full speed. Turning is decelerating in one direction and accelerating in another. Faster movement means a slower turning speed, and vice versa.
| turnspeed | How fast the player turns to face its target. |
| virtual void iPcAnalogMotion::SetMovementAcceleration | ( | float | moveaccel | ) | [pure virtual] |
Set the movement acceleration of the character for when you start moving.
| moveaccel | Acceleration of character. |
| virtual void iPcAnalogMotion::SetMovementDeceleration | ( | float | movedecel | ) | [pure virtual] |
Set the movement deceleration of the character for when you stop moving.
| movedecel | Deceleration of character. |
| virtual void iPcAnalogMotion::SetMovementSpeed | ( | float | movespeed | ) | [pure virtual] |
Set the movement speed of the character.
| movespeed | How fast the character moves in the direction its facing. |