export function rigid_body2d(kind: RigidKind, bounciness = 1, drag = 0.001) {
return (game: Game, entity: Entity) => {
game.World.Signature[entity] |= Has.RigidBody2D;
game.World.RigidBody2D[entity] = {
Kind: kind,
Drag: clamp(0, 1, drag),
Bounciness: clamp(0, 1, bounciness),
Acceleration: [0, 0],
VelocityLinear: [0, 0],
VelocityResolved: [0, 0],
VelocityAngular: 0,
IsGrounded: false,
};
};
}