using System.Numerics;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
///
/// Rectangle type
///
[StructLayout(LayoutKind.Sequential)]
public struct Rectangle
{
public float x;
public float y;
public float width;
public float height;
public Rectangle(float x, float y, float width, float height)
{
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
}
/// Bounding box type
[StructLayout(LayoutKind.Sequential)]
public struct BoundingBox
{
///
/// Minimum vertex box-corner
///
public Vector3 min;
///
/// Maximum vertex box-corner
///
public Vector3 max;
public BoundingBox(Vector3 min, Vector3 max)
{
this.min = min;
this.max = max;
}
}
///
/// Ray, ray for raycasting
///
[StructLayout(LayoutKind.Sequential)]
public struct Ray
{
///
/// Ray position (origin)
///
public Vector3 position;
///
/// Ray direction
///
public Vector3 direction;
public Ray(Vector3 position, Vector3 direction)
{
this.position = position;
this.direction = direction;
}
}
///
/// Raycast hit information
///
[StructLayout(LayoutKind.Sequential)]
public struct RayCollision
{
///
/// Did the ray hit something?
///
public byte hit;
///
/// Distance to nearest hit
///
public float distance;
///
/// Position of nearest hit
///
public Vector3 point;
///
/// Surface normal of hit
///
public Vector3 normal;
}
}