Procedural road object (help?)
by Dan Keller · in Torque Game Engine · 03/18/2008 (2:30 pm) · 62 replies
I made an object that automatically renders a curved road from a path. Well, it's more of a proof of concept, but it works fairly well. I'm having two problems, though:
*it ignores fog when rendering and sometimes doesn't render at all
*I have absolutely no idea how to get collision working.
Both of these are areas of the engine I know very little about. So here are the files. Can anyone help me on this?
fxRoad.h
fxRoad.cc
And yes, I know the object is re-calculated every frame, that's temporary.
Oh and thanks to Melv May for the fxRenderObject code that this is based on.

*it ignores fog when rendering and sometimes doesn't render at all
*I have absolutely no idea how to get collision working.
Both of these are areas of the engine I know very little about. So here are the files. Can anyone help me on this?
fxRoad.h
fxRoad.cc
And yes, I know the object is re-calculated every frame, that's temporary.
Oh and thanks to Melv May for the fxRenderObject code that this is based on.

About the author
Recent Threads
#62
I haven't looked at this code for a while, to be honest - have been focusing on other stuff for a little while. I'll get back on it sometime within the next few weeks ;).
Apparently debug/release discrepancies can often be caused by pointers not being initialised to NULL - something about debug mode safely initialising these variables for you. Which seems like exactly what you'd want it not to do :P.
10/24/2010 (8:19 am)
Arg, I hate it when I develop in debug mode and then things break in release mode :P. The collision is definitely a bit unstable, partly because I haven't added a bottom surface to the test road. Running along atop the road seems to work fine (possibly because of Player's stepping?), but trying to walk along the edges is not.I haven't looked at this code for a while, to be honest - have been focusing on other stuff for a little while. I'll get back on it sometime within the next few weeks ;).
Apparently debug/release discrepancies can often be caused by pointers not being initialised to NULL - something about debug mode safely initialising these variables for you. Which seems like exactly what you'd want it not to do :P.
Torque Owner CSMP
MP Studios
I don't think the road(texture?) is being generated when the host multiplayer option is disabled though the collision is always intact.
Also had the collision freeze kork(jittered when moved) and in other instances freeze the game.
Btw: I was testing on a release build
Edit: Checked on a debug build and the road is visible consistantly, seems like the collision may be a bit more stable as well.