128 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/camera_tools/camera_tools.layout");
130 m_KeyframeContent = layoutRoot.FindAnyWidget(
"keyframe_list_content");
131 m_EventContent = layoutRoot.FindAnyWidget(
"events_list_content");
132 m_InterpTypeCombo =
XComboBoxWidget.Cast(layoutRoot.FindAnyWidget(
"interp_type"));
133 m_InterpTypeSpeedCombo =
XComboBoxWidget.Cast(layoutRoot.FindAnyWidget(
"interp_speed_type"));
134 m_BlurEditWidget =
EditBoxWidget.Cast(layoutRoot.FindAnyWidget(
"blur_value"));
135 m_ActorTypeWidget =
EditBoxWidget.Cast(layoutRoot.FindAnyWidget(
"add_actor_type"));
136 m_ActorIdWidget =
EditBoxWidget.Cast(layoutRoot.FindAnyWidget(
"add_actor_id"));
137 m_ActorItemTypeWidget =
EditBoxWidget.Cast(layoutRoot.FindAnyWidget(
"add_item_type"));
139 m_AddKeyframe =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"add_keyframe"));
140 m_AddEvent =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"add_event"));
142 m_AddItem =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"add_actor_item"));
143 m_AddHandsItem =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"add_actor_item_hands"));
144 m_AddActor =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"add_actor"));
145 m_Play =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"play"));
146 m_Stop =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"stop"));
147 m_Save =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"save"));
148 m_Load =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"load"));
150 m_SaveKeyframe =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"save_keyframe"));
151 m_DeleteKeyframe =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"delete_keyframe"));
152 m_ViewKeyframe =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"snap_to_keyframe"));
153 m_SaveEvent =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"save_event"));
154 m_DeleteEvent =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"delete_event"));
155 m_ViewEvent =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"snap_to_event"));
157 m_CopyButton =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"CopyButton"));
158 m_ApplyButton =
ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"ApplyButton"));
159 m_CameraEditbox =
EditBoxWidget.Cast(layoutRoot.FindAnyWidget(
"CameraEditbox"));
160 m_CameraValues =
TextWidget.Cast(layoutRoot.FindAnyWidget(
"CameraValues"));
162 MissionGameplay
ms = MissionGameplay.Cast(
GetGame().GetMission());
163 ms.GetHud().Show(
false);
166 m_BlurEditWidget.SetText(
"0.0");
205 m_InterpTypeCombo.SetCurrentItem(
save_data.m_InterpType);
206 m_InterpTypeSpeedCombo.SetCurrentItem(
save_data.m_InterpSpeed);
213 m_Cameras.Insert(
kf);
218 CTEvent
ev =
new CTEvent(m_Events.Count(),
event_t.param1, m_EventContent,
event_t.param4,
this);
275 if (
Camera.GetCurrentCamera())
277 vector pos =
Camera.GetCurrentCamera().GetWorldPosition();
279 CTKeyframe
kf =
new CTKeyframe(m_Cameras.Count(), pos,
orient, 1, 70, 50, -1, GetTotalTime(m_Cameras.Count()), m_KeyframeContent,
this);
280 m_Cameras.Insert(
kf);
379 if (
Camera.GetCurrentCamera())
380 Camera.GetCurrentCamera().GetTransform(m_FreeflightCamTransform);
381 if (m_Cameras.Count() > 0)
383 layoutRoot.Show(
false);
384 GetGame().GetUIManager().ShowUICursor(
false);
387 foreach (CTKeyframe
keyframe : m_Cameras)
389 Param6<vector, vector, float, float, float, int> transform =
new Param6<vector, vector, float, float, float, int>(
keyframe.GetPosition(),
keyframe.GetOrientation(),
keyframe.GetInterpTime(),
keyframe.GetFOV(),
keyframe.GetDOF(),
keyframe.GetPin());
394 foreach (CTActor
ac : m_Actors)
397 foreach (CTEvent
ev : m_Events)
402 int time = SetCameraData(GetCameraLine(0), GetCameraLine(1));
404 if (GetCameraLine(0).param6 > -1)
406 m_FollowingTimeFinished =
time;
407 m_NextCamPosition =
"0 0 0";
408 m_Camera1.SetActive(
true);
412 m_NextCamPosition = m_Camera2.GetPosition();
413 m_FollowingTimeFinished = -1;
414 m_Camera1.SetActive(
true);
415 m_Camera1.InterpolateTo(m_Camera2,
time, m_InterpTypeCombo.GetCurrentItem());
418 m_NextCameraIndex = 1;
487 m_CameraValues.SetText(
"Pos:" +
camPos +
" | Rot:" +
camOri);
494 if (!
cam && m_Camera1)
507 foreach (CTEvent
ev : m_Events)
515 if (!
Camera.GetCurrentCamera() || !m_Camera1 || !m_Camera2)
523 vector pos =
p.GetBonePositionWS(m_FollowingBone.param2);
525 int bone_index =
p.GetBoneIndexByName(
"LeftHand_Dummy");
540 m_Camera1.SetPosition(pos);
545 if (m_NextCameraIndex + 1 == m_CameraLines.Count())
549 foreach (CTEvent
ev2 : m_Events)
554 if (
Camera.GetCurrentCamera().GetPosition() == m_NextCamPosition || (m_FollowingTimeFinished != -1 &&
m_Time >= m_FollowingTimeFinished))
557 if (GetCameraLine(m_NextCameraIndex - 1).param6 > -1)
560 GetCameraLine(m_NextCameraIndex).param6 = -1;
562 time = SetCameraData(GetCameraLine(m_NextCameraIndex), GetCameraLine(m_NextCameraIndex + 1));
565 time = SetCameraData(GetCameraLine(m_NextCameraIndex), GetCameraLine(m_NextCameraIndex + 1));
568 if (GetCameraLine(m_NextCameraIndex - 1).param6 > -1)
571 m_NextCamPosition =
"0 0 0";
572 m_Camera1.SetActive(
true);
574 else if (GetCameraLine(m_NextCameraIndex))
576 m_NextCamPosition = GetCameraLine(m_NextCameraIndex).param1;
577 m_FollowingTimeFinished = -1;
578 m_Camera1.SetActive(
true);
579 m_Camera1.InterpolateTo(m_Camera2,
time, m_InterpTypeCombo.GetCurrentItem());
586 foreach (CTEvent
ev3 : m_Events)
593 if (m_Camera1.GetPosition() == m_NextCamPosition)
596 for (
int i = 0;
i < (m_Cameras.Count() - 1);
i++)
605 if (!
g_Game.IsLeftCtrlDown())
606 m_SelectedActor.SetPosition(GetMouseLookDir());
617 foreach (CTActor
ac : m_Actors)
724 if (
w == m_SaveKeyframe)
729 else if (
w == m_DeleteKeyframe)
734 else if (
w == m_ViewKeyframe)
739 else if (
w == m_SaveEvent)
744 else if (
w == m_DeleteEvent)
749 else if (
w == m_ViewEvent)
754 else if (
w == m_AddKeyframe)
759 else if (
w == m_AddEvent)
764 else if (
w == m_Play)
769 else if (
w == m_Stop)
774 else if (
w == m_Save)
779 else if (
w == m_Load)
784 else if (
w == m_AddActor)
785 AddActor(m_ActorTypeWidget.GetText());
786 else if (
w == m_AddItem)
787 AddItem(m_ActorIdWidget.GetText(), m_ActorItemTypeWidget.GetText());
788 else if (
w == m_AddHandsItem)
789 AddHandsItem(m_ActorIdWidget.GetText(), m_ActorItemTypeWidget.GetText());
790 else if (
w == m_CopyButton)
797 else if (
w == m_ApplyButton)
799 string camText = m_CameraEditbox.GetText();
static proto bool RaycastRV(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, set< Object > results=NULL, Object with=NULL, Object ignore=NULL, bool sorted=false, bool ground_only=false, int iType=ObjIntersectView, float radius=0.0, CollisionFlags flags=CollisionFlags.NEARESTCONTACT)
Raycasts world by given parameters.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.