| 131 | } |
| 132 | |
| 133 | void 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 | |
| 167 | void CProjector::renderable_Render(u32 context_id, IRenderable* root) { inherited::renderable_Render(context_id, root); } |
| 168 |
nothing calls this directly
no test coverage detected