Skip to content
Snippets Groups Projects
Commit 7489a47c authored by Paul-Walcher's avatar Paul-Walcher
Browse files

Added CylinderPrefab

parent 55e13abd
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,6 @@ GameObject: ...@@ -11,7 +11,6 @@ GameObject:
- component: {fileID: 6247848413542547290} - component: {fileID: 6247848413542547290}
- component: {fileID: 2803381884781347863} - component: {fileID: 2803381884781347863}
- component: {fileID: 6081132167704541829} - component: {fileID: 6081132167704541829}
- component: {fileID: 6530428533264499097}
m_Layer: 0 m_Layer: 0
m_Name: Cylinder m_Name: Cylinder
m_TagString: Untagged m_TagString: Untagged
...@@ -27,8 +26,8 @@ Transform: ...@@ -27,8 +26,8 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6069774532129100082} m_GameObject: {fileID: 6069774532129100082}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.19499995} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 0.5, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 3390467403729316765} m_Father: {fileID: 3390467403729316765}
...@@ -84,20 +83,6 @@ MeshRenderer: ...@@ -84,20 +83,6 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 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 --- !u!1 &6839596689016440457
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -38,7 +38,7 @@ RenderSettings: ...@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {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 m_UseRadianceAmbientProbe: 0
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:
...@@ -60800,6 +60800,12 @@ PrefabInstance: ...@@ -60800,6 +60800,12 @@ PrefabInstance:
value: value:
objectReference: {fileID: 6839596689016440457, guid: 3053a4bcf6f3c7c45ad438b69ffcde9b, objectReference: {fileID: 6839596689016440457, guid: 3053a4bcf6f3c7c45ad438b69ffcde9b,
type: 3} type: 3}
- target: {fileID: 2872381745209199267, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: Cylinder
value:
objectReference: {fileID: 6839596689016440457, guid: 33aea09fa1ea1fa40a3eb47c47ba7650,
type: 3}
- target: {fileID: 2872381745209199267, guid: b07552db700124a4680401e6fb94c186, - target: {fileID: 2872381745209199267, guid: b07552db700124a4680401e6fb94c186,
type: 3} type: 3}
propertyPath: Triangle propertyPath: Triangle
...@@ -17,6 +17,8 @@ public class CylinderFact : FactWrappedCRTP<CylinderFact> ...@@ -17,6 +17,8 @@ public class CylinderFact : FactWrappedCRTP<CylinderFact>
public string PidM, PidE, PidT; public string PidM, PidE, PidT;
public Vector3 M, E, T; public Vector3 M, E, T;
public float Volume = 0.0F; public float Volume = 0.0F;
public float Radius = 0.0F;
public float Height = 0.0F;
public PointFact GetM {get => (PointFact)FactRecorder.AllFacts[PidM];} public PointFact GetM {get => (PointFact)FactRecorder.AllFacts[PidM];}
...@@ -30,7 +32,15 @@ protected void calculate_vectors(){ ...@@ -30,7 +32,15 @@ protected void calculate_vectors(){
T = ((PointFact)FactRecorder.AllFacts[PidT]).Point + Vector3.zero; T = ((PointFact)FactRecorder.AllFacts[PidT]).Point + Vector3.zero;
//Rotation = Quaternion.LookRotation(forward, new Vector3(1.0F, 0.0F, 0.0F)); //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);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment