ObjectClient

isPointInAngledArea

IS_POINT_IN_ANGLED_AREA0x2A70BAE8883E4C81

The GTA V native IS_POINT_IN_ANGLED_AREA of the OBJECT namespace, as LS:MP client scripts call it: the global function isPointInAngledArea, in JavaScript and in Lua.

SignatureJavaScript
isPointInAngledArea(
  xPos: number,
  yPos: number,
  zPos: number,
  x1: number,
  y1: number,
  z1: number,
  x2: number,
  y2: number,
  z2: number,
  width: number,
  debug: boolean,
  includeZ: boolean
): boolean
SignatureLua
isPointInAngledArea(
  xPos: number,
  yPos: number,
  zPos: number,
  x1: number,
  y1: number,
  z1: number,
  x2: number,
  y2: number,
  z2: number,
  width: number,
  debug: boolean,
  includeZ: boolean
): boolean

Usage

JavaScript
const result = isPointInAngledArea(
  xPos, yPos, zPos, x1, y1, z1, x2, y2, z2, width, debug, includeZ
);
Lua
local result = isPointInAngledArea(
    xPos, yPos, zPos, x1, y1, z1, x2, y2, z2, width, debug, includeZ
)

Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.

JavaScript · with vectors
const result = isPointInAngledArea(pos, pos1, pos2, width, debug, includeZ);
Lua · with vectors
local result = isPointInAngledArea(pos, pos1, pos2, width, debug, includeZ)

Parameters

ParameterTypeJavaScriptLua
xPosfloatnumbernumber
yPosfloatnumbernumber
zPosfloatnumbernumber
x1floatnumbernumber
y1floatnumbernumber
z1floatnumbernumber
x2floatnumbernumber
y2floatnumbernumber
z2floatnumbernumber
widthfloatnumbernumber
debugBOOLbooleanboolean
includeZBOOLbooleanboolean

Returns

BOOL JavaScript boolean, Lua boolean

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

An angled area is an X-Z oriented rectangle with three parameters:

1. origin: the mid-point along a base edge of the rectangle;
2. extent: the mid-point of opposite base edge on the other Z;

3. width: the length of the base edge.

The oriented rectangle can then be derived from the direction of the two points (`norm(origin - extent)`), its orthonormal, and the width.

Reference

Namespace
Object OBJECT
In the game
BOOL IS_POINT_IN_ANGLED_AREA(float xPos, float yPos, float zPos, float x1, float y1, float z1, float x2, float y2, float z2, float width, BOOL debug, BOOL includeZ)
Hash
0x2A70BAE8883E4C81

Open in the interactive natives reference