Jump to content

Water Depth


Tibbybob
 Share

You are about to reply to a thread that has been inactive for 4562 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello,

I want to display the water depth from the surface to the bottom, when a boat is floating near the shoreline.  I have experimented with variations of

 depthString="Water Depth "+(string) llRound((llWater( ZERO_VECTOR ))/3.28)+ "Feet\n";

 but the depth seems to be wrong when the boat is out in open water and it doesn't change when you get to shore (where the water comes up to my waist if I stand beside the boat).  I expected llWater to display the depth directly under the center of the prim where the script is located, based on the description at http://wiki.secondlife.com/wiki/LlWater.

Is the problem with my script, or with my understanding of what the function should do?  (or both?)

Thanks,

Tibbybob

 

Link to comment
Share on other sites

llWater() just tells you the height above 0m at which water has been set for that sim (typically 20m).  If you want the depth you have to calculate it by subtracting the llGround() height. That is; if the ground is below the water-level you have positive depth (llWater(ZERO_VECTOR) - llGround(ZERO_VECTOR)).  On the other hand, of course, if the ground is above the water-level then you've run aground.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4562 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...