Skip to content

Commit

Permalink
Deleted more unneeded stuff from EarClipping.
Browse files Browse the repository at this point in the history
  • Loading branch information
MeltyPlayer committed Jan 5, 2025
1 parent b12987e commit 425c495
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 59 deletions.
12 changes: 0 additions & 12 deletions FinModelUtility/Formats/Vrml/Vrml/src/util/EarClipping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,16 +260,4 @@ internal void Remove(ConnectionEdge cur) {
if (cur == this.start_)
this.start_ = cur.prev_;
}

public bool Contains(Vector3m vector2M, out Vector3m res) {
foreach (var connectionEdge in this.GetPolygonCirculator()) {
if (connectionEdge.Origin.Equals(vector2M)) {
res = connectionEdge.Origin;
return true;
}
}

res = null;
return false;
}
}
48 changes: 1 addition & 47 deletions FinModelUtility/Formats/Vrml/Vrml/src/util/Vector3m.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace vrml.util;

public class Vector3m : ICloneable {
public class Vector3m {
internal DynamicProperties DynamicProperties = new DynamicProperties();

public Vector3m(ERational x, ERational y, ERational z) {
Expand All @@ -11,12 +11,6 @@ public Vector3m(ERational x, ERational y, ERational z) {
this.Z = z;
}

public Vector3m(Vector3m v) {
this.X = v.X;
this.Y = v.Y;
this.Z = v.Z;
}

public static Vector3m Zero() {
return new Vector3m(0, 0, 0);
}
Expand All @@ -25,42 +19,14 @@ public static Vector3m Zero() {
public ERational Y { get; set; }
public ERational Z { get; set; }

public object Clone() {
return new Vector3m(this.X, this.Y, this.Z);
}

public Vector3m Plus(Vector3m a) {
return new Vector3m(this.X + a.X, this.Y + a.Y, this.Z + a.Z);
}

public Vector3m Minus(Vector3m a) {
return new Vector3m(this.X - a.X, this.Y - a.Y, this.Z - a.Z);
}

public Vector3m Times(ERational a) {
return new Vector3m(this.X * a, this.Y * a, this.Z * a);
}

public Vector3m DividedBy(ERational a) {
return new Vector3m(this.X / a, this.Y / a, this.Z / a);
}

public ERational Dot(Vector3m a) {
return this.X * a.X + this.Y * a.Y + this.Z * a.Z;
}

public Vector3m Lerp(Vector3m a, ERational t) {
return this.Plus(a.Minus(this).Times(t));
}

public double Length() {
return System.Math.Sqrt(this.Dot(this).ToDouble());
}

public (double, double, double) ToDouble() {
return (this.X.ToDouble(), this.Y.ToDouble(), this.Z.ToDouble());
}

public ERational LengthSquared() {
return this.Dot(this);
}
Expand Down Expand Up @@ -89,19 +55,7 @@ public override int GetHashCode() {
return this.X.GetHashCode() ^ this.Y.GetHashCode() ^ this.Z.GetHashCode();
}

public static Vector3m operator+(Vector3m a, Vector3m b) {
return a.Plus(b);
}

public static Vector3m operator-(Vector3m a, Vector3m b) {
return a.Minus(b);
}

public static Vector3m operator*(Vector3m a, ERational d) {
return new Vector3m(a.X * d, a.Y * d, a.Z * d);
}

public static Vector3m operator/(Vector3m a, ERational d) {
return a.DividedBy(d);
}
}

0 comments on commit 425c495

Please sign in to comment.