41 lines
924 B
C++
41 lines
924 B
C++
#include "dl_rigid_body.h"
|
|
|
|
#include <Jolt/Jolt.h>
|
|
|
|
#include <Jolt/RegisterTypes.h>
|
|
#include <Jolt/Core/Factory.h>
|
|
#include <Jolt/Core/TempAllocator.h>
|
|
#include <Jolt/Core/JobSystemThreadPool.h>
|
|
#include <Jolt/Physics/PhysicsSettings.h>
|
|
#include <Jolt/Physics/PhysicsSystem.h>
|
|
#include <Jolt/Physics/Collision/Shape/BoxShape.h>
|
|
#include <Jolt/Physics/Collision/Shape/SphereShape.h>
|
|
#include <Jolt/Physics/Body/BodyCreationSettings.h>
|
|
#include <Jolt/Physics/Body/BodyActivationListener.h>
|
|
#include <Jolt/Physics/Body/Body.h>
|
|
|
|
#include "dl_physics.h"
|
|
|
|
namespace dl
|
|
{
|
|
|
|
|
|
RigidBody::~RigidBody()
|
|
{
|
|
g_physics->_delete_rigid_body(this);
|
|
}
|
|
|
|
dl::Position3 RigidBody::GetPosition()
|
|
{
|
|
auto pos = _body->GetPosition();
|
|
return { pos.GetX(), pos.GetY(), pos.GetZ() };
|
|
}
|
|
|
|
dl::Position3 RigidBody::GetRotate()
|
|
{
|
|
auto quat = _body->GetRotation();
|
|
auto vec = quat.GetEulerAngles();
|
|
return { vec.GetX(), vec.GetY(), vec.GetZ() };
|
|
}
|
|
|
|
} |