feat(physics): rigidbodies can now be marked static
This commit is contained in:
parent
14877b0a28
commit
90dc3e1792
|
@ -20,6 +20,7 @@ struct RigidBody {
|
|||
PhysicsMask collision_mask;
|
||||
|
||||
int overlap;
|
||||
int is_static;
|
||||
|
||||
List contacts;
|
||||
};
|
||||
|
@ -159,6 +160,14 @@ void rigidbody_set_overlap(RigidBody* self, int value) {
|
|||
self->overlap = 1;
|
||||
}
|
||||
|
||||
int rigidbody_is_static(RigidBody* self) {
|
||||
return self->is_static;
|
||||
}
|
||||
|
||||
void rigidbody_set_static(RigidBody* self, int value) {
|
||||
self->is_static = value != 0;
|
||||
}
|
||||
|
||||
Vector rigidbody_get_velocity(const RigidBody* self) {
|
||||
return self->linear_velocity;
|
||||
}
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include "collision.h"
|
||||
#include "stdint.h"
|
||||
|
||||
typedef uint32_t PhysicsMask;
|
||||
|
||||
struct Collision;
|
||||
typedef struct {
|
||||
struct Collision hit;
|
||||
|
@ -48,6 +46,9 @@ extern void rigidbody_set_collision_mask(RigidBody* self, PhysicsMask mask);
|
|||
extern int rigidbody_get_overlap(RigidBody* self);
|
||||
extern void rigidbody_set_overlap(RigidBody* self, int value);
|
||||
|
||||
extern int rigidbody_is_static(RigidBody* self);
|
||||
extern void rigidbody_set_static(RigidBody* self, int value);
|
||||
|
||||
extern Vector rigidbody_get_velocity(const RigidBody* self);
|
||||
extern void rigidbody_set_velocity(RigidBody* self, Vector velocity);
|
||||
|
||||
|
|
Loading…
Reference in a new issue