Overte C++ Documentation
PostTransformFilter.h
1 //
2 // Created by Brad Hefta-Gaub 2017/04/11
3 // Copyright 2017 High Fidelity, Inc.
4 //
5 // Distributed under the Apache License, Version 2.0.
6 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
7 //
8 
9 #pragma once
10 #ifndef hifi_Controllers_Filters_PostTransform_h
11 #define hifi_Controllers_Filters_PostTransform_h
12 
13 #include <glm/gtx/transform.hpp>
14 
15 #include "../Filter.h"
16 
17 namespace controller {
18 
19 class PostTransformFilter : public Filter {
20  REGISTER_FILTER_CLASS(PostTransformFilter);
21 public:
22  PostTransformFilter() = default;
23  PostTransformFilter(glm::mat4 transform) : _transform(transform) {}
24  virtual AxisValue apply(AxisValue value) const override { return value; }
25  virtual Pose apply(Pose value) const override { return value.postTransform(_transform); }
26  virtual bool parseParameters(const QJsonValue& parameters) override { return parseMat4Parameter(parameters, _transform); }
27 private:
28  glm::mat4 _transform;
29 };
30 
31 }
32 
33 #endif