mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-10 04:42:38 +01:00
41 lines
852 B
C++
41 lines
852 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;
|
|
std::shared_ptr<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,
|
|
std::shared_ptr<InstanceObject> lod,
|
|
std::shared_ptr<DynamicObjectData> dyn
|
|
);
|
|
|
|
Type type() { return Instance; }
|
|
|
|
void tick(float dt);
|
|
|
|
virtual bool takeDamage(const DamageInfo& damage);
|
|
};
|
|
|
|
|
|
#endif
|