Class SVector3
Inheritance
System.Object
SVector3
Implements
System.IFormattable
Assembly: Eco.Shared.dll
Syntax
public sealed class SVector3 : ValueType, IEquatable<SVector3>, IFormattable
Constructors
SVector3(Single)
Declaration
Parameters
| Type |
Name |
Description |
| System.Single |
v |
|
SVector3(Single, Single, Single)
Declaration
public SVector3(float x, float y, float z)
Parameters
| Type |
Name |
Description |
| System.Single |
x |
|
| System.Single |
y |
|
| System.Single |
z |
|
Fields
Back
Declaration
public static SVector3 Back
Field Value
Down
Declaration
public static SVector3 Down
Field Value
Forward
Declaration
public static SVector3 Forward
Field Value
Left
Declaration
public static SVector3 Left
Field Value
MinValue
Declaration
public static SVector3 MinValue
Field Value
One
Declaration
public static SVector3 One
Field Value
Right
Declaration
public static SVector3 Right
Field Value
Up
Declaration
public static SVector3 Up
Field Value
x
Declaration
Field Value
| Type |
Description |
| System.Single |
|
y
Declaration
Field Value
| Type |
Description |
| System.Single |
|
z
Declaration
Field Value
| Type |
Description |
| System.Single |
|
Zero
Declaration
public static SVector3 Zero
Field Value
Properties
Ceiling
Declaration
public Vector3i Ceiling { get; }
Property Value
Floor
Declaration
public Vector3i Floor { get; }
Property Value
Magnitude
Declaration
public float Magnitude { get; }
Property Value
| Type |
Description |
| System.Single |
|
MagnitudeSq
Declaration
public float MagnitudeSq { get; }
Property Value
| Type |
Description |
| System.Single |
|
Normalized
Declaration
public SVector3 Normalized { get; }
Property Value
Round
Uses default rounding rules (bank rounding, or round to closest even in case of tie).
I.e. 0.5 -> 0, but 1.5 -> 2.
Declaration
public Vector3i Round { get; }
Property Value
RoundPositively
Always rounds to closes greater number. Preferred way of rounding for coordinates, because voxel coordinates always shifted down.
I.e. 0.5 -> 1, 1.5 -> 2 and -1.5 -> -1.
Declaration
public Vector3i RoundPositively { get; }
Property Value
WorldPosition3i
Declaration
public WorldPosition3i WorldPosition3i { get; }
Property Value
X
Declaration
[JsonIgnore]
public float X { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
XY
Declaration
public Vector2 XY { get; }
Property Value
XYZi
Declaration
public Vector3i XYZi { get; }
Property Value
XZ
Declaration
public Vector2 XZ { get; }
Property Value
XZi
Declaration
public Vector2i XZi { get; }
Property Value
Y
Declaration
[JsonIgnore]
public float Y { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
YZ
Declaration
public Vector2 YZ { get; }
Property Value
Z
Declaration
[JsonIgnore]
public float Z { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
Methods
Abs()
Declaration
Returns
Angle(SVector3, SVector3)
Declaration
public static float Angle(SVector3 lhs, SVector3 rhs)
Parameters
Returns
| Type |
Description |
| System.Single |
|
AngleDeg(SVector3)
Declaration
public float AngleDeg(SVector3 to)
Parameters
Returns
| Type |
Description |
| System.Single |
|
AngleRad(SVector3)
Returns angle between two in degs.
Declaration
public float AngleRad(SVector3 to)
Parameters
Returns
| Type |
Description |
| System.Single |
|
Clamp(SVector3, SVector3)
Declaration
public void Clamp(SVector3 min, SVector3 max)
Parameters
CloseTo(SVector3, SVector3)
Declaration
public bool CloseTo(SVector3 other, SVector3 maxDistance)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Cross(SVector3)
Declaration
public SVector3 Cross(SVector3 rhs)
Parameters
Returns
Cross(SVector3, SVector3)
Declaration
public static SVector3 Cross(SVector3 lhs, SVector3 rhs)
Parameters
Returns
Distance(SVector3, SVector3)
Declaration
public static float Distance(SVector3 a, SVector3 b)
Parameters
Returns
| Type |
Description |
| System.Single |
|
DistanceSq(SVector3, SVector3)
Declaration
public static float DistanceSq(SVector3 a, SVector3 b)
Parameters
Returns
| Type |
Description |
| System.Single |
|
Dot(SVector3, SVector3)
Declaration
public static float Dot(SVector3 v1, SVector3 v2)
Parameters
Returns
| Type |
Description |
| System.Single |
|
Equals(SVector3)
Declaration
public bool Equals(SVector3 other)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
| Type |
Name |
Description |
| System.Object |
other |
|
Returns
| Type |
Description |
| System.Boolean |
|
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| System.Int32 |
|
IsInfinity(SVector3)
Declaration
public static bool IsInfinity(SVector3 v)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
IsNAN(SVector3)
Declaration
public static bool IsNAN(SVector3 v)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
IsValid(SVector3)
Declaration
public static bool IsValid(SVector3 v)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Lerp(SVector3, SVector3, Single)
Declaration
public static SVector3 Lerp(SVector3 a, SVector3 b, float t)
Parameters
Returns
Max(SVector3, SVector3)
Declaration
public static SVector3 Max(SVector3 max, SVector3 othermax)
Parameters
Returns
Min(SVector3, SVector3)
Declaration
public static SVector3 Min(SVector3 min, SVector3 othermin)
Parameters
Returns
NormalizeSafe(SVector3)
Returns normalized version of vector (by dividing each component on vector length), but returns defaultValue in case if length is zero to avoid producing NaN vector.
Declaration
public SVector3 NormalizeSafe(SVector3 defaultValue = null)
Parameters
| Type |
Name |
Description |
| SVector3 |
defaultValue |
|
Returns
RotateByXAxis(Single)
Declaration
public SVector3 RotateByXAxis(float radians)
Parameters
| Type |
Name |
Description |
| System.Single |
radians |
|
Returns
RotateByYAxis(Single)
Declaration
public SVector3 RotateByYAxis(float radians)
Parameters
| Type |
Name |
Description |
| System.Single |
radians |
|
Returns
RotateByZAxis(Single)
Declaration
public SVector3 RotateByZAxis(float radians)
Parameters
| Type |
Name |
Description |
| System.Single |
radians |
|
Returns
ToString()
Declaration
public override string ToString()
Returns
| Type |
Description |
| System.String |
|
Declaration
public string ToString(string formatString, IFormatProvider formatProvider = null)
Parameters
| Type |
Name |
Description |
| System.String |
formatString |
|
| System.IFormatProvider |
formatProvider |
|
Returns
| Type |
Description |
| System.String |
|
ToStringLabelled(String)
Declaration
public string ToStringLabelled(string text)
Parameters
| Type |
Name |
Description |
| System.String |
text |
|
Returns
| Type |
Description |
| System.String |
|
UnwrapRelative(SVector3)
Declaration
public SVector3 UnwrapRelative(SVector3 other)
Parameters
Returns
WrappedDistance(SVector3)
Declaration
public float WrappedDistance(SVector3 other)
Parameters
Returns
| Type |
Description |
| System.Single |
|
WrappedDistance(SVector3, SVector3)
Declaration
public static float WrappedDistance(SVector3 a, SVector3 b)
Parameters
Returns
| Type |
Description |
| System.Single |
|
WrappedDistanceSq(SVector3, SVector3)
Declaration
public static float WrappedDistanceSq(SVector3 a, SVector3 b)
Parameters
Returns
| Type |
Description |
| System.Single |
|
XZWrappedDirectionalVector(in SVector3, in SVector3, in SVector3)
Returns directional difference vector wrapped in size (i.e. WrappedVoxelSize, WrappedChunkSize or WrappedPlotSize).
Declaration
public static SVector3 XZWrappedDirectionalVector(in SVector3 from, in SVector3 to, in SVector3 size)
Parameters
Returns
ZeroY()
Declaration
Returns
Operators
Addition(SVector3, SVector3)
Declaration
public static SVector3 operator +(SVector3 v1, SVector3 v2)
Parameters
Returns
Addition(SVector3, Single)
Declaration
public static SVector3 operator +(SVector3 v1, float f)
Parameters
| Type |
Name |
Description |
| SVector3 |
v1 |
|
| System.Single |
f |
|
Returns
Division(SVector3, Int32)
Declaration
public static SVector3 operator /(SVector3 v, int f)
Parameters
| Type |
Name |
Description |
| SVector3 |
v |
|
| System.Int32 |
f |
|
Returns
Division(SVector3, Single)
Declaration
public static SVector3 operator /(SVector3 v, float f)
Parameters
| Type |
Name |
Description |
| SVector3 |
v |
|
| System.Single |
f |
|
Returns
Equality(SVector3, SVector3)
Declaration
public static bool operator ==(SVector3 a, SVector3 b)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Implicit(SVector3 to Vector3)
Declaration
public static implicit operator Vector3(SVector3 value)
Parameters
Returns
| Type |
Description |
| System.Numerics.Vector3 |
|
Implicit(Vector3 to SVector3)
Declaration
public static implicit operator SVector3(Vector3 value)
Parameters
| Type |
Name |
Description |
| System.Numerics.Vector3 |
value |
|
Returns
Inequality(SVector3, SVector3)
Declaration
public static bool operator !=(SVector3 a, SVector3 b)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Multiply(SVector3, SVector3)
Declaration
public static SVector3 operator *(SVector3 v1, SVector3 v2)
Parameters
Returns
Multiply(SVector3, Int32)
Declaration
public static SVector3 operator *(SVector3 v, int f)
Parameters
| Type |
Name |
Description |
| SVector3 |
v |
|
| System.Int32 |
f |
|
Returns
Multiply(SVector3, Single)
Declaration
public static SVector3 operator *(SVector3 v, float f)
Parameters
| Type |
Name |
Description |
| SVector3 |
v |
|
| System.Single |
f |
|
Returns
Subtraction(SVector3, SVector3)
Declaration
public static SVector3 operator -(SVector3 v1, SVector3 v2)
Parameters
Returns
Implements
System.IEquatable<>
System.IFormattable
Extension Methods