#include <llviewerjoystick.h>
Public Member Functions | |
LLViewerJoystick () | |
virtual | ~LLViewerJoystick () |
void | init (bool autoenable) |
void | updateStatus () |
void | scanJoystick () |
void | moveObjects (bool reset=false) |
void | moveAvatar (bool reset=false) |
void | moveFlycam (bool reset=false) |
F32 | getJoystickAxis (U32 axis) const |
U32 | getJoystickButton (U32 button) const |
bool | isJoystickInitialized () const |
bool | isLikeSpaceNavigator () const |
void | setNeedsReset (bool reset=true) |
void | setCameraNeedsUpdate (bool b) |
bool | getCameraNeedsUpdate () const |
bool | getOverrideCamera () |
void | setOverrideCamera (bool val) |
bool | toggleFlycam () |
void | setSNDefaults () |
std::string | getDescription () |
Protected Member Functions | |
void | updateEnabled (bool autoenable) |
void | terminate () |
void | agentSlide (F32 inc) |
void | agentPush (F32 inc) |
void | agentFly (F32 inc) |
void | agentRotate (F32 pitch_inc, F32 turn_inc) |
void | agentJump () |
void | resetDeltas (S32 axis[], bool flycam_and_build=false) |
Private Attributes | |
F32 | mAxes [6] |
long | mBtn [16] |
EJoystickDriverState | mDriverState |
NDOF_Device * | mNdofDev |
bool | mResetFlag |
F32 | mPerfScale |
bool | mCameraUpdated |
bool | mOverrideCamera |
Static Private Attributes | |
static F32 | sLastDelta [7] = {0,0,0,0,0,0,0} |
static F32 | sDelta [7] = {0,0,0,0,0,0,0} |
Definition at line 53 of file llviewerjoystick.h.
LLViewerJoystick::LLViewerJoystick | ( | ) |
Definition at line 140 of file llviewerjoystick.cpp.
References LLCPUInfo::getMhz(), gSysCPU, i, mAxes, mBtn, mPerfScale, sDelta, and sLastDelta.
LLViewerJoystick::~LLViewerJoystick | ( | ) | [virtual] |
Definition at line 159 of file llviewerjoystick.cpp.
References JDS_INITIALIZED, mDriverState, and terminate().
void LLViewerJoystick::init | ( | bool | autoenable | ) |
Definition at line 168 of file llviewerjoystick.cpp.
References LLControlGroup::getString(), gSavedSettings, isLikeSpaceNavigator(), JDS_INITIALIZED, JDS_INITIALIZING, JDS_UNINITIALIZED, llendl, llinfos, llwarns, MAX_JOYSTICK_INPUT_VALUE, mDriverState, mNdofDev, NULL, setSNDefaults(), LLControlGroup::setString(), and updateEnabled().
Referenced by LLViewerWindow::handleDeviceChange(), and LLAppViewer::init().
void LLViewerJoystick::updateStatus | ( | ) |
Definition at line 280 of file llviewerjoystick.cpp.
References i, mAxes, mBtn, and mNdofDev.
Referenced by LLViewerWindow::handleTimerEvent(), and scanJoystick().
void LLViewerJoystick::scanJoystick | ( | ) |
Definition at line 898 of file llviewerjoystick.cpp.
References LLControlGroup::getBOOL(), LLSingleton< LLToolMgr >::getInstance(), gSavedSettings, JDS_INITIALIZED, mBtn, mDriverState, moveAvatar(), mOverrideCamera, toggleFlycam(), and updateStatus().
Referenced by LLAppViewer::mainLoop().
void LLViewerJoystick::moveObjects | ( | bool | reset = false |
) |
Definition at line 404 of file llviewerjoystick.cpp.
References LLFocusMgr::getAppHasFocus(), LLControlGroup::getBOOL(), LLControlGroup::getF32(), LLSingleton< LLSelectMgr >::getInstance(), LLControlGroup::getS32(), gFocusMgr, gFrameIntervalSeconds, gSavedSettings, i, JDS_INITIALIZED, llmax(), llmin(), mAxes, mDriverState, mResetFlag, resetDeltas(), S32, sDelta, LLSelectMgr::sendSelectionMove(), LLVector3::setVec(), sLastDelta, UPD_NONE, UPD_POSITION, and UPD_ROTATION.
Referenced by LLObjectEdit::handleEvent(), and LLAppViewer::idle().
void LLViewerJoystick::moveAvatar | ( | bool | reset = false |
) |
Definition at line 522 of file llviewerjoystick.cpp.
References agentFly(), agentJump(), agentPush(), agentRotate(), agentSlide(), gAgent, LLFocusMgr::getAppHasFocus(), LLControlGroup::getBOOL(), LLControlGroup::getF32(), LLAgent::getFlying(), LLControlGroup::getS32(), gFocusMgr, gFrameIntervalSeconds, gSavedSettings, i, JDS_INITIALIZED, llmax(), llmin(), mAxes, mBtn, mDriverState, mNdofDev, LLAgent::moveAt(), mPerfScale, mResetFlag, resetDeltas(), RX_I, RY_I, RZ_I, S32, sDelta, sLastDelta, X_I, Y_I, and Z_I.
Referenced by LLFloaterTools::onClose(), reset_view_final(), scanJoystick(), toggle_build_mode(), and toggleFlycam().
void LLViewerJoystick::moveFlycam | ( | bool | reset = false |
) |
Definition at line 723 of file llviewerjoystick.cpp.
References BUILDMODE_FLYCAM_T_SCALE, LLFocusMgr::getAppHasFocus(), LLControlGroup::getBOOL(), LLControlGroup::getF32(), LLSingleton< LLViewerCamera >::getInstance(), LLSingleton< LLToolMgr >::getInstance(), getJoystickAxis(), LLCoordFrame::getOrigin(), LLCoordFrame::getQuaternion(), LLControlGroup::getS32(), LLCamera::getView(), gFocusMgr, gFrameIntervalSeconds, gSavedSettings, i, LLToolMgr::inBuildMode(), JDS_INITIALIZED, llmax(), llmin(), mDriverState, LLMatrix3::mMatrix, mResetFlag, LLVector3::mV, LLCoordFrame::mXAxis, LLCoordFrame::mYAxis, LLCoordFrame::mZAxis, nlerp(), LLVector3::normVec(), LLMatrix3::orthogonalize(), resetDeltas(), S32, sDelta, LLCoordFrame::setOrigin(), LLMatrix3::setRows(), LLCamera::setView(), sLastDelta, X_I, Y_I, and Z_I.
Referenced by LLAppViewer::idle(), and toggleFlycam().
Definition at line 300 of file llviewerjoystick.cpp.
References mAxes.
Referenced by LLFloaterJoystick::draw(), and moveFlycam().
bool LLViewerJoystick::isJoystickInitialized | ( | ) | const [inline] |
Definition at line 67 of file llviewerjoystick.h.
References JDS_INITIALIZED, and mDriverState.
Referenced by LLFloaterJoystick::draw(), and isLikeSpaceNavigator().
bool LLViewerJoystick::isLikeSpaceNavigator | ( | ) | const |
Definition at line 945 of file llviewerjoystick.cpp.
References isJoystickInitialized(), and mNdofDev.
Referenced by init(), and updateEnabled().
void LLViewerJoystick::setNeedsReset | ( | bool | reset = true |
) | [inline] |
Definition at line 69 of file llviewerjoystick.h.
References mResetFlag.
Referenced by LLViewerWindow::handleActivateApp(), LLObjectEdit::handleEvent(), LLAppViewer::mainLoop(), and toggleFlycam().
void LLViewerJoystick::setCameraNeedsUpdate | ( | bool | b | ) | [inline] |
Definition at line 70 of file llviewerjoystick.h.
References mCameraUpdated.
Referenced by handleJoystickChanged(), LLViewerWindow::handleScanKey(), and toggleFlycam().
bool LLViewerJoystick::getCameraNeedsUpdate | ( | ) | const [inline] |
bool LLViewerJoystick::getOverrideCamera | ( | ) | [inline] |
Definition at line 72 of file llviewerjoystick.h.
References mOverrideCamera.
Referenced by LLPipeline::calcNearbyLights(), and LLViewCheckJoystickFlycam::handleEvent().
void LLViewerJoystick::setOverrideCamera | ( | bool | val | ) |
Definition at line 92 of file llviewerjoystick.cpp.
References FALSE, LLControlGroup::getBOOL(), gSavedSettings, and mOverrideCamera.
bool LLViewerJoystick::toggleFlycam | ( | ) |
Definition at line 872 of file llviewerjoystick.cpp.
References LLControlGroup::getBOOL(), LLSingleton< LLToolMgr >::getInstance(), gSavedSettings, moveAvatar(), moveFlycam(), mOverrideCamera, setCameraNeedsUpdate(), and setNeedsReset().
Referenced by handle_toggle_flycam(), and scanJoystick().
void LLViewerJoystick::setSNDefaults | ( | ) |
Definition at line 959 of file llviewerjoystick.cpp.
References gSavedSettings, kPlatformScale, llendl, llinfos, LLControlGroup::setBOOL(), LLControlGroup::setF32(), and LLControlGroup::setS32().
Referenced by init(), and LLFloaterJoystick::setSNDefaults().
std::string LLViewerJoystick::getDescription | ( | void | ) |
Definition at line 933 of file llviewerjoystick.cpp.
References JDS_INITIALIZED, ll_safe_string(), mDriverState, and mNdofDev.
Referenced by LLFloaterJoystick::draw().
void LLViewerJoystick::updateEnabled | ( | bool | autoenable | ) | [protected] |
Definition at line 73 of file llviewerjoystick.cpp.
References FALSE, LLControlGroup::getBOOL(), gSavedSettings, isLikeSpaceNavigator(), JDS_UNINITIALIZED, mDriverState, mOverrideCamera, LLControlGroup::setBOOL(), and TRUE.
Referenced by init().
void LLViewerJoystick::terminate | ( | ) | [protected] |
Definition at line 269 of file llviewerjoystick.cpp.
References llendl, and llinfos.
Referenced by ~LLViewerJoystick().
void LLViewerJoystick::agentSlide | ( | F32 | inc | ) | [protected] |
Definition at line 326 of file llviewerjoystick.cpp.
References gAgent, and LLAgent::moveLeft().
Referenced by moveAvatar().
void LLViewerJoystick::agentPush | ( | F32 | inc | ) | [protected] |
Definition at line 339 of file llviewerjoystick.cpp.
References gAgent, and LLAgent::moveAt().
Referenced by moveAvatar().
void LLViewerJoystick::agentFly | ( | F32 | inc | ) | [protected] |
Definition at line 352 of file llviewerjoystick.cpp.
References gAgent, LLAgent::getFlying(), LLAgent::moveUp(), and LLAgent::setFlying().
Referenced by moveAvatar().
Definition at line 373 of file llviewerjoystick.cpp.
References LLAgent::clampPitchToLimits(), gAgent, LLAgent::getLeftAxis(), LLAgent::getReferenceUpVector(), LLAgent::rotate(), and LLQuaternion::setQuat().
Referenced by moveAvatar().
void LLViewerJoystick::agentJump | ( | ) | [protected] |
Definition at line 320 of file llviewerjoystick.cpp.
References gAgent, and LLAgent::moveUp().
Referenced by moveAvatar().
void LLViewerJoystick::resetDeltas | ( | S32 | axis[], | |
bool | flycam_and_build = false | |||
) | [protected] |
Definition at line 384 of file llviewerjoystick.cpp.
References BUILDMODE_FLYCAM_T_SCALE, i, mAxes, mResetFlag, sDelta, sLastDelta, X_I, Y_I, and Z_I.
Referenced by moveAvatar(), moveFlycam(), and moveObjects().
F32 LLViewerJoystick::mAxes[6] [private] |
Definition at line 93 of file llviewerjoystick.h.
Referenced by getJoystickAxis(), LLViewerJoystick(), moveAvatar(), moveObjects(), resetDeltas(), and updateStatus().
long LLViewerJoystick::mBtn[16] [private] |
Definition at line 94 of file llviewerjoystick.h.
Referenced by getJoystickButton(), LLViewerJoystick(), moveAvatar(), scanJoystick(), and updateStatus().
Definition at line 95 of file llviewerjoystick.h.
Referenced by getDescription(), init(), isJoystickInitialized(), moveAvatar(), moveFlycam(), moveObjects(), scanJoystick(), updateEnabled(), and ~LLViewerJoystick().
NDOF_Device* LLViewerJoystick::mNdofDev [private] |
Definition at line 96 of file llviewerjoystick.h.
Referenced by getDescription(), init(), isLikeSpaceNavigator(), moveAvatar(), and updateStatus().
bool LLViewerJoystick::mResetFlag [private] |
Definition at line 97 of file llviewerjoystick.h.
Referenced by moveAvatar(), moveFlycam(), moveObjects(), resetDeltas(), and setNeedsReset().
F32 LLViewerJoystick::mPerfScale [private] |
Definition at line 98 of file llviewerjoystick.h.
Referenced by LLViewerJoystick(), and moveAvatar().
bool LLViewerJoystick::mCameraUpdated [private] |
Definition at line 99 of file llviewerjoystick.h.
Referenced by getCameraNeedsUpdate(), and setCameraNeedsUpdate().
bool LLViewerJoystick::mOverrideCamera [private] |
Definition at line 100 of file llviewerjoystick.h.
Referenced by getOverrideCamera(), scanJoystick(), setOverrideCamera(), toggleFlycam(), and updateEnabled().
F32 LLViewerJoystick::sLastDelta = {0,0,0,0,0,0,0} [static, private] |
Definition at line 102 of file llviewerjoystick.h.
Referenced by LLViewerJoystick(), moveAvatar(), moveFlycam(), moveObjects(), and resetDeltas().
F32 LLViewerJoystick::sDelta = {0,0,0,0,0,0,0} [static, private] |
Definition at line 103 of file llviewerjoystick.h.
Referenced by LLViewerJoystick(), moveAvatar(), moveFlycam(), moveObjects(), and resetDeltas().