isPointInAngledArea
IS_POINT_IN_ANGLED_AREA0x2A70BAE8883E4C81The 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.
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
): booleanisPointInAngledArea(
xPos: number,
yPos: number,
zPos: number,
x1: number,
y1: number,
z1: number,
x2: number,
y2: number,
z2: number,
width: number,
debug: boolean,
includeZ: boolean
): booleanUsage
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
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
xPos | float | number | number |
yPos | float | number | number |
zPos | float | number | number |
x1 | float | number | number |
y1 | float | number | number |
z1 | float | number | number |
x2 | float | number | number |
y2 | float | number | number |
z2 | float | number | number |
width | float | number | number |
debug | BOOL | boolean | boolean |
includeZ | BOOL | boolean | boolean |
Returns
BOOL JavaScript boolean, Lua booleanNotes
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