getShapeTestResultIncludingMaterial
GET_SHAPE_TEST_RESULT_INCLUDING_MATERIAL0x65287525D951F6BEThe GTA V native GET_SHAPE_TEST_RESULT_INCLUDING_MATERIAL of the SHAPETEST namespace, as LS:MP client scripts call it: the global function getShapeTestResultIncludingMaterial, in JavaScript and in Lua.
getShapeTestResultIncludingMaterial(shapeTestHandle: number): [
result: number,
hit: boolean,
endCoords: { x: number, y: number, z: number },
surfaceNormal: { x: number, y: number, z: number },
materialHash: Hash,
entityHit: Entity
]getShapeTestResultIncludingMaterial(
shapeTestHandle: integer
): integer, boolean, Vector3, Vector3, Hash, EntityUsage
JavaScript
const [result, hit, endCoords, surfaceNormal, materialHash, entityHit] =
getShapeTestResultIncludingMaterial(shapeTestHandle);Lua
local result, hit, endCoords, surfaceNormal, materialHash, entityHit =
getShapeTestResultIncludingMaterial(shapeTestHandle)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
shapeTestHandle | int | number | integer |
Returns
6 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 | materialHash | Hash | number | integer | output |
| 6 | entityHit | Entity | number | integer | output |
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, also returning the material of any touched surface.
When used with an asynchronous shape test, this native should be looped until returning 0 or 2, after which the handle is invalidated.
Unless the return value is 2, the other return values are undefined.
Reference
- Namespace
- Shape tests SHAPETEST
- In the game
int GET_SHAPE_TEST_RESULT_INCLUDING_MATERIAL(int shapeTestHandle, BOOL* hit, Vector3* endCoords, Vector3* surfaceNormal, Hash* materialHash, Entity* entityHit)- Hash
0x65287525D951F6BE- Formerly
_GET_SHAPE_TEST_RESULT_EX