diff --git a/Assets/Resources/Prefabs/Facts/Cylinder.prefab b/Assets/Resources/Prefabs/Facts/Cylinder.prefab index 7d8a6c1da00c38796c877a16fd67a1cc5dcaf923..702a12e41fe4245ca502b172ccbb313a57d905f6 100644 --- a/Assets/Resources/Prefabs/Facts/Cylinder.prefab +++ b/Assets/Resources/Prefabs/Facts/Cylinder.prefab @@ -11,7 +11,6 @@ GameObject: - component: {fileID: 6247848413542547290} - component: {fileID: 2803381884781347863} - component: {fileID: 6081132167704541829} - - component: {fileID: 6530428533264499097} m_Layer: 0 m_Name: Cylinder m_TagString: Untagged @@ -27,8 +26,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6069774532129100082} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0.19499995} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 0.5, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 3390467403729316765} @@ -84,20 +83,6 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!136 &6530428533264499097 -CapsuleCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6069774532129100082} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - m_Radius: 0.5000001 - m_Height: 2 - m_Direction: 1 - m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} --- !u!1 &6839596689016440457 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Worlds/RiverWorld.unity b/Assets/Scenes/Worlds/RiverWorld.unity index c14c4fac1562ca0ea5604858666212c52e34ac21..39ac84768241c975acb61889d93b99457fc84791 100644 --- a/Assets/Scenes/Worlds/RiverWorld.unity +++ b/Assets/Scenes/Worlds/RiverWorld.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44100717, g: 0.4898312, b: 0.5698877, a: 1} + m_IndirectSpecularColor: {r: 0.44084534, g: 0.48955458, b: 0.56959116, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -60800,6 +60800,12 @@ PrefabInstance: value: objectReference: {fileID: 6839596689016440457, guid: 3053a4bcf6f3c7c45ad438b69ffcde9b, type: 3} + - target: {fileID: 2872381745209199267, guid: b07552db700124a4680401e6fb94c186, + type: 3} + propertyPath: Cylinder + value: + objectReference: {fileID: 6839596689016440457, guid: 33aea09fa1ea1fa40a3eb47c47ba7650, + type: 3} - target: {fileID: 2872381745209199267, guid: b07552db700124a4680401e6fb94c186, type: 3} propertyPath: Triangle diff --git a/Assets/Scripts/InteractionEngine/FactHandling/Facts/CylinderFact.cs b/Assets/Scripts/InteractionEngine/FactHandling/Facts/CylinderFact.cs index 50765db99c8231949a6e467b5435501c13dd09c2..af997e430211362ec9d9f9433394a0feb74a6a15 100644 --- a/Assets/Scripts/InteractionEngine/FactHandling/Facts/CylinderFact.cs +++ b/Assets/Scripts/InteractionEngine/FactHandling/Facts/CylinderFact.cs @@ -17,6 +17,8 @@ public class CylinderFact : FactWrappedCRTP<CylinderFact> public string PidM, PidE, PidT; public Vector3 M, E, T; public float Volume = 0.0F; + public float Radius = 0.0F; + public float Height = 0.0F; public PointFact GetM {get => (PointFact)FactRecorder.AllFacts[PidM];} @@ -30,7 +32,15 @@ protected void calculate_vectors(){ T = ((PointFact)FactRecorder.AllFacts[PidT]).Point + Vector3.zero; //Rotation = Quaternion.LookRotation(forward, new Vector3(1.0F, 0.0F, 0.0F)); - Position = M; + Position = M + 0.5F * ((T - M) + (E - M)); + Radius = Vector3.Distance(M, E) / 2; + Height = Vector3.Distance(T, M); + + LocalScale = new Vector3(Radius*2, Height, Radius*2); + + Vector3 LookVector = Vector3.Cross((T - M), (E - M)); + + Rotation = Quaternion.LookRotation(LookVector, Vector3.up); }