feat: assignment 2
This commit is contained in:
		
							
								
								
									
										55
									
								
								src/entity.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								src/entity.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,55 @@ | ||||
| #ifndef ENTITY_H_ | ||||
| #define ENTITY_H_ | ||||
|  | ||||
| #include "../lib/glm/glm.hpp" | ||||
|  | ||||
| class Entity { | ||||
| public: | ||||
| 	Entity(); | ||||
| 	virtual ~Entity() | ||||
| 	{ | ||||
| 	} | ||||
|  | ||||
| 	const glm::vec3& getPosition() const | ||||
| 	{ | ||||
| 		return position_; | ||||
| 	} | ||||
| 	void setPosition(const glm::vec3& pos) | ||||
| 	{ | ||||
| 		position_ = pos; | ||||
| 	} | ||||
|  | ||||
| 	const glm::vec3& getRotation() const | ||||
| 	{ | ||||
| 		return rotation_; | ||||
| 	} | ||||
| 	void setRotation(const glm::vec3& rot) | ||||
| 	{ | ||||
| 		rotation_ = rot; | ||||
| 	} | ||||
|  | ||||
| 	const glm::vec3& getScale() const | ||||
| 	{ | ||||
| 		return scale_; | ||||
| 	} | ||||
| 	void setScale(const glm::vec3& scale) | ||||
| 	{ | ||||
| 		scale_ = scale; | ||||
| 	} | ||||
|  | ||||
| 	void move(const glm::vec3& vec); | ||||
|  | ||||
| 	virtual void update(float deltaTime) | ||||
| 	{ | ||||
| 	} | ||||
| 	virtual void draw() | ||||
| 	{ | ||||
| 	} | ||||
|  | ||||
| protected: | ||||
| 	glm::vec3 position_; | ||||
| 	glm::vec3 rotation_; | ||||
| 	glm::vec3 scale_; | ||||
| }; | ||||
|  | ||||
| #endif // ENTITY_H_ | ||||
		Reference in New Issue
	
	Block a user