GlistEngine
Loading...
Searching...
No Matches
gNode.h
Go to the documentation of this file.
1/*
2 * gTransformable.h
3 *
4 * Created on: Aug 25, 2020
5 * Author: noyan
6 */
7
8#ifndef ENGINE_BASE_GNODE_H_
9#define ENGINE_BASE_GNODE_H_
10
11#include "gRenderObject.h"
12#include <deque>
13
14
15class gNode : public gRenderObject {
16public:
18 virtual ~gNode();
19
20 void move(float dx, float dy, float dz);
21 void move(const glm::vec3& dv);
22 void rotate(const glm::quat& q);
23 void rotate(float radians, float ax, float ay, float az);
24 void rotateDeg(float degrees, float ax, float ay, float az);
25 void rotateAround(float radians, const glm::vec3& axis, const glm::vec3& point);
26 void rotateAroundDeg(float degrees, const glm::vec3& axis, const glm::vec3& point);
27 void scale(float sx, float sy, float sz);
28 void scale(float s);
29
30 void setPosition(float px, float py, float pz);
31 void setPosition(const glm::vec3& pv);
32 void setOrientation(const glm::quat& o);
33 void setOrientation(const glm::vec3& angles);
34 void setScale(const glm::vec3& s);
35 void setScale(float sx, float sy, float sz);
36 void setScale(float s);
37
43 void truck(float distance);
44
50 void boom(float distance);
51
57 void dolly(float distance);
58
64 void tilt(float radians);
65
71 void tiltDeg(float degrees);
72
78 void pan(float radians);
79
85 void panDeg(float degrees);
86
92 void roll(float radians);
93
99 void rollDeg(float degrees);
100
101 float getPosX() const;
102 float getPosY() const;
103 float getPosZ() const;
104 const glm::vec3& getPosition() const;
105 const glm::quat& getOrientation() const;
106 const glm::vec3& getScale() const;
107
111 glm::vec3 getScalarDirectionX() const;
112
116 glm::vec3 getScalarDirectionY() const;
117
121 glm::vec3 getScalarDirectionZ() const;
122
123 void setTransformationMatrix(const glm::mat4& transformationMatrix);
124 const glm::mat4& getTransformationMatrix() const;
125
126 int getId() const;
127
129 gNode* getParent() const;
131 void addChild(gNode* child);
132 void removeChild(gNode* child);
133 void removeChild(int gObjectId);
134
136 bool isEnabled() const;
137
138 void pushMatrix() const;
139 void popMatrix() const;
140
141protected:
143 std::deque<gNode*> children;
145
147
148 glm::vec3 position;
149 glm::quat orientation;
150 glm::vec3 scalevec;
151
152 glm::vec3 prevposition;
154 glm::vec3 prevscalevec;
155
157
158private:
159 static int lastid;
160 int id;
161};
162
163#endif /* ENGINE_BASE_GNODE_H_ */
Definition gNode.h:15
float getPosZ() const
void rotateAround(float radians, const glm::vec3 &axis, const glm::vec3 &point)
void setEnabled(bool isEnabled)
const glm::mat4 & getTransformationMatrix() const
void tiltDeg(float degrees)
glm::quat orientation
Definition gNode.h:149
void scale(float sx, float sy, float sz)
void rollDeg(float degrees)
void move(float dx, float dy, float dz)
glm::vec3 getScalarDirectionZ() const
void removeChild(gNode *child)
gNode * parent
Definition gNode.h:142
float getPosX() const
glm::vec3 getScalarDirectionX() const
const glm::vec3 & getScale() const
const glm::vec3 & getPosition() const
void removeChild(int gObjectId)
virtual void processTransformationMatrix()
void setOrientation(const glm::vec3 &angles)
glm::vec3 getScalarDirectionY() const
void popMatrix() const
void removeParent()
std::deque< gNode * > children
Definition gNode.h:143
void rotate(float radians, float ax, float ay, float az)
void rotateAroundDeg(float degrees, const glm::vec3 &axis, const glm::vec3 &point)
glm::vec3 scalevec
Definition gNode.h:150
glm::quat prevorientation
Definition gNode.h:153
void addChild(gNode *child)
gNode * getParent() const
bool isenabled
Definition gNode.h:146
void rotateDeg(float degrees, float ax, float ay, float az)
void setScale(float s)
virtual ~gNode()
glm::mat4 localtransformationmatrix
Definition gNode.h:144
glm::vec3 prevscalevec
Definition gNode.h:154
bool isEnabled() const
void move(const glm::vec3 &dv)
const glm::quat & getOrientation() const
void truck(float distance)
void setPosition(const glm::vec3 &pv)
void pushMatrix() const
void pan(float radians)
void setScale(float sx, float sy, float sz)
int getId() const
void scale(float s)
void tilt(float radians)
void setScale(const glm::vec3 &s)
void setTransformationMatrix(const glm::mat4 &transformationMatrix)
void setParent(gNode *parent)
glm::vec3 position
Definition gNode.h:148
void setPosition(float px, float py, float pz)
void setOrientation(const glm::quat &o)
void roll(float radians)
void panDeg(float degrees)
float getPosY() const
void rotate(const glm::quat &q)
glm::vec3 prevposition
Definition gNode.h:152
void boom(float distance)
void dolly(float distance)
Definition gRenderObject.h:25