| 203 | } |
| 204 | |
| 205 | void CWeaponStatMgun::cam_Update(float dt, float fov) |
| 206 | { |
| 207 | Fvector P, Da; |
| 208 | Da.set(0, 0, 0); |
| 209 | |
| 210 | IKinematics* K = smart_cast<IKinematics*>(Visual()); |
| 211 | K->CalculateBones_Invalidate(); |
| 212 | K->CalculateBones(); |
| 213 | const Fmatrix& C = K->LL_GetTransform(m_camera_bone); |
| 214 | XFORM().transform_tiny(P, C.c); |
| 215 | |
| 216 | Fvector d = C.k; |
| 217 | XFORM().transform_dir(d); |
| 218 | Fvector2 des_cam_dir; |
| 219 | |
| 220 | d.getHP(des_cam_dir.x, des_cam_dir.y); |
| 221 | des_cam_dir.mul(-1.0f); |
| 222 | |
| 223 | Camera()->yaw = angle_inertion_var(Camera()->yaw, des_cam_dir.x, 0.5f, 7.5f, PI_DIV_6, Device.fTimeDelta); |
| 224 | Camera()->pitch = angle_inertion_var(Camera()->pitch, des_cam_dir.y, 0.5f, 7.5f, PI_DIV_6, Device.fTimeDelta); |
| 225 | |
| 226 | if (OwnerActor()) |
| 227 | { |
| 228 | // rotate head |
| 229 | OwnerActor()->Orientation().yaw = -Camera()->yaw; |
| 230 | OwnerActor()->Orientation().pitch = -Camera()->pitch; |
| 231 | } |
| 232 | |
| 233 | Camera()->Update(P, Da); |
| 234 | Level().Cameras().UpdateFromCamera(Camera()); |
| 235 | } |
| 236 | |
| 237 | void CWeaponStatMgun::renderable_Render(u32 context_id, IRenderable* root) |
| 238 | { |
nothing calls this directly
no test coverage detected