Render Objects Below Terrain?
by Matt Swanson · in Torque Game Engine · 07/31/2008 (10:25 pm) · 5 replies
Right now I am using an invisible terrain to keep my vehicle from moving vertically. This is set in space and I want to have planets in the background (top down view) but when I place them below the terrain they don't draw unless I move the camera below the terrain. Is there a way to get them to draw so I can see them when above the terrain?
About the author
#2
Find something similar to:
That will cancel out any verticle movement. If you wanted to let the player/vehicle move up or down a slope, you might be able to do this:
08/01/2008 (11:19 am)
I took this out of the player code, but I assume there is something like it in your vehicle shtuff.Find something similar to:
mVelocity -= mVelocity * mDrag * TickSec;and replace it with this:
mVelocity -= mVelocity * mDrag * TickSec; mVelocity.z = 0;
That will cancel out any verticle movement. If you wanted to let the player/vehicle move up or down a slope, you might be able to do this:
mVelocity -= mVelocity * mDrag * TickSec; if(!runSurface) mVelocity.z = 0;
#3
08/01/2008 (12:52 pm)
Thanks for the replies. I'll give those ideas a shot when I get the chance. That seems like a much better idea since it would help keep the vehicle from bouncing since the velocity on the z axis would be null, right?
#4
08/01/2008 (12:55 pm)
Yep, it should. I'm not sure how it will effect vehicles though, I've only used that on Players and AIPlayers and I'm not on my dev computer.
#5
It keeps the vehicle stable which is great, only problem now is my advanced camera doesn't track it properly like it did before. The camera turns more than the ship where as before it turned with the ship. Any ideas?
08/01/2008 (3:40 pm)
Okay, went into HoverVehicle.cc and added this toward the end of ::updateForcesforce.z = 0; torque.z = 0;
It keeps the vehicle stable which is great, only problem now is my advanced camera doesn't track it properly like it did before. The camera turns more than the ship where as before it turned with the ship. Any ideas?
Associate James Ford
Sickhead Games