1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-20 09:21:44 +02:00
openrw/rwengine/include/objects/InstanceObject.hpp
Daniel Evans 3e9b0c64e4 Re-implement object rendering using a depth-sorted approach.
This moves the object rendering logic into ObjectRenderer. This makes
GameRenderer a bit smaller.

There are some rendering logic decisions that haven't been brought
back yet since they may be better placed elsewhere.
2016-04-19 01:20:54 +01:00

46 lines
1.1 KiB
C++

#pragma once
#ifndef _OBJECTINSTANCE_HPP_
#define _OBJECTINSTANCE_HPP_
#include <objects/GameObject.hpp>
#include <btBulletDynamicsCommon.h>
class CollisionInstance;
/**
* @struct InstanceObject
* A simple object instance
*/
class InstanceObject : public GameObject
{
float health;
public:
glm::vec3 scale;
CollisionInstance* body;
std::shared_ptr<ObjectData> object;
InstanceObject* LODinstance;
std::shared_ptr<DynamicObjectData> dynamics;
bool _enablePhysics;
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
);
~InstanceObject();
Type type() { return Instance; }
void tick(float dt);
void changeModel(std::shared_ptr<ObjectData> incoming);
glm::vec3 getPosition() const override;
glm::quat getRotation() const override;
virtual void setRotation(const glm::quat& r);
virtual bool takeDamage(const DamageInfo& damage);
float getHealth() const { return health; }
};
#endif