mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 05:52:31 +02:00
re-enable avatar position update when moving HMD
This commit is contained in:
parent
44243aaa52
commit
e1a5afcff3
1 changed files with 1 additions and 3 deletions
|
@ -337,18 +337,16 @@ void MyAvatar::updateFromHMDSensorMatrix(const glm::mat4& hmdSensorMatrix) {
|
||||||
const float STRAIGHTENING_LEAN_DURATION = 0.5f; // seconds
|
const float STRAIGHTENING_LEAN_DURATION = 0.5f; // seconds
|
||||||
|
|
||||||
// define a vertical capsule
|
// define a vertical capsule
|
||||||
static float adebug = 1.0f; // adebug
|
|
||||||
const float STRAIGHTENING_LEAN_CAPSULE_RADIUS = 0.2f; // meters
|
const float STRAIGHTENING_LEAN_CAPSULE_RADIUS = 0.2f; // meters
|
||||||
const float STRAIGHTENING_LEAN_CAPSULE_LENGTH = 0.05f; // length of the cylinder part of the capsule in meters.
|
const float STRAIGHTENING_LEAN_CAPSULE_LENGTH = 0.05f; // length of the cylinder part of the capsule in meters.
|
||||||
|
|
||||||
auto newBodySensorMatrix = deriveBodyFromHMDSensor();
|
auto newBodySensorMatrix = deriveBodyFromHMDSensor();
|
||||||
glm::vec3 diff = extractTranslation(newBodySensorMatrix) - extractTranslation(_bodySensorMatrix);
|
glm::vec3 diff = extractTranslation(newBodySensorMatrix) - extractTranslation(_bodySensorMatrix);
|
||||||
if (!_straighteningLean && (capsuleCheck(diff, adebug * STRAIGHTENING_LEAN_CAPSULE_LENGTH, adebug * STRAIGHTENING_LEAN_CAPSULE_RADIUS) || hmdIsAtRest)) {
|
if (!_straighteningLean && (capsuleCheck(diff, STRAIGHTENING_LEAN_CAPSULE_LENGTH, STRAIGHTENING_LEAN_CAPSULE_RADIUS) || hmdIsAtRest)) {
|
||||||
|
|
||||||
// begin homing toward derived body position.
|
// begin homing toward derived body position.
|
||||||
_straighteningLean = true;
|
_straighteningLean = true;
|
||||||
_straighteningLeanAlpha = 0.0f;
|
_straighteningLeanAlpha = 0.0f;
|
||||||
adebug = 1000.0f; // adebug
|
|
||||||
|
|
||||||
} else if (_straighteningLean) {
|
} else if (_straighteningLean) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue