aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Rigidbody.cpp
blob: be6bb93e0ecb6919fd72f83e2a274c18e3634155 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "Rigidbody.h"

using namespace crepe;

crepe::Rigidbody::Rigidbody(const Component::Data & component_data, const Data & data)
	: Component(component_data),
	  data(data) {}

void crepe::Rigidbody::add_force_linear(const Vector2 & force) {
	this->data.linear_velocity += force;
}

void crepe::Rigidbody::add_force_angular(double force) {
	this->data.angular_velocity += force;
}