PointInfo
Public / Attributes
Elevation
The terrain-space elevation.
If the given value in is not a number (see Maths.IsNumber), the corresponding point info flag flag will be cleared.
- See also
Face
The cubemap face of the triangle that contains the point (derived from PointInfoFlags.Heightmap and Vertices).
Heightmap
Heightmap coordinates of the picked point, relative to HeightmapsUtil.MaxSize.
If the given value in is undefined (see Vec3D.IsUndefined), the corresponding point info flag flag will be cleared.
Vertices
Indices of vertices of picked triangle.
The vertices of the picked triangle are oriented so that the vector cross(Y-X, Z-X)
points into the direction of the triangle face normal.
Weights
The barycentric coordinates (range [0..1]
) of picked point in picked triangle.
If the given value in is undefined (see Vec3D.IsUndefined), the corresponding point info flag flag will be cleared.
The picked point can be expressed using barycentric coordinates as follows:
p = A * w1 + B * w2 + C * w3
where
p := the picked point
A := first vertex of picked triangle
B := second vertex of picked triangle
C := third vertex of picked triangle
w1 := first barycentric coordinate of picked point in picked triangle ( Vec3D.X)
w2 := second barycentric coordinate of picked point in picked triangle ( Vec3D.Y)
w3 := third barycentric coordinate of picked point in picked triangle ( Vec3D.Z)
The sum of the barycentric coordinates is always 1.0
(i.e. w1 + w2 + w3 = 1
).