iPcAnalogMotion Struct 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 Get(Minimum|Maximum)TurningSpeed () instead") virtual float GetTurningSpeed() const =0 | |
| Get the turning speed of the character. | |
| CS_DEPRECATED_METHOD_MSG ("Use Set(Minimum|Maximum)TurningSpeed () instead") virtual void SetTurningSpeed(float turnspeed)=0 | |
| Set 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 const csVector2 & | GetAxis () const =0 |
| Get both the axis values as a vector. | |
| virtual float | GetAxis (size_t axis) const =0 |
| Get an axis' value. | |
| 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 (const csVector2 &axis)=0 |
| Set both the axis values using a vector. | |
| virtual void | SetAxis (size_t axis, float value)=0 |
| Set axis to a value. | |
| 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. | |
Detailed Description
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):
- SetAxis: parameters 'axis' (long), 'value' (float).
- AddAxis: parameters 'axis' (long), 'value' (float).
- SetMovementSpeed: parameters 'value' (float).
- SetTurningSpeed: parameters 'value' (float).
This property class supports the following properties:
- axisx (float, read/write): Left/Right axis value (-1.0 to 1.0).
- axisy (float, read/write): Forward/Backwards axis value (-1.0 to 1.0).
- movespeed (float, read/write): Movement speed.
- turnspeed (float, read/write): Turning speed.
Definition at line 43 of file analogmotion.h.
Member Function Documentation
| virtual void iPcAnalogMotion::AddAxis | ( | size_t | axis, | |
| float | value | |||
| ) | [pure virtual] |
Increase axis by a value.
This is for keyboard keys to avoid 'deadlock'
- Parameters:
-
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 Get(Minimum|Maximum)TurningSpeed () instead" | ) | const [pure virtual] |
Get the turning speed of the character.
- Returns:
- How fast the player turns to face its target.
| iPcAnalogMotion::CS_DEPRECATED_METHOD_MSG | ( | "Use Set(Minimum|Maximum)TurningSpeed () instead" | ) | [pure virtual] |
Set the turning speed of the character.
- Parameters:
-
turnspeed How fast the player turns to face its target.
| 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 const csVector2& iPcAnalogMotion::GetAxis | ( | ) | const [pure virtual] |
Get both the axis values as a vector.
| virtual float iPcAnalogMotion::GetAxis | ( | size_t | axis | ) | const [pure virtual] |
Get an axis' value.
- Parameters:
-
axis This is the axis. 0 for left/right axis, 1 for forwards/backwards axis. value The value in the range [-1,1].
| 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.
- Returns:
- How fast the player turns to face its target.
| 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.
- Returns:
- How fast the player turns to face its target.
| virtual float iPcAnalogMotion::GetMovementAcceleration | ( | ) | const [pure virtual] |
Get the movement acceleration of the character for when you start moving.
- Returns:
- Acceleration of character.
| virtual float iPcAnalogMotion::GetMovementDeceleration | ( | ) | const [pure virtual] |
Get the movement deceleration of the character for when you stop moving.
- Returns:
- Deceleration of character.
| virtual float iPcAnalogMotion::GetMovementSpeed | ( | ) | const [pure virtual] |
Get the movement speed of the character.
- Returns:
- How fast the character moves in the direction its facing.
| virtual bool iPcAnalogMotion::IsEnabled | ( | ) | const [pure virtual] |
Get whether this component is actively updating the player.
| virtual void iPcAnalogMotion::SetAxis | ( | const csVector2 & | axis | ) | [pure virtual] |
Set both the axis values using a vector.
| virtual void iPcAnalogMotion::SetAxis | ( | size_t | axis, | |
| float | value | |||
| ) | [pure virtual] |
Set axis to a value.
- Parameters:
-
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::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.
- Parameters:
-
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.
- Parameters:
-
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.
- Parameters:
-
moveaccel Acceleration of character.
| virtual void iPcAnalogMotion::SetMovementDeceleration | ( | float | movedecel | ) | [pure virtual] |
Set the movement deceleration of the character for when you stop moving.
- Parameters:
-
movedecel Deceleration of character.
| virtual void iPcAnalogMotion::SetMovementSpeed | ( | float | movespeed | ) | [pure virtual] |
Set the movement speed of the character.
- Parameters:
-
movespeed How fast the character moves in the direction its facing.
The documentation for this struct was generated from the following file:
- propclass/analogmotion.h
Generated for CEL: Crystal Entity Layer 2.1 by doxygen 1.6.1
