Commit f130b46a authored by ATREVI Dieudonne's avatar ATREVI Dieudonne
Browse files

Manage Camera movement panel

parent 1e23a6f9
......@@ -8319,7 +8319,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -7.5, y: -0.5}
m_AnchoredPosition: {x: -7.5, y: -0.4999981}
m_SizeDelta: {x: -35, y: -13}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &914841687
......@@ -9790,8 +9790,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 46.1, y: -33}
m_SizeDelta: {x: 109.8, y: 30}
m_AnchoredPosition: {x: 48.2, y: -34}
m_SizeDelta: {x: 139.7, y: 32.2}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1106504387
MonoBehaviour:
......@@ -9849,6 +9849,8 @@ MonoBehaviour:
m_Image: {fileID: 0}
- m_Text: Torsum
m_Image: {fileID: 0}
- m_Text: Free_Movement
m_Image: {fileID: 0}
m_OnValueChanged:
m_PersistentCalls:
m_Calls:
......
......@@ -43,8 +43,9 @@ public class MenuManager : MonoBehaviour
Camera cam; // the main camera
Dropdown configFilesMenu; // GUI object to select the scenario
GameObject menu; // the menu gameObject
public GameObject panel, cameraMovPanel; // the panel gameObject
public static GameObject controlPanel; // The play, pause and stop control panel
public GameObject panel; // the panel gameObject
public GameObject cameraMovPanel; // Panel of camera mouvement
public static GameObject controlPanel; // The play, pause and stop control panel
public GameObject configPanel; // the panel to set the config parameters
public GameObject topMenuPanel; // the top menu panel
public GameObject slider; // Slider for the progress state bar
......@@ -209,11 +210,18 @@ public class MenuManager : MonoBehaviour
env = gameObject.GetComponent<LoadEnv>();
env.loadScenario(ConfigReader.trajectoriesDir);
panel.SetActive(false);
configPanel.SetActive(false);
controlPanel.SetActive(true);
topMenuPanel.SetActive(true);
cameraMovPanel.SetActive(true);
cameraMovPanel.transform.Find("cameraType").GetComponent<Dropdown>().value = ConfigReader.camType;
//slider.SetActive(true);
GameObject.Find("/controlCanvas/fakePanel/topMenu").SetActive(false);
}
......@@ -228,6 +236,7 @@ public class MenuManager : MonoBehaviour
panel.SetActive(!panel.activeSelf);
controlPanel.SetActive(!panel.activeSelf);
topMenuPanel.SetActive(!panel.activeSelf);
cameraMovPanel.SetActive(!panel.activeSelf);
//slider.SetActive(!panel.activeSelf);
// Pause the scenario while showing the menu
Time.timeScale = 0;
......@@ -244,6 +253,7 @@ public class MenuManager : MonoBehaviour
controlPanel.SetActive(!controlPanel.activeSelf);
//slider.SetActive(!slider.activeSelf);
topMenuPanel.SetActive(false);
cameraMovPanel.SetActive(false);
ConfigManager.showConfig();
}
......@@ -260,6 +270,7 @@ public class MenuManager : MonoBehaviour
controlPanel.SetActive(!controlPanel.activeSelf);
//slider.SetActive(!panel.activeSelf);
topMenuPanel.SetActive(true);
cameraMovPanel.SetActive(true);
//Play(); // start after the parameters modification
}
......@@ -273,6 +284,7 @@ public class MenuManager : MonoBehaviour
controlPanel.SetActive(!controlPanel.activeSelf);
//slider.SetActive(!panel.activeSelf);
topMenuPanel.SetActive(true);
cameraMovPanel.SetActive(true);
controlPanel.transform.Find("pause").GetComponent<Button>().Select();
}
......
......@@ -15,11 +15,10 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**
** Authors: Julien Bruneau, Tristan Le Bouffant, Alberto Jovane
** Authors: Julien Bruneau, Tristan Le Bouffant, Alberto Jovane, Fabrice ATREVI
**
** Contact: crowd_group@inria.fr
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
......@@ -77,8 +76,7 @@ public class CamMvt : MonoBehaviour
// Use this for initialization
void Start()
{
//_camera_type = CameraType.Default;
lockFirstPersonView = false;
//lockFirstPersonView = false;
}
/// <summary>
......@@ -86,16 +84,14 @@ public class CamMvt : MonoBehaviour
/// </summary>
public void initializeTargetObjects()
{
// initialize the ids
if (lookAt_Id >= 0)
activateLookAt = true;
else
{
activateLookAt = false;
lookAt_Id = 0;
}
activateLookAt = ConfigReader.lookAtAgent;
lookAt_Id = ConfigReader.camLookAtTarget;
Debug.Log("Initial camera Type :" + _camera_type);
//follow_Agent = ConfigReader.followAgent;
follow_Id = ConfigReader.camFollowTarget;
if (!activateLookAt)
lookAt_Id = 0;
// initialize camera type
if (_camera_type == CameraType.Follow || _camera_type == CameraType.First_Person || _camera_type == CameraType.Torsum)
{
......@@ -103,11 +99,6 @@ public class CamMvt : MonoBehaviour
follow_Id = 0;
}
// to di initialize the Panel
//camTypePanel = GameObject.Find("/controlCanvas/cameraMovPanel");
//Dropdown camSelect = camTypePanel.transform.Find("cameraType").GetComponent<Dropdown>();
//camSelect.options[camSelect.value].text = get_CameraType(_camera_type);
// initialize the look at and follow target
update_look_at_target();
update_follow_target();
......
......@@ -115,7 +115,7 @@ public static class ConfigReader
set { data.env_obstFile = value; }
}
/// <summary>
/// Starting camera position
/// camera Type
/// </summary>
static public int camType
{
......@@ -148,6 +148,13 @@ public static class ConfigReader
set { data.cam.CamResolution = new ConfigVect2(value); }
}
/// <summary>
/// Boolean, true if the LookAtAgent id greater than -1
/// </summary>
static public bool lookAtAgent
{
get { return data.cam.lookAtAgent.id > -1; }
}
/// <summary>
/// ID of the agent to look at
/// </summary>
......@@ -157,6 +164,13 @@ public static class ConfigReader
set { data.cam.lookAtAgent.id = value;}
}
/// <summary>
/// Boolean, true if the FollowAgent id greater than -1
/// </summary>
static public bool followAgent
{
get { return data.cam.followAgent.id > -1; }
}
/// <summary>
/// ID of the agent to follow with the camera
/// </summary>
static public int camFollowTarget
......
......@@ -8,7 +8,7 @@
<rotation x="0" y="0" z="0" />
</env_stageInfos>
<cam>
<cameraType typeID="0"/>
<cameraType typeID="2"/>
<position x="-30" y="-3" z="5" />
<rotation x="30.32365" y="0" z="92.53606" />
<lookAtAgent agentID="-1" />
......@@ -27,4 +27,4 @@
<saveDir>./Output/</saveDir>
</recording>
<AgentColorList />
</ConfigData>
\ No newline at end of file
</ConfigData>
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