mirror of https://github.com/OpenMW/openmw.git
Merge branch 'collision_object' into 'master'
Move btCollisionObject creation for MWPhysics::Object into components See merge request OpenMW/openmw!1281pull/3174/head
commit
d110c1be3b
@ -0,0 +1,24 @@
|
||||
#ifndef OPENMW_COMPONENTS_BULLETHELPERS_COLLISIONOBJECT_H
|
||||
#define OPENMW_COMPONENTS_BULLETHELPERS_COLLISIONOBJECT_H
|
||||
|
||||
#include <components/misc/convert.hpp>
|
||||
|
||||
#include <BulletCollision/CollisionDispatch/btCollisionObject.h>
|
||||
#include <LinearMath/btQuaternion.h>
|
||||
#include <LinearMath/btTransform.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace BulletHelpers
|
||||
{
|
||||
inline std::unique_ptr<btCollisionObject> makeCollisionObject(btCollisionShape* shape,
|
||||
const btVector3& position, const btQuaternion& rotation)
|
||||
{
|
||||
std::unique_ptr<btCollisionObject> result = std::make_unique<btCollisionObject>();
|
||||
result->setCollisionShape(shape);
|
||||
result->setWorldTransform(btTransform(rotation, position));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue