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

Method UpdateCL

ogsr_engine/xrGame/searchlight.cpp:133–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133void CProjector::UpdateCL()
134{
135 inherited::UpdateCL();
136
137 // update light source
138 if (light_render->get_active())
139 {
140 // calc color animator
141 if (lanim)
142 {
143 int frame;
144 // возвращает в формате BGR
145 u32 clr = lanim->CalculateBGR(Device.fTimeGlobal, frame);
146
147 Fcolor fclr;
148 fclr.set((float)color_get_B(clr), (float)color_get_G(clr), (float)color_get_R(clr), 1.f);
149 fclr.mul_rgb(fBrightness / 255.f);
150 light_render->set_color(fclr);
151 }
152
153 CBoneInstance& BI = smart_cast<IKinematics*>(Visual())->LL_GetBoneInstance(guid_bone);
154 Fmatrix M;
155
156 M.mul(XFORM(), BI.mTransform);
157
158 light_render->set_rotation(M.k, M.i);
159 light_render->set_position(M.c);
160 }
161
162 // Update searchlight
163 angle_lerp(_current.yaw, _target.yaw, bone_x.velocity, Device.fTimeDelta);
164 angle_lerp(_current.pitch, _target.pitch, bone_y.velocity, Device.fTimeDelta);
165}
166
167void CProjector::renderable_Render(u32 context_id, IRenderable* root) { inherited::renderable_Render(context_id, root); }
168

Callers

nothing calls this directly

Calls 13

color_get_BFunction · 0.85
color_get_GFunction · 0.85
color_get_RFunction · 0.85
VisualFunction · 0.85
XFORMFunction · 0.85
angle_lerpFunction · 0.85
get_activeMethod · 0.80
CalculateBGRMethod · 0.80
set_colorMethod · 0.80
setMethod · 0.45
mulMethod · 0.45
set_rotationMethod · 0.45

Tested by

no test coverage detected