MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / world_to_screen

Function world_to_screen

src/SB/Game/zEntCruiseBubble.cpp:1492–1505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1490 }
1491
1492 xVec3 world_to_screen(const xVec3& loc)
1493 {
1494 iCameraUpdatePos(globals.camera.lo_cam, &globals.camera.mat);
1495
1496 xVec3 world_loc;
1497 xMat4x3* view_mat = (xMat4x3*)&globals.camera.lo_cam->viewMatrix;
1498 xMat4x3Toworld(&world_loc, view_mat, &loc);
1499
1500 xVec3 screen_loc;
1501 F32 iz = 1.0f / world_loc.z;
1502 screen_loc.assign(world_loc.x * iz, world_loc.y * iz, 1.0f);
1503
1504 return screen_loc;
1505 }
1506
1507 S32 find_locked_target(const xVec3* target)
1508 {

Callers 1

lock_targetFunction · 0.70

Calls 2

xMat4x3ToworldFunction · 0.85
iCameraUpdatePosFunction · 0.50

Tested by

no test coverage detected