January 2015
Beginner to intermediate
478 pages
9h 46m
English
Now, we will create individual bodies and set their properties and put them into our dynamics world, as follows:
modelbuilder.begin();
MeshPartBuilder mpb = modelbuilder.part("parts", GL20.GL_TRIANGLES, Usage.Position | Usage.Normal | Usage.Color, new Material(ColorAttribute.createDiffuse(Color.WHITE)));
mpb.setColor(1f, 1f, 1f, 1f);
mpb.box(0, 0, 0, 40, 1, 40);
Model model = modelbuilder.end();
groundInstance = new ModelInstance(model);
btCollisionShape groundshape = new btBoxShape(new Vector3(20, 1 / 2f, 20));
btRigidBodyConstructionInfo bodyInfo = new btRigidBodyConstructionInfo(0, null, groundshape, Vector3.Zero);
btRigidBody body = new btRigidBody(bodyInfo);
world.addRigidBody(body);The preceding steps are to create ...
Read now
Unlock full access