From 165342bcc3c8c90f7dab5a40708b3de487d27bf6 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 22 Aug 2013 10:35:21 -0700 Subject: [PATCH 1/6] Have the local avatar glow when moving. --- interface/src/OculusManager.cpp | 1 - interface/src/avatar/Avatar.cpp | 16 +++++++++++++++- interface/src/renderer/GlowEffect.cpp | 8 +++++--- interface/src/renderer/GlowEffect.h | 4 ++++ 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/interface/src/OculusManager.cpp b/interface/src/OculusManager.cpp index 046e1684fb..17775b9f9c 100644 --- a/interface/src/OculusManager.cpp +++ b/interface/src/OculusManager.cpp @@ -46,7 +46,6 @@ void OculusManager::updateYawOffset() { } void OculusManager::getEulerAngles(float& yaw, float& pitch, float& roll) { - yaw = pitch = roll = 0.0f; #ifdef __APPLE__ _sensorFusion.GetOrientation().GetEulerAngles(&yaw, &pitch, &roll); diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 7cd3e4d7c8..91e8d97c82 100755 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -1477,7 +1477,17 @@ void Avatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) { if (isMyAvatar() && Application::getInstance()->getCamera()->getMode() == CAMERA_MODE_FIRST_PERSON) { // Dont display body - } else if (_head.getFace().isFullFrame()) { + return; + } + + // glow when moving + const float MIN_GLOW_SPEED = 0.01f; + bool glowing = _speed > MIN_GLOW_SPEED; + if (glowing) { + Application::getInstance()->getGlowEffect()->begin(); + } + + if (_head.getFace().isFullFrame()) { // Render the full-frame video float alpha = getBallRenderAlpha(BODY_BALL_HEAD_BASE, lookingInMirror); if (alpha > 0.0f) { @@ -1558,6 +1568,10 @@ void Avatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) { } } _hand.render(lookingInMirror); + + if (glowing) { + Application::getInstance()->getGlowEffect()->end(); + } } diff --git a/interface/src/renderer/GlowEffect.cpp b/interface/src/renderer/GlowEffect.cpp index e35896c975..782bda2a06 100644 --- a/interface/src/renderer/GlowEffect.cpp +++ b/interface/src/renderer/GlowEffect.cpp @@ -15,7 +15,7 @@ #include "ProgramObject.h" #include "RenderUtil.h" -GlowEffect::GlowEffect() : _renderMode(DIFFUSE_ADD_MODE), _isOddFrame(false) { +GlowEffect::GlowEffect() : _renderMode(DIFFUSE_ADD_MODE), _isOddFrame(false), _intensity(0.0f) { } QOpenGLFramebufferObject* GlowEffect::getFreeFramebufferObject() const { @@ -70,12 +70,14 @@ void GlowEffect::prepare() { } void GlowEffect::begin(float intensity) { - glBlendColor(0.0f, 0.0f, 0.0f, intensity); + // store the current intensity and add the new amount + _intensityStack.push(_intensity); + glBlendColor(0.0f, 0.0f, 0.0f, _intensity += intensity); _isEmpty = false; } void GlowEffect::end() { - glBlendColor(0.0f, 0.0f, 0.0f, 0.0f); + glBlendColor(0.0f, 0.0f, 0.0f, _intensity = _intensityStack.pop()); } static void maybeBind(QOpenGLFramebufferObject* fbo) { diff --git a/interface/src/renderer/GlowEffect.h b/interface/src/renderer/GlowEffect.h index 2cf1efe9d7..81acd0c108 100644 --- a/interface/src/renderer/GlowEffect.h +++ b/interface/src/renderer/GlowEffect.h @@ -10,6 +10,7 @@ #define __interface__GlowEffect__ #include +#include class QOpenGLFramebufferObject; @@ -63,6 +64,9 @@ private: bool _isEmpty; ///< set when nothing in the scene is currently glowing bool _isOddFrame; ///< controls the alternation between texture targets in diffuse add mode + + float _intensity; + QStack _intensityStack; }; #endif /* defined(__interface__GlowEffect__) */ From 7da9556815a9df4a90167a88b6e58e4ac1de5a5f Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 22 Aug 2013 11:23:28 -0700 Subject: [PATCH 2/6] Glow when moving. --- interface/src/avatar/Avatar.cpp | 15 ++++++++++++++- interface/src/avatar/Avatar.h | 4 ++++ interface/src/avatar/MyAvatar.cpp | 14 ++++++++++++-- interface/src/renderer/GlowEffect.cpp | 12 +++++++++++- interface/src/renderer/GlowEffect.h | 8 ++++++++ 5 files changed, 49 insertions(+), 4 deletions(-) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 5f206fb6ed..39ce97c8eb 100755 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -105,7 +105,8 @@ Avatar::Avatar(Node* owningNode) : _initialized(false), _handHoldingPosition(0.0f, 0.0f, 0.0f), _maxArmLength(0.0f), - _pelvisStandingHeight(0.0f) + _pelvisStandingHeight(0.0f), + _moving(false) { // give the pointer to our head to inherited _headData variable from AvatarData _headData = &_head; @@ -695,6 +696,10 @@ float Avatar::getBallRenderAlpha(int ball, bool lookingInMirror) const { } void Avatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) { + + // glow when moving + Glower glower(_moving ? 1.0f : 0.0f); + if (_head.getFace().isFullFrame()) { // Render the full-frame video float alpha = getBallRenderAlpha(BODY_BALL_HEAD_BASE, lookingInMirror); @@ -793,6 +798,14 @@ void Avatar::getBodyBallTransform(AvatarJointID jointID, glm::vec3& position, gl rotation = _bodyBall[jointID].rotation; } +int Avatar::parseData(unsigned char* sourceBuffer, int numBytes) { + // change in position implies movement + glm::vec3 oldPosition = _position; + AvatarData::parseData(sourceBuffer, numBytes); + const float MOVE_DISTANCE_THRESHOLD = 0.001f; + _moving = glm::distance(oldPosition, _position) > MOVE_DISTANCE_THRESHOLD; +} + void Avatar::saveData(QSettings* set) { set->beginGroup("Avatar"); diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index eb7a7851d0..4048f15d0f 100755 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -164,6 +164,8 @@ public: // Get the position/rotation of a single body ball void getBodyBallTransform(AvatarJointID jointID, glm::vec3& position, glm::quat& rotation) const; + virtual int parseData(unsigned char* sourceBuffer, int numBytes); + static void renderJointConnectingCone(glm::vec3 position1, glm::vec3 position2, float radius1, float radius2); public slots: @@ -219,6 +221,8 @@ protected: float _stringLength; AvatarVoxelSystem _voxels; + bool _moving; ///< set when position is changing + // protected methods... glm::vec3 getBodyRightDirection() const { return getOrientation() * IDENTITY_RIGHT; } glm::vec3 getBodyUpDirection() const { return getOrientation() * IDENTITY_UP; } diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 00898da333..175b38378d 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -318,6 +318,10 @@ void MyAvatar::simulate(float deltaTime, Transmitter* transmitter, float gyroCam _mode = AVATAR_MODE_INTERACTING; } + // update moving flag based on speed + const float MOVING_SPEED_THRESHOLD = 0.01f; + _moving = _speed > MOVING_SPEED_THRESHOLD; + // update position by velocity, and subtract the change added earlier for gravity _position += _velocity * deltaTime; @@ -511,7 +515,13 @@ void MyAvatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) { if (Application::getInstance()->getCamera()->getMode() == CAMERA_MODE_FIRST_PERSON) { // Dont display body - } else if (_head.getFace().isFullFrame()) { + return; + } + + // glow when moving + Glower glower(_moving ? 1.0f : 0.0f); + + if (_head.getFace().isFullFrame()) { // Render the full-frame video float alpha = getBallRenderAlpha(BODY_BALL_HEAD_BASE, lookingInMirror); if (alpha > 0.0f) { @@ -1032,4 +1042,4 @@ void MyAvatar::setOrientation(const glm::quat& orientation) { void MyAvatar::setNewScale(const float scale) { _newScale = scale; -} \ No newline at end of file +} diff --git a/interface/src/renderer/GlowEffect.cpp b/interface/src/renderer/GlowEffect.cpp index 782bda2a06..24936b85d3 100644 --- a/interface/src/renderer/GlowEffect.cpp +++ b/interface/src/renderer/GlowEffect.cpp @@ -73,10 +73,11 @@ void GlowEffect::begin(float intensity) { // store the current intensity and add the new amount _intensityStack.push(_intensity); glBlendColor(0.0f, 0.0f, 0.0f, _intensity += intensity); - _isEmpty = false; + _isEmpty &= (_intensity == 0.0f); } void GlowEffect::end() { + // restore the saved intensity glBlendColor(0.0f, 0.0f, 0.0f, _intensity = _intensityStack.pop()); } @@ -270,3 +271,12 @@ void GlowEffect::cycleRenderMode() { break; } } + +Glower::Glower(float amount) { + Application::getInstance()->getGlowEffect()->begin(amount); +} + +Glower::~Glower() { + Application::getInstance()->getGlowEffect()->end(); +} + diff --git a/interface/src/renderer/GlowEffect.h b/interface/src/renderer/GlowEffect.h index 81acd0c108..37765d18ba 100644 --- a/interface/src/renderer/GlowEffect.h +++ b/interface/src/renderer/GlowEffect.h @@ -69,4 +69,12 @@ private: QStack _intensityStack; }; +/// RAII-style glow handler. Applies glow when in scope. +class Glower { +public: + + Glower(float amount = 1.0f); + ~Glower(); +}; + #endif /* defined(__interface__GlowEffect__) */ From 2eaaee673f9e9c1dc0f2c71843d6c68e885bbe77 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 22 Aug 2013 13:52:10 -0700 Subject: [PATCH 3/6] Argh, forgot to return the result of the superclass implementation. --- interface/src/avatar/Avatar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 39ce97c8eb..08533666f3 100755 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -801,9 +801,10 @@ void Avatar::getBodyBallTransform(AvatarJointID jointID, glm::vec3& position, gl int Avatar::parseData(unsigned char* sourceBuffer, int numBytes) { // change in position implies movement glm::vec3 oldPosition = _position; - AvatarData::parseData(sourceBuffer, numBytes); + int bytesRead = AvatarData::parseData(sourceBuffer, numBytes); const float MOVE_DISTANCE_THRESHOLD = 0.001f; _moving = glm::distance(oldPosition, _position) > MOVE_DISTANCE_THRESHOLD; + return bytesRead; } void Avatar::saveData(QSettings* set) { From 3dfefefeae9a74e0352bed5701f27c81125a7923 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 22 Aug 2013 14:00:50 -0700 Subject: [PATCH 4/6] Make the surrounding spheres glow when moving, too. --- interface/src/avatar/Avatar.cpp | 36 +++++++++++++++++---------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 08533666f3..9f2ac37518 100755 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -486,22 +486,27 @@ void Avatar::render(bool lookingInMirror, bool renderAvatarBalls) { // render a simple round on the ground projected down from the avatar's position renderDiskShadow(_position, glm::vec3(0.0f, 1.0f, 0.0f), _scale * 0.1f, 0.2f); - // render body - renderBody(lookingInMirror, renderAvatarBalls); + { + // glow when moving + Glower glower(_moving ? 1.0f : 0.0f); + + // render body + renderBody(lookingInMirror, renderAvatarBalls); - // render sphere when far away - const float MAX_ANGLE = 10.f; - glm::vec3 toTarget = _position - Application::getInstance()->getAvatar()->getPosition(); - glm::vec3 delta = _height * (_head.getCameraOrientation() * IDENTITY_UP) / 2.f; - float angle = abs(angleBetween(toTarget + delta, toTarget - delta)); + // render sphere when far away + const float MAX_ANGLE = 10.f; + glm::vec3 toTarget = _position - Application::getInstance()->getAvatar()->getPosition(); + glm::vec3 delta = _height * (_head.getCameraOrientation() * IDENTITY_UP) / 2.f; + float angle = abs(angleBetween(toTarget + delta, toTarget - delta)); - if (angle < MAX_ANGLE) { - glColor4f(0.5f, 0.8f, 0.8f, 1.f - angle / MAX_ANGLE); - glPushMatrix(); - glTranslatef(_position.x, _position.y, _position.z); - glScalef(_height / 2.f, _height / 2.f, _height / 2.f); - glutSolidSphere(1.2f + _head.getAverageLoudness() * .0005f, 20, 20); - glPopMatrix(); + if (angle < MAX_ANGLE) { + glColor4f(0.5f, 0.8f, 0.8f, 1.f - angle / MAX_ANGLE); + glPushMatrix(); + glTranslatef(_position.x, _position.y, _position.z); + glScalef(_height / 2.f, _height / 2.f, _height / 2.f); + glutSolidSphere(1.2f + _head.getAverageLoudness() * .0005f, 20, 20); + glPopMatrix(); + } } // Render the balls @@ -697,9 +702,6 @@ float Avatar::getBallRenderAlpha(int ball, bool lookingInMirror) const { void Avatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) { - // glow when moving - Glower glower(_moving ? 1.0f : 0.0f); - if (_head.getFace().isFullFrame()) { // Render the full-frame video float alpha = getBallRenderAlpha(BODY_BALL_HEAD_BASE, lookingInMirror); From 2cff4b6b3a1c293771a0fc92f1673823d7ea556a Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 22 Aug 2013 17:09:23 -0700 Subject: [PATCH 5/6] "Laser pointer" for transmitter. --- interface/src/Application.cpp | 59 ++++++++++++++++++++++++++++++++- interface/src/Application.h | 3 ++ interface/src/Util.cpp | 36 ++++++++++++++++---- interface/src/Util.h | 3 +- interface/src/avatar/Avatar.cpp | 15 +++++++++ interface/src/avatar/Avatar.h | 7 ++++ 6 files changed, 114 insertions(+), 9 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index d69770678c..de9759959a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1384,7 +1384,9 @@ Avatar* Application::isLookingAtOtherAvatar(glm::vec3& mouseRayOrigin, glm::vec3 if (node->getLinkedData() != NULL && node->getType() == NODE_TYPE_AGENT) { Avatar* avatar = (Avatar *) node->getLinkedData(); glm::vec3 headPosition = avatar->getHead().getPosition(); - if (rayIntersectsSphere(mouseRayOrigin, mouseRayDirection, headPosition, HEAD_SPHERE_RADIUS * avatar->getScale())) { + float distance; + if (rayIntersectsSphere(mouseRayOrigin, mouseRayDirection, headPosition, + HEAD_SPHERE_RADIUS * avatar->getScale(), distance)) { eyePosition = avatar->getHead().getEyePosition(); _lookatIndicatorScale = avatar->getScale(); _lookatOtherPosition = headPosition; @@ -1722,6 +1724,40 @@ void Application::update(float deltaTime) { _myAvatar.simulate(deltaTime, NULL, Menu::getInstance()->getGyroCameraSensitivity()); } + // no transmitter drive implies transmitter pick + if (!Menu::getInstance()->isOptionChecked(MenuOption::TransmitterDrive) && _myTransmitter.isConnected()) { + _transmitterPickStart = _myAvatar.getSkeleton().joint[AVATAR_JOINT_CHEST].position; + glm::vec3 direction = _myAvatar.getOrientation() * + glm::quat(glm::radians(_myTransmitter.getEstimatedRotation())) * IDENTITY_FRONT; + + // check against voxels, avatars + const float MAX_PICK_DISTANCE = 100.0f; + float minDistance = MAX_PICK_DISTANCE; + VoxelDetail detail; + float distance; + BoxFace face; + if (_voxels.findRayIntersection(_transmitterPickStart, direction, detail, distance, face)) { + minDistance = min(minDistance, distance); + } + for(NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) { + node->lock(); + if (node->getLinkedData() != NULL) { + Avatar *avatar = (Avatar*)node->getLinkedData(); + if (!avatar->isInitialized()) { + avatar->init(); + } + if (avatar->findRayIntersection(_transmitterPickStart, direction, distance)) { + minDistance = min(minDistance, distance); + } + } + node->unlock(); + } + _transmitterPickEnd = _transmitterPickStart + direction * minDistance; + + } else { + _transmitterPickStart = _transmitterPickEnd = glm::vec3(); + } + if (!OculusManager::isConnected()) { if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) { if (_myCamera.getMode() != CAMERA_MODE_MIRROR) { @@ -2271,6 +2307,27 @@ void Application::displaySide(Camera& whichCamera) { } renderFollowIndicator(); + + // render transmitter pick ray, if non-empty + if (_transmitterPickStart != _transmitterPickEnd) { + Glower glower; + float TRANSMITTER_PICK_COLOR[] = { 1.0f, 1.0f, 0.0f }; + glColor3fv(TRANSMITTER_PICK_COLOR); + glLineWidth(3.0f); + glBegin(GL_LINES); + glVertex3f(_transmitterPickStart.x, _transmitterPickStart.y, _transmitterPickStart.z); + glVertex3f(_transmitterPickEnd.x, _transmitterPickEnd.y, _transmitterPickEnd.z); + glEnd(); + glLineWidth(1.0f); + + glPushMatrix(); + glTranslatef(_transmitterPickEnd.x, _transmitterPickEnd.y, _transmitterPickEnd.z); + + float PICK_END_RADIUS = 0.025f; + glutSolidSphere(PICK_END_RADIUS, 8, 8); + + glPopMatrix(); + } } void Application::displayOverlay() { diff --git a/interface/src/Application.h b/interface/src/Application.h index a88ea3269f..7ad64ca707 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -298,6 +298,9 @@ private: glm::vec3 _lookatOtherPosition; float _lookatIndicatorScale; + glm::vec3 _transmitterPickStart; + glm::vec3 _transmitterPickEnd; + bool _perfStatsOn; // Do we want to display perfStats? ChatEntry _chatEntry; // chat entry field diff --git a/interface/src/Util.cpp b/interface/src/Util.cpp index 743957128c..dc825ca765 100644 --- a/interface/src/Util.cpp +++ b/interface/src/Util.cpp @@ -598,13 +598,35 @@ float loadSetting(QSettings* settings, const char* name, float defaultValue) { return value; } -bool rayIntersectsSphere(glm::vec3& rayStarting, glm::vec3& rayNormalizedDirection, glm::vec3& sphereCenter, double sphereRadius) { - glm::vec3 vecFromRayToSphereCenter = sphereCenter - rayStarting; - double projection = glm::dot(vecFromRayToSphereCenter, rayNormalizedDirection); - double shortestDistance = sqrt(glm::dot(vecFromRayToSphereCenter, vecFromRayToSphereCenter) - projection * projection); - if (shortestDistance <= sphereRadius) { - return true; +bool rayIntersectsSphere(const glm::vec3& rayStarting, const glm::vec3& rayNormalizedDirection, + const glm::vec3& sphereCenter, float sphereRadius, float& distance) { + glm::vec3 relativeOrigin = rayStarting - sphereCenter; + + // compute the b, c terms of the quadratic equation (a is dot(direction, direction), which is one) + float b = 2.0f * glm::dot(rayNormalizedDirection, relativeOrigin); + float c = glm::dot(relativeOrigin, relativeOrigin) - sphereRadius * sphereRadius; + + // compute the radicand of the quadratic. if less than zero, there's no intersection + float radicand = b * b - 4.0f * c; + if (radicand < 0.0f) { + return false; } + + // compute the first solution of the quadratic + float root = sqrtf(radicand); + float firstSolution = -b - root; + if (firstSolution > 0.0f) { + distance = firstSolution / 2.0f; + return true; // origin is outside the sphere + } + + // now try the second solution + float secondSolution = -b + root; + if (secondSolution > 0.0f) { + distance = 0.0f; + return true; // origin is inside the sphere + } + return false; } @@ -615,4 +637,4 @@ bool pointInSphere(glm::vec3& point, glm::vec3& sphereCenter, double sphereRadiu return true; } return false; -} \ No newline at end of file +} diff --git a/interface/src/Util.h b/interface/src/Util.h index c1bb2949fa..2926d5bfc4 100644 --- a/interface/src/Util.h +++ b/interface/src/Util.h @@ -74,7 +74,8 @@ void runTimingTests(); float loadSetting(QSettings* settings, const char* name, float defaultValue); -bool rayIntersectsSphere(glm::vec3& rayStarting, glm::vec3& rayNormalizedDirection, glm::vec3& sphereCenter, double sphereRadius); +bool rayIntersectsSphere(const glm::vec3& rayStarting, const glm::vec3& rayNormalizedDirection, + const glm::vec3& sphereCenter, float sphereRadius, float& distance); bool pointInSphere(glm::vec3& point, glm::vec3& sphereCenter, double sphereRadius); diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 9f2ac37518..4635be7357 100755 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -800,6 +800,21 @@ void Avatar::getBodyBallTransform(AvatarJointID jointID, glm::vec3& position, gl rotation = _bodyBall[jointID].rotation; } +bool Avatar::findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance) const { + float minDistance = FLT_MAX; + for (int i = 0; i < NUM_AVATAR_BODY_BALLS; i++) { + float distance; + if (rayIntersectsSphere(origin, direction, _bodyBall[i].position, _bodyBall[i].radius, distance)) { + minDistance = min(minDistance, distance); + } + } + if (minDistance == FLT_MAX) { + return false; + } + distance = minDistance; + return true; +} + int Avatar::parseData(unsigned char* sourceBuffer, int numBytes) { // change in position implies movement glm::vec3 oldPosition = _position; diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index 4048f15d0f..b04f9f04b8 100755 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -164,6 +164,13 @@ public: // Get the position/rotation of a single body ball void getBodyBallTransform(AvatarJointID jointID, glm::vec3& position, glm::quat& rotation) const; + /// Checks for an intersection between the described ray and any of the avatar's body balls. + /// \param origin the origin of the ray + /// \param direction the unit direction vector + /// \param[out] distance the variable in which to store the distance to intersection + /// \return whether or not the ray intersected + bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance) const; + virtual int parseData(unsigned char* sourceBuffer, int numBytes); static void renderJointConnectingCone(glm::vec3 position1, glm::vec3 position2, float radius1, float radius2); From 3682e32eb15ae4cf508a741a67690022e52b5d33 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 22 Aug 2013 17:40:55 -0700 Subject: [PATCH 6/6] Yes, these should be consts. --- interface/src/Application.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index de9759959a..cc95aec1fd 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2311,7 +2311,7 @@ void Application::displaySide(Camera& whichCamera) { // render transmitter pick ray, if non-empty if (_transmitterPickStart != _transmitterPickEnd) { Glower glower; - float TRANSMITTER_PICK_COLOR[] = { 1.0f, 1.0f, 0.0f }; + const float TRANSMITTER_PICK_COLOR[] = { 1.0f, 1.0f, 0.0f }; glColor3fv(TRANSMITTER_PICK_COLOR); glLineWidth(3.0f); glBegin(GL_LINES); @@ -2323,7 +2323,7 @@ void Application::displaySide(Camera& whichCamera) { glPushMatrix(); glTranslatef(_transmitterPickEnd.x, _transmitterPickEnd.y, _transmitterPickEnd.z); - float PICK_END_RADIUS = 0.025f; + const float PICK_END_RADIUS = 0.025f; glutSolidSphere(PICK_END_RADIUS, 8, 8); glPopMatrix();