Difference between revisions of "LlGroundRepel"

From Second Life Wiki
Jump to navigation Jump to search
(This function was poorly documented. I added some notes I found while testing it)
 
(5 intermediate revisions by the same user not shown)
Line 8: Line 8:
|p3_type=float|p3_name=tau
|p3_type=float|p3_name=tau
|func_footnote=Do not use with vehicles.
|func_footnote=Do not use with vehicles.
|func_desc=Critically damps to {{LSLP|height}} if within <code>{{LSLPT|height}} * 0.5</code> of ground or water level (which ever is higher). Does not pull the object down if it is stuck higher than that, unlike the similar [[llSetHoverHeight]].
|func_desc=Critically damps to {{LSLP|height}} if within <code>{{LSLPT|height}} * 0.5</code> of ground or water level (which ever is higher).  
|return_text
|spec=Does not pull the object down if it is stuck higher than that, unlike the similar [[llSetHoverHeight]].


To stop llGroundRepel, this seems to work: <code>llGroundRepel(0.0, FALSE, 0.0)</code>
To stop llGroundRepel, this seems to work: <code>llGroundRepel(0.0, FALSE, 0.0)</code>
|return_text
|spec
|caveats=
|caveats=
* This is not a prim property; stopping or resetting the script stops llGroundRepel
* This is not a prim property; stopping or resetting the script stops llGroundRepel; same with the similar [[llSetHoverHeight]]
* Crossing a sim border will cancel llGroundRepel
* Crossing a sim border will cancel llGroundRepel, unlike [[llSetHoverHeight]]
* A negative height value allows you to hover underwater, same as [[llSetHoverHeight]]
* A previous version of this page suggested that [[llStopHover]] will stop llGroundRepel, but it does not
* A previous version of this page suggested that [[llStopHover]] will stop llGroundRepel, but it does not
|constants
|constants
Line 31: Line 32:
}// This is actually a remarkably fast way to go straight up!!</source>
}// This is actually a remarkably fast way to go straight up!!</source>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llSetHoverHeight]]| Similar to llGroundRepel, but is not terrain-dependent}}
|also_functions={{LSL DefineRow||[[llSetHoverHeight]]| Similar to llGroundRepel, but also pulls down}}
|also_tests
|also_tests
|also_events
|also_events

Latest revision as of 21:44, 17 February 2024

Summary

Function: llGroundRepel( float height, integer water, float tau );

Critically damps to height if within height * 0.5 of ground or water level (which ever is higher).

• float height Distance above the ground
• integer water boolean, if TRUE then hover above water too.
• float tau seconds to critically damp in

Do not use with vehicles.

Specification

Does not pull the object down if it is stuck higher than that, unlike the similar llSetHoverHeight.

To stop llGroundRepel, this seems to work: llGroundRepel(0.0, FALSE, 0.0)

Caveats

  • Only works in physics-enabled objects.
  • This is not a prim property; stopping or resetting the script stops llGroundRepel; same with the similar llSetHoverHeight
  • Crossing a sim border will cancel llGroundRepel, unlike llSetHoverHeight
  • A negative height value allows you to hover underwater, same as llSetHoverHeight
  • A previous version of this page suggested that llStopHover will stop llGroundRepel, but it does not
All Issues ~ Search JIRA for related Bugs

Examples

default
{
    state_entry()
    {
        llSetStatus(STATUS_PHYSICS, TRUE);
        llGroundRepel(0.5, TRUE, 0.2); // In a 1/2 meter cube this is roughly the minimum height for any noticeable effect.
        // to
        llGroundRepel(4096.0, TRUE, 0.2); // There is no restrictive maximum.
        // However as the prim reaches 4096 meters (bear in mind the prim height will be (float height + ground height))
        // it will be too high to be allowed to exist.
    }
}// This is actually a remarkably fast way to go straight up!!

See Also

Functions

•  llSetHoverHeight Similar to llGroundRepel, but also pulls down

Deep Notes

Search JIRA for related Issues

Signature

function void llGroundRepel( float height, integer water, float tau );