pixwerx/src/scene/include/pw/scene/transform.hpp

39 lines
640 B
C++
Raw Normal View History

#ifndef PW_SCENE_TRANSFORM_HPP
#define PW_SCENE_TRANSFORM_HPP
#include <pw/core/matrix.hpp>
#include <pw/scene/component.hpp>
namespace pw {
class transform : public component {
public:
transform() = default;
using component::component;
using component::ref;
inline const matrix44& local() const { return _local; }
void set_local(const matrix44 &local);
void set_global(const matrix44 &global);
void update();
2019-01-01 21:47:35 +01:00
inline void translate(const real_t &x, const real_t &y, const real_t &z) {
_local.at(0,3) += x;_local.at(1,3) += y;_local.at(2,3) += z;
}
protected:
matrix44 _local;
matrix44 _global;
};
}
#endif