API Reference › Natives
Vector
StructNamespace: SwiftlyS2.Shared.Natives · Assembly: SwiftlyS2.CS2.dll
public struct Vector3-Dimensional vector 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 Vector 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.
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 Vector vector)Tries to deserialize the vector from a string. Example input: "100 200 300"
public static bool TryDeserialize(string? input, IFormatProvider? formatProvider, out Vector vector)Parameters
- inputstring?Serialized vector in string.
- formatProviderIFormatProvider?Format provider to use for the string. Null for default provider.
- vectorVectorDeserialized vector.
Fields
Operators
public static Vector operator +(Vector a, Vector b)Returns
public static Vector operator /(Vector a, Vector b)Returns
public static Vector operator /(Vector a, float b)Returns
public static bool operator ==(Vector a, Vector b)Returns
public static bool operator !=(Vector a, Vector b)Returns
public static Vector operator *(Vector a, Vector b)Returns
public static Vector operator *(Vector a, float b)Returns
public static Vector operator *(float b, Vector a)Returns
public static Vector operator -(Vector a, Vector b)Returns