{"hash":"0x4301E10C","ns":"CFX","name":"GET_SHAPE_TEST_RESULT_INCLUDING_MATERIAL","slug":"GET_SHAPE_TEST_RESULT_INCLUDING_MATERIAL","official":true,"named":true,"luaName":"GetShapeTestResultIncludingMaterial","game":"cfx","apiset":"client","returnType":"int","params":[{"name":"shapeTestHandle","type":"int","description":"A shape test handle."},{"name":"hit","type":"BOOL*","description":"Whether or not the shape test hit any collisions."},{"name":"endCoords","type":"Vector3*","description":"The resulting coordinates where the shape test hit a collision."},{"name":"surfaceNormal","type":"Vector3*","description":"The surface normal of the hit position."},{"name":"materialHash","type":"Hash*","description":"hash of the hit material or surface type, see materialFX.dat"},{"name":"entityHit","type":"Entity*","description":"Any dynamic entity hit by the shape test."}],"returnsDescription":"`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.","summary":"Returns the result of a shape test, also returning the material of any touched surface.","descriptions":[{"source":"cfx","format":"md","body":"Returns the result of a shape test, also returning the material of any touched surface.\n\nWhen used with an asynchronous shape test, this native should be looped until returning 0 or 2, after which the handle is invalidated.\n\nUnless the return value is 2, the other return values are undefined."}],"examples":[],"aliases":[],"enums":[],"related":[],"sources":["cfx"],"doc":2,"url":"https://natives.borderlinerp.com/natives/CFX/GET_SHAPE_TEST_RESULT_INCLUDING_MATERIAL","markdownUrl":"https://natives.borderlinerp.com/natives/CFX/GET_SHAPE_TEST_RESULT_INCLUDING_MATERIAL.md","snippets":{"lua":"local retval, hit, endCoords, surfaceNormal, materialHash, entityHit = GetShapeTestResultIncludingMaterial(shapeTestHandle)","luaInvoke":"local retval, hit, endCoords, surfaceNormal, materialHash, entityHit = Citizen.InvokeNative(0x4301e10c, shapeTestHandle, Citizen.PointerValueInt() --[[ BOOL* ]], Citizen.PointerValueVector(), Citizen.PointerValueVector(), Citizen.PointerValueInt(), Citizen.PointerValueInt(), Citizen.ResultAsInteger())","js":"const [retval, hit, endCoords, surfaceNormal, materialHash, entityHit] = GetShapeTestResultIncludingMaterial(shapeTestHandle);","jsInvoke":"const [retval, hit, endCoords, surfaceNormal, materialHash, entityHit] = Citizen.invokeNative('0x4301e10c', shapeTestHandle, Citizen.pointerValueInt() /* BOOL* */, Citizen.pointerValueVector(), Citizen.pointerValueVector(), Citizen.pointerValueInt(), Citizen.pointerValueInt(), Citizen.returnResultAnyway(), Citizen.resultAsInteger());","csharp":"var hit = new OutputArgument();\nvar endCoords = new OutputArgument();\nvar surfaceNormal = new OutputArgument();\nvar materialHash = new OutputArgument();\nvar entityHit = new OutputArgument();\nint retval = Function.Call<int>((Hash)0x4301e10c, shapeTestHandle, hit, endCoords, surfaceNormal, materialHash, entityHit);\n// hit.GetResult<bool>()\n// endCoords.GetResult<Vector3>()\n// surfaceNormal.GetResult<Vector3>()\n// materialHash.GetResult<int>()\n// entityHit.GetResult<int>()","notes":["Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order."]}}