VectorWS
Struct VectorWS
Namespace: SwiftlyS2.Shared.Natives
Assembly: SwiftlyS2.CS2.dll
3-Dimensional vector at world scale (?) for source 2.
No more cssharp chaos.
public struct VectorWSInherited Members
- object.Equals(object?)
- object.Equals(object?, object?)
- object.GetHashCode()
- object.GetType()
- object.ReferenceEquals(object?, object?)
- object.ToString()
Constructors
VectorWS(float, float, float)
public VectorWS(float x, float y, float z)Parameters
VectorWS(VectorWS)
public VectorWS(VectorWS other)Parameters
- other VectorWS
Fields
X
public float XField Value
Y
public float YField Value
Z
public float ZField Value
Properties
One
public static VectorWS One { get; }Property Value
Zero
public static VectorWS Zero { get; }Property Value
Methods
Cross(VectorWS)
public readonly VectorWS Cross(VectorWS other)Parameters
- other VectorWS
Returns
Deconstruct(out float, out float, out float)
public readonly void Deconstruct(out float x, out float y, out float z)Parameters
Deserialize(string, IFormatProvider?)
Deserializes the vector from a string. Example input: "100 200 300"
public static VectorWS Deserialize(string input, IFormatProvider? formatProvider = null)Parameters
- input string — Serialized vector in string.
- formatProvider IFormatProvider? — Format provider to use for the string. Null for default provider.
Returns
- VectorWS — Deserialized vector.
Exceptions
- FormatException — Thrown when the input string is not in the correct format.
Distance(VectorWS)
public readonly float Distance(VectorWS other)Parameters
- other VectorWS
Returns
Distance2D(VectorWS)
public readonly float Distance2D(VectorWS other)Parameters
- other VectorWS
Returns
Distance2DSquared(VectorWS)
public readonly float Distance2DSquared(VectorWS other)Parameters
- other VectorWS
Returns
DistanceSquared(VectorWS)
public readonly float DistanceSquared(VectorWS other)Parameters
- other VectorWS
Returns
Dot(VectorWS)
public readonly float Dot(VectorWS other)Parameters
- other VectorWS
Returns
Dot(VectorWS, VectorWS)
public static float Dot(VectorWS a, VectorWS 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 VectorWS 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
Length2D()
public readonly float Length2D()Returns
Length2DSquared()
public readonly float Length2DSquared()Returns
LengthSquared()
public readonly float LengthSquared()Returns
Normalize()
public void Normalize()Normalize2D()
public void Normalize2D()Normalized()
public readonly VectorWS Normalized()Returns
Normalized2D()
public readonly VectorWS Normalized2D()Returns
Serialize(IFormatProvider?)
Serializes the vector to a string. Example return: "100 200 300"
public readonly string Serialize(IFormatProvider? formatProvider = null)Parameters
- formatProvider IFormatProvider? — Format provider to use for the string. Null for default provider.
Returns
- string — Serialized vector in string.
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.
ToVector()
public readonly Vector ToVector()Returns
TryDeserialize(string?, out VectorWS)
Tries to deserialize the vector from a string. Example input: "100 200 300"
public static bool TryDeserialize(string? input, out VectorWS vector)Parameters
Returns
- bool — True if the deserialization was successful, false otherwise.
TryDeserialize(string?, IFormatProvider?, out VectorWS)
Tries to deserialize the vector from a string. Example input: "100 200 300"
public static bool TryDeserialize(string? input, IFormatProvider? formatProvider, out VectorWS vector)Parameters
- input string? — Serialized vector in string.
- formatProvider IFormatProvider? — Format provider to use for the string. Null for default provider.
- vector VectorWS — Deserialized vector.
Returns
- bool — True if the deserialization was successful, false otherwise.
Operators
operator +(VectorWS, VectorWS)
public static VectorWS operator +(VectorWS a, VectorWS b)Parameters
Returns
operator /(VectorWS, VectorWS)
public static VectorWS operator /(VectorWS a, VectorWS b)Parameters
Returns
operator /(VectorWS, float)
public static VectorWS operator /(VectorWS a, float b)Parameters
Returns
operator ==(VectorWS, VectorWS)
public static bool operator ==(VectorWS a, VectorWS b)Parameters
Returns
operator !=(VectorWS, VectorWS)
public static bool operator !=(VectorWS a, VectorWS b)Parameters
Returns
operator *(VectorWS, VectorWS)
public static VectorWS operator *(VectorWS a, VectorWS b)Parameters
Returns
operator *(VectorWS, float)
public static VectorWS operator *(VectorWS a, float b)Parameters
Returns
operator *(float, VectorWS)
public static VectorWS operator *(float b, VectorWS a)Parameters
Returns
operator -(VectorWS, VectorWS)
public static VectorWS operator -(VectorWS a, VectorWS b)Parameters
Returns
operator -(VectorWS)
public static VectorWS operator -(VectorWS a)Parameters
- a VectorWS
Returns