Difference between revisions of "LlGroundNormal"

From Second Life Wiki
Jump to navigation Jump to search
m (fixing the links I just added)
m (<lsl> tag to <source>)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|inject-2={{LSL Function/offset|offset|noZ=*|sim=*}}
|func_id=222|func_sleep=0.0|func_energy=10.0
|func_id=222|func_sleep=0.0|func_energy=10.0
|func=llGroundNormal
|func=llGroundNormal
|return_type=vector|p1_type=vector|p1_name=offset
|return_type=vector|p1_type=vector|p1_name=offset
|func_footnote=The requested position needs to be in the same sim.
|func_footnote
|func_desc
|func_desc
|return_text=that is the ground normal from the current [[llGetPos|position]] + '''offset'''.
|return_text=that is the ground {{Wikipedia|Normal (geometry)|normal}} from the current [[llGetPos|position]] + {{LSLPT|offset}}.
|spec=This function is defined as:
|spec=This function is defined as:
<lsl>
<source lang="lsl2">
vector llGroundNormal(vector offset)
vector llGroundNormal(vector offset)
{
{
Line 13: Line 14:
     return <slope.x, slope.y, 1.0>;
     return <slope.x, slope.y, 1.0>;
}
}
</lsl>
</source>
|caveats=*Despite the name, llGroundNormal DOES NOT RETURN A NORMAL VECTOR!!! If your calculation requires a normal (for example if you are using the result as an argument to [[llAxes2Rot]]) then you must force it to be a normal with [[llVecNorm]](llGroundNormal(offset));
|caveats
|constants
|constants
|examples
|examples
Line 24: Line 25:
|also_events
|also_events
|also_articles
|also_articles
|notes
|notes=
*There seems to some confusion be between a [http://en.wikipedia.org/wiki/Normal_%28geometry%29 Surface Normal] (the direction from the surface) and [http://en.wikipedia.org/wiki/Unit_vector Normalized Vector] (a vector with a magnitude of 1.0, AKA Unit Vector). This function does '''not''' return a unit vector. Surface normals may encode additional information in the magnitude of the vector. If you need a Unit Vector, simply use [[llVecNorm]].
|cat1=Ground
|cat1=Ground
|cat2=Region
|cat2=Region
|cat3
|cat3
|cat4
|cat4
|history={{LSL Added|0.9.0|remote=http://secondlife.wikia.com/wiki/Version_0.9.0}}
}}
}}

Latest revision as of 11:24, 22 January 2015

Summary

Function: vector llGroundNormal( vector offset );

Returns a vector that is the ground "Wikipedia logo"normal from the current position + offset.

• vector offset offset relative to the prim's position and expressed in local coordinates

The requested position needs to be in the same region. Only the x and y coordinates in offset are important, the z component is ignored.

Specification

This function is defined as:

vector llGroundNormal(vector offset)
{
    vector slope = llGroundSlope(offset);
    return <slope.x, slope.y, 1.0>;
}

Examples

Notes

  • There seems to some confusion be between a Surface Normal (the direction from the surface) and Normalized Vector (a vector with a magnitude of 1.0, AKA Unit Vector). This function does not return a unit vector. Surface normals may encode additional information in the magnitude of the vector. If you need a Unit Vector, simply use llVecNorm.

See Also

Functions

•  llGround Gets the ground height
•  llGroundContour Gets the ground contour
•  llGroundSlope Gets the ground slope

Deep Notes

History

Search JIRA for related Issues

Footnotes

  1. ^ Early release notes were not very accurate or thorough, they sometimes included information about features added in previous releases or failed to include information about features added in that release.

Signature

function vector llGroundNormal( vector offset );