mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-10 12:52:39 +01:00
40 lines
817 B
C++
40 lines
817 B
C++
#pragma once
|
|
#ifndef _OBJECTINSTANCE_HPP_
|
|
#define _OBJECTINSTANCE_HPP_
|
|
#include <engine/GameObject.hpp>
|
|
#include <btBulletDynamicsCommon.h>
|
|
|
|
/**
|
|
* @struct InstanceObject
|
|
* A simple object instance
|
|
*/
|
|
struct InstanceObject : public GameObject
|
|
{
|
|
glm::vec3 scale;
|
|
btRigidBody* body = nullptr;
|
|
std::shared_ptr<ObjectData> object;
|
|
InstanceObject* LODinstance;
|
|
std::shared_ptr<DynamicObjectData> dynamics;
|
|
float _collisionHeight;
|
|
bool _enablePhysics;
|
|
|
|
InstanceObject(GameWorld* engine,
|
|
const glm::vec3& pos,
|
|
const glm::quat& rot,
|
|
ModelHandle* model,
|
|
const glm::vec3& scale,
|
|
std::shared_ptr<ObjectData> obj,
|
|
InstanceObject *lod,
|
|
std::shared_ptr<DynamicObjectData> dyn
|
|
);
|
|
|
|
Type type() { return Instance; }
|
|
|
|
void tick(float dt);
|
|
|
|
virtual bool takeDamage(const DamageInfo& damage);
|
|
};
|
|
|
|
|
|
#endif
|