SlerpNearQuaternion
Docslocal outX, outY, outZ, outW = SlerpNearQuaternion(t, x, y, z, w, x1, y1, z1, w1)Description
This native always come right before SET_ENTITY_QUATERNION where its final 4 parameters are SLERP_NEAR_QUATERNION p9 to p12
Parameters
| Name | Type | Description |
|---|---|---|
t | float | acceleration differenzial (am_rollercoaster.c func\_134) |
x | float | rotation parameter (maybe X axys) |
y | float | rotation parameter (maybe X axys) |
z | float | rotation parameter (maybe X axys) |
w | float | rotation parameter (maybe X axys) |
x1 | float | rotation parameter (maybe Y axys) |
y1 | float | rotation parameter (maybe Y axys) |
z1 | float | rotation parameter (maybe Y axys) |
w1 | float | rotation parameter (maybe Y axys) |
outX | float* | output value calculated (X) |
outY | float* | output value calculated (Y) |
outZ | float* | output value calculated (Z) |
outW | float* | output value calculated (W) |
Quick Snippet: Get Coordinatesxyzx1
xyzx1Add this command to your client script to retrieve precise locations in-game.
-- Add this to your client.lua. Type /pos in-game to copy coords.
RegisterCommand('pos', function()
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
local heading = GetEntityHeading(ped)
local output = string.format("vector4(%.2f, %.2f, %.2f, %.2f)", coords.x, coords.y, coords.z, heading)
print(output)
TriggerEvent('chat:addMessage', { args = { '^4[COORD]^0', output } })
end)Returns
voidThis native does not return a value.
Examples
Official
// Example from am_rollercoaster.c
// where func_136 calculates arctan of given values and func_135 calculates both sin and cos
void func_134(int iParam0, int iParam1, float fParam2) cippalippo
{
int iVar0;
int iVar1;
int iVar2;
int iVar3;
float fVar4;
var uVar5[4];
var uVar6[4];
var uVar7[4];
float fVar8;
iVar0 = func_47(iParam1);
iVar1 = iParam1;
iVar2 = func_48(iParam1);
iVar3 = func_48(iVar2);
if (fParam2 < 0f)
{
fParam2 = (fParam2 + Local_1417[(iLocal_714 - 1) /*5*/].f_3);
}
fVar8 = ((fParam2 - Local_1417[iVar1 /*5*/].f_3) / (Local_1417[iVar2 /*5*/].f_3 - Local_1417[iVar1 /*5*/].f_3));
if (fVar8 < 0.5f)
{
fVar4 = (fVar8 + 0.5f);
func_135(func_136(iVar0, iVar1), &(uVar5[0]), &(uVar5[1]), &(uVar5[2]), &(uVar5[3]));
func_135(func_136(iVar1, iVar2), &(uVar6[0]), &(uVar6[1]), &(uVar6[2]), &(uVar6[3]));
}
else
{
fVar4 = (fVar8 - 0.5f);
func_135(func_136(iVar1, iVar2), &(uVar5[0]), &(uVar5[1]), &(uVar5[2]), &(uVar5[3]));
func_135(func_136(iVar2, iVar3), &(uVar6[0]), &(uVar6[1]), &(uVar6[2]), &(uVar6[3]));
}
MISC::_0xF2F6A2FA49278625(fVar4, uVar5[0], uVar5[1], uVar5[2], uVar5[3], uVar6[0], uVar6[1], uVar6[2], uVar6[3], &(uVar7[0]), &(uVar7[1]), &(uVar7[2]), &(uVar7[3]));
ENTITY::SET_ENTITY_QUATERNION(iLocal_719[iParam0], uVar7[0], uVar7[1], uVar7[2], uVar7[3]);
}