Files
HydraV3/HydraEngine/source/task/physics/HydraSetPhysicsTransform.hpp
2026-08-25 22:10:54 +01:00

39 lines
972 B
C++

#ifndef HYDRASETPHYSICSTRANSFORM
#define HYDRASETPHYSICSTRANSFORM
#include "../HydraTask.h"
#include "../../engine/HydraEngine.h"
#include "../../renderer/HydraRenderer.h"
#include <GLMIncludes.h>
#include "../../GlewIncludes.h"
#include "../../buffer/HydraTextureBufferManager.h"
#include <box3d/box3d.h>
class HydraSetPhysicsTransform : public HydraTask
{
private:
b3BodyId m_body_id = {};
glm::vec3 m_position = {};
glm::quat m_rotation = {};
protected:
public:
void Process() override
{
b3Vec3 position = {m_position.x, m_position.y, m_position.z};
b3Quat rotation = {m_rotation.x, m_rotation.y, m_rotation.z, m_rotation.w};
b3Body_SetTransform(m_body_id, position, rotation);
}
void Initialise(b3BodyId body_id, glm::vec3 position, glm::quat rotation)
{
m_body_id = body_id;
m_position = position;
m_rotation = rotation;
}
};
#endif /* HYDRASETPHYSICSTRANSFORM */