-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIsland.cpp
More file actions
27 lines (23 loc) · 734 Bytes
/
Island.cpp
File metadata and controls
27 lines (23 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "Island.h"
void Island::addBody(std::shared_ptr<RigidBody> body) {
if (i_bodyCount < i_maxBodyCount) {
i_bodies[i_bodyCount++] = body;
}
}
void Island::initialize() {
//once learned about contacts
}
void Island::solve() {
////gravity
//for (int i = 0; i < i_bodyCount; ++i) {
// std::shared_ptr<RigidBody> body = i_bodies[i];
// VelocitySaved* v = i_velocities + i++;
// if (body->getBodyType() == BodyType::DYNAMIC) {
// body->applyForce(gravity * body->getGravityDirection());
// //vel
// body->setLinearVelocity(body->getLinearVelocity() + (body->getForce() * body->getInvMass() * dt));
// }
// v->v = body->getLinearVelocity();
// v->w = body->getAngularVelocity();
//}
}