2
0
mirror of https://github.com/raylib-cs/raylib-cs synced 2025-04-05 11:19:39 -04:00
Chris d3e225a286
Update to raylib 4.5 (#149)
* Update bindings to raylib 4.5
* Review naming, comments and formatting
2023-03-30 20:01:55 +01:00

56 lines
1.2 KiB
C#

using System.Numerics;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
/// <summary>
/// Ray, ray for raycasting
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct Ray
{
/// <summary>
/// Ray position (origin)
/// </summary>
public Vector3 position;
/// <summary>
/// Ray direction
/// </summary>
public Vector3 direction;
public Ray(Vector3 position, Vector3 direction)
{
this.position = position;
this.direction = direction;
}
}
/// <summary>
/// Raycast hit information
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct RayCollision
{
/// <summary>
/// Did the ray hit something?
/// </summary>
public CBool hit;
/// <summary>
/// Distance to the nearest hit
/// </summary>
public float distance;
/// <summary>
/// Point of the nearest hit
/// </summary>
public Vector3 point;
/// <summary>
/// Surface normal of hit
/// </summary>
public Vector3 normal;
}
}