Jump problem identify floor
Members - Reputation: 230
Posted 06 November 2012 - 06:42 AM
Basically now the player can jump again as soon as i touch any wall/floor/roof. But i want the player only to jump again if location is on the floor.
My collision detection is calc length to triangle and push the player out the amount it is to close from sphere radius.
Crossbones+ - Reputation: 8351
Posted 06 November 2012 - 07:26 AM
if( dot(surface_normal, up_vector)>threshold) jump;<=>
// assumption: y pointing up if( surface_normal.y>threshold) jump;
Edited by Ashaman73, 06 November 2012 - 07:32 AM.
My game: Gnoblins
Developer journal about Gnoblins
Small goodies: Simple alpha transparency in deferred shader