mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 07:04:36 +00:00
Tidy up indentation in openvr changes
This commit is contained in:
parent
e6159a590a
commit
212ac36cc1
25 changed files with 2171 additions and 2172 deletions
|
|
@ -36,17 +36,17 @@ void ExtendedMoveManager::init()
|
|||
dSprintf(varName, sizeof(varName), "mvPosX%d", i);
|
||||
Con::addVariable(varName, TypeF32, &mPosX[i],
|
||||
"X position of controller in millimeters. Only 13 bits are networked.\n"
|
||||
"@ingroup Game");
|
||||
"@ingroup Game");
|
||||
|
||||
dSprintf(varName, sizeof(varName), "mvPosY%d", i);
|
||||
Con::addVariable(varName, TypeF32, &mPosY[i],
|
||||
"Y position of controller in millimeters. Only 13 bits are networked.\n"
|
||||
"@ingroup Game");
|
||||
"@ingroup Game");
|
||||
|
||||
dSprintf(varName, sizeof(varName), "mvPosZ%d", i);
|
||||
Con::addVariable(varName, TypeF32, &mPosZ[i],
|
||||
"Z position of controller in millimeters. Only 13 bits are networked.\n"
|
||||
"@ingroup Game");
|
||||
"@ingroup Game");
|
||||
|
||||
dSprintf(varName, sizeof(varName), "mvRotIsEuler%d", i);
|
||||
Con::addVariable(varName, TypeBool, &mRotIsEuler[i],
|
||||
|
|
@ -55,33 +55,33 @@ void ExtendedMoveManager::init()
|
|||
"(a vector and angle). When true, the given rotation is a three component "
|
||||
"Euler angle. When using Euler angles, the $mvRotA component of the ExtendedMove "
|
||||
"is ignored for this set of rotations.\n"
|
||||
"@ingroup Game");
|
||||
"@ingroup Game");
|
||||
|
||||
dSprintf(varName, sizeof(varName), "mvRotX%d", i);
|
||||
Con::addVariable(varName, TypeF32, &mRotAX[i],
|
||||
"X rotation vector component of controller.\n"
|
||||
"@ingroup Game");
|
||||
"@ingroup Game");
|
||||
|
||||
dSprintf(varName, sizeof(varName), "mvRotY%d", i);
|
||||
Con::addVariable(varName, TypeF32, &mRotAY[i],
|
||||
"Y rotation vector component of controller.\n"
|
||||
"@ingroup Game");
|
||||
"@ingroup Game");
|
||||
|
||||
dSprintf(varName, sizeof(varName), "mvRotZ%d", i);
|
||||
Con::addVariable(varName, TypeF32, &mRotAZ[i],
|
||||
"Z rotation vector component of controller.\n"
|
||||
"@ingroup Game");
|
||||
"@ingroup Game");
|
||||
|
||||
dSprintf(varName, sizeof(varName), "mvRotA%d", i);
|
||||
Con::addVariable(varName, TypeF32, &mRotAA[i],
|
||||
"Angle rotation (in degrees) component of controller.\n"
|
||||
"@ingroup Game");
|
||||
"@ingroup Game");
|
||||
}
|
||||
|
||||
Con::addVariable("mvPosScale", TypeF32, &mPosScale,
|
||||
"@brief Indicates the scale to be given to mvPos values.\n\n"
|
||||
""
|
||||
"@ingroup Game");
|
||||
"@brief Indicates the scale to be given to mvPos values.\n\n"
|
||||
""
|
||||
"@ingroup Game");
|
||||
}
|
||||
|
||||
const ExtendedMove NullExtendedMove;
|
||||
|
|
@ -293,7 +293,7 @@ void ExtendedMove::clamp()
|
|||
crotW[i] = CLAMPROT(rotW[i] / M_2PI_F);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_CONTROLLER_MOVE
|
||||
#ifdef DEBUG_CONTROLLER_MOVE
|
||||
if (i == 1)
|
||||
{
|
||||
F32 x, y, z, a;
|
||||
|
|
@ -302,14 +302,14 @@ void ExtendedMove::clamp()
|
|||
z = UNCLAMPPOS(crotZ[i]);
|
||||
a = UNCLAMPROT(crotW[i]) * M_2PI_F;
|
||||
|
||||
Con::printf("INPUT POS == %f,%f,%f", ExtendedMoveManager::mPosX[i], ExtendedMoveManager::mPosY[i], ExtendedMoveManager::mPosZ[i]);
|
||||
Con::printf("INPUT POS == %f,%f,%f", ExtendedMoveManager::mPosX[i], ExtendedMoveManager::mPosY[i], ExtendedMoveManager::mPosZ[i]);
|
||||
Con::printf("rot %f,%f,%f,%f clamped to %f,%f,%f,%f", rotX[i], rotY[i], rotZ[i], rotW[i], x,y,z,a);
|
||||
x = UNCLAMPPOS(cposX[i]) * ExtendedMoveManager::mPosScale;
|
||||
y = UNCLAMPPOS(cposX[i]) * ExtendedMoveManager::mPosScale;
|
||||
z = UNCLAMPPOS(cposX[i]) * ExtendedMoveManager::mPosScale;
|
||||
Con::printf("pos %f,%f,%f clamped to %f,%f,%f", posX[i], posY[i], posZ[i], x, y, z);
|
||||
x = UNCLAMPPOS(cposX[i]) * ExtendedMoveManager::mPosScale;
|
||||
y = UNCLAMPPOS(cposX[i]) * ExtendedMoveManager::mPosScale;
|
||||
z = UNCLAMPPOS(cposX[i]) * ExtendedMoveManager::mPosScale;
|
||||
Con::printf("pos %f,%f,%f clamped to %f,%f,%f", posX[i], posY[i], posZ[i], x, y, z);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
// Perform the standard Move clamp
|
||||
|
|
|
|||
|
|
@ -469,8 +469,8 @@ bool GameConnection::readConnectRequest(BitStream *stream, const char **errorStr
|
|||
|
||||
for(U32 i = 0; i < mConnectArgc+3; i++)
|
||||
{
|
||||
connectArgv[i].value = &connectArgvValue[i];
|
||||
connectArgvValue[i].init();
|
||||
connectArgv[i].value = &connectArgvValue[i];
|
||||
connectArgvValue[i].init();
|
||||
}
|
||||
|
||||
for(U32 i = 0; i < mConnectArgc; i++)
|
||||
|
|
@ -683,20 +683,20 @@ bool GameConnection::getControlCameraTransform(F32 dt, MatrixF* mat)
|
|||
|
||||
bool GameConnection::getControlCameraHeadTransform(IDisplayDevice *display, MatrixF *transform)
|
||||
{
|
||||
GameBase* obj = getCameraObject();
|
||||
if (!obj)
|
||||
return false;
|
||||
GameBase* obj = getCameraObject();
|
||||
if (!obj)
|
||||
return false;
|
||||
|
||||
GameBase* cObj = obj;
|
||||
while ((cObj = cObj->getControlObject()) != 0)
|
||||
{
|
||||
if (cObj->useObjsEyePoint())
|
||||
obj = cObj;
|
||||
}
|
||||
GameBase* cObj = obj;
|
||||
while ((cObj = cObj->getControlObject()) != 0)
|
||||
{
|
||||
if (cObj->useObjsEyePoint())
|
||||
obj = cObj;
|
||||
}
|
||||
|
||||
obj->getEyeCameraTransform(display, -1, transform);
|
||||
obj->getEyeCameraTransform(display, -1, transform);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GameConnection::getControlCameraEyeTransforms(IDisplayDevice *display, MatrixF *transforms)
|
||||
|
|
@ -914,8 +914,8 @@ void GameConnection::onRemove()
|
|||
// clientgroup and what not (this is so that we can disconnect from a local server
|
||||
// without needing to destroy and recreate the server before we can connect to it
|
||||
// again).
|
||||
// Safe-delete as we don't know whether the server connection is currently being
|
||||
// worked on.
|
||||
// Safe-delete as we don't know whether the server connection is currently being
|
||||
// worked on.
|
||||
getRemoteConnection()->safeDeleteObject();
|
||||
setRemoteConnectionObject(NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1783,7 +1783,7 @@ void Player::onRemove()
|
|||
mWorkingQueryBox.minExtents.set(-1e9f, -1e9f, -1e9f);
|
||||
mWorkingQueryBox.maxExtents.set(-1e9f, -1e9f, -1e9f);
|
||||
|
||||
SAFE_DELETE( mPhysicsRep );
|
||||
SAFE_DELETE( mPhysicsRep );
|
||||
|
||||
Parent::onRemove();
|
||||
}
|
||||
|
|
@ -2505,12 +2505,12 @@ void Player::updateMove(const Move* move)
|
|||
#ifdef TORQUE_OPENVR
|
||||
if (mControllers[0])
|
||||
{
|
||||
mControllers[0]->processTick(move);
|
||||
mControllers[0]->processTick(move);
|
||||
}
|
||||
|
||||
if (mControllers[1])
|
||||
{
|
||||
mControllers[1]->processTick(move);
|
||||
mControllers[1]->processTick(move);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -3337,9 +3337,9 @@ bool Player::canCrouch()
|
|||
if ( mDataBlock->actionList[PlayerData::CrouchRootAnim].sequence == -1 )
|
||||
return false;
|
||||
|
||||
// We are already in this pose, so don't test it again...
|
||||
if ( mPose == CrouchPose )
|
||||
return true;
|
||||
// We are already in this pose, so don't test it again...
|
||||
if ( mPose == CrouchPose )
|
||||
return true;
|
||||
|
||||
// Do standard Torque physics test here!
|
||||
if ( !mPhysicsRep )
|
||||
|
|
@ -3389,8 +3389,8 @@ bool Player::canStand()
|
|||
return false;
|
||||
|
||||
// We are already in this pose, so don't test it again...
|
||||
if ( mPose == StandPose )
|
||||
return true;
|
||||
if ( mPose == StandPose )
|
||||
return true;
|
||||
|
||||
// Do standard Torque physics test here!
|
||||
if ( !mPhysicsRep )
|
||||
|
|
@ -3453,9 +3453,9 @@ bool Player::canProne()
|
|||
if ( !mPhysicsRep )
|
||||
return true;
|
||||
|
||||
// We are already in this pose, so don't test it again...
|
||||
if ( mPose == PronePose )
|
||||
return true;
|
||||
// We are already in this pose, so don't test it again...
|
||||
if ( mPose == PronePose )
|
||||
return true;
|
||||
|
||||
return mPhysicsRep->testSpacials( getPosition(), mDataBlock->proneBoxSize );
|
||||
}
|
||||
|
|
@ -3652,7 +3652,7 @@ MatrixF * Player::Death::fallToGround(F32 dt, const Point3F& loc, F32 curZ, F32
|
|||
normal.normalize();
|
||||
mat.set(EulerF (0.0f, 0.0f, curZ));
|
||||
mat.mulV(upY, & ahead);
|
||||
mCross(ahead, normal, &sideVec);
|
||||
mCross(ahead, normal, &sideVec);
|
||||
sideVec.normalize();
|
||||
mCross(normal, sideVec, &ahead);
|
||||
|
||||
|
|
@ -5846,7 +5846,7 @@ F32 Player::getSpeed() const
|
|||
|
||||
void Player::setVelocity(const VectorF& vel)
|
||||
{
|
||||
AssertFatal( !mIsNaN( vel ), "Player::setVelocity() - The velocity is NaN!" );
|
||||
AssertFatal( !mIsNaN( vel ), "Player::setVelocity() - The velocity is NaN!" );
|
||||
|
||||
mVelocity = vel;
|
||||
setMaskBits(MoveMask);
|
||||
|
|
@ -5854,7 +5854,7 @@ void Player::setVelocity(const VectorF& vel)
|
|||
|
||||
void Player::applyImpulse(const Point3F&,const VectorF& vec)
|
||||
{
|
||||
AssertFatal( !mIsNaN( vec ), "Player::applyImpulse() - The vector is NaN!" );
|
||||
AssertFatal( !mIsNaN( vec ), "Player::applyImpulse() - The vector is NaN!" );
|
||||
|
||||
// Players ignore angular velocity
|
||||
VectorF vel;
|
||||
|
|
@ -6202,7 +6202,7 @@ U32 Player::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
|
|||
stream->writeFlag(mSwimming);
|
||||
stream->writeFlag(mJetting);
|
||||
stream->writeInt(mPose, NumPoseBits);
|
||||
|
||||
|
||||
stream->writeInt(mState,NumStateBits);
|
||||
if (stream->writeFlag(mState == RecoverState))
|
||||
stream->writeInt(mRecoverTicks,PlayerData::RecoverDelayBits);
|
||||
|
|
@ -6303,7 +6303,7 @@ void Player::unpackUpdate(NetConnection *con, BitStream *stream)
|
|||
mSwimming = stream->readFlag();
|
||||
mJetting = stream->readFlag();
|
||||
mPose = (Pose)(stream->readInt(NumPoseBits));
|
||||
|
||||
|
||||
ActionState actionState = (ActionState)stream->readInt(NumStateBits);
|
||||
if (stream->readFlag()) {
|
||||
mRecoverTicks = stream->readInt(PlayerData::RecoverDelayBits);
|
||||
|
|
@ -7174,34 +7174,34 @@ void Player::renderConvex( ObjectRenderInst *ri, SceneRenderState *state, BaseMa
|
|||
#ifdef TORQUE_OPENVR
|
||||
void Player::setControllers(Vector<OpenVRTrackedObject*> controllerList)
|
||||
{
|
||||
mControllers[0] = controllerList.size() > 0 ? controllerList[0] : NULL;
|
||||
mControllers[1] = controllerList.size() > 1 ? controllerList[1] : NULL;
|
||||
mControllers[0] = controllerList.size() > 0 ? controllerList[0] : NULL;
|
||||
mControllers[1] = controllerList.size() > 1 ? controllerList[1] : NULL;
|
||||
}
|
||||
|
||||
ConsoleMethod(Player, setVRControllers, void, 4, 4, "")
|
||||
{
|
||||
OpenVRTrackedObject *controllerL, *controllerR;
|
||||
Vector<OpenVRTrackedObject*> list;
|
||||
OpenVRTrackedObject *controllerL, *controllerR;
|
||||
Vector<OpenVRTrackedObject*> list;
|
||||
|
||||
if (Sim::findObject(argv[2], controllerL))
|
||||
{
|
||||
list.push_back(controllerL);
|
||||
}
|
||||
else
|
||||
{
|
||||
list.push_back(NULL);
|
||||
}
|
||||
if (Sim::findObject(argv[2], controllerL))
|
||||
{
|
||||
list.push_back(controllerL);
|
||||
}
|
||||
else
|
||||
{
|
||||
list.push_back(NULL);
|
||||
}
|
||||
|
||||
if (Sim::findObject(argv[3], controllerR))
|
||||
{
|
||||
list.push_back(controllerR);
|
||||
}
|
||||
else
|
||||
{
|
||||
list.push_back(NULL);
|
||||
}
|
||||
if (Sim::findObject(argv[3], controllerR))
|
||||
{
|
||||
list.push_back(controllerR);
|
||||
}
|
||||
else
|
||||
{
|
||||
list.push_back(NULL);
|
||||
}
|
||||
|
||||
object->setControllers(list);
|
||||
object->setControllers(list);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue