swiftlys2/docs/api/ai/
API Reference Natives

QAngle

Struct
Namespace: SwiftlyS2.Shared.Natives · Assembly: SwiftlyS2.CS2.dll
public struct QAngle

QAngle is a type that contains 3 float, representing an angle. Degree Euler. Pitch, Yaw, Roll

View source

Constructors

QAngle(float, float, float)

public QAngle(float pitch, float yaw, float roll)
Parameters

QAngle(QAngle)

public QAngle(QAngle other)
Parameters

Properties

X

X-axis accessor for Pitch rotation (up/down).

public float X { readonly get; set; }
Property Value

This is just a mapped accessor to the Pitch field.

Y

Y-axis accessor for Yaw rotation (left/right).

public float Y { readonly get; set; }
Property Value

This is just a mapped accessor to the Yaw field.

Z

Z-axis accessor for Roll rotation (roll/tilt).

public float Z { readonly get; set; }
Property Value

This is just a mapped accessor to the Roll field.

Zero

public static QAngle Zero { get; }
Property Value

Methods

Deserialize(string, IFormatProvider?)

Deserializes the qangle from a string. Example input: "100 200 300"

public static QAngle Deserialize(string input, IFormatProvider? formatProvider = null)
Parameters
  • inputstringSerialized qangle in string.
  • formatProviderIFormatProvider?optionalFormat provider to use for the string. Null for default provider.
Returns
Deserialized qangle.
Exceptions

Equals(object?)

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 .

GetHashCode()

Returns the hash code for this instance.

public override readonly int GetHashCode()
Returns
A 32-bit signed integer that is the hash code for this instance.

Serialize(IFormatProvider?)

Serializes the qangle 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.
Returns
Serialized qangle in string.

ToDirectionVectors(out Vector, out Vector, out Vector)

Calculates forward, right, and up basis vectors that correspond to this angle. Usage: angle.ToDirectionVectors(out var forward, out var right, out var up);

public readonly void ToDirectionVectors(out Vector forward, out Vector right, out Vector up)
Parameters
  • forwardVectorForward direction (X: north, Z: up).
  • rightVectorRight direction.
  • upVectorUp direction.

ToRadianEuler()

public readonly RadianEuler ToRadianEuler()

ToString()

Returns the fully qualified type name of this instance.

public override readonly string ToString()
Returns
The fully qualified type name.

TryDeserialize(string?, out QAngle)

Tries to deserialize the qangle from a string. Example input: "100 200 300"

public static bool TryDeserialize(string? input, out QAngle qangle)
Parameters
  • inputstring?Serialized qangle in string.
  • qangleQAngleDeserialized qangle.
Returns
True if the deserialization was successful, false otherwise.

TryDeserialize(string?, IFormatProvider?, out QAngle)

Tries to deserialize the qangle from a string. Example input: "100 200 300"

public static bool TryDeserialize(string? input, IFormatProvider? provider, out QAngle qangle)
Parameters
  • inputstring?Serialized qangle in string.
  • providerIFormatProvider?Format provider to use for the string. Null for default provider.
  • qangleQAngleDeserialized qangle.
Returns
True if the deserialization was successful, false otherwise.

Fields

Pitch

public float Pitch
Field Value

Roll

public float Roll
Field Value

Yaw

public float Yaw
Field Value

Operators

operator +(QAngle, QAngle)

public static QAngle operator +(QAngle a, QAngle b)
Parameters
Returns

operator /(QAngle, QAngle)

public static QAngle operator /(QAngle a, QAngle b)
Parameters
Returns

operator /(QAngle, float)

public static QAngle operator /(QAngle a, float b)
Parameters
Returns

operator ==(QAngle, QAngle)

public static bool operator ==(QAngle a, QAngle b)
Parameters
Returns

operator !=(QAngle, QAngle)

public static bool operator !=(QAngle a, QAngle b)
Parameters
Returns

operator *(QAngle, QAngle)

public static QAngle operator *(QAngle a, QAngle b)
Parameters
Returns

operator *(QAngle, float)

public static QAngle operator *(QAngle a, float b)
Parameters
Returns

operator -(QAngle, QAngle)

public static QAngle operator -(QAngle a, QAngle b)
Parameters
Returns

operator -(QAngle)

public static QAngle operator -(QAngle a)
Parameters
Returns