mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-22 04:45:31 +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
|
|
@ -23,132 +23,132 @@ class PhysicsBody;
|
|||
|
||||
class OpenVRTrackedObjectData : public GameBaseData {
|
||||
public:
|
||||
typedef GameBaseData Parent;
|
||||
typedef GameBaseData Parent;
|
||||
|
||||
StringTableEntry mShapeFile;
|
||||
Resource<TSShape> mShape; ///< Torque model
|
||||
StringTableEntry mShapeFile;
|
||||
Resource<TSShape> mShape; ///< Torque model
|
||||
|
||||
Point3F mCollisionBoxMin;
|
||||
Point3F mCollisionBoxMax;
|
||||
Point3F mCollisionBoxMin;
|
||||
Point3F mCollisionBoxMax;
|
||||
|
||||
public:
|
||||
|
||||
OpenVRTrackedObjectData();
|
||||
~OpenVRTrackedObjectData();
|
||||
OpenVRTrackedObjectData();
|
||||
~OpenVRTrackedObjectData();
|
||||
|
||||
DECLARE_CONOBJECT(OpenVRTrackedObjectData);
|
||||
DECLARE_CONOBJECT(OpenVRTrackedObjectData);
|
||||
|
||||
bool onAdd();
|
||||
bool preload(bool server, String &errorStr);
|
||||
bool onAdd();
|
||||
bool preload(bool server, String &errorStr);
|
||||
|
||||
static void initPersistFields();
|
||||
static void initPersistFields();
|
||||
|
||||
virtual void packData(BitStream* stream);
|
||||
virtual void unpackData(BitStream* stream);
|
||||
virtual void packData(BitStream* stream);
|
||||
virtual void unpackData(BitStream* stream);
|
||||
};
|
||||
|
||||
/// Implements a GameObject which tracks an OpenVR controller
|
||||
class OpenVRTrackedObject : public GameBase
|
||||
{
|
||||
typedef GameBase Parent;
|
||||
typedef GameBase Parent;
|
||||
|
||||
enum MaskBits
|
||||
{
|
||||
UpdateMask = Parent::NextFreeMask << 0,
|
||||
NextFreeMask = Parent::NextFreeMask << 1
|
||||
};
|
||||
enum MaskBits
|
||||
{
|
||||
UpdateMask = Parent::NextFreeMask << 0,
|
||||
NextFreeMask = Parent::NextFreeMask << 1
|
||||
};
|
||||
|
||||
struct RenderModelSlot
|
||||
{
|
||||
StringTableEntry componentName; ///< Component name
|
||||
S16 mappedNodeIdx; ///< Mapped node idx in mShape
|
||||
OpenVRRenderModel *nativeModel; ///< Native model
|
||||
};
|
||||
struct RenderModelSlot
|
||||
{
|
||||
StringTableEntry componentName; ///< Component name
|
||||
S16 mappedNodeIdx; ///< Mapped node idx in mShape
|
||||
OpenVRRenderModel *nativeModel; ///< Native model
|
||||
};
|
||||
|
||||
OpenVRTrackedObjectData *mDataBlock;
|
||||
OpenVRTrackedObjectData *mDataBlock;
|
||||
|
||||
/// @name Rendering
|
||||
/// {
|
||||
TSShapeInstance *mShapeInstance; ///< Shape used to render controller (uses native model otherwise)
|
||||
StringTableEntry mModelName;
|
||||
OpenVRRenderModel *mBasicModel; ///< Basic model
|
||||
Vector<RenderModelSlot> mRenderComponents;
|
||||
/// }
|
||||
/// @name Rendering
|
||||
/// {
|
||||
TSShapeInstance *mShapeInstance; ///< Shape used to render controller (uses native model otherwise)
|
||||
StringTableEntry mModelName;
|
||||
OpenVRRenderModel *mBasicModel; ///< Basic model
|
||||
Vector<RenderModelSlot> mRenderComponents;
|
||||
/// }
|
||||
|
||||
S32 mDeviceIndex; ///< Controller idx in openvr (for direct updating)
|
||||
S32 mMappedMoveIndex; ///< Movemanager move index for rotation
|
||||
S32 mDeviceIndex; ///< Controller idx in openvr (for direct updating)
|
||||
S32 mMappedMoveIndex; ///< Movemanager move index for rotation
|
||||
|
||||
vr::VRControllerState_t mCurrentControllerState;
|
||||
vr::VRControllerState_t mPreviousControllerState;
|
||||
vr::VRControllerState_t mCurrentControllerState;
|
||||
vr::VRControllerState_t mPreviousControllerState;
|
||||
|
||||
IDevicePose mPose; ///< Current openvr pose data, or reconstructed data from the client
|
||||
IDevicePose mPose; ///< Current openvr pose data, or reconstructed data from the client
|
||||
|
||||
Convex* mConvexList;
|
||||
EarlyOutPolyList mClippedList;
|
||||
PhysicsBody *mPhysicsRep;
|
||||
Convex* mConvexList;
|
||||
EarlyOutPolyList mClippedList;
|
||||
PhysicsBody *mPhysicsRep;
|
||||
|
||||
SimObjectPtr<SceneObject> mCollisionObject; ///< Object we're currently colliding with
|
||||
SimObjectPtr<SceneObject> mInteractObject; ///< Object we've designated as important to interact with
|
||||
SimObjectPtr<SceneObject> mCollisionObject; ///< Object we're currently colliding with
|
||||
SimObjectPtr<SceneObject> mInteractObject; ///< Object we've designated as important to interact with
|
||||
|
||||
bool mHoldInteractedObject; ///< Performs pickup logic with mInteractObject
|
||||
bool mIgnoreParentRotation; ///< Ignores the rotation of the parent object
|
||||
bool mHoldInteractedObject; ///< Performs pickup logic with mInteractObject
|
||||
bool mIgnoreParentRotation; ///< Ignores the rotation of the parent object
|
||||
|
||||
static bool smDebugControllerPosition; ///< Shows latest controller position in DebugDrawer
|
||||
static bool smDebugControllerMovePosition; ///< Shows move position in DebugDrawer
|
||||
static U32 sServerCollisionMask;
|
||||
static U32 sClientCollisionMask;
|
||||
static bool smDebugControllerPosition; ///< Shows latest controller position in DebugDrawer
|
||||
static bool smDebugControllerMovePosition; ///< Shows move position in DebugDrawer
|
||||
static U32 sServerCollisionMask;
|
||||
static U32 sClientCollisionMask;
|
||||
|
||||
public:
|
||||
OpenVRTrackedObject();
|
||||
virtual ~OpenVRTrackedObject();
|
||||
OpenVRTrackedObject();
|
||||
virtual ~OpenVRTrackedObject();
|
||||
|
||||
void updateRenderData();
|
||||
void setupRenderDataFromModel(bool loadComponentModels);
|
||||
void updateRenderData();
|
||||
void setupRenderDataFromModel(bool loadComponentModels);
|
||||
|
||||
void clearRenderData();
|
||||
void clearRenderData();
|
||||
|
||||
DECLARE_CONOBJECT(OpenVRTrackedObject);
|
||||
DECLARE_CONOBJECT(OpenVRTrackedObject);
|
||||
|
||||
static void initPersistFields();
|
||||
static void initPersistFields();
|
||||
|
||||
virtual void inspectPostApply();
|
||||
virtual void inspectPostApply();
|
||||
|
||||
bool onAdd();
|
||||
void onRemove();
|
||||
bool onAdd();
|
||||
void onRemove();
|
||||
|
||||
|
||||
void _updatePhysics();
|
||||
bool onNewDataBlock(GameBaseData *dptr, bool reload);
|
||||
void _updatePhysics();
|
||||
bool onNewDataBlock(GameBaseData *dptr, bool reload);
|
||||
|
||||
void setInteractObject(SceneObject* object, bool holding);
|
||||
void setInteractObject(SceneObject* object, bool holding);
|
||||
|
||||
void setTransform(const MatrixF &mat);
|
||||
void setModelName(String &modelName);
|
||||
void setTransform(const MatrixF &mat);
|
||||
void setModelName(String &modelName);
|
||||
|
||||
U32 packUpdate(NetConnection *conn, U32 mask, BitStream *stream);
|
||||
void unpackUpdate(NetConnection *conn, BitStream *stream);
|
||||
void writePacketData(GameConnection *conn, BitStream *stream);
|
||||
void readPacketData(GameConnection *conn, BitStream *stream);
|
||||
U32 packUpdate(NetConnection *conn, U32 mask, BitStream *stream);
|
||||
void unpackUpdate(NetConnection *conn, BitStream *stream);
|
||||
void writePacketData(GameConnection *conn, BitStream *stream);
|
||||
void readPacketData(GameConnection *conn, BitStream *stream);
|
||||
|
||||
void prepRenderImage(SceneRenderState *state);
|
||||
void prepRenderImage(SceneRenderState *state);
|
||||
|
||||
MatrixF getTrackedTransform();
|
||||
MatrixF getLastTrackedTransform();
|
||||
MatrixF getBaseTrackingTransform();
|
||||
MatrixF getTrackedTransform();
|
||||
MatrixF getLastTrackedTransform();
|
||||
MatrixF getBaseTrackingTransform();
|
||||
|
||||
U32 getCollisionMask();
|
||||
void updateWorkingCollisionSet();
|
||||
U32 getCollisionMask();
|
||||
void updateWorkingCollisionSet();
|
||||
|
||||
// Time management
|
||||
void updateMove(const Move *move);
|
||||
void processTick(const Move *move);
|
||||
void interpolateTick(F32 delta);
|
||||
void advanceTime(F32 dt);
|
||||
// Time management
|
||||
void updateMove(const Move *move);
|
||||
void processTick(const Move *move);
|
||||
void interpolateTick(F32 delta);
|
||||
void advanceTime(F32 dt);
|
||||
|
||||
// Collision
|
||||
bool castRay(const Point3F &start, const Point3F &end, RayInfo* info);
|
||||
void buildConvex(const Box3F& box, Convex* convex);
|
||||
bool testObject(SceneObject* enter);
|
||||
// Collision
|
||||
bool castRay(const Point3F &start, const Point3F &end, RayInfo* info);
|
||||
void buildConvex(const Box3F& box, Convex* convex);
|
||||
bool testObject(SceneObject* enter);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue