Merge pull request #6139 from samcake/controllers

Controllers : Fixing the pose transmission
This commit is contained in:
Brad Hefta-Gaub 2015-10-21 13:12:28 -07:00
commit 0aab108729
2 changed files with 4 additions and 1 deletions

View file

@ -12,7 +12,7 @@ namespace controller {
Pose::Pose(const vec3& translation, const quat& rotation,
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 {
// invalid poses return false for comparison, even against identical invalid poses, like NaN

View file

@ -205,6 +205,9 @@ public:
virtual Pose pose() override { return _currentPose; }
virtual void apply(const Pose& newValue, const Pose& oldValue, const Pointer& source) override {
_currentPose = newValue;
if (!_currentPose.isValid()) {
return;
}
if (!(_input == Input::INVALID_INPUT)) {
auto userInputMapper = DependencyManager::get<UserInputMapper>();
userInputMapper->setActionState(Action(_input.getChannel()), _currentPose);