API Reference › Natives
VectorWS
StructNamespace: SwiftlyS2.Shared.Natives · Assembly: SwiftlyS2.CS2.dll
public struct VectorWS3-Dimensional vector at world scale (?) for source 2. No more cssharp chaos.
View sourceConstructors
Properties
Methods
public readonly void Deconstruct(out float x, out float y, out float z)Deserializes the vector from a string. Example input: "100 200 300"
public static VectorWS Deserialize(string input, IFormatProvider? formatProvider = null)Parameters
- inputstringSerialized vector in string.
- formatProviderIFormatProvider?optionalFormat provider to use for the string. Null for default provider.
Exceptions
- FormatExceptionThrown when the input string is not in the correct format.
public static float Dot(VectorWS a, VectorWS b)Returns
Indicates whether this instance and a specified object are equal.
public override readonly bool Equals(object? obj)Parameters
- objobject?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 .
Returns the hash code for this instance.
public override readonly int GetHashCode()Serializes the vector to a string. Example return: "100 200 300"
public readonly string Serialize(IFormatProvider? formatProvider = null)Parameters
- formatProviderIFormatProvider?optionalFormat provider to use for the string. Null for default provider.
Converts this forward vector into Euler QAngles (pitch, yaw, roll). Usage: forward.ToQAngles(out var angles);
public readonly QAngle ToQAngles()Returns the fully qualified type name of this instance.
public override readonly string ToString()Tries to deserialize the vector from a string. Example input: "100 200 300"
public static bool TryDeserialize(string? input, out VectorWS vector)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
- inputstring?Serialized vector in string.
- formatProviderIFormatProvider?Format provider to use for the string. Null for default provider.
- vectorVectorWSDeserialized vector.
Fields
Operators
public static VectorWS operator +(VectorWS a, VectorWS b)Returns
public static VectorWS operator /(VectorWS a, VectorWS b)Returns
public static VectorWS operator /(VectorWS a, float b)Returns
public static bool operator ==(VectorWS a, VectorWS b)Returns
public static bool operator !=(VectorWS a, VectorWS b)Returns
public static VectorWS operator *(VectorWS a, VectorWS b)Returns
public static VectorWS operator *(VectorWS a, float b)Returns
public static VectorWS operator *(float b, VectorWS a)Returns
public static VectorWS operator -(VectorWS a, VectorWS b)Returns