Hi guys,
i am attempting to cast a ray from my model downwards against the terrain to set the models height, only problem is that i am lost on how to write the actual ray, i know the start position of the ray will be the models position but i am not sure how to write the end of the ray.
i have already tried using the getheight function for updating the height but because i am creating a platformer with jumping, when i am on top of a platform it doesnt register that the height of the model is not the terrain but the terrain PLUS the height of the platform and thus my jumpin wont work, but i digress.
if any one could help me with how to write the end point on the ray. Thanks in advance for any help
Ray casting
Last edited by ent1ty on Wed Mar 02, 2011 10:45 am, edited 1 time in total.
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Just subtract a real huge value from your y-axis of the startpoint to be sure it's large enough. If you know the the maximal size of your world you can use that value.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm