Adjusted scene (more objects, mixed boxes and spheres)

master
Martin Felis 2020-11-24 22:30:59 +01:00
parent 28d7e5efaa
commit ca4f4048df
1 changed files with 3 additions and 3 deletions

View File

@ -45,11 +45,11 @@ void simulator_init() {
double restitution = 0.3; double restitution = 0.3;
int num_bodies = 5; int num_bodies = 10;
for (int i = 0; i < num_bodies; i++) { for (int i = 0; i < num_bodies; i++) {
SimBody body; SimBody body;
bool create_sphere = false; bool create_sphere = i %2;
if (!create_sphere) { if (!create_sphere) {
body = CreateBoxBody( body = CreateBoxBody(
@ -102,7 +102,7 @@ void simulator_reset() {
for (int i = 0; i < sWorld.mBodies.size(); i++) { for (int i = 0; i < sWorld.mBodies.size(); i++) {
sWorld.mBodies[i].q.block(0, 0, 3, 1) = sWorld.mBodies[i].q.block(0, 0, 3, 1) =
Vector3d::Random() * 0.3 + Vector3d(0., 5., 0.); Vector3d::Random() * 2.5 + Vector3d(0., 5., 0.);
sWorld.mBodies[i].q[2] = 0.; sWorld.mBodies[i].q[2] = 0.;
} }