MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / CursorOnFrame

Method CursorOnFrame

ogsr_engine/xrGame/HUDTarget.cpp:89–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void CHUDTarget::CursorOnFrame()
90{
91 CActor* Actor = smart_cast<CActor*>(Level().CurrentEntity());
92 if (!Actor)
93 return;
94
95 Fvector p1 = Device.vCameraPosition;
96 Fvector dir = Device.vCameraDirection;
97
98 if (auto Wpn = smart_cast<CHudItem*>(Actor->inventory().ActiveItem()))
99 Actor->g_fireParams(Wpn, p1, dir, true);
100
101 // Render cursor
102 RQ.O = nullptr;
103 RQ.range = g_pGamePersistent->Environment().CurrentEnv->far_plane * 0.99f;
104 RQ.element = -1;
105 m_real_dist = -1.f;
106
107 collide::ray_defs RD(p1, dir, RQ.range, CDB::OPT_CULL, collide::rqtBoth);
108 RQR.r_clear();
109 VERIFY(!fis_zero(RD.dir.square_magnitude()));
110 if (Level().ObjectSpace.RayQuery(RQR, RD, pick_trace_callback, &RQ, nullptr, Level().CurrentEntity()))
111 {
112 m_real_dist = RQ.range;
113 clamp(RQ.range, NEAR_LIM, RQ.range);
114 }
115}
116
117extern ENGINE_API BOOL g_bRendering;
118

Callers 1

OnFrameMethod · 0.80

Calls 8

fis_zeroFunction · 0.85
clampFunction · 0.85
ActiveItemMethod · 0.80
EnvironmentMethod · 0.80
r_clearMethod · 0.80
RayQueryMethod · 0.80
g_fireParamsMethod · 0.45
square_magnitudeMethod · 0.45

Tested by

no test coverage detected