Watercoverage issue
by Michael Richards · in Torque Game Engine · 02/23/2003 (8:46 am) · 8 replies
In my project I am working with the latest HEAD. I have jets that depend on mwatercoverage for determining both jet force and emitters. If I have a water block at said height and go to a point outside the water block, but lower than said height, I still get the underwater jet force and emitters, indicating that mWaterCoverage is determined soley on height. It would make more sense to have it also determined by if you are inside the bounds of any water blocks. I don't know if this is how you made it or if there is actually a bug. A little insight would be appreciated.
#3
Your question/problem could probably be phrased better, it took reading it a couple times to even guess at what you are having a problem with.
02/27/2003 (10:28 am)
there are operations that determine if the player is in liquid or not that you might try.Your question/problem could probably be phrased better, it took reading it a couple times to even guess at what you are having a problem with.
#4
Say I have a pool of water in the game and a player with a jet pack, when I go underwater a different emitter is triggered for the jet trail, as well the jet pack gives more thrust.
The problem is, that if I go to another area of the map that is dry and is lower than the pool of water, it is as if I am in the water, the underwater jet emitter fires and I get more jet thrust. I've also tested it for the inwater sound fields that came with the original fps player.cs, and the same problem occurs, the sound is activated on dry land when the player's altitude drops below a water blocks altitude.
As far as I've seen, the two methods for easily determining if a player is underwater are the variable mWaterCoverage and another variable something like InWater, but it's derived from mWaterCoverage.
I believe that the problem is that mWaterCoverage seems to be determined by
the player's location on the vertical plane, not any bounds information.
The palyer's splash emitters work I believe because they are based off of raycasting, not the watercoverage variable.
If anyone who knows what I'm talking about can confirm that and/or help, it would be greatly appreciated.
02/27/2003 (11:31 am)
Ok... a little more simple.Say I have a pool of water in the game and a player with a jet pack, when I go underwater a different emitter is triggered for the jet trail, as well the jet pack gives more thrust.
The problem is, that if I go to another area of the map that is dry and is lower than the pool of water, it is as if I am in the water, the underwater jet emitter fires and I get more jet thrust. I've also tested it for the inwater sound fields that came with the original fps player.cs, and the same problem occurs, the sound is activated on dry land when the player's altitude drops below a water blocks altitude.
As far as I've seen, the two methods for easily determining if a player is underwater are the variable mWaterCoverage and another variable something like InWater, but it's derived from mWaterCoverage.
I believe that the problem is that mWaterCoverage seems to be determined by
the player's location on the vertical plane, not any bounds information.
The palyer's splash emitters work I believe because they are based off of raycasting, not the watercoverage variable.
If anyone who knows what I'm talking about can confirm that and/or help, it would be greatly appreciated.
#5
from there depending on the object in question the variable is used differently
the player class the update splash checks by asking the water block if pointInWater this has the real goods.
just using the mCoverage var seems to not have the truth.
02/27/2003 (11:44 am)
ok this is the function used by ShapeBase class to calculate water coverage : static void waterFind(SceneObject* obj,void * key)
from there depending on the object in question the variable is used differently
the player class the update splash checks by asking the water block if pointInWater this has the real goods.
just using the mCoverage var seems to not have the truth.
#6
03/01/2003 (11:54 am)
edit: deleted. I posted in wrong thread.
#7
03/02/2003 (12:49 am)
I changed it to use the pointInWater function as Bg suggested, it works fine, and I also modified the in water sounds to do the same.
#8
www.garagegames.com/mg/forums/result.thread.php?qt=21868
12/18/2007 (8:04 am)
If anyone has dead-ended here - I posted a patch to compensate for the underlying bug at the shapebase level (which includes Item, Player, StaticShape, etc.).www.garagegames.com/mg/forums/result.thread.php?qt=21868
Torque Owner Michael Richards