2013-09-09 01:18:36 +02:00
|
|
|
#pragma once
|
2014-06-06 16:22:26 +02:00
|
|
|
#ifndef _OBJECTINSTANCE_HPP_
|
|
|
|
#define _OBJECTINSTANCE_HPP_
|
2015-04-27 03:09:56 +02:00
|
|
|
#include <objects/GameObject.hpp>
|
2014-06-11 22:00:53 +02:00
|
|
|
#include <btBulletDynamicsCommon.h>
|
2013-09-09 01:18:36 +02:00
|
|
|
|
2014-08-11 00:31:59 +02:00
|
|
|
class CollisionInstance;
|
|
|
|
|
2013-09-09 01:18:36 +02:00
|
|
|
/**
|
2014-06-06 16:22:26 +02:00
|
|
|
* @struct InstanceObject
|
|
|
|
* A simple object instance
|
2013-09-09 01:18:36 +02:00
|
|
|
*/
|
2014-08-11 18:58:43 +02:00
|
|
|
class InstanceObject : public GameObject
|
2013-09-09 01:18:36 +02:00
|
|
|
{
|
2014-08-11 18:58:43 +02:00
|
|
|
public:
|
2013-09-09 01:18:36 +02:00
|
|
|
glm::vec3 scale;
|
2014-08-11 00:31:59 +02:00
|
|
|
CollisionInstance* body;
|
2013-11-26 17:14:13 +01:00
|
|
|
std::shared_ptr<ObjectData> object;
|
2014-07-02 00:04:23 +02:00
|
|
|
InstanceObject* LODinstance;
|
2014-06-11 22:00:53 +02:00
|
|
|
std::shared_ptr<DynamicObjectData> dynamics;
|
2014-06-16 02:29:36 +02:00
|
|
|
bool _enablePhysics;
|
2013-09-09 01:18:36 +02:00
|
|
|
|
2015-03-06 05:38:22 +01:00
|
|
|
InstanceObject(GameWorld* engine, const glm::vec3& pos, const glm::quat& rot, const ModelRef& model, const glm::vec3& scale, std::shared_ptr< ObjectData > obj, InstanceObject* lod, std::shared_ptr< DynamicObjectData > dyn
|
2013-09-09 02:40:30 +02:00
|
|
|
);
|
2014-08-01 16:48:11 +02:00
|
|
|
~InstanceObject();
|
2013-09-09 01:18:36 +02:00
|
|
|
|
|
|
|
Type type() { return Instance; }
|
2014-06-15 02:34:13 +02:00
|
|
|
|
|
|
|
void tick(float dt);
|
2014-07-25 04:30:44 +02:00
|
|
|
|
2014-08-01 16:48:11 +02:00
|
|
|
void changeModel(std::shared_ptr<ObjectData> incoming);
|
|
|
|
|
2014-07-25 04:30:44 +02:00
|
|
|
virtual void setRotation(const glm::quat& r);
|
2013-12-06 22:25:34 +01:00
|
|
|
|
2014-06-11 22:00:53 +02:00
|
|
|
virtual bool takeDamage(const DamageInfo& damage);
|
2013-09-09 01:18:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|