1
0
Fork 0
spectre/include/Spectre/Graphics/Transformable.h
Henrik Hautakoski e10daeaaa6
Move everything from global namespace to "sp" namespace
When writing the X11 (linux) implementation there was a problem with X11 defining a "Display" type and we also have a Display class in the engine.

So to fix that problem and minimize the risk for running into other name conflicts. We move everything from global namespace.
2019-09-30 19:10:17 +02:00

63 lines
No EOL
1,004 B
C++

#ifndef SPECTRE_GRAPHICS_TRANSFORMABLE_H
#define SPECTRE_GRAPHICS_TRANSFORMABLE_H
#include <Spectre/Math/Transform.h>
#include <Spectre/Math/Vector2.h>
namespace sp {
class Transformable
{
public :
Transformable();
Transformable(const Vector2f& position);
virtual ~Transformable();
// Position
void setPosition(const Vector2f& position);
void setPosition(float x, float y);
void move(const Vector2f& offset);
const Vector2f& getPosition() const;
// Rotation
void setRotation(float angle);
void rotate(float angle);
float getRotation() const;
// Scale
void setScale(const Vector2f& offset);
void setScale(float scale);
void scale(const Vector2f& offset);
void scale(float scale);
const Vector2f getScale() const;
const Transform& getTransform() const;
private :
Vector2f m_position;
float m_rotation;
Vector2f m_scale;
mutable bool m_transformNeedsUpdate;
mutable Transform m_transform;
};
} // namespace sp
#endif /* SPECTRE_GRAPHICS_TRANSFORMABLE_H */