mirror of https://github.com/OpenMW/openmw.git
Move btCollisionObject creation for MWPhysics::Object into components
parent
d6613d3677
commit
405e814190
@ -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