Planeshift
psMovementManager Class Reference

Manages main character movements. More...

#include <psmovement.h>

Public Member Functions

void CancelRunTo ()
 
GEMClientActorControlledActor ()
 
const psCharModeFindCharMode (size_t id) const
 
const psCharModeFindCharMode (const char *name) const
 
const psMovementFindMovement (const char *name) const
 
bool GetInvertedMouse ()
 
const char * GetModeIdleAnim (size_t id) const
 
bool HandleEvent (iEvent &event)
 
void HandleMessage (MsgEntry *me)
 
bool IsLocked ()
 
bool IsReady ()
 Ready to receive events? More...
 
void LoadMouseSettings ()
 
void LockMoves (bool v)
 
void MouseLook (bool v)
 
bool MouseLook ()
 
void MouseLook (iEvent &ev)
 
void MouseLookCanAct (bool v)
 
bool MouseLookCanAct ()
 
bool MouseMove ()
 
void MouseZoom (bool v)
 
bool MouseZoom ()
 
void MouseZoom (iEvent &ev)
 
bool MoveStateChanged (psMoveState &state)
 
 psMovementManager (iEventNameRegistry *eventname_reg, psControlManager *controls)
 
void Push (const psMovement *move)
 Use a movement once. More...
 
void SaveMoveState (psMoveState &state)
 
void SetActor (GEMClientActor *actor)
 
void SetInvertedMouse (bool v)
 
void SetMouseMove (bool v)
 
void SetMouseSensX (float v)
 
void SetMouseSensY (float v)
 
bool SetRun (bool runState)
 Set the character run mode. More...
 
void SetRunToPos (psPoint &mouse)
 
void SetSneaking (bool v)
 
bool Sneaking ()
 
void Start (const psCharMode *mode)
 Switch to a new mode. More...
 
void Start (const psMovement *move)
 Add a new movement. More...
 
void Stop (const psCharMode *mode)
 Switch back to normal mode. More...
 
void Stop (const psMovement *move)
 Stop an existing movement. More...
 
void StopAllMovement ()
 Stops all movements, resets mode, cancels mousemove, and halts the actor. More...
 
void StopControlledMovement ()
 Stops all user applied movements/modes (does not halt actor if falling or mousemove) More...
 
void ToggleAutoMove ()
 
bool ToggleRun ()
 Toggle the character run mode. More...
 
void UpdateMouseLook ()
 
void UpdateRunTo ()
 
 ~psMovementManager ()
 
- Public Member Functions inherited from psClientNetSubscriber
virtual void HandleMessage (MsgEntry *msg, Client *)
 Interprets a received message and executes the command. More...
 
virtual bool Verify (MsgEntry *, unsigned int, Client *&)
 
virtual ~psClientNetSubscriber ()
 

Protected Member Functions

void ApplyMod (psVelocity &vel)
 
void HandleMod (psMoveModMsg &msg)
 
void SetActorMode (const psCharMode *mode)
 
void SetupControls ()
 
void SetupMovements (psMovementInfoMessage &msg)
 
void UpdateVelocity ()
 

Protected Attributes

psVelocity activeMod
 
psMoveModMsg::ModType activeModType
 
uint activeMoves
 Bit mask for active moves. More...
 
GEMClientActoractor
 Actor we're moving here. More...
 
const psCharModeactormode
 Current active mode. More...
 
bool autoMove
 
const psMovementbackward
 
psControlManagercontrols
 
const psCharModedefaultmode
 Default actor mode. More...
 
csEventID event_frame
 
csEventID event_mousemove
 
const psMovementforward
 
bool invertedMouse
 
uint kbdRotate
 
float lastDeltaX
 
float lastDeltaY
 
float lastDist
 
bool locked
 Is this player allowed to move? More...
 
csPDelArray< psCharModemodes
 All available character modes. More...
 
int mouseAutoMove
 
bool mouseLook
 
bool mouseLookCanAct
 
bool mouseMove
 
bool mouseZoom
 
psVelocity move_total
 Current total of all active move velocities. More...
 
csPDelArray< psMovementmoves
 All available movement types. More...
 
bool onGround
 Is actor on ground or airborne? More...
 
bool ready
 Have movements been setup? More...
 
const psCharModerun
 
csVector3 runToDiff
 
int runToMarkerID
 
float sensX
 
float sensY
 
bool sneaking
 
bool toggleRun
 
const psCharModewalk
 

Detailed Description

Manages main character movements.

Starts/stops modes and movements for the controled character. Modes and movements are stored in the server's database and requested upon login. The primary way this class is accessed is via psTriggerHandler function calls from button presses registered by psControlManager.

Definition at line 84 of file psmovement.h.

Constructor & Destructor Documentation

psMovementManager::psMovementManager ( iEventNameRegistry *  eventname_reg,
psControlManager controls 
)
psMovementManager::~psMovementManager ( )

Member Function Documentation

void psMovementManager::ApplyMod ( psVelocity vel)
protected
void psMovementManager::CancelRunTo ( )
GEMClientActor* psMovementManager::ControlledActor ( )
inline

Definition at line 153 of file psmovement.h.

const psCharMode* psMovementManager::FindCharMode ( size_t  id) const
inline

Definition at line 157 of file psmovement.h.

const psCharMode* psMovementManager::FindCharMode ( const char *  name) const
const psMovement* psMovementManager::FindMovement ( const char *  name) const
bool psMovementManager::GetInvertedMouse ( )
inline

Definition at line 182 of file psmovement.h.

const char* psMovementManager::GetModeIdleAnim ( size_t  id) const
inline

Definition at line 156 of file psmovement.h.

bool psMovementManager::HandleEvent ( iEvent &  event)
void psMovementManager::HandleMessage ( MsgEntry me)
virtual

Implements psClientNetSubscriber.

void psMovementManager::HandleMod ( psMoveModMsg msg)
protected
bool psMovementManager::IsLocked ( )
inline

Definition at line 162 of file psmovement.h.

bool psMovementManager::IsReady ( )
inline

Ready to receive events?

Definition at line 161 of file psmovement.h.

void psMovementManager::LoadMouseSettings ( )
void psMovementManager::LockMoves ( bool  v)
void psMovementManager::MouseLook ( bool  v)
bool psMovementManager::MouseLook ( )
inline

Definition at line 189 of file psmovement.h.

void psMovementManager::MouseLook ( iEvent &  ev)
void psMovementManager::MouseLookCanAct ( bool  v)
bool psMovementManager::MouseLookCanAct ( )
inline

Definition at line 186 of file psmovement.h.

bool psMovementManager::MouseMove ( )
inline

Definition at line 198 of file psmovement.h.

void psMovementManager::MouseZoom ( bool  v)
inline

Definition at line 193 of file psmovement.h.

bool psMovementManager::MouseZoom ( )
inline

Definition at line 194 of file psmovement.h.

void psMovementManager::MouseZoom ( iEvent &  ev)
bool psMovementManager::MoveStateChanged ( psMoveState state)
inline

Definition at line 229 of file psmovement.h.

void psMovementManager::Push ( const psMovement move)

Use a movement once.

void psMovementManager::SaveMoveState ( psMoveState state)
inline

Definition at line 222 of file psmovement.h.

void psMovementManager::SetActor ( GEMClientActor actor)
void psMovementManager::SetActorMode ( const psCharMode mode)
protected
void psMovementManager::SetInvertedMouse ( bool  v)
inline

Definition at line 181 of file psmovement.h.

void psMovementManager::SetMouseMove ( bool  v)
inline

Definition at line 197 of file psmovement.h.

void psMovementManager::SetMouseSensX ( float  v)
inline

Definition at line 179 of file psmovement.h.

void psMovementManager::SetMouseSensY ( float  v)
inline

Definition at line 180 of file psmovement.h.

bool psMovementManager::SetRun ( bool  runState)

Set the character run mode.

True to enable run mode. False to disable.

Returns
Return the current run state.
void psMovementManager::SetRunToPos ( psPoint mouse)
void psMovementManager::SetSneaking ( bool  v)
inline

Definition at line 219 of file psmovement.h.

void psMovementManager::SetupControls ( )
protected
void psMovementManager::SetupMovements ( psMovementInfoMessage msg)
protected
bool psMovementManager::Sneaking ( )
inline

Definition at line 220 of file psmovement.h.

void psMovementManager::Start ( const psCharMode mode)

Switch to a new mode.

void psMovementManager::Start ( const psMovement move)

Add a new movement.

void psMovementManager::Stop ( const psCharMode mode)

Switch back to normal mode.

void psMovementManager::Stop ( const psMovement move)

Stop an existing movement.

void psMovementManager::StopAllMovement ( )

Stops all movements, resets mode, cancels mousemove, and halts the actor.

void psMovementManager::StopControlledMovement ( )

Stops all user applied movements/modes (does not halt actor if falling or mousemove)

void psMovementManager::ToggleAutoMove ( )
bool psMovementManager::ToggleRun ( )

Toggle the character run mode.

Returns
Return the current run state.
void psMovementManager::UpdateMouseLook ( )
void psMovementManager::UpdateRunTo ( )
void psMovementManager::UpdateVelocity ( )
protected

Member Data Documentation

psVelocity psMovementManager::activeMod
protected

Definition at line 114 of file psmovement.h.

psMoveModMsg::ModType psMovementManager::activeModType
protected

Definition at line 113 of file psmovement.h.

uint psMovementManager::activeMoves
protected

Bit mask for active moves.

Definition at line 96 of file psmovement.h.

GEMClientActor* psMovementManager::actor
protected

Actor we're moving here.

Definition at line 92 of file psmovement.h.

const psCharMode* psMovementManager::actormode
protected

Current active mode.

Definition at line 94 of file psmovement.h.

bool psMovementManager::autoMove
protected

Definition at line 116 of file psmovement.h.

const psMovement* psMovementManager::backward
protected

Definition at line 139 of file psmovement.h.

psControlManager* psMovementManager::controls
protected

Definition at line 104 of file psmovement.h.

const psCharMode* psMovementManager::defaultmode
protected

Default actor mode.

Definition at line 90 of file psmovement.h.

csEventID psMovementManager::event_frame
protected

Definition at line 135 of file psmovement.h.

csEventID psMovementManager::event_mousemove
protected

Definition at line 136 of file psmovement.h.

const psMovement* psMovementManager::forward
protected

Definition at line 138 of file psmovement.h.

bool psMovementManager::invertedMouse
protected

Definition at line 131 of file psmovement.h.

uint psMovementManager::kbdRotate
protected

Definition at line 143 of file psmovement.h.

float psMovementManager::lastDeltaX
protected

Definition at line 132 of file psmovement.h.

float psMovementManager::lastDeltaY
protected

Definition at line 133 of file psmovement.h.

float psMovementManager::lastDist
protected

Definition at line 125 of file psmovement.h.

bool psMovementManager::locked
protected

Is this player allowed to move?

Definition at line 102 of file psmovement.h.

csPDelArray<psCharMode> psMovementManager::modes
protected

All available character modes.

Definition at line 87 of file psmovement.h.

int psMovementManager::mouseAutoMove
protected

Definition at line 123 of file psmovement.h.

bool psMovementManager::mouseLook
protected

Definition at line 118 of file psmovement.h.

bool psMovementManager::mouseLookCanAct
protected

Definition at line 119 of file psmovement.h.

bool psMovementManager::mouseMove
protected

Definition at line 121 of file psmovement.h.

bool psMovementManager::mouseZoom
protected

Definition at line 120 of file psmovement.h.

psVelocity psMovementManager::move_total
protected

Current total of all active move velocities.

Definition at line 97 of file psmovement.h.

csPDelArray<psMovement> psMovementManager::moves
protected

All available movement types.

Definition at line 88 of file psmovement.h.

bool psMovementManager::onGround
protected

Is actor on ground or airborne?

Definition at line 95 of file psmovement.h.

bool psMovementManager::ready
protected

Have movements been setup?

Definition at line 101 of file psmovement.h.

const psCharMode* psMovementManager::run
protected

Definition at line 140 of file psmovement.h.

csVector3 psMovementManager::runToDiff
protected

Definition at line 126 of file psmovement.h.

int psMovementManager::runToMarkerID
protected

Definition at line 124 of file psmovement.h.

float psMovementManager::sensX
protected

Definition at line 130 of file psmovement.h.

float psMovementManager::sensY
protected

Definition at line 129 of file psmovement.h.

bool psMovementManager::sneaking
protected

Definition at line 122 of file psmovement.h.

bool psMovementManager::toggleRun
protected

Definition at line 117 of file psmovement.h.

const psCharMode* psMovementManager::walk
protected

Definition at line 141 of file psmovement.h.


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