llGroundNormal
function
Function syntax
vector llGroundNormal(vector offset// Offset relative to the prim's position, expressed in local coordinates.
);- Returns
vector- Energy
- 10
Returns a vector representing the ground surface normal vector directly below the current position offset by the vector offset.
Returns a vector that is the ground normal from the current position + offset.
vector result = llGroundNormal(ZERO_VECTOR);Specification
Section titled “Specification”This function is defined as:
vector llGroundNormal(vector offset){ vector slope = llGroundSlope(offset); return <slope.x, slope.y, 1.0>;}- 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.
History
Section titled “History”Added in SL 0.9.0
See also
Section titled “See also”Functions
Section titled “Functions”llGround— Gets the ground heightllGroundContour— Gets the ground contourllGroundSlope— Gets the ground slope
Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.