Commit e57f1788 authored by JOVANE Alberto's avatar JOVANE Alberto
Browse files

Add the smooth parameter in the config file and in all the exampeles + added a first person example

parent e1834275
......@@ -98,6 +98,7 @@ public class LoadEnv : MonoBehaviour
cam_Movement.followOnX = ConfigReader.camFollowOnX;
cam_Movement.followOnY = ConfigReader.camFollowOnY;
cam_Movement.lockFirstPersonView = ConfigReader.camLockFirstPerson;
cam_Movement.smoothFirstPersonView = ConfigReader.camSmoothFirstPerson;
// -------------
......@@ -426,17 +427,19 @@ public class LoadEnv : MonoBehaviour
// -------------
// CAMERA CONFIG
cam_Rec.enabled = true;
cam_Movement.enabled = true;
cam.transform.position = ConfigReader.camPosition;
cam.transform.rotation = Quaternion.Euler(ConfigReader.camRotation);
cam_Movement.lookAt_Id = ConfigReader.camLookAtTarget;
cam_Movement.follow_Id = ConfigReader.camFollowTarget;
cam_Movement.activateLookAt = ConfigReader.lookAtAgent;
cam_Movement.activateFollow = ConfigReader.followAgent;
cam_Movement.followOnX = ConfigReader.camFollowOnX;
cam_Movement.followOnY = ConfigReader.camFollowOnY;
cam_Movement.lockFirstPersonView = ConfigReader.camLockFirstPerson;
cam_Rec.enabled = true;
cam_Movement.enabled = true;
cam.transform.position = ConfigReader.camPosition;
cam.transform.rotation = Quaternion.Euler(ConfigReader.camRotation);
cam_Movement.lookAt_Id = ConfigReader.camLookAtTarget;
cam_Movement.follow_Id = ConfigReader.camFollowTarget;
cam_Movement.activateLookAt = ConfigReader.lookAtAgent;
cam_Movement.activateFollow = ConfigReader.followAgent;
cam_Movement.followOnX = ConfigReader.camFollowOnX;
cam_Movement.followOnY = ConfigReader.camFollowOnY;
cam_Movement.lockFirstPersonView = ConfigReader.camLockFirstPerson;
cam_Movement.smoothFirstPersonView = ConfigReader.camSmoothFirstPerson;
// -------------
// RECORD CONFIG
......
......@@ -268,7 +268,7 @@ public class MenuManager : MonoBehaviour
cameraMovPanel.transform.Find("FollowX").GetComponent<Toggle>().isOn = ConfigReader.camFollowOnX;
cameraMovPanel.transform.Find("FollowY").GetComponent<Toggle>().isOn = ConfigReader.camFollowOnY;
cameraMovPanel.transform.Find("LockPerson").GetComponent<Toggle>().isOn = ConfigReader.camLockFirstPerson;
//cameraMovPanel.transform.Find("SmoothView").GetComponent<Toggle>().isOn = ConfigReader.camSmoothView;
cameraMovPanel.transform.Find("SmoothView").GetComponent<Toggle>().isOn = ConfigReader.camSmoothFirstPerson;
}
/// <summary>
/// Load the current scenario file and remove the menu
......
......@@ -72,7 +72,7 @@ public class ConfigManager : MonoBehaviour
PanelCamera.transform.Find("FollowX").GetComponent<Toggle>().isOn = ConfigReader.camFollowOnX;
PanelCamera.transform.Find("FollowY").GetComponent<Toggle>().isOn = ConfigReader.camFollowOnY;
PanelCamera.transform.Find("LockPerson").GetComponent<Toggle>().isOn = ConfigReader.camLockFirstPerson;
//PanelCamera.transform.Find("SmoothView").GetComponent<Toggle>().isOn = ConfigReader.camSmoothView;
PanelCamera.transform.Find("SmoothView").GetComponent<Toggle>().isOn = ConfigReader.camSmoothFirstPerson;
/// Get Recording parameters
// Duration
......@@ -160,7 +160,7 @@ public class ConfigManager : MonoBehaviour
{
ConfigReader.camFollowTarget = int.Parse(PanelCamera.transform.Find("AgentID").GetComponent<InputField>().text);
ConfigReader.camLockFirstPerson = PanelCamera.transform.Find("LockPerson").GetComponent<Toggle>().isOn;
//ConfigReader.camSmoothView = PanelCamera.transform.Find("SmoothView").GetComponent<Toggle>().isOn;
ConfigReader.camSmoothFirstPerson = PanelCamera.transform.Find("SmoothView").GetComponent<Toggle>().isOn;
}
//// Set Recording parameters
......
......@@ -204,6 +204,14 @@ public static class ConfigReader
set { data.cam.followAgent.lockFirstPerson = value; }
}
/// <summary>
/// Boolean, if true the movment of camera first person or torsum is smooth, if false it oscillate with the head/torsum
/// </summary>
static public bool camSmoothFirstPerson
{
get { return data.cam.followAgent == null ? false : data.cam.followAgent.smoothFirstPerson; }
set { data.cam.followAgent.smoothFirstPerson = value; }
}
/// <summary>
/// Boolean, true if the animation should be recorded
/// </summary>
static public bool recording
......@@ -523,6 +531,8 @@ public class ConfigCamBehaviour2
public bool followY;
[XmlAttribute("lockFirstPerson")]
public bool lockFirstPerson;
[XmlAttribute("smoothFirstPerson")]
public bool smoothFirstPerson;
public ConfigCamBehaviour2()
{
......@@ -530,6 +540,7 @@ public class ConfigCamBehaviour2
followX = false;
followY = false;
lockFirstPerson = false;
smoothFirstPerson = true;
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<XMLObstacles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Cylinders>
<Cylinder Radius="1">
<Center X="2.5" Y="0" />
</Cylinder>
<Cylinder Radius="1">
<Center X="2.5" Y="-4.1667" />
</Cylinder>
<Cylinder Radius="1">
<Center X="-16.333" Y="-1.6667" />
</Cylinder>
<Cylinder Radius="1">
<Center X="-38.667" Y="0" />
</Cylinder>
<Cylinder Radius="1">
<Center X="-42.667" Y="-4.1667" />
</Cylinder>
<Cylinder Radius="1">
<Center X="-46.333" Y="-1.8333" />
</Cylinder>
<Cylinder Radius="1">
<Center X="-48.167" Y="-5.5" />
</Cylinder>
<Cylinder Radius="1">
<Center X="-51.333" Y="-2.8333" />
</Cylinder>
</Cylinders>
</XMLObstacles>
<?xml version="1.0" encoding="utf-8"?>
<ConfigData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env_filesPath>./Scenarios/ExampleFirstPerson/</env_filesPath>
<env_obstFile>./Scenarios/Decor/obstExampleFirstPerson.xml</env_obstFile>
<env_stageInfos stageName="">
<file />
<position x="0" y="0" z="0" />
<rotation x="0" y="0" z="0" />
</env_stageInfos>
<cam>
<cameraType typeID="3" />
<position x="-32.01872" y="-1.759027" z="3.32442" />
<rotation x="30.5008" y="3.963564E-06" z="88.99989" />
<lookAtAgent agentID="2" />
<followAgent agentID="2" followOnX="true" followOnY="true" lockFirstPerson="false" smoothFirstPerson="true" />
<CamResolution x="-1" y="-1" />
</cam>
<recording start="0" end="0" framerate="15" width="320" height="240">
<saveImgOriginal record="true" quality="8" width="-1" height="-1" />
<saveImgSegmentation record="false" quality="8" width="-1" height="-1" />
<saveImgCategories record="false" quality="8" width="-1" height="-1" />
<saveImgDepth record="false" quality="8" width="-1" height="-1" minDepth="0" maxDepth="50" exponent="1" />
<saveImgNormals record="false" quality="8" width="-1" height="-1" />
<saveImgOpticalFlow record="false" quality="8" width="-1" height="-1" motionVector="false" />
<saveBodyBoundingBoxes record="false" />
<saveHeadBoundingBoxes record="false" />
<saveDir>./Output/Follow/</saveDir>
</recording>
<AgentColorList />
</ConfigData>
\ No newline at end of file
5.124,-22.283,-0.42333
5.224,-22.129,-0.42342
5.324,-21.981,-0.42332
5.424,-21.839,-0.42284
5.524,-21.702,-0.42216
5.624,-21.565,-0.42169
5.724,-21.428,-0.42158
5.824,-21.294,-0.42162
5.924,-21.162,-0.42167
6.024,-21.025,-0.42172
6.124,-20.881,-0.42175
6.224,-20.735,-0.42161
6.324,-20.592,-0.42112
6.424,-20.453,-0.42046
6.524,-20.314,-0.42001
6.624,-20.176,-0.41991
6.724,-20.036,-0.41996
6.824,-19.896,-0.42004
6.924,-19.758,-0.4201
7.024,-19.62,-0.41998
7.124,-19.481,-0.41951
7.224,-19.342,-0.41883
7.324,-19.203,-0.41836
7.424,-19.064,-0.41824
7.524,-18.926,-0.41829
7.624,-18.789,-0.41833
7.724,-18.651,-0.41838
7.824,-18.511,-0.41842
7.924,-18.371,-0.41831
8.024,-18.234,-0.41784
8.124,-18.097,-0.41716
8.224,-17.957,-0.41669
8.324,-17.816,-0.41657
8.424,-17.675,-0.41663
8.524,-17.538,-0.41671
8.624,-17.403,-0.41676
8.724,-17.267,-0.41665
8.824,-17.127,-0.41617
8.924,-16.983,-0.41549
9.024,-16.842,-0.41502
9.124,-16.706,-0.41491
9.224,-16.573,-0.41495
9.324,-16.437,-0.415
9.424,-16.296,-0.41505
9.524,-16.152,-0.41509
9.624,-16.01,-0.41498
9.724,-15.868,-0.41451
9.824,-15.728,-0.41383
9.924,-15.591,-0.41335
10.024,-15.454,-0.41324
10.124,-15.317,-0.41329
10.224,-15.176,-0.41337
10.324,-15.035,-0.41343
10.424,-14.896,-0.41331
10.524,-14.76,-0.41284
10.624,-14.622,-0.41216
10.724,-14.481,-0.41169
10.824,-14.339,-0.41158
10.924,-14.201,-0.41162
11.024,-14.067,-0.41167
11.124,-13.933,-0.41171
11.224,-13.793,-0.41176
11.324,-13.651,-0.41164
11.424,-13.512,-0.41117
11.524,-13.377,-0.41049
11.624,-13.242,-0.41002
11.724,-13.105,-0.40991
11.824,-12.963,-0.40995
11.924,-12.818,-0.41
12.024,-12.675,-0.41005
12.124,-12.537,-0.41008
12.224,-12.4,-0.40994
12.324,-12.26,-0.40946
12.424,-12.12,-0.40879
12.524,-11.981,-0.40835
12.624,-11.842,-0.40823
12.724,-11.702,-0.40829
12.824,-11.563,-0.40839
12.924,-11.425,-0.40851
13.024,-11.288,-0.40839
13.124,-11.15,-0.40758
13.224,-11.008,-0.40628
13.324,-10.869,-0.40637
13.424,-10.737,-0.41082
13.524,-10.616,-0.42095
13.624,-10.501,-0.4347
13.724,-10.386,-0.449
13.824,-10.271,-0.46271
13.924,-10.157,-0.47622
14.024,-10.045,-0.48979
14.124,-9.933,-0.50342
14.224,-9.8187,-0.51725
14.324,-9.7014,-0.53125
14.424,-9.5848,-0.54498
14.524,-9.4722,-0.5582
14.624,-9.3616,-0.5713
14.724,-9.2475,-0.58486
14.824,-9.1291,-0.59897
14.924,-9.0112,-0.61306
15.024,-8.8969,-0.62679
15.124,-8.7835,-0.64072
15.224,-8.6677,-0.65567
15.324,-8.547,-0.67195
15.424,-8.4204,-0.68923
15.524,-8.2918,-0.70664
15.624,-8.1664,-0.72348
15.724,-8.0447,-0.73985
15.824,-7.9242,-0.7562
15.924,-7.8033,-0.77274
16.024,-7.6812,-0.78938
16.124,-7.5588,-0.80587
16.224,-7.438,-0.82197
16.324,-7.3199,-0.83775
16.424,-7.2024,-0.85367
16.524,-7.0823,-0.87013
16.624,-6.9569,-0.88719
16.724,-6.8277,-0.90448
16.824,-6.7,-0.92156
16.924,-6.5764,-0.93839
17.024,-6.4552,-0.95485
17.124,-6.3333,-0.97018
17.224,-6.2095,-0.98356
17.324,-6.0853,-0.99516
17.424,-5.9627,-1.0061
17.524,-5.8395,-1.0174
17.624,-5.7125,-1.0296
17.724,-5.5821,-1.0421
17.824,-5.4519,-1.0545
17.924,-5.3251,-1.0669
18.024,-5.2023,-1.0793
18.124,-5.0814,-1.0914
18.224,-4.9591,-1.1038
18.324,-4.8316,-1.1177
18.424,-4.6989,-1.1327
18.524,-4.5667,-1.1468
18.624,-4.4381,-1.1592
18.724,-4.3117,-1.1708
18.824,-4.1869,-1.1824
18.924,-4.0612,-1.1946
19.024,-3.9273,-1.2088
19.124,-3.7818,-1.2253
19.224,-3.6304,-1.2431
19.324,-3.4791,-1.2601
19.424,-3.327,-1.2761
19.524,-3.1709,-1.2926
19.624,-3.0108,-1.3114
19.724,-2.8496,-1.3319
19.824,-2.6915,-1.3524
19.924,-2.5381,-1.3719
20.024,-2.3849,-1.3912
20.124,-2.2247,-1.4117
20.224,-2.0579,-1.4331
20.324,-1.8918,-1.4534
20.424,-1.7321,-1.4709
20.524,-1.5786,-1.4856
20.624,-1.4252,-1.4989
20.724,-1.2678,-1.5119
20.824,-1.1195,-1.524
20.924,-1.0053,-1.5333
21.024,-0.91396,-1.541
21.124,-0.78629,-1.5526
21.224,-0.5987,-1.5681
21.324,-0.39992,-1.5798
21.424,-0.23058,-1.5831
21.524,-0.084235,-1.5811
21.624,0.054891,-1.5785
21.724,0.19115,-1.577
21.824,0.32479,-1.576
21.924,0.46073,-1.575
22.024,0.60375,-1.5739
22.124,0.74962,-1.5728
22.224,0.89119,-1.5717
22.324,1.0277,-1.5706
22.424,1.1627,-1.5695
22.524,1.2986,-1.5683
22.624,1.4359,-1.567
22.724,1.5756,-1.5658
22.824,1.7178,-1.5647
22.924,1.8589,-1.5634
23.024,1.997,-1.5622
23.124,2.1347,-1.5611
23.224,2.2739,-1.5599
23.324,2.4139,-1.5586
23.424,2.5541,-1.5573
23.524,2.694,-1.5562
23.624,2.8324,-1.555
23.724,2.9686,-1.5539
23.824,3.1052,-1.5528
23.924,3.2454,-1.5517
24.024,3.3868,-1.5506
24.124,3.5251,-1.5495
24.224,3.6621,-1.5482
24.324,3.8019,-1.5468
24.424,3.9445,-1.5455
24.524,4.0865,-1.5444
24.624,4.2258,-1.5433
24.724,4.3629,-1.5422
24.824,4.4996,-1.5412
24.924,4.6375,-1.5399
25.024,4.7767,-1.5387
25.124,4.9154,-1.5375
25.224,5.0534,-1.5363
25.324,5.1917,-1.5351
25.424,5.3304,-1.5339
25.524,5.4688,-1.5328
25.624,5.6072,-1.5316
25.724,5.7464,-1.5302
25.824,5.8855,-1.529
25.924,6.0231,-1.5279
26.024,6.1599,-1.5267
26.124,6.2985,-1.5255
26.224,6.44,-1.5245
26.324,6.5824,-1.5233
26.424,6.7232,-1.5221
26.524,6.8615,-1.5212
26.624,6.9995,-1.5205
26.724,7.1397,-1.52
26.824,7.281,-1.5193
26.924,7.421,-1.5181
27.024,7.559,-1.5168
27.124,7.6954,-1.5161
27.224,7.8314,-1.5154
27.324,7.9698,-1.5122
27.424,8.1129,-1.504
27.524,8.2613,-1.4908
27.624,8.4135,-1.4755
27.724,8.5667,-1.4602
27.824,8.7187,-1.4454
27.924,8.8702,-1.4305
28.024,9.024,-1.4153
28.124,9.1776,-1.4002
28.224,9.3262,-1.3855
28.324,9.4731,-1.3712
28.424,9.6254,-1.3565
28.524,9.7829,-1.3411
28.624,9.9405,-1.3256
28.724,10.094,-1.3105
28.824,10.243,-1.2959
28.924,10.394,-1.2811
29.024,10.548,-1.2661
29.124,10.703,-1.2511
29.224,10.857,-1.236
29.324,11.009,-1.221
29.424,11.162,-1.2061
29.524,11.315,-1.1915
29.624,11.47,-1.1766
29.724,11.625,-1.1614
29.824,11.779,-1.1462
29.924,11.931,-1.1312
30.024,12.08,-1.1165
30.124,12.221,-1.1021
30.224,12.353,-1.0882
30.324,12.479,-1.0746
30.424,12.603,-1.0612
30.524,12.727,-1.0479
30.624,12.853,-1.0344
30.724,12.98,-1.0209
30.824,13.106,-1.0077
30.924,13.232,-0.99435
31.024,13.359,-0.98107
31.124,13.486,-0.96799
31.224,13.611,-0.95498
31.324,13.735,-0.94188
31.424,13.86,-0.92878
31.524,13.986,-0.91564
31.624,14.116,-0.90227
31.724,14.249,-0.88866
31.824,14.382,-0.8749
31.924,14.512,-0.86062
32.024,14.641,-0.84536
32.124,14.771,-0.82942
32.224,14.906,-0.8137
32.324,15.048,-0.79881
32.424,15.194,-0.7847
32.524,15.338,-0.77099
32.624,15.472,-0.75728
32.724,15.603,-0.74297
32.824,15.737,-0.72768
32.924,15.873,-0.71198
33.024,16.002,-0.69645
33.124,16.126,-0.68183
33.224,16.253,-0.67033
33.324,16.385,-0.66411
33.424,16.522,-0.66241
33.524,16.66,-0.66237
33.624,16.798,-0.6622
33.724,16.937,-0.66186
33.824,17.076,-0.66159
33.924,17.217,-0.66117
34.024,17.357,-0.66057
34.124,17.497,-0.66001
34.224,17.636,-0.65945
34.324,17.776,-0.65888
34.424,17.914,-0.65848
34.524,18.052,-0.65823
34.624,18.189,-0.6578
34.724,18.326,-0.65719
34.824,18.464,-0.65677
34.924,18.604,-0.65654
35.024,18.743,-0.65618
35.124,18.881,-0.65566
35.224,19.019,-0.65509
35.324,19.16,-0.65419
35.424,19.302,-0.65301
35.524,19.442,-0.6535
35.624,19.579,-0.65893
35.724,19.713,-0.67065
35.824,19.852,-0.68605
35.924,19.997,-0.70107
36.024,20.142,-0.71459
36.124,20.283,-0.72938
36.224,20.42,-0.74761
36.324,20.556,-0.76629
36.424,20.696,-0.78023
36.524,20.843,-0.78813
36.624,20.989,-0.7928
36.724,21.133,-0.79712
36.824,21.275,-0.80218
36.924,21.419,-0.80743
37.024,21.565,-0.81203
37.124,21.71,-0.81617
37.224,21.852,-0.82077
37.324,21.991,-0.82597
37.424,22.129,-0.83107
37.524,22.267,-0.83585
37.624,22.406,-0.84067
37.724,22.544,-0.84537
37.824,22.682,-0.84957
37.924,22.821,-0.85371
38.024,22.96,-0.85829
38.124,23.096,-0.86291
38.224,23.231,-0.86718
38.324,23.369,-0.87155
38.424,23.506,-0.87635
38.524,23.641,-0.88104
38.624,23.775,-0.88517
38.724,23.915,-0.88911
38.824,24.06,-0.89339
38.924,24.207,-0.89801
39.024,24.352,-0.90272
39.124,24.495,-0.90703
39.224,24.636,-0.90984
39.324,24.777,-0.91045
39.424,24.917,-0.90989
39.524,25.058,-0.91011
39.624,25.199,-0.91222
39.724,25.34,-0.91564
39.824,25.48,-0.9186
39.924,25.62,-0.91969
40.024,25.762,-0.91912
40.124,25.902,-0.91803
40.224,26.041,-0.91706
40.324,26.18,-0.91621
40.424,26.319,-0.91538
40.524,26.459,-0.91453
40.624,26.598,-0.91382
40.724,26.737,-0.91334
40.824,26.874,-0.91288
40.924,27.011,-0.91218
41.024,27.148,-0.91116
41.124,27.284,-0.90998
41.224,27.422,-0.90937
41.324,27.565,-0.9106
41.424,27.709,-0.91386
41.524,27.851,-0.91738
41.624,27.99,-0.9192
41.724,28.125,-0.91912
41.824,28.262,-0.91821
41.924,28.405,-0.91756
42.024,28.549,-0.91825
42.124,28.676,-0.92101
42.224,28.779,-0.92589
42.324,28.884,-0.93244
42.424,29.027,-0.93864
42.524,29.196,-0.9419
42.624,29.358,-0.94257
42.724,29.503,-0.94322
42.824,29.641,-0.94445
42.924,29.779,-0.94513
43.024,29.918,-0.94527
43.124,30.057,-0.94595
43.224,30.197,-0.94757
43.324,30.339,-0.95068
43.424,30.487,-0.9571
43.524,30.637,-0.96791
43.624,30.785,-0.9822
43.724,30.926,-0.99855
43.824,31.059,-1.0156
43.924,31.188,-1.032
44.024,31.317,-1.0484
44.124,31.45,-1.0655
44.224,31.583,-1.0829
44.324,31.713,-1.0994
44.424,31.841,-1.1152
44.524,31.97,-1.1315
44.624,32.104,-1.149
44.724,32.241,-1.168
44.824,32.378,-1.1885
44.924,32.514,-1.2103
45.024,32.651,-1.2328
45.124,32.791,-1.2552
45.224,32.928,-1.2759
45.324,33.06,-1.2929
45.424,33.186,-1.3062
45.524,33.31,-1.3173
45.624,33.437,-1.3281
45.724,33.565,-1.3395
45.824,33.692,-1.3511
45.924,33.818,-1.3626
46.024,33.944,-1.3738
46.124,34.069,-1.3849
46.224,34.195,-1.3959
46.324,34.321,-1.4068
46.424,34.448,-1.418
46.524,34.573,-1.4292
46.624,34.698,-1.4403
46.724,34.828,-1.4513
46.824,34.964,-1.4627
46.924,35.103,-1.4747
47.024,35.238,-1.4883
47.124,35.368,-1.5047
47.224,35.495,-1.5238
47.324,35.62,-1.5442
47.424,35.744,-1.5647
47.524,35.87,-1.5852
47.624,35.998,-1.6056
47.724,36.131,-1.6243
47.824,36.268,-1.6401
47.924,36.403,-1.6542
48.024,36.536,-1.6698
48.124,36.665,-1.6884
48.224,36.792,-1.709
48.324,36.919,-1.7301
48.424,37.048,-1.7516
48.524,37.178,-1.7732
48.624,37.309,-1.7943
48.724,37.437,-1.8147
48.824,37.564,-1.8351
48.924,37.693,-1.856
49.024,37.822,-1.8774
49.124,37.952,-1.8989
49.224,38.081,-1.9201
49.324,38.208,-1.9409
49.424,38.335,-1.9615
49.524,38.462,-1.9821
49.624,38.591,-2.003
49.724,38.722,-2.0243
49.824,38.852,-2.0454
49.924,38.98,-2.066
50.024,39.105,-2.0864
50.124,39.222,-2.1066
50.224,39.333,-2.1262
50.324,39.443,-2.1438
50.424,39.557,-2.1585
50.524,39.678,-2.1713
50.624,39.801,-2.1838
50.724,39.924,-2.197
50.824,40.045,-2.2107
50.924,40.168,-2.2247
51.024,40.292,-2.2388
51.124,40.414,-2.2527
51.224,40.535,-2.2662
51.324,40.656,-2.2796
51.424,40.779,-2.2933