Commit 4540e844 authored by ATREVI Dieudonne's avatar ATREVI Dieudonne
Browse files

- Add progress bar on the scene

- Add Replay option at the end of the animation allowing the user to play back the same animation without to go to the welcome menu
parent 20470ba4
fileFormatVersion: 2
guid: d7fd7eb9a38319183ae98468395b7b5f
guid: 8a214de5a616f5e7fac22679e8b7c376
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
......@@ -36,7 +36,7 @@ TextureImporter:
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
......@@ -70,6 +70,18 @@ TextureImporter:
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
......
fileFormatVersion: 2
guid: a92a0b4471c106236ab628451e6d08e2
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
......@@ -3312,8 +3312,8 @@ GameObject:
- component: {fileID: 275588658}
- component: {fileID: 275588657}
- component: {fileID: 275588656}
- component: {fileID: 275588655}
- component: {fileID: 275588654}
- component: {fileID: 275588655}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
......@@ -3353,13 +3353,15 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 12c47d7420a90704bbd9509551cc3574, type: 3}
m_Name:
m_EditorClassIdentifier:
_default_position: {x: 0, y: 0, z: 0}
_default_rotation: {x: 0, y: 0, z: 0}
activateLookAt: 0
activateFollow: 0
lookAt_Id: 0
follow_Id: 0
follow_LockX: 0
follow_LockZ: 0
lockFirstPersonView: 1
followOnX: 0
followOnY: 0
lockFirstPersonView: 0
panelMovCamera: {fileID: 0}
camSelect: {fileID: 0}
--- !u!114 &275588656
......@@ -5595,6 +5597,83 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 414540830}
m_CullTransparentMesh: 0
--- !u!1 &425495271
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 425495272}
- component: {fileID: 425495274}
- component: {fileID: 425495273}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &425495272
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 425495271}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1741252960}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &425495273
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 425495271}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text:
--- !u!222 &425495274
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 425495271}
m_CullTransparentMesh: 0
--- !u!1 &426456925
GameObject:
m_ObjectHideFlags: 0
......@@ -6826,6 +6905,17 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1741252959}
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &525111708
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -9680,6 +9770,17 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1898254883}
m_MethodName: closeHelpAboutPanel
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &835324856
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -10686,7 +10787,7 @@ GameObject:
- component: {fileID: 943443530}
- component: {fileID: 943443531}
m_Layer: 5
m_Name: Slider
m_Name: progressBar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......@@ -10700,19 +10801,19 @@ RectTransform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 943443529}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 39}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 840018334}
- {fileID: 613463099}
- {fileID: 2084379463}
m_Father: {fileID: 1229005602}
m_RootOrder: 0
m_RootOrder: 1
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: 0, y: -149}
m_SizeDelta: {x: 361.5, y: 66.5}
m_AnchoredPosition: {x: 0, y: -153}
m_SizeDelta: {x: 239.6, y: 48.65}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &943443531
MonoBehaviour:
......@@ -12740,7 +12841,7 @@ RectTransform:
- {fileID: 1741090612}
- {fileID: 1970815489}
m_Father: {fileID: 1229005602}
m_RootOrder: 1
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
......@@ -13692,13 +13793,14 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 943443530}
- {fileID: 1179796688}
- {fileID: 943443530}
- {fileID: 1924304615}
- {fileID: 1630200776}
- {fileID: 566229644}
- {fileID: 1555170342}
- {fileID: 1235341451}
- {fileID: 1741252960}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -14471,6 +14573,17 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1741252959}
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &1254477454
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -17109,6 +17222,17 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1898254883}
m_MethodName: closeHelpAboutPanel
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &1477760987
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -20999,6 +21123,135 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &1741252959
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1741252960}
- component: {fileID: 1741252963}
- component: {fileID: 1741252962}
- component: {fileID: 1741252961}
m_Layer: 5
m_Name: Replay
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1741252960
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1741252959}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 425495272}
m_Father: {fileID: 1229005602}
m_RootOrder: 7
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: 0, y: 0}
m_SizeDelta: {x: 103.8, y: 93.1}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1741252961
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1741252959}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 1741252962}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1898254883}
m_MethodName: replayScenario
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &1741252962
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1741252959}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.64705884, g: 0.64705884, b: 0.64705884, a: 1}
m_RaycastTarget: 0
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 8a214de5a616f5e7fac22679e8b7c376, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &1741252963
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1741252959}
m_CullTransparentMesh: 0
--- !u!1 &1745372758
GameObject:
m_ObjectHideFlags: 0
......@@ -22318,8 +22571,8 @@ MonoBehaviour:
configPanel: {fileID: 0}
topMenuPanel: {fileID: 0}
slider: {fileID: 0}
FollowAgentID: {fileID: 0}
LookAgentID: {fileID: 0}
progressBar: {fileID: 0}
env: {fileID: 0}
--- !u!114 &1898254884
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -22332,6 +22585,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5b0715366e7e09248b778f5f8876cba1, type: 3}
m_Name:
m_EditorClassIdentifier:
avatars: []
cam: {fileID: 275588653}
--- !u!4 &1898254885
Transform:
......
......@@ -15,7 +15,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**
** Authors: Tristan Le Bouffant, Julian Joseph
** Authors: Tristan Le Bouffant, Julian Joseph, Fabrice ATREVI
**
** Contact: crowd_group@inria.fr
*/
......@@ -64,13 +64,13 @@ public class FollowTrajectory : MonoBehaviour
Vector3 _InitialPositionWhenChangingParent;
Vector3 _SavedParentPosition;
bool _bIsDone;
public float runTime = 0.0f;
// optimization value
int _ReaderIndexCount = 0;
ObjectInterface _ObjectInterface = null;
[HideInInspector] public AFilter _BasicFilter = new BasicFilter();
[HideInInspector] public float _DeltaTimeForSmoothing = 0.5f;
[HideInInspector] public FilteringMethod _FilterType = FilteringMethod.None;
......@@ -82,83 +82,85 @@ public class FollowTrajectory : MonoBehaviour
// Use this for initialization
void Start ()
{
_bIsDone = false;
_IsLaunchable = (_TrajectroryFilename != "" && _TrajectroryFilename != null);
CurrentTime = 0.0f;
iCurrentInf = 0;
iCurrentSup = 1;
_bIsDone = false;
_IsLaunchable = (_TrajectroryFilename != "" && _TrajectroryFilename != null);
CurrentTime = 0.0f;
iCurrentInf = 0;
iCurrentSup = 1;
}
public void initNewTrajectories()
{
_bIsDone = false;
_IsLaunchable = (_TrajectroryFilename != "" && _TrajectroryFilename != null);
if (!_IsLaunchable)
{
Debug.LogError("Your CSV file is empty : " + _TrajectroryFilename);
return;
}
CurrentTime = 0.0f;
if (_Myreader == null)
{
_Myreader = new TrajectoryReader();
}
_Myreader.Init(_TrajectroryFilename, _SamplingInput, _SamplingFactor, _MergeClosedPoints, _ClosedPointsMinimumDistance);
_ReaderIndexCount = _Myreader.IndexList.Count;
InitLineRenderer();
InitFilter();
iCurrentInf = 0;
iCurrentSup = 1;
Vector4 iPosition = _Myreader.mSkeleton[0];
fCurrentTime = iPosition[0];
float yVal = 0.0f;
if (float.IsNaN(iPosition[3]))
{
yVal = this.transform.localPosition.y;
_AnimateYAxe = false;
Debug.Log("A non alpha numerique value has been detected in your trajectory file " + _TrajectroryFilename + ". ensure x,y and z coordinates are set in the file if you want to animate Y coordinate. by default, the animation on Y axe is disable.");
}
else
{
yVal = (_AnimateYAxe) ? iPosition[3] : this.transform.localPosition.y;
}
this.transform.localPosition = new Vector3(iPosition[1], yVal, iPosition[2]);
_ZeNavMeshAgent = this.GetComponent<UnityEngine.AI.NavMeshAgent>();
if (_ZeNavMeshAgent)
{
_fAngularSpeed = _ZeNavMeshAgent.angularSpeed;
}
else
{
_fAngularSpeed = _DefaultAngularSpeed;
}
// init de la rotation
Vector3 vPosCurrent = new Vector3(0.0f, 0.0f, 1.0f);
Vector3 vPosSup = new Vector3(_Myreader.mSkeleton[1][1], 0.0f, _Myreader.mSkeleton[1][2]) - this.transform.localPosition; // y
if (Vector3.Magnitude(vPosSup) != 0)
{
_fOldAlpha = 57.2957795f * Mathf.Acos(Vector3.Dot(vPosCurrent, vPosSup) / (Vector3.Magnitude(vPosCurrent) * Vector3.Magnitude(vPosSup)));
if (Vector3.Cross(vPosCurrent, vPosSup).y < 0)
_fOldAlpha *= -1;
this.transform.rotation = Quaternion.Euler(0, _fOldAlpha/*+this.transform.rotation.eulerAngles.y*/, 0);
}
else
_fOldAlpha = this.transform.rotation.eulerAngles.y;
_SavedParentPosition = Vector3.zero;
_InitialPositionWhenChangingParent = Vector3.zero;
// init interface
ObjectInterface MyObjInterface = new ObjectInterface();
MyObjInterface.Init(this.gameObject);
RegisterInterface(MyObjInterface);
public void initNewTrajectories()