Physics working

This commit is contained in:
Confideo-IOM
2026-08-24 20:59:24 +01:00
parent 20c0794d10
commit 1253571c17
146 changed files with 4469 additions and 1273 deletions
+11 -14
View File
@@ -7,6 +7,7 @@
#include "../ecs/components/HydraMeshComponent.h"
#include "../ecs/components/HydraRenderableComponent.h"
#include "../ecs/components/HydraMaterialComponent.h"
#include "../ecs/components/HydraPhysicsComponent.h"
#include "../buffer/HydraMaterialBufferManager.h"
#include "../buffer/HydraTextureBufferManager.h"
#include "../buffer/HydraMaterialBuffer.h"
@@ -18,7 +19,7 @@ void HydraTestCubeActor::InitialiseComponents()
// HydraECS* ecs = GetEngine()->ECS();
// HydraID entity_id = ecs->CreateEntity();
_CreatePosition();
// _CreatePhysics();
_CreatePhysics();
_CreateMaterial();
_CreateMesh();
@@ -183,21 +184,17 @@ void HydraTestCubeActor::_CreateMaterial()
void HydraTestCubeActor::_CreatePhysics()
{
// HydraECSPhysicsComponent physics_component;
// physics_component.physics_state = Hydra_State::Waiting;
// physics_component.physics_definition.actor_id = GetID();
// physics_component.physics_definition.physics_type = HydraPhyicsType::Static;
// physics_component.physics_definition.physics_shape = HydraPhysicsShape::HydraBoxShape;
// physics_component.physics_definition.mass = 100000.0f;
// physics_component.physics_definition.extent_x = 1000.0f;
// physics_component.physics_definition.extent_y = 0.5f;
// physics_component.physics_definition.extent_z = 1000.0f;
// physics_component.physics_definition.dynamic_friction = 0.5f;
// physics_component.physics_definition.restitution = 0.5f;
HydraEngine *engine = GetEngine();
HydraPhysicsComponent phys_comp = {};
phys_comp.mass = 0;
phys_comp.phyics_type = HYDRA_PHYSICS_TYPE::HYDRA_RIGID_BODY;
phys_comp.physics_shape = HYDRA_PHYSICS_SHAPE::HYDRA_PHYSICS_BOX;
// HydraECS* ecs = GetEngine()->ECS();
phys_comp.depth = 1.0f;
phys_comp.height = 1.0f;
phys_comp.width = 1.0f;
// ecs->AddComponent<HydraECSPhysicsComponent>(GetID(), physics_component);
engine->ECS()->AddComponent<HydraPhysicsComponent>(GetID(), phys_comp);
}
void HydraTestCubeActor::_CreateRenderableComponent()
{