Skip to content
lsl.devlsl.devLSL Dev

llGroundNormal

function
Function syntax
vector llGroundNormal(
  1. 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.

How to use
vector result = llGroundNormal(ZERO_VECTOR);

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.

Added in SL 0.9.0

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.