This repository has been archived on 2022-05-21. You can view files and clone it, but cannot push or open issues or pull requests.
LEFTONE/core/locommon/physics.h

29 lines
541 B
C
Raw Permalink Normal View History

#pragma once
#include <stdbool.h>
#include "util/math/vector.h"
#include "./position.h"
typedef struct {
/* input */
vec2_t size;
/* input/output */
locommon_position_t pos;
vec2_t velocity;
} locommon_physics_entity_t;
bool
locommon_physics_entity_valid(
const locommon_physics_entity_t* e
);
bool /* whether they were collided */
locommon_physics_solve_collision_with_fixed_one(
locommon_physics_entity_t* e1,
const locommon_physics_entity_t* e2,
float dt
);