From d0461e36f1caeedbf5775460412766b2f4c6f24a Mon Sep 17 00:00:00 2001 From: atlante45 Date: Wed, 7 Aug 2013 14:16:49 -0700 Subject: [PATCH 1/2] Fix no collision when offset camera on from the beginning --- interface/src/Camera.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/src/Camera.cpp b/interface/src/Camera.cpp index 3fdb401751..a91dfdce6c 100644 --- a/interface/src/Camera.cpp +++ b/interface/src/Camera.cpp @@ -37,7 +37,8 @@ Camera::Camera() { _linearModeShift = 0.0f; _mode = CAMERA_MODE_THIRD_PERSON; _tightness = 10.0f; // default - _fieldOfView = HORIZONTAL_FIELD_OF_VIEW_DEGREES; + _fieldOfView = HORIZONTAL_FIELD_OF_VIEW_DEGREES; + _aspectRatio = 16.f/9.f; _nearClip = 0.08f; // default _farClip = 50.0f * TREE_SCALE; // default _upShift = 0.0f; From 81446f13d58cbf3ea6c1be302eb42f819f5ed1e9 Mon Sep 17 00:00:00 2001 From: atlante45 Date: Wed, 7 Aug 2013 14:18:02 -0700 Subject: [PATCH 2/2] Fix head not colliding with voxels and environement --- interface/src/avatar/Avatar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 93a2d05c52..f425ffefbc 100755 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -991,7 +991,7 @@ void Avatar::updateCollisionWithEnvironment(float deltaTime) { glm::vec3 penetration; if (Application::getInstance()->getEnvironment()->findCapsulePenetration( _position - up * (_pelvisFloatingHeight - radius), - _position + up * (_height - _pelvisFloatingHeight - radius), radius, penetration)) { + _position + up * (_height - _pelvisFloatingHeight + radius), radius, penetration)) { _lastCollisionPosition = _position; updateCollisionSound(penetration, deltaTime, ENVIRONMENT_COLLISION_FREQUENCY); applyHardCollision(penetration, ENVIRONMENT_SURFACE_ELASTICITY, ENVIRONMENT_SURFACE_DAMPING); @@ -1007,7 +1007,7 @@ void Avatar::updateCollisionWithVoxels(float deltaTime) { glm::vec3 penetration; if (Application::getInstance()->getVoxels()->findCapsulePenetration( _position - glm::vec3(0.0f, _pelvisFloatingHeight - radius, 0.0f), - _position + glm::vec3(0.0f, _height - _pelvisFloatingHeight - radius, 0.0f), radius, penetration)) { + _position + glm::vec3(0.0f, _height - _pelvisFloatingHeight + radius, 0.0f), radius, penetration)) { _lastCollisionPosition = _position; updateCollisionSound(penetration, deltaTime, VOXEL_COLLISION_FREQUENCY); applyHardCollision(penetration, VOXEL_ELASTICITY, VOXEL_DAMPING);