Tuesday, November 27, 2012

fractureDeath

Was getting ahead of myself there again.  Had to back up and spend some more time on player movement and death.  You see, the shell concept will come into play later in the game.  At the beginning you start with only the heart, which is quite vulnerable.  If you hit anything too hard, you fracture into 8 gray cubes and die, as shown.
Was searching for a way to query the strength of a collision, and thereby compare it to a threshold above which you die.  Was worried I would have to implement a collision callback for this, and worse case calculate the impact strength manually using the velocities, angle of impact, etc.
But I found another neat little method:
btRigidBody->getDeltaLinearVelocity( )
It's not perfectly accurate, but a good cheat : )  I was reading on a game dev forum that game simulations rarely model the real world in an accurate way, but rather find cheats and work-arounds to get close to the right 'feel'. 

No comments:

Post a Comment