3 PluginDeveloper m_ModuleDeveloper;
13 vector m_camera_orientation;
15 const float FOV = 0.5236;
22 Log(FOV.ToString(),
"FOV");
23 Log(m_camera_dir.ToString(),
"camera dir");
24 Log(m_cam_pos.ToString(),
"camera pos");
25 Log(m_demoPos.ToString(),
"character pos");
30 if( FreeDebugCamera.GetInstance().IsActive() )
40 m_Character =
PlayerBase.Cast(
GetGame().CreateObject(
"SurvivorF_Judy", FreeDebugCamera.GetInstance().GetPosition(),
false,
false) );
42 FreeDebugCamera.GetInstance().SetFOV(FOV);
46 override void OnUpdate(
float delta_time)
49 if(!FreeDebugCamera.GetInstance().IsActive())
return;
50 if(!m_Character)
return;
51 m_camera_orientation = FreeDebugCamera.GetInstance().GetOrientation();
52 m_camera_orientation[1] = 1;
53 FreeDebugCamera.GetInstance().SetOrientation(m_camera_orientation);
54 m_cam_pos = FreeDebugCamera.GetInstance().GetPosition();
55 m_character_pos = m_Character.GetPosition();
56 m_camera_dir = FreeDebugCamera.GetInstance().GetDirection();
58 m_camera_dir.Normalize();
59 m_Character.SetPosition(CalculatePos());
60 m_demoRot[0] =
Math.Atan2(-m_camera_dir[0], -m_camera_dir[2]) *
Math.RAD2DEG;
61 m_Character.SetOrientation(m_demoRot);
66 FreeDebugCamera.GetInstance().SetFOV(
g_Game.GetUserFOV());
71 vector cam_pos = FreeDebugCamera.GetInstance().GetPosition();
72 Math3D.MatrixIdentity4(m_cameraTrans);
73 Math3D.DirectionAndUpMatrix(m_camera_dir,
"0 1 0", m_cameraTrans);
74 m_cameraTrans[3] = cam_pos;
75 m_demoPos =
Vector(0,0, 3.68823).Multiply4(m_cameraTrans);
76 m_demoPos[1] =
GetGame().SurfaceY(m_demoPos[0], m_demoPos[2]);