The previous tutorial allowed motion to be into the 3d models, this tutorial adds the ability to detect and respond to collisions.
To do this we add the DynamicsBean (here we are doing forward dynamics as opposed to inverse dynamics - inverse comes later!). I.e. motion is calculated from the forces, such as, force = mass * acceleration, constraints are not yet applied.
This tutorial sets up a collision between two shapes, when they collide they should bounce off each other rather than passing through each other.
First add two shapes with kinematics beans added to them (to see how to do this read the previous tutorial )
Change the colour of one of the shapes so the we can distinguish between the shapes..
Setup the kinematics beans under each of the transformGroups to setup the collision as follows:
Left hand shape:
- initial Distance: x = -0.5 , y = 0 , z = 0
- initial Velocity: x = 0.01 ,y = 0, z = 0
Right hand shape:
- initial Distance: x = 0.5 , y = 0 , z = 0
- initial Velocity: x = -0.01 ,y = 0, z = 0