45 lines
719 B
C++
45 lines
719 B
C++
/*
|
|
* Transform.h
|
|
*
|
|
* Created on: Nov 30, 2016
|
|
* Author: tibi
|
|
*/
|
|
|
|
#ifndef BASE_TRANSFORM_H_
|
|
#define BASE_TRANSFORM_H_
|
|
|
|
namespace farmlands {
|
|
namespace model {
|
|
|
|
class GameObject;
|
|
|
|
class Transform
|
|
{
|
|
public:
|
|
Transform(GameObject* obj);
|
|
|
|
// Getters
|
|
float globalX() const;
|
|
float globalY() const;
|
|
float globalScaleX() const;
|
|
float globalScaleY() const;
|
|
|
|
// Setters
|
|
void setGlobalX(float gx);
|
|
void setGlobalY(float gy);
|
|
void setGlobalScaleX(float gscaleX);
|
|
void setGlobalScaleY(float gscaleY);
|
|
|
|
// Local coordinates (relative to parent)
|
|
float x, y;
|
|
float scaleX, scaleY;
|
|
|
|
// Parent object
|
|
GameObject* gameObject;
|
|
};
|
|
|
|
}
|
|
} /* namespace farmlands */
|
|
|
|
#endif /* BASE_TRANSFORM_H_ */
|