mirror of
https://github.com/lubosz/overte.git
synced 2025-04-19 17:03:43 +02:00
Merge pull request #9150 from hyperlogic/bug-fix/driving-while-flying-in-hmd
Fix for driving/turning while flying in HMD mode
This commit is contained in:
commit
a69d77ffbe
2 changed files with 7 additions and 2 deletions
|
@ -467,6 +467,8 @@ void MyAvatar::simulate(float deltaTime) {
|
|||
|
||||
if (_characterController.getState() != CharacterController::State::Hover) {
|
||||
updateSensorToWorldMatrix(_enableVerticalComfortMode ? SensorToWorldUpdateMode::VerticalComfort : SensorToWorldUpdateMode::Vertical);
|
||||
} else {
|
||||
updateSensorToWorldMatrix(SensorToWorldUpdateMode::None);
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -616,6 +618,8 @@ void MyAvatar::updateSensorToWorldMatrix(SensorToWorldUpdateMode mode) {
|
|||
} else if (mode == SensorToWorldUpdateMode::Vertical) {
|
||||
setSensorToWorldMatrix(sensorToWorldMat);
|
||||
}
|
||||
} else if (mode == SensorToWorldUpdateMode::None) {
|
||||
setSensorToWorldMatrix(_sensorToWorldMatrix);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1897,7 +1901,7 @@ void MyAvatar::applyVelocityToSensorToWorldMatrix(const glm::vec3& velocity, flo
|
|||
// update the position column of matrix
|
||||
glm::mat4 newSensorToWorldMatrix = _sensorToWorldMatrix;
|
||||
newSensorToWorldMatrix[3] = glm::vec4(position, 1.0f);
|
||||
setSensorToWorldMatrix(newSensorToWorldMatrix);
|
||||
_sensorToWorldMatrix = newSensorToWorldMatrix;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -192,7 +192,8 @@ public:
|
|||
enum class SensorToWorldUpdateMode {
|
||||
Full = 0,
|
||||
Vertical,
|
||||
VerticalComfort
|
||||
VerticalComfort,
|
||||
None
|
||||
};
|
||||
void updateSensorToWorldMatrix(SensorToWorldUpdateMode mode = SensorToWorldUpdateMode::Full);
|
||||
|
||||
|
|
Loading…
Reference in a new issue