dtTriArea2D

Derives the signed xz-plane area of the triangle ABC, or the relationship of line AB to point C.

Windows
MacOS
Linux

References

Module

Navmesh

Header

/Engine/Source/Runtime/Navmesh/Public/Detour/DetourCommon.h

Include

#include "Detour/DetourCommon.h"

Syntax

float dtTriArea2D
(
    const float * a,
    const float * b,
    const float * c
)

Remarks

Derives the signed xz-plane area of the triangle ABC, or the relationship of line AB to point C. This section contains detailed documentation for members that don't have a source file. It reduces clutter in the main section of the header.

The vertices are projected onto the xz-plane, so the y-values are ignored.

This is a low cost function than can be used for various purposes. Its main purpose is for point/line relationship testing.

In all cases: A value of zero indicates that all vertices are collinear or represent the same point. (On the xz-plane.)

When used for point/line relationship tests, AB usually represents a line against which the C point is to be tested. In this case:

A positive value indicates that point C is to the left of line AB, looking from A toward B. A negative value indicates that point C is to the right of lineAB, looking from A toward B.

When used for evaluating a triangle:

The absolute value of the return value is two times the area of the triangle when it is projected onto the xz-plane.

A positive return value indicates:

  • The vertices are wrapped in the normal Detour wrap direction.

  • The triangle's 3D face normal is in the general up direction.

A negative return value indicates:

  • The vertices are reverse wrapped. (Wrapped opposite the normal Detour wrap direction.)

  • The triangle's 3D face normal is in the general down direction.

Returns

The signed xz-plane area of the triangle.

Parameters

Parameter

Description

a

Vertex A. [(x, y, z)]

b

Vertex B. [(x, y, z)]

c

Vertex C. [(x, y, z)]

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss