mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 18:30:42 +02:00
resolve conflicts on merge with upstream master
This commit is contained in:
parent
30d6c7f68a
commit
2cb9b609f4
1 changed files with 65 additions and 97 deletions
|
@ -1146,10 +1146,8 @@ void Avatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) {
|
|||
const float RENDER_OPAQUE_BEYOND = 1.0f; // Meters beyond which body is shown opaque
|
||||
const float RENDER_TRANSLUCENT_BEYOND = 0.5f;
|
||||
|
||||
// Render the body's voxels
|
||||
_voxels.render(false);
|
||||
|
||||
// Render the body as balls and cones
|
||||
if (renderAvatarBalls) {
|
||||
for (int b = 0; b < NUM_AVATAR_BODY_BALLS; b++) {
|
||||
float distanceToCamera = glm::length(_cameraPosition - _bodyBall[b].position);
|
||||
|
||||
|
@ -1217,6 +1215,7 @@ void Avatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Render the body's voxels
|
||||
_voxels.render(false);
|
||||
|
@ -1225,37 +1224,6 @@ void Avatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) {
|
|||
|
||||
|
||||
|
||||
void Avatar::setHeadFromGyros(glm::vec3* eulerAngles, glm::vec3* angularVelocity, float deltaTime, float smoothingTime) {
|
||||
//
|
||||
// Given absolute position and angular velocity information, update the avatar's head angles
|
||||
// with the goal of fast instantaneous updates that gradually follow the absolute data.
|
||||
//
|
||||
// Euler Angle format is (Yaw, Pitch, Roll) in degrees
|
||||
//
|
||||
// Angular Velocity is (Yaw, Pitch, Roll) in degrees per second
|
||||
//
|
||||
// SMOOTHING_TIME is the time is seconds over which the head should average to the
|
||||
// absolute eulerAngles passed.
|
||||
//
|
||||
//
|
||||
|
||||
if (deltaTime == 0.f) {
|
||||
// On first sample, set head to absolute position
|
||||
_head.setYaw (eulerAngles->x);
|
||||
_head.setPitch(eulerAngles->y);
|
||||
_head.setRoll (eulerAngles->z);
|
||||
} else {
|
||||
glm::vec3 angles(_head.getYaw(), _head.getPitch(), _head.getRoll());
|
||||
// Increment by detected velocity
|
||||
angles += (*angularVelocity) * deltaTime;
|
||||
// Smooth to slowly follow absolute values
|
||||
angles = ((1.f - deltaTime / smoothingTime) * angles) + (deltaTime / smoothingTime) * (*eulerAngles);
|
||||
_head.setYaw (angles.x);
|
||||
_head.setPitch(angles.y);
|
||||
_head.setRoll (angles.z);
|
||||
// printLog("Y/P/R: %3.1f, %3.1f, %3.1f\n", angles.x, angles.y, angles.z);
|
||||
}
|
||||
}
|
||||
|
||||
void Avatar::loadData(QSettings* set) {
|
||||
set->beginGroup("Avatar");
|
||||
|
|
Loading…
Reference in a new issue