Initial commit
This commit is contained in:
commit
edfc5298e1
252 changed files with 93965 additions and 0 deletions
59
include/Spectre/Graphics/Transformable.h
Normal file
59
include/Spectre/Graphics/Transformable.h
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
|
||||
#ifndef SPECTRE_GRAPHICS_TRANSFORMABLE_H
|
||||
#define SPECTRE_GRAPHICS_TRANSFORMABLE_H
|
||||
|
||||
#include <Spectre/Math/Transform.h>
|
||||
#include <Spectre/Math/Vector2.h>
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
#endif /* SPECTRE_GRAPHICS_TRANSFORMABLE_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue