Vector3
Namespace: Hex1b.Scene.Math
Assembly: Hex1b.dll
A 3D vector with x, y, z components for 3D coordinate space.
[Experimental("HEX1B_SCENE", UrlFormat = "https://github.com/hex1b/hex1b/blob/main/docs/experimental/scene.md")]
public struct Vector3 : IEquatable<Vector3>Implements
Constructors
Vector3(float, float, float)
Parameters:
public Vector3(float x = 0, float y = 0, float z = 0)Properties
Magnitude
Returns: Single
public float Magnitude { get; }Normalized
Returns: Vector3
public Vector3 Normalized { get; }One
Returns: Vector3
public static Vector3 One { get; }SqrMagnitude
Returns: Single
public float SqrMagnitude { get; }UnitX
Returns: Vector3
public static Vector3 UnitX { get; }UnitY
Returns: Vector3
public static Vector3 UnitY { get; }UnitZ
Returns: Vector3
public static Vector3 UnitZ { get; }X
Returns: Single
public float X { readonly get; set; }Y
Returns: Single
public float Y { readonly get; set; }Z
Returns: Single
public float Z { readonly get; set; }Zero
Returns: Vector3
public static Vector3 Zero { get; }Methods
Cross(Vector3, Vector3)
Cross product of two vectors (right-hand rule).
Parameters:
Returns: Vector3
public static Vector3 Cross(Vector3 a, Vector3 b)Distance(Vector3, Vector3)
Euclidean distance between two points.
Parameters:
Returns: Single
public static float Distance(Vector3 a, Vector3 b)Dot(Vector3, Vector3)
Dot product of two vectors.
Parameters:
Returns: Single
public static float Dot(Vector3 a, Vector3 b)Equals(object?)
Indicates whether this instance and a specified object are equal.
Parameters:
obj(Object): The object to compare with the current instance.
Returns: Boolean
true if obj and this instance are the same type and represent the same value; otherwise, false.
public override bool Equals(object? obj)Equals(Vector3)
Indicates whether the current object is equal to another object of the same type.
Parameters:
other(Vector3): An object to compare with this object.
Returns: Boolean
true if the current object is equal to the other parameter; otherwise, false.
public bool Equals(Vector3 other)GetHashCode()
Returns the hash code for this instance.
Returns: Int32
A 32-bit signed integer that is the hash code for this instance.
public override int GetHashCode()Lerp(Vector3, Vector3, float)
Linear interpolation between two vectors.
Parameters:
Returns: Vector3
public static Vector3 Lerp(Vector3 a, Vector3 b, float t)ToString()
Returns the fully qualified type name of this instance.
Returns: String
The fully qualified type name.
public override string ToString()Members
operator -(Vector3, Vector3)
Parameters:
Returns: Vector3
public static Vector3 operator -(Vector3 a, Vector3 b)operator -(Vector3)
Parameters:
v(Vector3):
Returns: Vector3
public static Vector3 operator -(Vector3 v)operator *(float, Vector3)
Parameters:
Returns: Vector3
public static Vector3 operator *(float scalar, Vector3 v)operator *(Vector3, float)
Parameters:
Returns: Vector3
public static Vector3 operator *(Vector3 v, float scalar)operator /(Vector3, float)
Parameters:
Returns: Vector3
public static Vector3 operator /(Vector3 v, float scalar)operator +(Vector3, Vector3)
Parameters:
Returns: Vector3
public static Vector3 operator +(Vector3 a, Vector3 b)