Friday, December 14, 2012

kxCollectable

Nearing completion of foundation. 
Today added the much needed collision callback system, well, a rough first draft of it.  Using the method first recommended in the Bullet tutorials;
"The best way to determine if collisions happened between existing objects in the world, is to iterate over all contact manifolds. This should be done during a simulation tick (substep) callback, because contacts might be added and removed during several substeps of a single stepSimulation call."
It seems to be working fine. 
Derived a kxCollectable class from kxCube to be used first as just a test to get the callbacks working, but later as a base class for all kinds of collectibles.

 Also implemented a framerate cap. 
Although I thought it was cool to be getting 2K fps, I was ignoring the odd buzzing sound coming from my computer.  That sound was the graphics card components working their asses off and heating up :[
I tried v-sync but it was buggy and made my code lag, specifically collision detection was off.  So I just created a lastRenderTime variable and check it against the game clock to make sure 1/120 second has passed before rendering the scene again.  The other processes still continue separately.  So far so good...

No comments:

Post a Comment