Added ground normal & ground velocity C# API e

This commit is contained in:
Antoine Pilote
2024-09-02 18:09:02 -04:00
parent 01000b9d13
commit d9237f83d2
9 changed files with 125 additions and 8 deletions

View File

@@ -311,6 +311,8 @@ namespace Nuake.Net
{
internal static unsafe delegate*<int, float, float, float, void> MoveAndSlideIcall;
internal static unsafe delegate*<int, bool> IsOnGroundIcall;
internal static unsafe delegate*<int, NativeArray<float>> GetGroundVelocityIcall;
internal static unsafe delegate*<int, NativeArray<float>> GetGroundNormalIcall;
public CharacterControllerComponent(int entityId)
{
@@ -326,6 +328,24 @@ namespace Nuake.Net
{
unsafe { return IsOnGroundIcall(EntityID); }
}
public Vector3 GetGroundNormal()
{
unsafe
{
NativeArray<float> resultArray = GetGroundNormalIcall(EntityID);
return new(resultArray[0], resultArray[1], resultArray[2]);
}
}
public Vector3 GetGroundVelocity()
{
unsafe
{
NativeArray<float> resultArray = GetGroundVelocityIcall(EntityID);
return new(resultArray[0], resultArray[1], resultArray[2]);
}
}
}
public class ParticleEmitterComponent : IComponent