1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 19:32:49 +01:00
openrw/rwengine/include/objects/InstanceObject.hpp

45 lines
943 B
C++
Raw Normal View History

2013-09-09 01:18:36 +02:00
#pragma once
2014-06-06 16:22:26 +02:00
#ifndef _OBJECTINSTANCE_HPP_
#define _OBJECTINSTANCE_HPP_
#include <engine/GameObject.hpp>
2014-06-11 22:00:53 +02:00
#include <btBulletDynamicsCommon.h>
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-06-06 16:22:26 +02:00
struct InstanceObject : public GameObject
2013-09-09 01:18:36 +02:00
{
glm::vec3 scale;
2014-06-11 22:00:53 +02:00
btRigidBody* body = nullptr;
std::shared_ptr<ObjectData> object;
InstanceObject* LODinstance;
2014-06-11 22:00:53 +02:00
std::shared_ptr<DynamicObjectData> dynamics;
float _collisionHeight;
2014-06-16 02:29:36 +02:00
bool _enablePhysics;
2013-09-09 01:18:36 +02:00
InstanceObject(GameWorld* engine,
2013-09-09 01:18:36 +02:00
const glm::vec3& pos,
const glm::quat& rot,
2014-06-06 13:18:32 +02:00
ModelHandle* model,
2013-09-09 01:18:36 +02:00
const glm::vec3& scale,
std::shared_ptr<ObjectData> obj,
InstanceObject *lod,
2014-06-11 22:00:53 +02:00
std::shared_ptr<DynamicObjectData> dyn
);
~InstanceObject();
2013-09-09 01:18:36 +02:00
Type type() { return Instance; }
void tick(float dt);
2014-07-25 04:30:44 +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