Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:2.00

Description

Description:

Returns the surface normal for the terrain at the given position.

Objects on the terrain (such as buildings or bridges) are ignored. Allows alignment of static objects with an uneven terrain.

Syntax

Syntax:surfaceNormal position
Parameters:
  • position: Position2D - X/Y position on the terrain to check.
Return Value:Vector3D - [X,Y,Z] normal at specified position (a perfectly flat plane, returns [0,0,1]).

Examples

Examples:
someHouse setVectorUp (surfaceNormal getPos someHouse)

Additional Information

See also: terrainHeight, placeOnSurface, underlyingSurface
Multiplayer:
Problems:Does not consider the Attachments at the side of roads (V3.6).

Notes







Posted on Nov 20, 2013
General Barron
Note this only returns the normal of the terrain, not of any surfaces above the terrain. If you pass a Z component in the input position, it will be ignored. Example: the surfaceNormal of a position along a flat bridge over a hill will return the hill's normal, not the flat bridge's normal.