-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathConstants.cs
More file actions
57 lines (46 loc) · 1.35 KB
/
Constants.cs
File metadata and controls
57 lines (46 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
global using static godot_openal.Logger;
global using System;
global using System.Collections.Generic;
global using System.Diagnostics;
global using OpenAL;
global using OpenAL.managed;
global using Godot;
namespace godot_openal;
public static class Constants
{
public static string AudioPath = (string)ProjectSettings.GetSetting("audio/openal_sound_folder.custom", "res://audio");
}
public static class Helper
{
public static Vector3 PitchYawToVector3(float pitch, float yaw)
{
Vector3 direction = new()
{
X = Mathf.Cos(pitch) * Mathf.Sin(yaw),
Y = -Mathf.Sin(pitch),
Z = Mathf.Cos(pitch) * Mathf.Cos(yaw)
};
return direction.Normalized();
}
}
internal static class Logger
{
internal static void Log(string message)
{
var prefixed = $"[godot_openal] {message}";
Console.WriteLine(prefixed);
GD.Print(prefixed);
}
internal static void LogWarning(string message)
{
var prefixed = $"[godot_openal] {message}";
Console.WriteLine(prefixed);
GD.PushWarning(prefixed);
}
internal static void LogError(string message)
{
var prefixed = $"[godot_openal] {message}";
Console.Error.WriteLine(prefixed);
GD.PushError(prefixed);
}
}