GSAIUtils

Description

Math and vector utility functions.

Functions

Method Descriptions

clampedv3 (static)

func clampedv3(vector: Vector3, limit: float) -> Vector3

Returns the vector with its length capped to limit.

vector3_to_angle (static)

func vector3_to_angle(vector: Vector3) -> float

Returns an angle in radians between the positive X axis and the vector.

This assumes orientation for 3D agents that are upright and rotate around the Y axis.

vector2_to_angle (static)

func vector2_to_angle(vector: Vector2) -> float

Returns an angle in radians between the positive X axis and the vector.

angle_to_vector2 (static)

func angle_to_vector2(angle: float) -> Vector2

Returns a directional vector from the given orientation angle.

This assumes orientation for 2D agents or 3D agents that are upright and rotate around the Y axis.

to_vector2 (static)

func to_vector2(vector: Vector3) -> Vector2

Returns a vector2 with vector's x and y components.

to_vector3 (static)

func to_vector3(vector: Vector2) -> Vector3

Returns a vector3 with vector's x and y components and 0 in z.

Last updated