Struct Double3¶
Namespace: Apogee.Core.Numerics
Assembly: Apogee.Core.dll
A position in the double-precision world: three doubles (24 bytes). Float has 24 bits of precision, so at 5 km from
the origin a float position moves in 0.5 mm steps; a double keeps sub-micrometre steps for thousands of kilometres.
Only positions are double. Directions, rotations, scales and everything the GPU sees stay float: positions are turned into
float offsets from a nearby origin (the camera) with
public readonly struct Double3 : IEquatable<Double3>
Implements¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors¶
Double3(double, double, double)¶
A position in the double-precision world: three doubles (24 bytes). Float has 24 bits of precision, so at 5 km from
the origin a float position moves in 0.5 mm steps; a double keeps sub-micrometre steps for thousands of kilometres.
Only positions are double. Directions, rotations, scales and everything the GPU sees stay float: positions are turned into
float offsets from a nearby origin (the camera) with
public Double3(double x, double y, double z)
Parameters¶
x double
y double
z double
Double3(double)¶
public Double3(double value)
Parameters¶
value double
Fields¶
One¶
public static readonly Double3 One
Field Value¶
Properties¶
X¶
public double X { get; }
Property Value¶
Y¶
public double Y { get; }
Property Value¶
Z¶
public double Z { get; }
Property Value¶
Zero¶
public static Double3 Zero { get; }
Property Value¶
Methods¶
Distance(Double3, Double3)¶
public static double Distance(Double3 a, Double3 b)
Parameters¶
a Double3
b Double3
Returns¶
DistanceSquared(Double3, Double3)¶
public static double DistanceSquared(Double3 a, Double3 b)
Parameters¶
a Double3
b Double3
Returns¶
Dot(Double3, Double3)¶
public static double Dot(Double3 a, Double3 b)
Parameters¶
a Double3
b Double3
Returns¶
Equals(Double3)¶
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Double3 other)
Parameters¶
other Double3
An object to compare with this object.
Returns¶
true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)¶
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters¶
obj object?
The object to compare with the current instance.
Returns¶
true if obj and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()¶
Returns the hash code for this instance.
public override int GetHashCode()
Returns¶
A 32-bit signed integer that is the hash code for this instance.
Length()¶
public double Length()
Returns¶
LengthSquared()¶
public double LengthSquared()
Returns¶
Lerp(Double3, Double3, double)¶
public static Double3 Lerp(Double3 a, Double3 b, double t)
Parameters¶
a Double3
b Double3
t double
Returns¶
Max(Double3, Double3)¶
public static Double3 Max(Double3 a, Double3 b)
Parameters¶
a Double3
b Double3
Returns¶
Min(Double3, Double3)¶
public static Double3 Min(Double3 a, Double3 b)
Parameters¶
a Double3
b Double3
Returns¶
RelativeTo(Double3)¶
The offset from origin to this position as floats. The subtraction is done in double, so the result is
exact to float precision however far both are from the world's origin: this is how positions reach the GPU.
public Vector3 RelativeTo(Double3 origin)
Parameters¶
origin Double3
Returns¶
ToString()¶
Returns the fully qualified type name of this instance.
public override string ToString()
Returns¶
The fully qualified type name.
Operators¶
operator +(Double3, Double3)¶
public static Double3 operator +(Double3 a, Double3 b)
Parameters¶
a Double3
b Double3
Returns¶
operator +(Double3, Vector3)¶
public static Double3 operator +(Double3 a, Vector3 b)
Parameters¶
a Double3
b Vector3
Returns¶
operator /(Double3, double)¶
public static Double3 operator /(Double3 a, double b)
Parameters¶
a Double3
b double
Returns¶
operator ==(Double3, Double3)¶
public static bool operator ==(Double3 a, Double3 b)
Parameters¶
a Double3
b Double3
Returns¶
explicit operator Vector3(Double3)¶
Narrows to float; positions far from the origin lose precision here, which is what
public static explicit operator Vector3(Double3 value)
Parameters¶
value Double3
Returns¶
implicit operator Double3(Vector3)¶
public static implicit operator Double3(Vector3 value)
Parameters¶
value Vector3
Returns¶
operator !=(Double3, Double3)¶
public static bool operator !=(Double3 a, Double3 b)
Parameters¶
a Double3
b Double3
Returns¶
operator *(Double3, double)¶
public static Double3 operator *(Double3 a, double b)
Parameters¶
a Double3
b double
Returns¶
operator *(double, Double3)¶
public static Double3 operator *(double a, Double3 b)
Parameters¶
a double
b Double3
Returns¶
operator -(Double3, Double3)¶
public static Double3 operator -(Double3 a, Double3 b)
Parameters¶
a Double3
b Double3
Returns¶
operator -(Double3, Vector3)¶
public static Double3 operator -(Double3 a, Vector3 b)
Parameters¶
a Double3
b Vector3
Returns¶
operator -(Double3)¶
public static Double3 operator -(Double3 a)
Parameters¶
a Double3