LlGroundNormal: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
m changed the caveat to say "unit normal" instead of just normal
Void Singer (talk | contribs)
m corrected Caveat to Note
Line 14: Line 14:
}
}
</lsl>
</lsl>
|caveats=*Despite the name, [[llGroundNormal]] DOES NOT RETURN A NORMAL UNIT VECTOR!!! If your calculation requires a unit normal (for example if you are using the result as an argument to [[llAxes2Rot]]) then you must force it to be a unit normal with [[llVecNorm]]([[llGroundNormal]](offset));
|caveats
|constants
|constants
|examples
|examples
Line 24: Line 24:
|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

Revision as of 04:04, 16 June 2012

Summary

Function: vector llGroundNormal( vector offset );
0.0 Forced Delay
10.0 Energy

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

• vector offset

The requested position needs to be in the same sim.

Specification

This function is defined as: <lsl> vector llGroundNormal(vector offset) {

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

} </lsl>

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

Signature

function vector llGroundNormal( vector offset );