mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-09 16:52:28 +02:00
Misc fixes
This commit is contained in:
parent
f381361c82
commit
d073dc22ac
3 changed files with 7 additions and 4 deletions
|
@ -43,7 +43,6 @@ namespace controller {
|
|||
virtual Pose peekPose() const { return Pose(); };
|
||||
virtual Pose pose() { return peekPose(); }
|
||||
virtual void apply(const Pose& value, const Pointer& source) {}
|
||||
virtual bool isAxis() const { return _input.isAxis(); }
|
||||
virtual bool isPose() const { return _input.isPose(); }
|
||||
virtual bool writeable() const { return true; }
|
||||
virtual bool readable() const { return true; }
|
||||
|
|
|
@ -46,7 +46,7 @@ AxisValue AnyEndpoint::value() {
|
|||
for (auto& child : _children) {
|
||||
auto childValue = child->value();
|
||||
if (std::abs(childValue.value) > std::abs(result.value)) {
|
||||
result.value = childValue.value;
|
||||
result = childValue;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -25,13 +25,17 @@ bool CompositeEndpoint::readable() const {
|
|||
}
|
||||
|
||||
AxisValue CompositeEndpoint::peek() const {
|
||||
auto result = AxisValue(first->peek().value * -1.0f + second->peek().value, 0);
|
||||
auto negative = first->peek();
|
||||
auto positive = second->peek();
|
||||
auto result = AxisValue(positive.value - negative.value, std::max(positive.timestamp, negative.timestamp));
|
||||
return result;
|
||||
}
|
||||
|
||||
// Fetching via value() must trigger any side effects of value() on the children
|
||||
AxisValue CompositeEndpoint::value() {
|
||||
auto result = AxisValue(first->value().value * -1.0f + second->value().value, 0);
|
||||
auto negative = first->value();
|
||||
auto positive = second->value();
|
||||
auto result = AxisValue(positive.value - negative.value, std::max(positive.timestamp, negative.timestamp));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue