Vector
Struct Vector
Namespace: SwiftlyS2.Shared.Natives
Assembly: SwiftlyS2.CS2.dll
3-Dimensional vector for source 2.
No more cssharp chaos.
public struct VectorInherited Members
- object.Equals(object?)
- object.Equals(object?, object?)
- object.GetHashCode()
- object.GetType()
- object.ReferenceEquals(object?, object?)
- object.ToString()
Constructors
Vector(float, float, float)
public Vector(float x, float y, float z)Parameters
Vector(Vector)
public Vector(Vector other)Parameters
- other Vector
Fields
X
public float XField Value
Y
public float YField Value
Z
public float ZField Value
Properties
One
public static Vector One { get; }Property Value
Zero
public static Vector Zero { get; }Property Value
Methods
Cross(Vector)
public readonly Vector Cross(Vector other)Parameters
- other Vector
Returns
Deconstruct(out float, out float, out float)
public readonly void Deconstruct(out float x, out float y, out float z)Parameters
Distance(Vector)
public readonly float Distance(Vector other)Parameters
- other Vector
Returns
DistanceSquared(Vector)
public readonly float DistanceSquared(Vector other)Parameters
- other Vector
Returns
Dot(Vector)
public readonly float Dot(Vector other)Parameters
- other Vector
Returns
Dot(Vector, Vector)
public static float Dot(Vector a, Vector b)Parameters
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override readonly bool Equals(object? obj)Parameters
- obj object? — The object to compare with the current instance.
Returns
- bool — true if
objand this instance are the same type and represent the same value; otherwise, false.
FromBuiltin(Vector3)
public static Vector FromBuiltin(Vector3 vector)Parameters
- vector Vector3
Returns
GetHashCode()
Returns the hash code for this instance.
public override readonly int GetHashCode()Returns
- int — A 32-bit signed integer that is the hash code for this instance.
Length()
public readonly float Length()Returns
LengthSquared()
public readonly float LengthSquared()Returns
Normalize()
public void Normalize()Normalized()
public readonly Vector Normalized()Returns
ToBuiltin()
public readonly Vector3 ToBuiltin()Returns
ToQAngles()
Converts this forward vector into Euler QAngles (pitch, yaw, roll).
Usage: forward.ToQAngles(out var angles);
public readonly QAngle ToQAngles()Returns
- QAngle — Resulting SwiftlyS2.Shared.Natives.QAngle.
ToString()
Returns the fully qualified type name of this instance.
public override readonly string ToString()Returns
- string — The fully qualified type name.
Operators
operator +(Vector, Vector)
public static Vector operator +(Vector a, Vector b)Parameters
Returns
operator /(Vector, Vector)
public static Vector operator /(Vector a, Vector b)Parameters
Returns
operator /(Vector, float)
public static Vector operator /(Vector a, float b)Parameters
Returns
operator ==(Vector, Vector)
public static bool operator ==(Vector a, Vector b)Parameters
Returns
operator !=(Vector, Vector)
public static bool operator !=(Vector a, Vector b)Parameters
Returns
operator *(Vector, Vector)
public static Vector operator *(Vector a, Vector b)Parameters
Returns
operator *(Vector, float)
public static Vector operator *(Vector a, float b)Parameters
Returns
operator *(float, Vector)
public static Vector operator *(float b, Vector a)Parameters
Returns
operator -(Vector, Vector)
public static Vector operator -(Vector a, Vector b)Parameters
Returns
operator -(Vector)
public static Vector operator -(Vector a)Parameters
- a Vector
Returns