3API_CALLABLE(N(ItemEntityJumpToPos)) {
20 script->functionTemp[0] = (s32) jumpState;
28 moveDist =
dist2D(item->
pos.
x, item->
pos.
z, jumpState->pos.x, jumpState->pos.z);
29 jumpState->moveAngle =
atan2(item->
pos.
x, item->
pos.
z, jumpState->pos.x, jumpState->pos.z);
31 temp_f2 = item->
pos.
y;
32 jumpState->jumpVel = (jumpState->jumpAccel * jumpState->moveTime * 0.5f)
33 + ((jumpState->pos.y - temp_f2) / jumpState->moveTime);
35 temp_f2 = jumpState->moveTime;
36 jumpState->moveSpeed = moveDist / temp_f2;
39 jumpState = (
void*) script->functionTemp[0];
42 heap_free((
void*) script->functionTemp[0]);
46 item->
pos.
x += (jumpState->moveSpeed *
sin_deg(jumpState->moveAngle));
47 item->
pos.
z -= (jumpState->moveSpeed *
cos_deg(jumpState->moveAngle));
48 item->
pos.
y += jumpState->jumpVel;
49 jumpState->moveTime--;
50 jumpState->jumpVel = (jumpState->jumpVel - jumpState->jumpAccel);
51 if (jumpState->moveTime < 0) {
52 item->
pos.
x = jumpState->pos.x;
53 item->
pos.
y = jumpState->pos.y;
54 item->
pos.
z = jumpState->pos.z;
55 jumpState->jumpVel = 0.0f;
56 heap_free((
void*) script->functionTemp[0]);
s32 evt_get_variable(Evt *script, Bytecode var)
ItemEntity * get_item_entity(s32 itemEntityIndex)
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
f32 evt_get_float_variable(Evt *script, Bytecode var)
void * heap_malloc(s32 size)