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

added layers for rectangle, cuboid, cylinder and sphere

parent 2cfd6374
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@ GameObject:
m_Component:
- component: {fileID: 3390467403729316765}
- component: {fileID: 6950663371922587874}
m_Layer: 15
m_Layer: 26
m_Name: Cuboid
m_TagString: Selectable
m_Icon: {fileID: 0}
......@@ -67,7 +67,7 @@ GameObject:
- component: {fileID: 5986843358289336505}
- component: {fileID: 7177577245137766670}
- component: {fileID: 2586578973517344970}
m_Layer: 10
m_Layer: 26
m_Name: LabelText
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -254,7 +254,7 @@ GameObject:
- component: {fileID: 5831357366368800904}
- component: {fileID: 7650278115114718330}
- component: {fileID: 1525151776347487752}
m_Layer: 15
m_Layer: 26
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -11,7 +11,7 @@ GameObject:
- component: {fileID: 6247848413542547290}
- component: {fileID: 2803381884781347863}
- component: {fileID: 6081132167704541829}
m_Layer: 0
m_Layer: 25
m_Name: Cylinder
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -93,7 +93,7 @@ GameObject:
m_Component:
- component: {fileID: 3390467403729316765}
- component: {fileID: 6950663371922587874}
m_Layer: 15
m_Layer: 25
m_Name: Cylinder
m_TagString: Selectable
m_Icon: {fileID: 0}
......@@ -151,7 +151,7 @@ GameObject:
- component: {fileID: 5986843358289336505}
- component: {fileID: 7177577245137766670}
- component: {fileID: 2586578973517344970}
m_Layer: 10
m_Layer: 25
m_Name: LabelText
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -11,7 +11,7 @@ GameObject:
- component: {fileID: 3390467403729316765}
- component: {fileID: 1812690906255965161}
- component: {fileID: 6950663371922587874}
m_Layer: 15
m_Layer: 23
m_Name: Rectangle
m_TagString: Selectable
m_Icon: {fileID: 0}
......@@ -78,7 +78,7 @@ MonoBehaviour:
Hint: {fileID: 2100000, guid: 8621b710d7d1d5041bc6bfd0cc37cdff, type: 2}
Solution: {fileID: 2100000, guid: 2a003f0807acc1142965bb21bdc824f6, type: 2}
renderer:
- {fileID: 0}
- {fileID: 6517075380011649605}
--- !u!1 &7399997364077007465
GameObject:
m_ObjectHideFlags: 0
......@@ -90,7 +90,7 @@ GameObject:
- component: {fileID: 6990040153469839674}
- component: {fileID: 8042990558578607756}
- component: {fileID: 5361971246579526846}
m_Layer: 0
m_Layer: 23
m_Name: PlaneDown
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -173,7 +173,7 @@ GameObject:
- component: {fileID: 2727348597328184922}
- component: {fileID: 3597909010427076542}
- component: {fileID: 6517075380011649605}
m_Layer: 0
m_Layer: 23
m_Name: PlaneUp
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -257,7 +257,7 @@ GameObject:
- component: {fileID: 5986843358289336505}
- component: {fileID: 7177577245137766670}
- component: {fileID: 2586578973517344970}
m_Layer: 10
m_Layer: 23
m_Name: LabelText
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -11,7 +11,7 @@ GameObject:
- component: {fileID: 1380396336186306334}
- component: {fileID: 4239463486727728565}
- component: {fileID: 1073589650764508292}
m_Layer: 15
m_Layer: 24
m_Name: SphereVisual
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -93,7 +93,7 @@ GameObject:
m_Component:
- component: {fileID: 3390467403729316765}
- component: {fileID: 6950663371922587874}
m_Layer: 15
m_Layer: 24
m_Name: Sphere
m_TagString: Selectable
m_Icon: {fileID: 0}
......@@ -150,7 +150,7 @@ GameObject:
- component: {fileID: 5986843358289336505}
- component: {fileID: 7177577245137766670}
- component: {fileID: 2586578973517344970}
m_Layer: 10
m_Layer: 24
m_Name: LabelText
m_TagString: Untagged
m_Icon: {fileID: 0}
......
......@@ -60649,7 +60649,7 @@ PrefabInstance:
- target: {fileID: 2258042202925325658, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: factLayerMask.m_Bits
value: 6355968
value: 132185088
objectReference: {fileID: 0}
- target: {fileID: 2267088185126138740, guid: b07552db700124a4680401e6fb94c186,
type: 3}
......@@ -63085,6 +63085,12 @@ PrefabInstance:
value:
objectReference: {fileID: 3080888058940174091, guid: 389563c758e86d848b3341576b90b7e4,
type: 3}
- target: {fileID: 6898471569945669422, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: PrefabDataConfig.Array.data[32]
value:
objectReference: {fileID: 3080888058940174091, guid: 78a5636dd3b386a4e82a65390ad23c7d,
type: 3}
- target: {fileID: 6898471569945669422, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: PrefabDataConfig.Array.data[33]
......@@ -63557,6 +63563,12 @@ PrefabInstance:
value:
objectReference: {fileID: 3080888058940174091, guid: 389563c758e86d848b3341576b90b7e4,
type: 3}
- target: {fileID: 7743735189960969443, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: PrefabDataConfig.Array.data[32]
value:
objectReference: {fileID: 3080888058940174091, guid: 78a5636dd3b386a4e82a65390ad23c7d,
type: 3}
- target: {fileID: 7743735189960969443, guid: b07552db700124a4680401e6fb94c186,
type: 3}
propertyPath: PrefabDataConfig.Array.data[33]
......@@ -40,7 +40,31 @@ protected void calculate_vectors(){
Position = B + 0.5F*((A-B) + (C-B));
Rotation = Quaternion.LookRotation(Vector3.Cross((A-B), (C-B)), Vector3.up);
Vector3 cross = Vector3.Cross((A-B), (C-B));
float epsilon = 1E-9F;
float dot = Vector3.Dot(cross.normalized, Vector3.up.normalized);
float cosangle = dot / (cross.magnitude * Vector3.up.magnitude);
if (Mathf.Abs(cosangle) < epsilon || Mathf.Abs(cosangle - 180.0F) < epsilon){
//vectors are parallel
Vector3 initialForward = Vector3.forward;
// Project the normal vector onto the x-z plane
Vector3 projectedNormal = new Vector3(cross.x, 0, cross.z).normalized;
// Compute the angle between the initial forward direction and the projected normal
float angle = Vector3.SignedAngle(initialForward, projectedNormal, Vector3.up);
// Create the quaternion representing the rotation around the y-axis
Rotation = Quaternion.Euler(0, angle, 0);
}
else{
Rotation = Quaternion.LookRotation(cross, Vector3.up);
}
//Rotation = Quaternion.LookRotation(forward, new Vector3(1.0F, 0.0F, 0.0F));
}
......
......@@ -35,10 +35,10 @@ TagManager:
- SnapZone
- Triangle
- TriangularPrism
-
-
-
-
- Rectangle
- Sphere
- Cylinder
- Cuboid
-
-
-
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment