2 public struct Point3 : IEquatable<Point3> {
37 public static implicit
operator Point3((
int X,
int Y,
int Z) v) =>
new(v.X, v.Y, v.Z);
45 public override string ToString() => $
"{X},{Y},{Z}";
47 public static int Dot(
Point3 p1,
Point3 p2) => p1.X * p2.X + p1.Y * p2.Y + p1.Z * p2.
Z;
49 public static Point3 Cross(
Point3 p1,
Point3 p2) =>
new(p1.Y * p2.Z - p1.Z * p2.
Y, p1.Z * p2.X - p1.X * p2.
Z, p1.X * p2.Y - p1.Y * p2.
X);
86 fixed (
int* ptr = &
X) {
87 return new Span<int>(ptr, 3);
92 fixed (
int* ptr = &
X) {
99 public static Point3 Round(
Vector3 v) =>
new((int)MathF.Round(v.
X), (
int)MathF.Round(v.
Y), (
int)MathF.Round(v.
Z));
101 public static Point3 Round(
float x,
float y,
float z) =>
new((int)MathF.Round(x), (
int)MathF.Round(y), (
int)MathF.Round(z));
105 public static Point3 Ceiling(
float x,
float y,
float z) =>
new((int)MathF.Ceiling(x), (
int)MathF.Ceiling(y), (
int)MathF.Ceiling(z));
109 public static Point3 Floor(
float x,
float y,
float z) =>
new((int)MathF.Floor(x), (
int)MathF.Floor(y), (
int)MathF.Floor(z));
static int Min(int x1, int x2)
static int Max(int x1, int x2)
Point3(int x, int y, int z)
unsafe Span< int > AsSpan()
static Point3 Cross(Point3 p1, Point3 p2)
override string ToString()
static bool operator==(Point3 p1, Point3 p2)
static int Dot(Point3 p1, Point3 p2)
override bool Equals(object obj)
bool Equals(Point3 other)
static Point3 Max(Point3 p1, Point3 p2)
static int MaxElement(Point3 p)
static Point3 Floor(Vector3 v)
static Point3 Min(Point3 p, int v)
static Point3 Ceiling(float x, float y, float z)
static Point3 operator+(Point3 p)
static Point3 Max(Point3 p, int v)
static Point3 Round(float x, float y, float z)
static readonly Point3 Zero
static int MinElement(Point3 p)
static Point3 Ceiling(Vector3 v)
static readonly Point3 UnitY
static bool operator!=(Point3 p1, Point3 p2)
static Point3 operator-(Point3 p)
static Point3 operator*(int n, Point3 p)
static Point3 Min(Point3 p1, Point3 p2)
static readonly Point3 UnitX
static readonly Point3 UnitZ
static Point3 operator/(Point3 p, int n)
static Point3 Floor(float x, float y, float z)
static readonly Point3 One
override int GetHashCode()
static Point3 Round(Vector3 v)