mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +02:00
Merge pull request #6139 from samcake/controllers
Controllers : Fixing the pose transmission
This commit is contained in:
commit
0aab108729
2 changed files with 4 additions and 1 deletions
|
@ -12,7 +12,7 @@ namespace controller {
|
||||||
|
|
||||||
Pose::Pose(const vec3& translation, const quat& rotation,
|
Pose::Pose(const vec3& translation, const quat& rotation,
|
||||||
const vec3& velocity, const quat& angularVelocity) :
|
const vec3& velocity, const quat& angularVelocity) :
|
||||||
translation(translation), rotation(rotation), velocity(velocity), angularVelocity(angularVelocity) { }
|
translation(translation), rotation(rotation), velocity(velocity), angularVelocity(angularVelocity), valid (true) { }
|
||||||
|
|
||||||
bool Pose::operator==(const Pose& right) const {
|
bool Pose::operator==(const Pose& right) const {
|
||||||
// invalid poses return false for comparison, even against identical invalid poses, like NaN
|
// invalid poses return false for comparison, even against identical invalid poses, like NaN
|
||||||
|
|
|
@ -205,6 +205,9 @@ public:
|
||||||
virtual Pose pose() override { return _currentPose; }
|
virtual Pose pose() override { return _currentPose; }
|
||||||
virtual void apply(const Pose& newValue, const Pose& oldValue, const Pointer& source) override {
|
virtual void apply(const Pose& newValue, const Pose& oldValue, const Pointer& source) override {
|
||||||
_currentPose = newValue;
|
_currentPose = newValue;
|
||||||
|
if (!_currentPose.isValid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!(_input == Input::INVALID_INPUT)) {
|
if (!(_input == Input::INVALID_INPUT)) {
|
||||||
auto userInputMapper = DependencyManager::get<UserInputMapper>();
|
auto userInputMapper = DependencyManager::get<UserInputMapper>();
|
||||||
userInputMapper->setActionState(Action(_input.getChannel()), _currentPose);
|
userInputMapper->setActionState(Action(_input.getChannel()), _currentPose);
|
||||||
|
|
Loading…
Reference in a new issue