1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-10 12:52:39 +01:00
openrw/rwengine/include/dynamics/CollisionInstance.hpp
2015-04-04 20:11:48 +01:00

43 lines
878 B
C++

#pragma once
#ifndef _COLLISIONINSTANCE_HPP_
#define _COLLISIONINSTANCE_HPP_
#include <bullet/btBulletDynamicsCommon.h>
#include <vector>
#include <string>
class GameObject;
struct DynamicObjectData;
struct VehicleHandlingInfo;
/**
* @brief Utility object for managing bullet objects.
*
* Stores handles to a btRigidBody and a set of collision shapes
*/
class CollisionInstance
{
public:
CollisionInstance()
: body(nullptr), vertArray(nullptr), motionState(nullptr), collisionHeight(0.f)
{ }
~CollisionInstance();
bool createPhysicsBody(GameObject* object,
const std::string &modelName,
DynamicObjectData* dynamics = nullptr,
VehicleHandlingInfo* handling = nullptr);
btRigidBody* body;
std::vector<btCollisionShape*> shapes;
btTriangleIndexVertexArray* vertArray;
btMotionState* motionState;
float collisionHeight;
};
#endif