mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +02:00
LookatIndicator now scales with the avatar's scale.
This commit is contained in:
parent
0f1ac2b226
commit
4e641eed2f
2 changed files with 5 additions and 2 deletions
|
@ -200,6 +200,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
|
|||
_mouseVoxelScale(1.0f / 1024.0f),
|
||||
_justEditedVoxel(false),
|
||||
_isLookingAtOtherAvatar(false),
|
||||
_lookatIndicatorScale(1.0f),
|
||||
_paintOn(false),
|
||||
_dominantColor(0),
|
||||
_perfStatsOn(false),
|
||||
|
@ -1942,6 +1943,7 @@ bool Application::isLookingAtOtherAvatar(glm::vec3& mouseRayOrigin, glm::vec3& m
|
|||
glm::vec3 headPosition = avatar->getHead().getPosition();
|
||||
if (rayIntersectsSphere(mouseRayOrigin, mouseRayDirection, headPosition, HEAD_SPHERE_RADIUS)) {
|
||||
eyePosition = avatar->getHead().getEyeLevelPosition();
|
||||
_lookatIndicatorScale = avatar->getScale();
|
||||
_lookatOtherPosition = headPosition;
|
||||
return true;
|
||||
}
|
||||
|
@ -1952,8 +1954,8 @@ bool Application::isLookingAtOtherAvatar(glm::vec3& mouseRayOrigin, glm::vec3& m
|
|||
|
||||
void Application::renderLookatIndicator(glm::vec3 pointOfInterest, Camera& whichCamera) {
|
||||
|
||||
const float DISTANCE_FROM_HEAD_SPHERE = 0.1f;
|
||||
const float INDICATOR_RADIUS = 0.1f;
|
||||
const float DISTANCE_FROM_HEAD_SPHERE = 0.1f * _lookatIndicatorScale;
|
||||
const float INDICATOR_RADIUS = 0.1f * _lookatIndicatorScale;
|
||||
const float YELLOW[] = { 1.0f, 1.0f, 0.0f };
|
||||
const int NUM_SEGMENTS = 30;
|
||||
glm::vec3 haloOrigin(pointOfInterest.x, pointOfInterest.y + DISTANCE_FROM_HEAD_SPHERE, pointOfInterest.z);
|
||||
|
|
|
@ -373,6 +373,7 @@ private:
|
|||
|
||||
bool _isLookingAtOtherAvatar;
|
||||
glm::vec3 _lookatOtherPosition;
|
||||
float _lookatIndicatorScale;
|
||||
|
||||
bool _paintOn; // Whether to paint voxels as you fly around
|
||||
unsigned char _dominantColor; // The dominant color of the voxel we're painting
|
||||
|
|
Loading…
Reference in a new issue