Wheeled Vehicle driving on water?
by Chris Newman · in Torque Game Engine · 10/23/2004 (9:12 pm) · 5 replies
Just for fun im interisted in haveing a wheeled vehicle drive on water, and hopefully be able to bounce up and down with the waves.
Im looking in the WheeledVehicle::extendWheels() function and i see the code where it would cast a ray down, but it looks like that is only for the terrain.
Im thinking that i should be able to cast a ray down from each tire into the waterblock. In the hovervehicle class their is some code to get the waterblocks and then checks to see if the point is underwater. Im thinking that i should take that code to get the waterblocks then use the castray function from the waterblock code. That function is currently protected so it would have to be made public.
Would this be a good plan on how to do this or would there be an easier way?
Would the castRay function from the waterblock code be the proper one to use? I kind of have doubts on that because of the fact that it was protected while the castRay functions in other parts (such as container) are public.
Im looking in the WheeledVehicle::extendWheels() function and i see the code where it would cast a ray down, but it looks like that is only for the terrain.
Im thinking that i should be able to cast a ray down from each tire into the waterblock. In the hovervehicle class their is some code to get the waterblocks and then checks to see if the point is underwater. Im thinking that i should take that code to get the waterblocks then use the castray function from the waterblock code. That function is currently protected so it would have to be made public.
Would this be a good plan on how to do this or would there be an easier way?
Would the castRay function from the waterblock code be the proper one to use? I kind of have doubts on that because of the fact that it was protected while the castRay functions in other parts (such as container) are public.
#2
i think i found a solution

all i did was was added tha WaterObjectType to the sClientCollisionMask at the beginning of wheeledvehicle.cc.
But the only problem is that it does not conform to waves.
10/24/2004 (9:09 am)
Hmm well looking into everything even morei think i found a solution

all i did was was added tha WaterObjectType to the sClientCollisionMask at the beginning of wheeledvehicle.cc.
But the only problem is that it does not conform to waves.
#3
The waves are computed each time the WaterBlock is rendered, so in effect you cannot make object's conform to them.
Unless of course you modify the fluid code to simulate the waves on the server too...
10/24/2004 (9:45 am)
@Chris,The waves are computed each time the WaterBlock is rendered, so in effect you cannot make object's conform to them.
Unless of course you modify the fluid code to simulate the waves on the server too...
#4
im gonnna have to look into that.
Cuz now i have an idea to simulate boats useing wheeled vehicles.
I just wont render the tires, and because it uses springs it the shape would be able to "bounce" after hitting a wave or a ramp when it hits the water again.
10/24/2004 (9:54 am)
Ah i seeim gonnna have to look into that.
Cuz now i have an idea to simulate boats useing wheeled vehicles.
I just wont render the tires, and because it uses springs it the shape would be able to "bounce" after hitting a wave or a ramp when it hits the water again.
#5
09/16/2007 (8:42 pm)
Almost 3 years later lol, anyone have any progress on boats and waves?
Torque Owner Chris Newman
I think i need to use the cast ray from container and use a mask for the water.
Now onto my search of finding out what the masktype is...