41 lines
613 B
C
41 lines
613 B
C
#pragma once
|
|
|
|
#include "../../GAME_COMMON.h"
|
|
#include "../ecs_entity.h"
|
|
|
|
typedef struct ComponentPhysics
|
|
{
|
|
u32 id;
|
|
f32 friction;
|
|
f32 velocityMax;
|
|
vec3 velocity;
|
|
vec3 position;
|
|
} ComponentPhysics;
|
|
|
|
void component_physics_init
|
|
(
|
|
ComponentPhysics* self,
|
|
vec3 position,
|
|
f32 velocityMax,
|
|
f32 friction
|
|
);
|
|
void component_physics_tick(ComponentPhysics* self, ECS* ecs);
|
|
|
|
static const ECSComponentInfo COMPONENT_PHYSICS_INFO =
|
|
{
|
|
.system =
|
|
{
|
|
.functions =
|
|
{
|
|
NULL,
|
|
NULL,
|
|
(ECSFunction)component_physics_tick,
|
|
NULL
|
|
}
|
|
},
|
|
.type = ECS_COMPONENT_PHYSICS,
|
|
.size = sizeof(ComponentPhysics)
|
|
};
|
|
|
|
|