From 81dd170c7cb8b704b39f14c500e2fc2415b3a722 Mon Sep 17 00:00:00 2001 From: bjrtx <57685415+bjrtx@users.noreply.github.com> Date: Tue, 30 Apr 2024 09:08:31 +0200 Subject: [PATCH 1/9] Modify Kohli bounding box behaviour --- .../Scripts/Logging/JsonLogging.cs | 6 ++-- .../Redirection/3DInterpolation/Techniques.cs | 29 +++++++++---------- .../Scripts/Visualisation/Socket.cs | 7 ++--- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/JsonLogging.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/JsonLogging.cs index a0203b6c..7cddd338 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/JsonLogging.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/JsonLogging.cs @@ -48,7 +48,7 @@ public record JsonRedirectionData { public List Targets => script.scene.targets.ConvertAll(t => new TransformData(t)); public TransformData PhysicalTarget => script.scene.physicalTarget ? new(script.scene.physicalTarget) : null; public TransformData VirtualTarget => script.scene.virtualTarget ? new(script.scene.virtualTarget) : null; - public string StrategyDirection => script.scene.forwardTarget != null ? script.scene.forwardTarget.ToString() : null; + public string StrategyDirection => script.scene.forwardTarget != null ? Convert.ToString(script.scene.forwardTarget.ToString()) : null; public JsonRedirectionData(Interaction script) => this.script = script; } @@ -74,8 +74,8 @@ protected void WriteRecords(Queue records) { } private sealed class Unsubscriber : IDisposable { - private HashSet> _observers; - private IObserver _observer; + private readonly HashSet> _observers; + private readonly IObserver _observer; public Unsubscriber(HashSet> observers, IObserver observer) { _observers = observers; diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/3DInterpolation/Techniques.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/3DInterpolation/Techniques.cs index 14f6c358..0cb817e3 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/3DInterpolation/Techniques.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/3DInterpolation/Techniques.cs @@ -22,27 +22,26 @@ public class Kohli2010RedirectedTouching : BodyRedirectionTechnique { public void ComputeDisplacement(Scene scene) { var x = Array.ConvertAll(scene.referenceParent.GetComponentsInChildren(), t => t.position); var y = Array.ConvertAll(scene.interpolatedParent.GetComponentsInChildren(), t => t.position); - if (add_boundaries) { - var bounds = new Bounds(x[0], Vector3.zero); - foreach (var v in x.Concat(y)) { - bounds.Encapsulate(v); - } - bounds.extents *= 2f; - Vector3[] ends = { bounds.min, bounds.max }; - var supplementary_fixed = new List(8); - foreach (var a in ends) - foreach (var b in ends) - foreach (var c in ends) - supplementary_fixed.Add(new Vector3(a.x, b.y, c.z)); - x = x.Concat(supplementary_fixed).ToArray(); - y = y.Concat(supplementary_fixed).ToArray(); - } displace = ThinPlateSpline.SabooSmoothedDisplacementField( x, y, scene.parameters.SmoothingParameter, scene.parameters.Rescale ); + if (add_boundaries) { + var bounds = new Bounds(x[0], Vector3.zero); + foreach (var v in x.Concat(y)) { + bounds.Encapsulate(v); + } + var sqrRadius = 3 * bounds.extents.sqrMagnitude; + + static float f(float x) => x > 0 ? Mathf.Exp(-1 / x) : 0; + static float g(float x) => f(x) / (f(x) + f(1 - x)); + float transitionLayerWidth = 0.5F; + float smoothTransition(float x) => 1 - g((x - sqrRadius) / (transitionLayerWidth * sqrRadius)); + var old_displace = displace; + displace = (pos) => old_displace(pos) * smoothTransition((pos - bounds.center).sqrMagnitude); + } } public override void Redirect(Scene scene) { diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/Socket.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/Socket.cs index 867664f3..c161d935 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/Socket.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/Socket.cs @@ -19,8 +19,8 @@ struct WorldRedirectionData { [SerializeField] float[] maxSums; public void AddTo(float overTime, float rotational, float curvature, float time) { - if (this.maxSums is null || this.maxSums.Length != 3) { - this.maxSums = new float[3]; + if (maxSums?.Length != 3) { + maxSums = new float[3]; } this.overTime += Mathf.Abs(overTime); this.rotational += Mathf.Abs(rotational); @@ -108,9 +108,6 @@ private void StartSendingMessages() { Thread thread = new(() => SendMessage(client, json)); thread.Start(); redirectionData.Reset(); - // redirectionData.overTime = 0f; - // redirectionData.rotational = 0f; - // redirectionData.curvature = 0f; } } From faab92604e20449ba77596cf9c723c21f587bc18 Mon Sep 17 00:00:00 2001 From: benoitgeslain Date: Tue, 30 Apr 2024 12:01:09 +0200 Subject: [PATCH 2/9] fixed and tested Kohli --- .../3DInterpolation Demo.unity | 1437 ++++++++++++++--- .../Sample Scenes/Gradient.mat | 108 -- .../Sample Scenes/Gradient.mat.meta | 8 - .../Redirection/3DInterpolation/Techniques.cs | 3 +- 4 files changed, 1208 insertions(+), 348 deletions(-) delete mode 100644 Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Sample Scenes/Gradient.mat delete mode 100644 Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Sample Scenes/Gradient.mat.meta diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Sample Scenes/3DInterpolation/3DInterpolation Demo.unity b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Sample Scenes/3DInterpolation/3DInterpolation Demo.unity index 978ade21..d367148a 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Sample Scenes/3DInterpolation/3DInterpolation Demo.unity +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Sample Scenes/3DInterpolation/3DInterpolation Demo.unity @@ -123,6 +123,321 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &40660551 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 40660552} + - component: {fileID: 40660555} + - component: {fileID: 40660554} + - component: {fileID: 40660553} + m_Layer: 0 + m_Name: Cube (5) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &40660552 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 40660551} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1.5599995} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1400453483} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &40660553 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 40660551} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &40660554 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 40660551} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e043fe347fa898b4aa305c042a604493, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &40660555 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 40660551} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &232226397 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 232226398} + - component: {fileID: 232226401} + - component: {fileID: 232226400} + - component: {fileID: 232226399} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &232226398 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 232226397} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1400453483} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &232226399 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 232226397} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &232226400 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 232226397} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e043fe347fa898b4aa305c042a604493, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &232226401 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 232226397} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &255095093 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 255095094} + - component: {fileID: 255095097} + - component: {fileID: 255095096} + - component: {fileID: 255095095} + m_Layer: 0 + m_Name: Cube (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &255095094 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 255095093} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 1.5, z: -5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1400453483} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &255095095 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 255095093} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &255095096 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 255095093} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e043fe347fa898b4aa305c042a604493, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &255095097 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 255095093} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!1001 &295302860 PrefabInstance: m_ObjectHideFlags: 0 @@ -186,11 +501,11 @@ PrefabInstance: - target: {fileID: 8724392028278952693, guid: e2fbe1cb529b72b46958e442fe11b2e9, type: 3} propertyPath: scene.referenceParent value: - objectReference: {fileID: 1115728659} + objectReference: {fileID: 1400453483} - target: {fileID: 8724392028278952693, guid: e2fbe1cb529b72b46958e442fe11b2e9, type: 3} propertyPath: scene.interpolatedParent value: - objectReference: {fileID: 2085526127} + objectReference: {fileID: 1648326219} - target: {fileID: 8724392028278952693, guid: e2fbe1cb529b72b46958e442fe11b2e9, type: 3} propertyPath: scene.reference.Array.size value: 1 @@ -208,7 +523,217 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: e2fbe1cb529b72b46958e442fe11b2e9, type: 3} ---- !u!1 &328696478 +--- !u!1 &407152204 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 407152205} + - component: {fileID: 407152208} + - component: {fileID: 407152207} + - component: {fileID: 407152206} + m_Layer: 0 + m_Name: Cube (10) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &407152205 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 407152204} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -4.43, y: 0, z: -1.5599995} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1400453483} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &407152206 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 407152204} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &407152207 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 407152204} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e043fe347fa898b4aa305c042a604493, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &407152208 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 407152204} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &415451143 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 415451144} + - component: {fileID: 415451147} + - component: {fileID: 415451146} + - component: {fileID: 415451145} + m_Layer: 0 + m_Name: Cube (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &415451144 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 415451143} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -4.38, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1648326219} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &415451145 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 415451143} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &415451146 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 415451143} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &415451147 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 415451143} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &508128012 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -216,91 +741,209 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 328696481} - - component: {fileID: 328696480} - - component: {fileID: 328696479} + - component: {fileID: 508128013} + - component: {fileID: 508128016} + - component: {fileID: 508128015} + - component: {fileID: 508128014} m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera + m_Name: Cube + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!81 &328696479 -AudioListener: +--- !u!4 &508128013 +Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 328696478} - m_Enabled: 1 ---- !u!20 &328696480 -Camera: + m_GameObject: {fileID: 508128012} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1648326219} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &508128014 +BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 328696478} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_Iso: 200 - m_ShutterSpeed: 0.005 - m_Aperture: 16 - m_FocusDistance: 10 - m_FocalLength: 50 - m_BladeCount: 5 - m_Curvature: {x: 2, y: 11} - m_BarrelClipping: 0.25 - m_Anamorphism: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_NormalizedViewPortRect: + m_GameObject: {fileID: 508128012} + m_Material: {fileID: 0} + m_IncludeLayers: serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: + m_Bits: 0 + m_ExcludeLayers: serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &328696481 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &508128015 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 508128012} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &508128016 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 508128012} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &552046705 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 552046706} + - component: {fileID: 552046709} + - component: {fileID: 552046708} + - component: {fileID: 552046707} + m_Layer: 0 + m_Name: Cube (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &552046706 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 328696478} + m_GameObject: {fileID: 552046705} serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5, y: 0, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 0} + m_Father: {fileID: 1648326219} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &494585852 +--- !u!65 &552046707 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 552046705} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &552046708 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 552046705} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &552046709 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 552046705} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &618472467 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -308,39 +951,39 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 494585853} - - component: {fileID: 494585856} - - component: {fileID: 494585855} - - component: {fileID: 494585854} + - component: {fileID: 618472468} + - component: {fileID: 618472471} + - component: {fileID: 618472470} + - component: {fileID: 618472469} m_Layer: 0 - m_Name: Cube + m_Name: Cube (3) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &494585853 +--- !u!4 &618472468 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 494585852} + m_GameObject: {fileID: 618472467} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalPosition: {x: 0, y: 0, z: -5} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1115728659} + m_Father: {fileID: 1648326219} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!65 &494585854 +--- !u!65 &618472469 BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 494585852} + m_GameObject: {fileID: 618472467} m_Material: {fileID: 0} m_IncludeLayers: serializedVersion: 2 @@ -355,13 +998,13 @@ BoxCollider: serializedVersion: 3 m_Size: {x: 1, y: 1, z: 1} m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &494585855 +--- !u!23 &618472470 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 494585852} + m_GameObject: {fileID: 618472467} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -397,15 +1040,15 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &494585856 +--- !u!33 &618472471 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 494585852} + m_GameObject: {fileID: 618472467} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &1115728658 +--- !u!1 &855621721 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -413,34 +1056,104 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1115728659} + - component: {fileID: 855621722} + - component: {fileID: 855621725} + - component: {fileID: 855621724} + - component: {fileID: 855621723} m_Layer: 0 - m_Name: Reference + m_Name: Cube (1) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &1115728659 +--- !u!4 &855621722 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1115728658} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 494585853} - - {fileID: 1274739746} - - {fileID: 1934640164} - - {fileID: 1349567703} - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1212841110 + m_GameObject: {fileID: 855621721} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1400453483} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &855621723 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 855621721} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &855621724 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 855621721} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e043fe347fa898b4aa305c042a604493, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &855621725 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 855621721} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1119605364 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -448,39 +1161,39 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1212841111} - - component: {fileID: 1212841114} - - component: {fileID: 1212841113} - - component: {fileID: 1212841112} + - component: {fileID: 1119605365} + - component: {fileID: 1119605368} + - component: {fileID: 1119605367} + - component: {fileID: 1119605366} m_Layer: 0 - m_Name: Cube (3) + m_Name: Cube (4) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &1212841111 +--- !u!4 &1119605365 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1212841110} + m_GameObject: {fileID: 1119605364} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 1.5, z: -5} + m_LocalPosition: {x: 5, y: 1.5, z: -5} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 2085526127} + m_Father: {fileID: 1648326219} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!65 &1212841112 +--- !u!65 &1119605366 BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1212841110} + m_GameObject: {fileID: 1119605364} m_Material: {fileID: 0} m_IncludeLayers: serializedVersion: 2 @@ -495,13 +1208,13 @@ BoxCollider: serializedVersion: 3 m_Size: {x: 1, y: 1, z: 1} m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &1212841113 +--- !u!23 &1119605367 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1212841110} + m_GameObject: {fileID: 1119605364} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -537,15 +1250,15 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &1212841114 +--- !u!33 &1119605368 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1212841110} + m_GameObject: {fileID: 1119605364} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &1274739745 +--- !u!1 &1196637001 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -553,39 +1266,39 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1274739746} - - component: {fileID: 1274739749} - - component: {fileID: 1274739748} - - component: {fileID: 1274739747} + - component: {fileID: 1196637002} + - component: {fileID: 1196637005} + - component: {fileID: 1196637004} + - component: {fileID: 1196637003} m_Layer: 0 - m_Name: Cube (1) + m_Name: Cube (6) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &1274739746 +--- !u!4 &1196637002 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1274739745} + m_GameObject: {fileID: 1196637001} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 5, y: 0, z: -10} + m_LocalPosition: {x: -4.43, y: 0, z: -5} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1115728659} + m_Father: {fileID: 1400453483} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!65 &1274739747 +--- !u!65 &1196637003 BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1274739745} + m_GameObject: {fileID: 1196637001} m_Material: {fileID: 0} m_IncludeLayers: serializedVersion: 2 @@ -600,13 +1313,13 @@ BoxCollider: serializedVersion: 3 m_Size: {x: 1, y: 1, z: 1} m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &1274739748 +--- !u!23 &1196637004 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1274739745} + m_GameObject: {fileID: 1196637001} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -620,7 +1333,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: e043fe347fa898b4aa305c042a604493, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -642,13 +1355,13 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &1274739749 +--- !u!33 &1196637005 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1274739745} + m_GameObject: {fileID: 1196637001} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!1001 &1275036158 PrefabInstance: @@ -660,15 +1373,19 @@ PrefabInstance: m_Modifications: - target: {fileID: 316408367193774732, guid: 0949af27169be084f91744164e13647f, type: 3} propertyPath: m_LocalScale.x - value: 1 + value: 10 objectReference: {fileID: 0} - target: {fileID: 316408367193774732, guid: 0949af27169be084f91744164e13647f, type: 3} propertyPath: m_LocalScale.y - value: 1 + value: 10 objectReference: {fileID: 0} - target: {fileID: 316408367193774732, guid: 0949af27169be084f91744164e13647f, type: 3} propertyPath: m_LocalScale.z - value: 1 + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 316408367193774732, guid: 0949af27169be084f91744164e13647f, type: 3} + propertyPath: m_LocalPosition.y + value: -0.01699996 objectReference: {fileID: 0} - target: {fileID: 316408367193774732, guid: 0949af27169be084f91744164e13647f, type: 3} propertyPath: m_ConstrainProportionsScale @@ -720,15 +1437,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 7916654614193320361, guid: 0949af27169be084f91744164e13647f, type: 3} propertyPath: m_LocalScale.x - value: 1 + value: 10 objectReference: {fileID: 0} - target: {fileID: 7916654614193320361, guid: 0949af27169be084f91744164e13647f, type: 3} propertyPath: m_LocalScale.y - value: 1 + value: 10 objectReference: {fileID: 0} - target: {fileID: 7916654614193320361, guid: 0949af27169be084f91744164e13647f, type: 3} propertyPath: m_LocalScale.z - value: 1 + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 7916654614193320361, guid: 0949af27169be084f91744164e13647f, type: 3} + propertyPath: m_LocalPosition.y + value: -1.91 objectReference: {fileID: 0} - target: {fileID: 7916654614193320361, guid: 0949af27169be084f91744164e13647f, type: 3} propertyPath: m_ConstrainProportionsScale @@ -739,7 +1460,7 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 0949af27169be084f91744164e13647f, type: 3} ---- !u!1 &1288689812 +--- !u!1 &1300280827 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -747,39 +1468,39 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1288689813} - - component: {fileID: 1288689816} - - component: {fileID: 1288689815} - - component: {fileID: 1288689814} + - component: {fileID: 1300280828} + - component: {fileID: 1300280831} + - component: {fileID: 1300280830} + - component: {fileID: 1300280829} m_Layer: 0 - m_Name: Cube (4) + m_Name: Cube (8) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &1288689813 +--- !u!4 &1300280828 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1288689812} + m_GameObject: {fileID: 1300280827} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 5, y: 1.5, z: -5} + m_LocalPosition: {x: 5, y: 0, z: -1.5599995} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 2085526127} + m_Father: {fileID: 1400453483} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!65 &1288689814 +--- !u!65 &1300280829 BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1288689812} + m_GameObject: {fileID: 1300280827} m_Material: {fileID: 0} m_IncludeLayers: serializedVersion: 2 @@ -794,13 +1515,13 @@ BoxCollider: serializedVersion: 3 m_Size: {x: 1, y: 1, z: 1} m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &1288689815 +--- !u!23 &1300280830 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1288689812} + m_GameObject: {fileID: 1300280827} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -814,7 +1535,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: e043fe347fa898b4aa305c042a604493, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -836,15 +1557,15 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &1288689816 +--- !u!33 &1300280831 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1288689812} + m_GameObject: {fileID: 1300280827} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &1349567702 +--- !u!1 &1325485932 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -852,10 +1573,10 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1349567703} - - component: {fileID: 1349567706} - - component: {fileID: 1349567705} - - component: {fileID: 1349567704} + - component: {fileID: 1325485933} + - component: {fileID: 1325485936} + - component: {fileID: 1325485935} + - component: {fileID: 1325485934} m_Layer: 0 m_Name: Cube (4) m_TagString: Untagged @@ -863,28 +1584,28 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &1349567703 +--- !u!4 &1325485933 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1349567702} + m_GameObject: {fileID: 1325485932} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 5, y: 0, z: -5} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1115728659} + m_Father: {fileID: 1400453483} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!65 &1349567704 +--- !u!65 &1325485934 BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1349567702} + m_GameObject: {fileID: 1325485932} m_Material: {fileID: 0} m_IncludeLayers: serializedVersion: 2 @@ -899,13 +1620,13 @@ BoxCollider: serializedVersion: 3 m_Size: {x: 1, y: 1, z: 1} m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &1349567705 +--- !u!23 &1325485935 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1349567702} + m_GameObject: {fileID: 1325485932} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -919,7 +1640,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: e043fe347fa898b4aa305c042a604493, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -941,15 +1662,15 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &1349567706 +--- !u!33 &1325485936 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1349567702} + m_GameObject: {fileID: 1325485932} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &1496695406 +--- !u!1 &1400453482 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -957,39 +1678,79 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1496695407} - - component: {fileID: 1496695410} - - component: {fileID: 1496695409} - - component: {fileID: 1496695408} + - component: {fileID: 1400453483} m_Layer: 0 - m_Name: Cube + m_Name: Reference + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1400453483 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1400453482} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 232226398} + - {fileID: 1400938008} + - {fileID: 855621722} + - {fileID: 255095094} + - {fileID: 1196637002} + - {fileID: 40660552} + - {fileID: 407152205} + - {fileID: 1300280828} + - {fileID: 1325485933} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1400938007 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1400938008} + - component: {fileID: 1400938011} + - component: {fileID: 1400938010} + - component: {fileID: 1400938009} + m_Layer: 0 + m_Name: Cube (5) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &1496695407 +--- !u!4 &1400938008 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1496695406} + m_GameObject: {fileID: 1400938007} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalPosition: {x: -4.38, y: 0, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 2085526127} + m_Father: {fileID: 1400453483} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!65 &1496695408 +--- !u!65 &1400938009 BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1496695406} + m_GameObject: {fileID: 1400938007} m_Material: {fileID: 0} m_IncludeLayers: serializedVersion: 2 @@ -1004,13 +1765,13 @@ BoxCollider: serializedVersion: 3 m_Size: {x: 1, y: 1, z: 1} m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &1496695409 +--- !u!23 &1400938010 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1496695406} + m_GameObject: {fileID: 1400938007} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -1024,7 +1785,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: e043fe347fa898b4aa305c042a604493, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1046,19 +1807,59 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &1496695410 +--- !u!33 &1400938011 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1496695406} + m_GameObject: {fileID: 1400938007} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &1529740253 stripped Transform: m_CorrespondingSourceObject: {fileID: 7916654614193320361, guid: 0949af27169be084f91744164e13647f, type: 3} m_PrefabInstance: {fileID: 1275036158} m_PrefabAsset: {fileID: 0} +--- !u!1 &1648326218 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1648326219} + m_Layer: 0 + m_Name: Interpolated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1648326219 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1648326218} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 508128013} + - {fileID: 415451144} + - {fileID: 552046706} + - {fileID: 618472468} + - {fileID: 1756222528} + - {fileID: 1956221099} + - {fileID: 1837971064} + - {fileID: 1949765993} + - {fileID: 1119605365} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1711716549 GameObject: m_ObjectHideFlags: 0 @@ -1153,12 +1954,117 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &1756222527 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1756222528} + - component: {fileID: 1756222531} + - component: {fileID: 1756222530} + - component: {fileID: 1756222529} + m_Layer: 0 + m_Name: Cube (7) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1756222528 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1756222527} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -4.43, y: 1.5, z: -5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1648326219} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1756222529 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1756222527} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1756222530 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1756222527} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1756222531 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1756222527} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &1781404668 stripped Transform: m_CorrespondingSourceObject: {fileID: 316408367193774732, guid: 0949af27169be084f91744164e13647f, type: 3} m_PrefabInstance: {fileID: 1275036158} m_PrefabAsset: {fileID: 0} ---- !u!1 &1804381427 +--- !u!1 &1837971063 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1166,39 +2072,39 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1804381428} - - component: {fileID: 1804381431} - - component: {fileID: 1804381430} - - component: {fileID: 1804381429} + - component: {fileID: 1837971064} + - component: {fileID: 1837971067} + - component: {fileID: 1837971066} + - component: {fileID: 1837971065} m_Layer: 0 - m_Name: Cube (1) + m_Name: Cube (7) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &1804381428 +--- !u!4 &1837971064 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1804381427} + m_GameObject: {fileID: 1837971063} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 5, y: 0, z: -10} + m_LocalPosition: {x: -4.43, y: 1.5, z: -1.5599995} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 2085526127} + m_Father: {fileID: 1648326219} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!65 &1804381429 +--- !u!65 &1837971065 BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1804381427} + m_GameObject: {fileID: 1837971063} m_Material: {fileID: 0} m_IncludeLayers: serializedVersion: 2 @@ -1213,13 +2119,13 @@ BoxCollider: serializedVersion: 3 m_Size: {x: 1, y: 1, z: 1} m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &1804381430 +--- !u!23 &1837971066 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1804381427} + m_GameObject: {fileID: 1837971063} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -1255,15 +2161,15 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &1804381431 +--- !u!33 &1837971067 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1804381427} + m_GameObject: {fileID: 1837971063} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &1934640163 +--- !u!1 &1949765992 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1271,39 +2177,39 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1934640164} - - component: {fileID: 1934640167} - - component: {fileID: 1934640166} - - component: {fileID: 1934640165} + - component: {fileID: 1949765993} + - component: {fileID: 1949765996} + - component: {fileID: 1949765995} + - component: {fileID: 1949765994} m_Layer: 0 - m_Name: Cube (3) + m_Name: Cube (11) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &1934640164 +--- !u!4 &1949765993 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1934640163} + m_GameObject: {fileID: 1949765992} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -5} + m_LocalPosition: {x: 5, y: 1.5, z: -1.5599995} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 1115728659} + m_Father: {fileID: 1648326219} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!65 &1934640165 +--- !u!65 &1949765994 BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1934640163} + m_GameObject: {fileID: 1949765992} m_Material: {fileID: 0} m_IncludeLayers: serializedVersion: 2 @@ -1318,13 +2224,13 @@ BoxCollider: serializedVersion: 3 m_Size: {x: 1, y: 1, z: 1} m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &1934640166 +--- !u!23 &1949765995 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1934640163} + m_GameObject: {fileID: 1949765992} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -1360,15 +2266,15 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &1934640167 +--- !u!33 &1949765996 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1934640163} + m_GameObject: {fileID: 1949765992} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &2085526126 +--- !u!1 &1956221098 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1376,40 +2282,109 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 2085526127} + - component: {fileID: 1956221099} + - component: {fileID: 1956221102} + - component: {fileID: 1956221101} + - component: {fileID: 1956221100} m_Layer: 0 - m_Name: Interpolated + m_Name: Cube (9) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &2085526127 +--- !u!4 &1956221099 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2085526126} + m_GameObject: {fileID: 1956221098} serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 10} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 1.5, z: -1.5599995} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 1496695407} - - {fileID: 1804381428} - - {fileID: 1212841111} - - {fileID: 1288689813} - m_Father: {fileID: 0} + m_Children: [] + m_Father: {fileID: 1648326219} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1956221100 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1956221098} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1956221101 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1956221098} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1956221102 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1956221098} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 m_Roots: - - {fileID: 328696481} - {fileID: 1711716551} - {fileID: 295302860} - - {fileID: 1115728659} - - {fileID: 2085526127} + - {fileID: 1400453483} + - {fileID: 1648326219} - {fileID: 1275036158} diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Sample Scenes/Gradient.mat b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Sample Scenes/Gradient.mat deleted file mode 100644 index b6d2f21a..00000000 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Sample Scenes/Gradient.mat +++ /dev/null @@ -1,108 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 8 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Gradient - m_Shader: {fileID: 211, guid: 0000000000000000f000000000000000, type: 0} - m_Parent: {fileID: 0} - m_ModifiedSerializedProperties: 0 - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 0 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: - - GRABPASS - m_LockedProperties: - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _SpecGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] - m_Floats: - - _BlendOp: 0 - - _BumpScale: 1 - - _CameraFadingEnabled: 0 - - _CameraFarFadeDistance: 2 - - _CameraNearFadeDistance: 1 - - _ColorMode: 0 - - _Cull: 2 - - _Cutoff: 0.5 - - _DetailNormalMapScale: 1 - - _DistortionBlend: 0.5 - - _DistortionEnabled: 0 - - _DistortionStrength: 1 - - _DistortionStrengthScaled: 0 - - _DstBlend: 0 - - _EmissionEnabled: 0 - - _FlipbookMode: 0 - - _GlossMapScale: 1 - - _Glossiness: 0.5 - - _GlossyReflections: 1 - - _LightingEnabled: 0 - - _Metallic: 0 - - _Mode: 0 - - _OcclusionStrength: 1 - - _Parallax: 0.02 - - _SmoothnessTextureChannel: 0 - - _SoftParticlesEnabled: 0 - - _SoftParticlesFarFadeDistance: 1 - - _SoftParticlesNearFadeDistance: 0 - - _SpecularHighlights: 1 - - _SrcBlend: 1 - - _UVSec: 0 - - _ZWrite: 1 - m_Colors: - - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} - - _Color: {r: 1, g: 1, b: 1, a: 1} - - _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} - - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - m_BuildTextureStacks: [] diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Sample Scenes/Gradient.mat.meta b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Sample Scenes/Gradient.mat.meta deleted file mode 100644 index 362ca2e9..00000000 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Sample Scenes/Gradient.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ba3d2a0baf71a0e43bb54c2f3a8eae43 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 2100000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/3DInterpolation/Techniques.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/3DInterpolation/Techniques.cs index 0cb817e3..db3bec7e 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/3DInterpolation/Techniques.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/3DInterpolation/Techniques.cs @@ -40,10 +40,11 @@ public void ComputeDisplacement(Scene scene) { float transitionLayerWidth = 0.5F; float smoothTransition(float x) => 1 - g((x - sqrRadius) / (transitionLayerWidth * sqrRadius)); var old_displace = displace; - displace = (pos) => old_displace(pos) * smoothTransition((pos - bounds.center).sqrMagnitude); + displace = (pos) => pos + (old_displace(pos) - pos) * smoothTransition((pos - bounds.center).sqrMagnitude); } } + public override void Redirect(Scene scene) { if (displace is null) { ComputeDisplacement(scene); From c94b848f85bce16a635cfebf44e32450bba8abde Mon Sep 17 00:00:00 2001 From: bjrtx <57685415+bjrtx@users.noreply.github.com> Date: Wed, 1 May 2024 00:24:49 +0200 Subject: [PATCH 3/9] Fix naming mistake in JsonLogging.cs --- .../Scripts/Logging/JsonLogging.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/JsonLogging.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/JsonLogging.cs index 7cddd338..b90d35f8 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/JsonLogging.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/JsonLogging.cs @@ -10,6 +10,11 @@ using Newtonsoft.Json; namespace VHToolkit.Logging { + + /// + /// Record type TransformData is a wrapper around Unity's Transform. + /// It allows for serializing the underlying Transform's position and rotation properties. + /// public record TransformData { private readonly Transform obj; public string Position => obj ? obj.position.ToString() : "NULL"; @@ -17,6 +22,11 @@ public record TransformData { public TransformData(Transform obj) => this.obj = obj; } + /// + /// Record type PhysicalLimbData is a wrapper around Limb. + /// It allows for serializing the position and rotation properties of the underlying physical limb, + /// as well as those of all underlying virtual limbs. + /// public record PhysicalLimbData { private readonly Limb limb; public string Position => limb.physicalLimb.position.ToString(); @@ -30,13 +40,13 @@ public record JsonRedirectionData { public readonly DateTime TimeStamp = DateTime.Now; private readonly Interaction script; - public string Technique => script switch { + public string Strategy => script switch { WorldRedirection => (script as WorldRedirection).strategy.ToString(), BodyRedirection => "", _ => "" }; - public string Strategy => script switch { + public string Technique => script switch { WorldRedirection => (script as WorldRedirection).Technique.ToString(), BodyRedirection => (script as BodyRedirection).Technique.ToString(), _ => "" From c34ab4b3df0aac646f17f9e7de9376be4c585bcd Mon Sep 17 00:00:00 2001 From: bjrtx <57685415+bjrtx@users.noreply.github.com> Date: Wed, 1 May 2024 00:51:16 +0200 Subject: [PATCH 4/9] Comment various classes --- .../Scripts/Calibration/QuickCalibration.cs | 2 + .../Scripts/Calibration/SceneCalibration.cs | 2 +- .../Scripts/Logging/JsonLogging.cs | 28 +++++++++--- .../Scripts/Redirection/Scene.cs | 2 +- .../World Redirection/Strategies.cs | 18 +++++--- .../Scripts/Utils/Backport.cs | 11 +++-- .../Calibration/SceneCalibrationEditor.cs | 6 +-- .../Redirection/VectorsPropertyDrawer.cs | 21 +++------ .../Scripts/Utils/Gradient.cs | 9 +--- .../Scripts/Utils/InverseWeightedDistance.cs | 45 ++++++++++--------- 10 files changed, 82 insertions(+), 62 deletions(-) diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Calibration/QuickCalibration.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Calibration/QuickCalibration.cs index 766f1249..f88e3616 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Calibration/QuickCalibration.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Calibration/QuickCalibration.cs @@ -3,6 +3,8 @@ namespace VHToolkit.Calibration { public class QuickCalibration : MonoBehaviour { + + [SerializeField] private Transform physicalHead; [SerializeField] private Transform world; diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Calibration/SceneCalibration.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Calibration/SceneCalibration.cs index f5a84880..467f14b2 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Calibration/SceneCalibration.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Calibration/SceneCalibration.cs @@ -101,7 +101,7 @@ private void Update() { } /// - /// This function sets the state of the calibration so that the user can start calibration on the next frame + /// Function Calibrate sets the state of the calibration so that the user can start calibration on the next frame. /// public void Calibrate() => state = CalibrationState.FirstPoint; diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/JsonLogging.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/JsonLogging.cs index b90d35f8..24c73823 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/JsonLogging.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/JsonLogging.cs @@ -40,17 +40,26 @@ public record JsonRedirectionData { public readonly DateTime TimeStamp = DateTime.Now; private readonly Interaction script; + /// + /// Property Strategy is a string corresponding to the name of the current World Redirection + /// target selection strategy, if any, or the empty string. + /// public string Strategy => script switch { WorldRedirection => (script as WorldRedirection).strategy.ToString(), - BodyRedirection => "", - _ => "" + BodyRedirection => String.Empty, + _ => String.Empty }; + /// + /// Property Technique is a string corresponding to the name of the current 'edirection + /// technique, if any, or the empty string. + /// public string Technique => script switch { WorldRedirection => (script as WorldRedirection).Technique.ToString(), BodyRedirection => (script as BodyRedirection).Technique.ToString(), _ => "" }; + public bool Redirecting => script.redirect; public List Limbs => script.scene.limbs.ConvertAll(l => new PhysicalLimbData(l)); @@ -68,8 +77,8 @@ public class Logger : MonoBehaviour, IObservable { [SerializeField] protected string optionalFilenamePrefix; protected readonly int bufferSize = 10; // number of records kept before writing to disk - protected Queue records = new(); - protected HashSet> observers = new(); + protected readonly Queue records = new(); + protected readonly HashSet> observers = new(); protected Interaction script; protected void WriteRecords(Queue records) { @@ -115,7 +124,11 @@ private void Update() { records.Enqueue(new JsonRedirectionData(script)); WriteRecords(records); } - + /// + /// Create a new log file. + /// + /// The path to the directory where the file should be placed. + /// An optional prefix string to appear in the filename before its timestamp. public void CreateNewFile(string logDirectoryPath, string optionalFilenamePrefix = "") { Directory.CreateDirectory(logDirectoryPath); var fileName = $"{logDirectoryPath}{optionalFilenamePrefix}{DateTime.Now:yyyy-MM-dd_HH-mm-ss}.jsonl"; @@ -124,7 +137,10 @@ public void CreateNewFile(string logDirectoryPath, string optionalFilenamePrefix observers.Add(observer); } - + /// + /// The class FileObserver implements the Observer pattern for JsonRedirectionData instances, + /// serializing the information which it receives and writing it to a file. + /// private sealed class FileObserver : IObserver { private readonly StreamWriter writer; private IDisposable unsubscriber; diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/Scene.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/Scene.cs index be7515e1..52074542 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/Scene.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/Scene.cs @@ -10,7 +10,7 @@ namespace VHToolkit.Redirection { /// - /// A Limb pairs one physicalLimb Transform with a list of virtual limb Transforms. + /// A Limb pairs one physicalLimb Transform with a list of virtual limb Transforms. /// [Serializable] public struct Limb { diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/World Redirection/Strategies.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/World Redirection/Strategies.cs index 23dd9427..63e7218f 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/World Redirection/Strategies.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/World Redirection/Strategies.cs @@ -7,6 +7,11 @@ namespace VHToolkit.Redirection.WorldRedirection { public abstract class WorldRedirectionStrategy { + /// + /// Abstract method for producing a direction in which the user ought to be steered. + /// + /// + /// public abstract Vector3 SteerTo(Scene scene); } @@ -65,15 +70,16 @@ public class SteerInDirection : WorldRedirectionStrategy { public class APFP2R : WorldRedirectionStrategy { + /// A list of colliders, each of which will create a repulsive potential field. public List colliders; - public APFP2R() : base() => colliders = GameObject.FindGameObjectsWithTag("Obstacle").Select(o => o.GetComponent()).ToList(); + public APFP2R() => colliders = GameObject.FindGameObjectsWithTag("Obstacle").Select(o => o.GetComponent()).ToList(); public override Vector3 SteerTo(Scene scene) => ComputeGradient(scene); - private Vector3 ComputeGradient(Scene scene) => Vector3.ProjectOnPlane(MathTools.Gradient3( - MathTools.RepulsivePotential3D(colliders), - scene.physicalHead.position - ), Vector3.up); - } + private Vector3 ComputeGradient(Scene scene) => Vector3.ProjectOnPlane(MathTools.Gradient3( + MathTools.RepulsivePotential3D(colliders), + scene.physicalHead.position + ), Vector3.up); + } } \ No newline at end of file diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Backport.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Backport.cs index 15eff7e0..585fbd05 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Backport.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Backport.cs @@ -14,13 +14,16 @@ IEnumerable second // TODO fix behaviour with nullable types public static TSource MaxBy(this IEnumerable source, Func keySelector) where TKey : IComparable { + if (source is null) throw new ArgumentNullException(); TSource result = default; TKey value = default; foreach (var x in source) { - var newValue = keySelector(x); - if (result is null || newValue.CompareTo(value) > 0) { - result = x; - value = newValue; + if (x != null) { + var newValue = keySelector(x); + if (result is null || newValue.CompareTo(value) > 0) { + result = x; + value = newValue; + } } } return result; diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Editor/Calibration/SceneCalibrationEditor.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Editor/Calibration/SceneCalibrationEditor.cs index 6d76bc01..513f8ed6 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Editor/Calibration/SceneCalibrationEditor.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Editor/Calibration/SceneCalibrationEditor.cs @@ -11,15 +11,15 @@ public override void OnInspectorGUI() { base.OnInspectorGUI(); if (GUILayout.Button("Calibrate")) { - ((SceneCalibration)target).Calibrate(); + (target as SceneCalibration).Calibrate(); } EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Save Calibration")) { - ((SceneCalibration)target).SaveCalibration(); + (target as SceneCalibration).SaveCalibration(); } if (GUILayout.Button("Load Last Calibration")) { - ((SceneCalibration)target).LoadCalibration(); + (target as SceneCalibration).LoadCalibration(); } EditorGUILayout.EndHorizontal(); } diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Editor/Redirection/VectorsPropertyDrawer.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Editor/Redirection/VectorsPropertyDrawer.cs index ddda6022..cd07621a 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Editor/Redirection/VectorsPropertyDrawer.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Editor/Redirection/VectorsPropertyDrawer.cs @@ -6,12 +6,10 @@ public class VectorsPropertyDrawer : PropertyDrawer { protected float labelWidth = 60; - protected float GetWidth(float availableWidth) { - return availableWidth / 2f - 5f; - } + protected float GetWidth(float availableWidth) => availableWidth / 2f - 5f; } - [CustomPropertyDrawer(typeof(Vector2Horizontal))] +[CustomPropertyDrawer(typeof(Vector2Horizontal))] public class Vector2HorizontalPropertyDrawer : VectorsPropertyDrawer { public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { EditorGUI.BeginProperty(position, label, property); @@ -35,8 +33,7 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten } [CustomPropertyDrawer(typeof(Vector2Vertical))] -public class Vector2VerticalPropertyDrawer : VectorsPropertyDrawer -{ +public class Vector2VerticalPropertyDrawer : VectorsPropertyDrawer { public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { EditorGUI.BeginProperty(position, label, property); position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); @@ -59,10 +56,8 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten } [CustomPropertyDrawer(typeof(Vector2Gain))] -public class Vector2GainPropertyDrawer : VectorsPropertyDrawer -{ - public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) - { +public class Vector2GainPropertyDrawer : VectorsPropertyDrawer { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { EditorGUI.BeginProperty(position, label, property); position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); @@ -84,10 +79,8 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten } [CustomPropertyDrawer(typeof(Vector2Rotation))] -public class Vector2RotationPropertyDrawer : VectorsPropertyDrawer -{ - public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) - { +public class Vector2RotationPropertyDrawer : VectorsPropertyDrawer { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { EditorGUI.BeginProperty(position, label, property); position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Gradient.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Gradient.cs index 91591eb0..76c3d674 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Gradient.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/Gradient.cs @@ -35,16 +35,11 @@ public static Vector2 Gradient2(Func function, Vector2 x) { ) / (2 * eps); } - - public static Func RepulsivePotential2D(List obstacles) => - (x) => obstacles.Sum(o => 1 / Vector2.Distance(x, o.ClosestPoint(x))); - - public static Func RepulsivePotential3D(List obstacles) => + public static Func RepulsivePotential3D(List obstacles) => (x) => obstacles.Sum(o => 1 / Vector3.Distance(x, o.ClosestPoint(x))); - // maxence - public static Vector2 Gradient2v2(Vector2 x, List obstaclescolliders) { + public static Vector2 Gradient2v2(Vector2 x, List obstaclescolliders) { float RepulsivePotential(Vector2 x) => obstaclescolliders.Sum(o => 1 / Vector2.Distance(x, o.ClosestPoint(x))); var eps = Vector2.kEpsilon; return new Vector2( diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/InverseWeightedDistance.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/InverseWeightedDistance.cs index ff7c3f10..9807979d 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/InverseWeightedDistance.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Utils/InverseWeightedDistance.cs @@ -1,24 +1,29 @@ using UnityEngine; namespace VHToolkit { - public static class InverseWeightedDistance { - public static Vector3 Interpolate(Vector3[] x, Vector3[] target, float p, Vector3 position) { - Debug.Assert(x.Length == target.Length); - Debug.Assert(x.Length >= 3); - Vector3 numerator = Vector3.zero; - float denumerator = 0f; - foreach (var (origin, targ) in x.Zip(target)) { - var distance = (origin - position).sqrMagnitude; - if (Mathf.Approximately(distance, 0)) { - return targ; - } - else { - var weight = Mathf.Pow(distance, -p / 2); - numerator += weight * targ; - denumerator += weight; - } - } - return numerator / denumerator; - } - } + public static class InverseWeightedDistance { + public static Vector3 Interpolate(Vector3[] x, Vector3[] target, float p, Vector3 position) { + /* Inverse distance weighting computes a weighted average of the displacement over the + given refereence points. Each reference point at distance d from the current position receives + a weight proportional to (1/d)^p, where p is a parameter which tends to penalize more distant + points. + */ + Debug.Assert(x.Length == target.Length); + Debug.Assert(x.Length >= 3); + Vector3 numerator = Vector3.zero; + float denumerator = 0f; + foreach (var (origin, targ) in x.Zip(target)) { + var sqrDistance = (origin - position).sqrMagnitude; + if (Mathf.Approximately(sqrDistance, 0)) { + return targ; + } + else { + var weight = Mathf.Pow(sqrDistance, -p / 2); + numerator += weight * targ; + denumerator += weight; + } + } + return numerator / denumerator; + } + } } From 7e5a6bfca4c3915b24293771db39caf33f748f46 Mon Sep 17 00:00:00 2001 From: bjrtx <57685415+bjrtx@users.noreply.github.com> Date: Wed, 1 May 2024 01:14:57 +0200 Subject: [PATCH 5/9] Rename file --- .../Scripts/Visualisation/{TopViewCamera.CS => TopViewCamera.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/{TopViewCamera.CS => TopViewCamera.cs} (100%) diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/TopViewCamera.CS b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/TopViewCamera.cs similarity index 100% rename from Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/TopViewCamera.CS rename to Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/TopViewCamera.cs From 3735c9c59312fed938c4e1f9e70868697f92939e Mon Sep 17 00:00:00 2001 From: bjrtx <57685415+bjrtx@users.noreply.github.com> Date: Wed, 1 May 2024 14:11:22 +0200 Subject: [PATCH 6/9] Lint various classes --- .../Scripts/Calibration/QuickCalibration.cs | 1 - .../Scripts/Visualisation/APFGradientVisuals.cs | 11 ++++++----- .../Scripts/Visualisation/TopViewCamera.cs | 4 +++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Calibration/QuickCalibration.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Calibration/QuickCalibration.cs index f88e3616..a116b053 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Calibration/QuickCalibration.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Calibration/QuickCalibration.cs @@ -4,7 +4,6 @@ namespace VHToolkit.Calibration { public class QuickCalibration : MonoBehaviour { - [SerializeField] private Transform physicalHead; [SerializeField] private Transform world; diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/APFGradientVisuals.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/APFGradientVisuals.cs index 719923bf..7d2d8aa5 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/APFGradientVisuals.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/APFGradientVisuals.cs @@ -105,14 +105,15 @@ private void UpdateRepulsiveFunc() { // Compute the bounding box and repulsive function for all colliders if (obstaclesCollider.Any()) { - static Func Pointwise(Func f) => - (a, b) => new(f(a.x, b.x), f(a.y, b.y), f(a.z, b.z)); - repulsiveFunction = MathTools.RepulsivePotential3D(obstaclesCollider); var colliders = FindObjectsOfType(); - max = Array.ConvertAll(colliders, o => o.bounds.max).Aggregate(Pointwise(Mathf.Max)); - min = Array.ConvertAll(colliders, o => o.bounds.min).Aggregate(Pointwise(Mathf.Min)); + var bounds = new Bounds(colliders.First().transform.position, Vector3.zero); + foreach (var collider in colliders) { + bounds.Encapsulate(collider.bounds); + } + max = bounds.max; + min = bounds.min; min.y = max.y = 0f; width = max.x - min.x; diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/TopViewCamera.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/TopViewCamera.cs index e5320c5e..b3497fe0 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/TopViewCamera.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/TopViewCamera.cs @@ -1,7 +1,9 @@ using UnityEngine; /// -/// This class is used to copy the translations of the trackedObject in the horizontal plane while staying above the object. +/// This MonoBehaviour is used to copy the movements of the trackedObject Transform +/// in the horizontal plane (x and z coordinates) while leaving the vertical (y) +/// coordinate unchanged. /// public class TopViewCamera : MonoBehaviour { public Transform trackedObject; From 2915f86f5b3851f40efcb16c9f333bc497a3862d Mon Sep 17 00:00:00 2001 From: bjrtx <57685415+bjrtx@users.noreply.github.com> Date: Wed, 1 May 2024 22:00:14 +0200 Subject: [PATCH 7/9] Misc refactoring --- .../Scripts/Redirection/RedirectionTechnique.cs | 4 +--- .../Scripts/Redirection/Scene.cs | 5 ++--- .../Scripts/Visualisation/BRVisuals.cs | 14 +++++++------- .../Scripts/Visualisation/TopViewCamera.cs | 3 +-- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/RedirectionTechnique.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/RedirectionTechnique.cs index ebadb64c..ecf06d0b 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/RedirectionTechnique.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/RedirectionTechnique.cs @@ -1,6 +1,4 @@ -using UnityEngine; - -namespace VHToolkit.Redirection { +namespace VHToolkit.Redirection { abstract public class RedirectionTechnique { /// /// This abstract method redirects the Scene transforms according to the other parameters and the equations diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/Scene.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/Scene.cs index 52074542..4213c3db 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/Scene.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Redirection/Scene.cs @@ -42,7 +42,7 @@ public Limb(Transform physicalLimb, List virtualLimb) { public record Scene { [SerializeField] public List limbs; - [Ignore] public List virtualLimbs => limbs.SelectMany(limb => limb.virtualLimb).ToList(); + [Ignore] public List VirtualLimbs => limbs.SelectMany(limb => limb.virtualLimb).ToList(); [Ignore] public Transform physicalHead; [Ignore] public Transform virtualHead; @@ -103,7 +103,7 @@ public List LimbRedirection { public Vector3 GetHeadToHeadVector() => physicalHead.position - virtualHead.position; private Quaternion _redirection = Quaternion.identity; - /// The quaternion rotation between the user's physical and virtual head. + /// The quaternion rotation between the user's physical and virtual head. public Quaternion HeadToHeadRedirection { get => _redirection; set { virtualHead.rotation = value * physicalHead.rotation; _redirection = value; } @@ -161,6 +161,5 @@ public void CopyLimbTranslationAndRotation() => limbs.ForEach(limb => { /// public void RotateVirtualHeadY(float angle) => HeadToHeadRedirection = Quaternion.Euler(0f, angle, 0f) * HeadToHeadRedirection; - public List GetAllObstaclesCollider() => GameObject.FindGameObjectsWithTag("Obstacle").Select(v => v.GetComponent()).ToList(); } } diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/BRVisuals.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/BRVisuals.cs index 9bc53256..b65d9ee7 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/BRVisuals.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/BRVisuals.cs @@ -28,24 +28,24 @@ private void Update() { if (BRMainScript.IsRedirecting()) { // draws threshold lines for the hands - foreach(Limb limb in scene.limbs) { + foreach (Limb limb in scene.limbs) { DrawThresholdLines(limb.physicalLimb.position, limb.virtualLimb[0].position); } } // draw Lécuyer's swamp if applicable if (BRMainScript.Technique == BRTechnique.Lecuyer2000Swamp) { - foreach(var vlimb in scene.virtualLimbs) { + foreach (var vlimb in scene.VirtualLimbs) { Vector3 distanceToOrigin = vlimb.position - scene.origin.position; - Color c = (MathF.Max(MathF.Abs(distanceToOrigin[0]), MathF.Abs(distanceToOrigin[2])) < scene.parameters.SwampSquareLength/2) ? + Color c = (MathF.Max(MathF.Abs(distanceToOrigin[0]), MathF.Abs(distanceToOrigin[2])) < scene.parameters.SwampSquareLength / 2) ? Color.green : Color.yellow; - Debug.DrawRay(scene.origin.position + new Vector3(scene.parameters.SwampSquareLength/2, 0f, scene.parameters.SwampSquareLength/2), + Debug.DrawRay(scene.origin.position + new Vector3(scene.parameters.SwampSquareLength / 2, 0f, scene.parameters.SwampSquareLength / 2), Vector3.back * scene.parameters.SwampSquareLength, c); - Debug.DrawRay(scene.origin.position + new Vector3(scene.parameters.SwampSquareLength/2, 0f, scene.parameters.SwampSquareLength/2), + Debug.DrawRay(scene.origin.position + new Vector3(scene.parameters.SwampSquareLength / 2, 0f, scene.parameters.SwampSquareLength / 2), Vector3.left * scene.parameters.SwampSquareLength, c); - Debug.DrawRay(scene.origin.position - new Vector3(scene.parameters.SwampSquareLength/2, 0f, scene.parameters.SwampSquareLength/2), + Debug.DrawRay(scene.origin.position - new Vector3(scene.parameters.SwampSquareLength / 2, 0f, scene.parameters.SwampSquareLength / 2), Vector3.forward * scene.parameters.SwampSquareLength, c); - Debug.DrawRay(scene.origin.position - new Vector3(scene.parameters.SwampSquareLength/2, 0f, scene.parameters.SwampSquareLength/2), + Debug.DrawRay(scene.origin.position - new Vector3(scene.parameters.SwampSquareLength / 2, 0f, scene.parameters.SwampSquareLength / 2), Vector3.right * scene.parameters.SwampSquareLength, c); } } diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/TopViewCamera.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/TopViewCamera.cs index b3497fe0..2f8dd857 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/TopViewCamera.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/TopViewCamera.cs @@ -8,6 +8,5 @@ public class TopViewCamera : MonoBehaviour { public Transform trackedObject; - private void Update() => transform.position = - new(trackedObject.position.x, transform.position.y, trackedObject.position.z); + private void Update() => transform.position.Set(trackedObject.position.x, transform.position.y, trackedObject.position.z); } \ No newline at end of file From b34d089628b7813ec4a5e6a509cb6de4dfb9a9ab Mon Sep 17 00:00:00 2001 From: bjrtx <57685415+bjrtx@users.noreply.github.com> Date: Wed, 1 May 2024 22:24:30 +0200 Subject: [PATCH 8/9] Refactor logging classes --- .../Scripts/Logging/AbstractFileObserver.cs | 24 ++++++++ .../Logging/AbstractFileObserver.cs.meta | 11 ++++ .../Scripts/Logging/JsonLogging.cs | 61 ++----------------- .../Scripts/Logging/Logger.cs | 46 ++++++++++++++ .../Scripts/Logging/Logger.cs.meta | 11 ++++ .../Scripts/Logging/Logging.cs | 32 ++++------ 6 files changed, 110 insertions(+), 75 deletions(-) create mode 100644 Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/AbstractFileObserver.cs create mode 100644 Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/AbstractFileObserver.cs.meta create mode 100644 Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Logger.cs create mode 100644 Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Logger.cs.meta diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/AbstractFileObserver.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/AbstractFileObserver.cs new file mode 100644 index 00000000..29bdc837 --- /dev/null +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/AbstractFileObserver.cs @@ -0,0 +1,24 @@ +using System; +using System.IO; +using UnityEngine; + +namespace VHToolkit.Logging { + abstract class AbstractFileObserver : IObserver { + protected readonly StreamWriter writer; + private IDisposable unsubscriber; + public void OnCompleted() { + unsubscriber.Dispose(); + writer.Dispose(); + } + + public void Subscribe(IObservable observable) => unsubscriber = observable?.Subscribe(this); + + public void OnError(Exception error) => Debug.LogError(error); + + abstract public void OnNext(T value); + + public AbstractFileObserver(string filename) { + writer = new StreamWriter(filename, append: true); + } + } +} \ No newline at end of file diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/AbstractFileObserver.cs.meta b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/AbstractFileObserver.cs.meta new file mode 100644 index 00000000..087dff87 --- /dev/null +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/AbstractFileObserver.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d5c7fe9812ab4234f94cf0a5251fbd7c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/JsonLogging.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/JsonLogging.cs index 24c73823..d9531126 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/JsonLogging.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/JsonLogging.cs @@ -51,7 +51,7 @@ public record JsonRedirectionData { }; /// - /// Property Technique is a string corresponding to the name of the current 'edirection + /// Property Technique is a string corresponding to the name of the current redirection /// technique, if any, or the empty string. /// public string Technique => script switch { @@ -72,44 +72,6 @@ public record JsonRedirectionData { public JsonRedirectionData(Interaction script) => this.script = script; } - public class Logger : MonoBehaviour, IObservable { - public string logDirectoryPath = "LoggedData\\"; - [SerializeField] protected string optionalFilenamePrefix; - protected readonly int bufferSize = 10; // number of records kept before writing to disk - - protected readonly Queue records = new(); - protected readonly HashSet> observers = new(); - protected Interaction script; - - protected void WriteRecords(Queue records) { - if (records.Count > bufferSize) { - foreach (var record in records) { - foreach (var observer in observers) { - observer.OnNext(record); - } - } - records.Clear(); - } - } - - private sealed class Unsubscriber : IDisposable { - private readonly HashSet> _observers; - private readonly IObserver _observer; - - public Unsubscriber(HashSet> observers, IObserver observer) { - _observers = observers; - _observer = observer; - } - - public void Dispose() => _observers.Remove(_observer); - } - - IDisposable IObservable.Subscribe(IObserver observer) { - observers.Add(observer); - return new Unsubscriber(observers, observer); - } - } - /// /// Logs structured data in the JSON Lines format. /// @@ -132,30 +94,19 @@ private void Update() { public void CreateNewFile(string logDirectoryPath, string optionalFilenamePrefix = "") { Directory.CreateDirectory(logDirectoryPath); var fileName = $"{logDirectoryPath}{optionalFilenamePrefix}{DateTime.Now:yyyy-MM-dd_HH-mm-ss}.jsonl"; - var observer = new FileObserver(fileName); + var observer = new JsonFileObserver(fileName); observer.Subscribe(this); observers.Add(observer); } /// - /// The class FileObserver implements the Observer pattern for JsonRedirectionData instances, + /// The class JsonFileObserver implements the Observer pattern for JsonRedirectionData instances, /// serializing the information which it receives and writing it to a file. /// - private sealed class FileObserver : IObserver { - private readonly StreamWriter writer; - private IDisposable unsubscriber; - public void OnCompleted() { - unsubscriber.Dispose(); - writer.Dispose(); - } - - public void Subscribe(IObservable observable) => unsubscriber = observable?.Subscribe(this); - - public void OnError(Exception error) => Debug.LogError(error); - - public void OnNext(JsonRedirectionData value) => writer.WriteLine(JsonConvert.SerializeObject(value)); + private sealed class JsonFileObserver : AbstractFileObserver { + public JsonFileObserver(string filename) : base(filename) { } - public FileObserver(string filename) => writer = new StreamWriter(filename, append: true); + override public void OnNext(JsonRedirectionData value) => writer.WriteLine(JsonConvert.SerializeObject(value)); } } } \ No newline at end of file diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Logger.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Logger.cs new file mode 100644 index 00000000..f1323d72 --- /dev/null +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Logger.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +using UnityEngine; + +using VHToolkit.Redirection; + +namespace VHToolkit.Logging { + public class Logger : MonoBehaviour, IObservable { + public string logDirectoryPath = "LoggedData\\"; + [SerializeField] protected string optionalFilenamePrefix; + protected readonly int bufferSize = 10; // number of records kept before writing to disk + + protected readonly Queue records = new(); + protected readonly HashSet> observers = new(); + protected Interaction script; + + protected void WriteRecords(Queue records) { + if (records.Count > bufferSize) { + foreach (var record in records) { + foreach (var observer in observers) { + observer.OnNext(record); + } + } + records.Clear(); + } + } + + private sealed class Unsubscriber : IDisposable { + private readonly HashSet> _observers; + private readonly IObserver _observer; + + public Unsubscriber(HashSet> observers, IObserver observer) { + _observers = observers; + _observer = observer; + } + + public void Dispose() => _observers.Remove(_observer); + } + + IDisposable IObservable.Subscribe(IObserver observer) { + observers.Add(observer); + return new Unsubscriber(observers, observer); + } + } +} \ No newline at end of file diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Logger.cs.meta b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Logger.cs.meta new file mode 100644 index 00000000..d8a49e35 --- /dev/null +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Logger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a2dfdc06722d38c4b9caa4061b5a6fdc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Logging.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Logging.cs index d582dd31..40bff02d 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Logging.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Logging.cs @@ -12,12 +12,11 @@ using VHToolkit.Redirection.BodyRedirection; using VHToolkit.Redirection.WorldRedirection; -namespace VHToolkit.Logging -{ - /// - /// Class specifying loggable data for a redirection scene. - /// - public record RedirectionData { +namespace VHToolkit.Logging { + /// + /// Class specifying loggable data for a redirection scene. + /// + public record RedirectionData { public DateTime timeStamp = DateTime.Now; public string Technique => script switch { WorldRedirection => (script as WorldRedirection).Technique.ToString(), @@ -111,28 +110,21 @@ public void CreateNewFile(string logDirectoryPath = null, string optionalFilenam observer.Subscribe(this); observers.Add(observer); } - private sealed class FileObserver : IObserver { - private StreamWriter writer; - private CsvWriter csvWriter; - private IDisposable unsubscriber; - public void OnCompleted() { - unsubscriber.Dispose(); + + private sealed class FileObserver : AbstractFileObserver { + private readonly CsvWriter csvWriter; + public new void OnCompleted() { + base.OnCompleted(); csvWriter.Dispose(); - writer.Dispose(); } - public void Subscribe(IObservable observable) => unsubscriber = observable?.Subscribe(this); - - public void OnError(Exception error) => Debug.LogError(error); - - public void OnNext(RedirectionData value) { + public override void OnNext(RedirectionData value) { csvWriter.Context.RegisterClassMap(); csvWriter.WriteRecord(value); csvWriter.NextRecord(); } - public FileObserver(string filename, CsvConfiguration config) { - writer = new StreamWriter(filename, append: true); + public FileObserver(string filename, CsvConfiguration config) : base(filename) { csvWriter = new(writer, configuration: config); csvWriter.Context.RegisterClassMap(); csvWriter.WriteHeader(); From 2f7395894398b1a976230e860c32b42e16baaa3a Mon Sep 17 00:00:00 2001 From: bjrtx <57685415+bjrtx@users.noreply.github.com> Date: Wed, 1 May 2024 22:52:22 +0200 Subject: [PATCH 9/9] Start rewriting Socket.cs --- .../Scripts/Logging/Logger.cs | 16 ++-------------- .../Scripts/Logging/Unsubscriber.cs | 16 ++++++++++++++++ .../Scripts/Logging/Unsubscriber.cs.meta | 11 +++++++++++ .../Scripts/Visualisation/Socket.cs | 10 +++++++++- 4 files changed, 38 insertions(+), 15 deletions(-) create mode 100644 Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Unsubscriber.cs create mode 100644 Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Unsubscriber.cs.meta diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Logger.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Logger.cs index f1323d72..5a31e161 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Logger.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Logger.cs @@ -6,7 +6,7 @@ using VHToolkit.Redirection; namespace VHToolkit.Logging { - public class Logger : MonoBehaviour, IObservable { + public partial class Logger : MonoBehaviour, IObservable { public string logDirectoryPath = "LoggedData\\"; [SerializeField] protected string optionalFilenamePrefix; protected readonly int bufferSize = 10; // number of records kept before writing to disk @@ -26,21 +26,9 @@ protected void WriteRecords(Queue records) { } } - private sealed class Unsubscriber : IDisposable { - private readonly HashSet> _observers; - private readonly IObserver _observer; - - public Unsubscriber(HashSet> observers, IObserver observer) { - _observers = observers; - _observer = observer; - } - - public void Dispose() => _observers.Remove(_observer); - } - IDisposable IObservable.Subscribe(IObserver observer) { observers.Add(observer); - return new Unsubscriber(observers, observer); + return new HashSetUnsubscriber(observers, observer); } } } \ No newline at end of file diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Unsubscriber.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Unsubscriber.cs new file mode 100644 index 00000000..abd0b1d9 --- /dev/null +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Unsubscriber.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +namespace VHToolkit.Logging { + sealed class HashSetUnsubscriber : IDisposable { + private readonly HashSet> _observers; + private readonly IObserver _observer; + + public HashSetUnsubscriber(HashSet> observers, IObserver observer) { + _observers = observers; + _observer = observer; + } + + public void Dispose() => _observers.Remove(_observer); + } +} diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Unsubscriber.cs.meta b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Unsubscriber.cs.meta new file mode 100644 index 00000000..68e71b0d --- /dev/null +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Logging/Unsubscriber.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 252bf6c8209d94248a8e9654785457b9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/Socket.cs b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/Socket.cs index c161d935..0fc90978 100644 --- a/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/Socket.cs +++ b/Visuo-haptic Toolkit/Assets/Visuo-Haptic Toolkit/Scripts/Visualisation/Socket.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Net.Sockets; @@ -42,11 +43,13 @@ public void Reset() { this.curvature = 0f; } } - public class Socket : MonoBehaviour { + public class Socket : MonoBehaviour, IObservable { private Scene scene; private WorldRedirection script; private DateTime startTime; + private readonly HashSet> observers = new(); + private TcpClient client; [Tooltip("File name for the Python visualization script.")] @@ -132,5 +135,10 @@ private void Update() { (script.redirect && scene.enableHybridCurvature) ? Razzaque2001Curvature.GetRedirection(scene) : 0f, (float)(DateTime.Now - startTime).TotalSeconds); } + + IDisposable IObservable.Subscribe(IObserver observer) { + observers.Add(observer); + return new HashSetUnsubscriber(observers, observer); + } } }