Commit 18a3ebea authored by JOVANE Alberto's avatar JOVANE Alberto
Browse files

Update on Default bheaviour of camera movment

parent 01e68bdf
......@@ -32,6 +32,9 @@ public class CamMvt : MonoBehaviour
[SerializeField()]
public Vector3 _default_position;
public Vector3 _default_rotation;
// Rotation - Looking at an agent
public bool activateLookAt = false; // if true: lock the view to look at the selected agent - else : free movment
public bool activateFollow = false; // if true: follow the selected agent
......@@ -78,6 +81,10 @@ public class CamMvt : MonoBehaviour
/// </summary>
public void initializeTargetObjects()
{
//initial positions
_default_position = transform.position;
_default_rotation = transform.eulerAngles;
// initialize the look at and follow target
update_look_at_target();
update_follow_target();
......@@ -177,6 +184,10 @@ public class CamMvt : MonoBehaviour
transform.forward = agent_reference_transform.forward;
}
}
if(camSelect.options[camSelect.value].text == "Default")
{
transform.eulerAngles = _default_rotation;
}
#endregion
......@@ -197,8 +208,11 @@ public class CamMvt : MonoBehaviour
// --------------------------------
// TRANSLATION - FOLLOWING AN AGENT
if (camSelect.options[camSelect.value].text == "Default" || camSelect.options[camSelect.value].text == "Follow")
if (camSelect.options[camSelect.value].text == "Default")
{
transform.position = _default_position;
}
if (camSelect.options[camSelect.value].text == "Follow")
{
transform.position = _position_follow;
}
......
......@@ -8,10 +8,11 @@
<rotation x="0" y="0" z="0" />
</env_stageInfos>
<cam>
<cameraType typeID="4" />
<position x="0" y="0" z="30" />
<rotation x="90" y="0" z="0" />
<lookAtAgent agentID="-1" />
<followAgent agentID="-1" followOnX="false" followOnY="false" />
<followAgent agentID="-1" followOnX="false" followOnY="false" lockFirstPerson="false" />
<CamResolution x="-1" y="-1" />
</cam>
<recording start="0" end="0" framerate="15" width="-1" height="-1">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment