Reverted to using boxes and spheres for the scene
parent
ab469b40c8
commit
f06da4445f
|
@ -45,17 +45,31 @@ void simulator_init() {
|
||||||
|
|
||||||
sWorld.mStaticShapes.push_back(sGroundShape);
|
sWorld.mStaticShapes.push_back(sGroundShape);
|
||||||
|
|
||||||
double restitution = 0.8;
|
double restitution = 0.5;
|
||||||
|
|
||||||
int num_spheres = 40;
|
int num_bodies = 40;
|
||||||
for (int i = 0; i < num_spheres; i++) {
|
for (int i = 0; i < num_bodies; i++) {
|
||||||
SimBody sphere_body = CreateSphereBody(
|
SimBody body;
|
||||||
|
|
||||||
|
bool create_sphere = i %2;
|
||||||
|
|
||||||
|
if (!create_sphere) {
|
||||||
|
body = CreateBoxBody(
|
||||||
|
1.,
|
||||||
|
Vector3d(2., 1., 1.),
|
||||||
|
restitution,
|
||||||
|
Vector3d::Random() * 5.,
|
||||||
|
Vector3d::Zero());
|
||||||
|
} else {
|
||||||
|
body = CreateSphereBody(
|
||||||
1.,
|
1.,
|
||||||
1.,
|
1.,
|
||||||
restitution,
|
restitution,
|
||||||
Vector3d::Random() * 5.,
|
Vector3d::Random() * 5.,
|
||||||
Vector3d::Zero());
|
Vector3d::Zero());
|
||||||
sWorld.mBodies.push_back(sphere_body);
|
}
|
||||||
|
|
||||||
|
sWorld.mBodies.push_back(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < sWorld.mBodies.size(); i++) {
|
for (int i = 0; i < sWorld.mBodies.size(); i++) {
|
||||||
|
|
Loading…
Reference in New Issue