getShapeTestResult
GET_SHAPE_TEST_RESULT0x3D87450E15D98694The GTA V native GET_SHAPE_TEST_RESULT of the SHAPETEST namespace, as LS:MP client scripts call it: the global function getShapeTestResult, in JavaScript and in Lua.
getShapeTestResult(shapeTestHandle: number): [
result: number,
hit: boolean,
endCoords: { x: number, y: number, z: number },
surfaceNormal: { x: number, y: number, z: number },
entityHit: Entity
]getShapeTestResult(
shapeTestHandle: integer
): integer, boolean, Vector3, Vector3, EntityUsage
const [result, hit, endCoords, surfaceNormal, entityHit] =
getShapeTestResult(shapeTestHandle);local result, hit, endCoords, surfaceNormal, entityHit =
getShapeTestResult(shapeTestHandle)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
shapeTestHandle | int | number | integer |
Returns
5 values, in this order: an array in JavaScript, multiple return values in Lua.
| # | Value | Type | JavaScript | Lua | Description |
|---|---|---|---|---|---|
| 1 | result | int | number | integer | The native’s own return value. |
| 2 | hit | BOOL | boolean | boolean | output |
| 3 | endCoords | Vector3 | { x: number, y: number, z: number } | Vector3 | output |
| 4 | surfaceNormal | Vector3 | { x: number, y: number, z: number } | Vector3 | output |
| 5 | entityHit | Entity | number | integer | output |
On LS:MP
lsmp.raycast wraps a synchronous shape test and this call, and returns { hit, position, normal, entity }.
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Returns the result of a shape test: 0 if the handle is invalid, 1 if the shape test is still pending, or 2 if the shape test has completed, and the handle should be invalidated.
When used with an asynchronous shape test, this native should be looped until returning 0 or 2, after which the handle is invalidated.
Reference
- Namespace
- Shape tests SHAPETEST
- In the game
int GET_SHAPE_TEST_RESULT(int shapeTestHandle, BOOL* hit, Vector3* endCoords, Vector3* surfaceNormal, Entity* entityHit)- Hash
0x3D87450E15D98694- Formerly
_GET_RAYCAST_RESULT