Physics working
This commit is contained in:
@@ -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"
|
||||
@@ -23,6 +24,7 @@ void HydraPlaneActor::InitialiseComponents()
|
||||
_CreateMaterial();
|
||||
_CreateMesh();
|
||||
_CreateRenderableComponent();
|
||||
_CreatePhysics();
|
||||
}
|
||||
|
||||
void HydraPlaneActor::DeferredInitialiseComponents()
|
||||
@@ -183,21 +185,18 @@ void HydraPlaneActor::_CreateMaterial()
|
||||
|
||||
void HydraPlaneActor::_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_STATIC_BODY;
|
||||
phys_comp.physics_shape = HYDRA_PHYSICS_SHAPE::HYDRA_PHYSICS_BOX;
|
||||
|
||||
// HydraECS* ecs = GetEngine()->ECS();
|
||||
phys_comp.depth = 1000.0f;
|
||||
phys_comp.height = 1.0f;
|
||||
phys_comp.width = 1000.0f;
|
||||
|
||||
// ecs->AddComponent<HydraECSPhysicsComponent>(GetID(), physics_component);
|
||||
engine->ECS()->AddComponent<HydraPhysicsComponent>(GetID(), phys_comp);
|
||||
|
||||
}
|
||||
void HydraPlaneActor::_CreateRenderableComponent()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user