pandemonium_engine/modules/steering_ai/gsaiutils.h
Relintai 9fed52de03 Added a new steering_ai module.
It's a modified verion of https://github.com/GDQuest/godot-steering-ai-framework which I converted to c++ using thr converter srcipt.
It still needs to be cleaned.
2023-01-13 21:13:57 +01:00

39 lines
1.1 KiB
C++

#ifndef GSAIUTILS_H
#define GSAIUTILS_H
class GSAIUtils {
public:
static Vector3 clampedv3(const Vector3 &vector, const float limit);
static float vector3_to_angle(const Vector3 &vector);
static float vector2_to_angle(const Vector2 &vector);
static Vector2 angle_to_vector2(const float angle);
static Vector2 to_vector2(const Vector3 &vector);
static Vector3 to_vector3(const Vector2 &vector);
GSAIUtils();
~GSAIUtils();
protected:
static void _bind_methods();
// Math and vector utility functions.
// @Category - Utilities
// Returns the `vector` with its length capped to `limit`.
// 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.
// Returns an angle in radians between the positive X axis and the `vector`.
// 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.
// Returns a vector2 with `vector`'s x and y components.
// Returns a vector3 with `vector`'s x and y components and 0 in z.
};
#endif