History

Fix eyePosition so that lookatVectors point directly to eyes, even when looking at someone from above.

Mark Peng committed 13 years ago

Commit 0f1ac2b1 parent 4ce2a8a2 files · +7 −4Browse files

Showing the changes to interface/src/Application.cpp (1 of 2 files). Show all

Unified · Split

interface/src/Application.cpp+6−3
@@ -1953,10 +1953,13 @@ bool Application::isLookingAtOtherAvatar(glm::vec3& mouseRayOrigin, glm::vec3& m · 1952 unmodified lines
19531953 void Application::renderLookatIndicator(glm::vec3 pointOfInterest, Camera& whichCamera) {
19541954
19551955 const float DISTANCE_FROM_HEAD_SPHERE = 0.1f;
1956+ const float INDICATOR_RADIUS = 0.1f;
19561957 const float YELLOW[] = { 1.0f, 1.0f, 0.0f };
1958+ const int NUM_SEGMENTS = 30;
19571959 glm::vec3 haloOrigin(pointOfInterest.x, pointOfInterest.y + DISTANCE_FROM_HEAD_SPHERE, pointOfInterest.z);
19581960 glColor3f(YELLOW[0], YELLOW[1], YELLOW[2]);
1959− renderCircle(haloOrigin, 0.1f, glm::vec3(0.0f, 1.0f, 0.0f), 30);
1961+ glm::vec3 normalToFloor(0.0f, 1.0f, 0.0f);
1962+ renderCircle(haloOrigin, INDICATOR_RADIUS, normalToFloor, NUM_SEGMENTS);
19601963 }
19611964
19621965 void Application::update(float deltaTime) {
@@ -2003,7 +2006,7 @@ void Application::update(float deltaTime) { · 40 unmodified lines
20032006 glm::vec3 front = orientation * IDENTITY_FRONT;
20042007 glm::vec3 up = orientation * IDENTITY_UP;
20052008 glm::vec3 towardVoxel = getMouseVoxelWorldCoordinates(_mouseVoxelDragging)
2006− - _myAvatar.getCameraPosition(); // is this an error? getCameraPosition dne
2009+ - _myAvatar.getCameraPosition();
20072010 towardVoxel = front * glm::length(towardVoxel);
20082011 glm::vec3 lateralToVoxel = glm::cross(up, glm::normalize(towardVoxel)) * glm::length(towardVoxel);
20092012 _voxelThrust = glm::vec3(0, 0, 0);
@@ -2276,7 +2279,7 @@ void Application::updateAvatar(float deltaTime) { · 266 unmodified lines
22762279 // actually need to calculate the view frustum planes to send these details
22772280 // to the server.
22782281 loadViewFrustum(_myCamera, _viewFrustum);
2279− _myAvatar.setCameraPosition(_viewFrustum.getPosition()); // setCameraPosition() dne
2282+ _myAvatar.setCameraPosition(_viewFrustum.getPosition());
22802283 _myAvatar.setCameraOrientation(_viewFrustum.getOrientation());
22812284 _myAvatar.setCameraFov(_viewFrustum.getFieldOfView());
22822285 _myAvatar.setCameraAspectRatio(_viewFrustum.getAspectRatio());

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t