1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-10-06 00:57:19 +02:00
openrw/framework2/include/renderwure/engine/GTAObject.hpp

52 lines
1.0 KiB
C++
Raw Normal View History

2013-09-09 01:18:36 +02:00
#pragma once
#ifndef _GTAOBJECTS_HPP_
#define _GTAOBJECTS_HPP_
#include <renderwure/engine/GTATypes.hpp>
#include <renderwure/loaders/LoaderIDE.hpp>
#include <renderwure/loaders/LoaderIPL.hpp>
#include <glm/gtc/quaternion.hpp>
#include <memory>
class GTAAIController;
class Model;
2013-09-11 01:26:13 +02:00
class Animator;
2013-09-09 01:18:36 +02:00
class GTAEngine;
/**
* @brief The GTAObject struct
* Stores data that is relevant to all types of objects.
*/
struct GTAObject
{
glm::vec3 position;
glm::quat rotation;
Model* model; /// Cached pointer to Object's Model.
GTAEngine* engine;
2013-09-11 01:26:13 +02:00
Animator* animator; /// Object's animator.
2013-09-09 01:18:36 +02:00
GTAObject(GTAEngine* engine, const glm::vec3& pos, const glm::quat& rot, Model* model)
2013-09-11 01:26:13 +02:00
: position(pos), rotation(rot), model(model), engine(engine), animator(nullptr) {}
2013-09-09 01:18:36 +02:00
enum Type
{
Instance,
Character,
Vehicle
};
virtual Type type() = 0;
virtual void setPosition(const glm::vec3& pos);
virtual glm::vec3 getPosition() const;
2013-09-09 05:04:21 +02:00
virtual glm::quat getRotation() const;
2013-09-09 01:18:36 +02:00
};
#endif // GTAOBJECTS_HPP