Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 17f1ca3

Browse filesBrowse files
committed
chaning my custom plane class name so it don't conflict with Unity plane class
1 parent 349ae99 commit 17f1ca3
Copy full SHA for 17f1ca3

File tree

Expand file treeCollapse file tree

4 files changed

+17
-12
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+17
-12
lines changed

‎Assets/Scripts/CreatePlane.cs

Copy file name to clipboardExpand all lines: Assets/Scripts/CreatePlane.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ public class CreatePlane : MonoBehaviour
77
public Transform A;
88
public Transform B;
99
public Transform C;
10-
Plane plane;
10+
MPlane plane;
1111

1212
// Start is called before the first frame update
1313
void Start()
1414
{
15-
plane = new Plane(new Coords(A.position),
15+
plane = new MPlane(new Coords(A.position),
1616
new Coords(B.position),
1717
new Coords(C.position));
1818

‎Assets/Scripts/CreatePlaneHit.cs

Copy file name to clipboardExpand all lines: Assets/Scripts/CreatePlaneHit.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ public class CreatePlaneHit : MonoBehaviour
1010
public Transform D;
1111
public Transform E;
1212

13-
Plane plane;
13+
MPlane plane;
1414
Line L1;
1515

1616
// Start is called before the first frame update
1717
void Start()
1818
{
19-
plane = new Plane(new Coords(A.position),
19+
plane = new MPlane(new Coords(A.position),
2020
new Coords(B.position),
2121
new Coords(C.position));
2222

‎Assets/Scripts/Line.cs

Copy file name to clipboardExpand all lines: Assets/Scripts/Line.cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public Coords Reflect(Coords normal)
3838
return r;
3939
}
4040

41-
public float IntersectsAt(Plane p)
41+
public float IntersectsAt(MPlane p)
4242
{
4343
Coords normal = HolisticMath.Cross(p.u, p.v);
4444
if (HolisticMath.Dot(normal, v) == 0)

‎Assets/Scripts/Plane.cs

Copy file name to clipboard
+12-7Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
using System.Collections;
2-
using System.Collections.Generic;
3-
using UnityEngine;
1+
using UnityEngine;
42

5-
public class Plane
3+
public class MPlane
64
{
75
public Coords A;
86
Coords B;
97
Coords C;
108
public Coords v;
119
public Coords u;
1210

13-
public Plane(Coords _A, Coords _B, Coords _C)
11+
public MPlane(Coords _A, Coords _B, Coords _C)
1412
{
1513
A = _A;
1614
B = _B;
@@ -19,13 +17,20 @@ public Plane(Coords _A, Coords _B, Coords _C)
1917
u = C - A;
2018
}
2119

22-
public Plane(Coords _A, Vector3 V, Vector3 U)
20+
public MPlane(Coords _A, Vector3 V, Vector3 U)
2321
{
2422
A = _A;
2523
v = new Coords(V.x, V.y, V.z);
2624
u = new Coords(U.x, U.y, U.z);
2725
}
2826

27+
public MPlane(Vector3 _A, Vector3 _B, Vector3 _C)
28+
{
29+
A = new Coords(_A.x, _A.y, _A.z);
30+
B = new Coords(_B.x, _B.y, _B.z);
31+
C = new Coords(_C.x, _C.y, _C.z);
32+
}
33+
2934
public Coords Lerp(float s, float t)
3035
{
3136
float xst = A.x + v.x * s + u.x * t;
@@ -34,6 +39,6 @@ public Coords Lerp(float s, float t)
3439

3540
return new Coords(xst, yst, zst);
3641
}
37-
42+
3843

3944
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.