diff options
author | Brad Davis <[email protected]> | 2014-10-24 12:56:30 -0700 |
---|---|---|
committer | Brad Davis <[email protected]> | 2014-10-24 12:56:30 -0700 |
commit | 496894ecced1b0a4ae5ab176902bbd0f43a31ed1 (patch) | |
tree | 8b7d4be1fc8508253d399d98da6143212ceb8f3c /Samples/OculusWorldDemo/Player.h | |
parent | 911239601768bacf9420ab9cfeffed7e861844ac (diff) |
Updating to 0.4.3 SDK0.4.3-official
Diffstat (limited to 'Samples/OculusWorldDemo/Player.h')
-rw-r--r-- | Samples/OculusWorldDemo/Player.h | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/Samples/OculusWorldDemo/Player.h b/Samples/OculusWorldDemo/Player.h index 621af02..feae150 100644 --- a/Samples/OculusWorldDemo/Player.h +++ b/Samples/OculusWorldDemo/Player.h @@ -52,40 +52,45 @@ const float RailHeight = 0.8f; class Player { public: - - float UserEyeHeight; - - // Where the avatar coordinate system (and body) is positioned and oriented in the virtual world - // Modified by gamepad/mouse input - Vector3f BodyPos; - Anglef BodyYaw; - - // Where the player head is positioned and oriented in the real world - Posef HeadPose; - // Where the avatar head is positioned and oriented in the virtual world Vector3f GetPosition(); Quatf GetOrientation(bool baseOnly = false); // Returns virtual world position based on a real world head pose. // Allows predicting eyes separately based on scanout time. - Posef VirtualWorldTransformfromRealPose(const Posef &sensorHeadPose); + Posef VirtualWorldTransformfromRealPose(const Posef &sensorHeadPose); // Handle directional movement. Returns 'true' if movement was processed. bool HandleMoveKey(OVR::KeyCode key, bool down); + void HandleMovement(double dt, Array<Ptr<CollisionModel> >* collisionModels, + Array<Ptr<CollisionModel> >* groundCollisionModels, bool shiftDown); + + float GetScaledEyeHeight() { return UserEyeHeight * HeightScale; } + + Player(); + ~Player(); + +public: + // User parameters + float UserEyeHeight; + float HeightScale; + + // Where the avatar coordinate system (and body) is positioned and oriented in the virtual world + // Modified by gamepad/mouse input + Vector3f BodyPos; + Anglef BodyYaw; + + // Where the player head is positioned and oriented in the real world + Posef HeadPose; + // Movement state; different bits may be set based on the state of keys. - uint8_t MoveForward; - uint8_t MoveBack; - uint8_t MoveLeft; - uint8_t MoveRight; - Vector3f GamepadMove, GamepadRotate; - bool bMotionRelativeToBody; - - Player(); - ~Player(); - void HandleMovement(double dt, Array<Ptr<CollisionModel> >* collisionModels, - Array<Ptr<CollisionModel> >* groundCollisionModels, bool shiftDown); + uint8_t MoveForward; + uint8_t MoveBack; + uint8_t MoveLeft; + uint8_t MoveRight; + Vector3f GamepadMove, GamepadRotate; + bool bMotionRelativeToBody; }; #endif |