19 #include "IDrawable.h" 21 #include "linmath/float4x4.h" 23 #include <linmath/Quaternion.h> 25 #include "ShaderProgram.h" 27 enum EventType {BeforeCollision, DuringCollision, AfterCollision};
29 typedef int TypeIdentifier;
117 chag::float4x4 getModelMatrix();
123 void move(chag::float4x4 model_matrix);
129 void update(chag::float4x4 update_matrix);
131 chag::float3 getRelativeScale();
132 chag::float3 getAbsoluteScale();
133 void setScale(chag::float3 s);
135 chag::Quaternion getRelativeRotation();
136 chag::Quaternion getAbsoluteRotation();
137 void setRotation(chag::Quaternion r);
138 void updateRotation(chag::Quaternion r);
140 chag::float3 getRelativeLocation();
141 chag::float3 getAbsoluteLocation();
142 void setLocation(chag::float3 l);
146 TypeIdentifier getIdentifier();
147 void setIdentifier(TypeIdentifier identifier);
148 void addCollidesWith(TypeIdentifier colliderID);
149 void addCollidesWith(std::initializer_list<TypeIdentifier> colliderIDs);
150 void clearCollidesWithList();
151 bool collidesWith(TypeIdentifier
id);
166 AABB getTransformedAABB();
167 Sphere getTransformedSphere();
169 bool isDynamicObject();
170 void setDynamic(
bool isDynamic);
183 void initGameObject(
Mesh *mesh,
Mesh *colliderMesh);
185 chag::float4x4 getFullMatrix();
204 chag::float4x4 m_modelMatrix;
205 chag::float3 scale = chag::make_vector(1.0f, 1.0f, 1.0f);
206 chag::Quaternion rotation;
207 chag::Quaternion rotationPointReference;
208 bool hasRotation =
false;
210 chag::float3 location = chag::make_vector(0.0f, 0.0f, 0.0f);
212 bool changed =
false;
216 std::vector<GameObject*> children;
223 TypeIdentifier typeIdentifier = -1;
224 std::vector<TypeIdentifier> canCollideWith;
225 bool dynamicObject =
false;
229 std::vector<IComponent*> components;
virtual void renderShadow(ShaderProgram *shaderProgram)
Class for maintaining OpenGL shader programs.
void move(chag::float4x4 model_matrix)
A class for containing all information about a object in the game world.
void callEvent(EventType type, GameObject *data)
std::vector< Triangle * > getTriangles()