/****************************************************************************************
* \file Physics.hxx
* \author Diren D Bharwani, diren.dbharwani, 390002520
* \brief Interface for the managed Physics class.
*
* \copyright Copyright (C) 2022 DigiPen Institute of Technology. Reproduction or
* disclosure of this file or its contents without the prior written consent
* of DigiPen Institute of Technology is prohibited.
****************************************************************************************/
#pragma once
// Project Includes
#include "Math/Ray.hxx"
#include "RaycastHit.hxx"
namespace SHADE
{
/*-----------------------------------------------------------------------------------*/
/* Type Definitions */
/*-----------------------------------------------------------------------------------*/
public ref class Physics abstract sealed
{
public:
/*---------------------------------------------------------------------------------*/
/* Properties */
/*---------------------------------------------------------------------------------*/
static property Vector3 Gravity
{
Vector3 get();
void set(Vector3 value);
}
// TODO(Diren): Add more properties for physics system settings.
/*---------------------------------------------------------------------------------*/
/* Raycast Function Members */
/*---------------------------------------------------------------------------------*/
///
/// Casts an infinite ray into the world.
///
/// The ray to cast.
/// The result of the raycast.
static RaycastHit Raycast (Ray ray);
///
/// Casts a ray for a given distance into the world.
///
/// The ray to cast.
/// The distance to cast the ray.
/// The result of the raycast.
static RaycastHit Raycast (Ray ray, float distance);
///
/// Casts a bounded ray into the world.
///
/// The start of the bounded ray.
/// The end of the bounded ray.
/// The result of the raycast.
static RaycastHit Linecast (Vector3 start, Vector3 end);
///
/// Casts an infinite ray w.r.t a GameObject.
///
/// The GameObject to cast the ray to.
/// The ray to cast.
/// The result of the raycast.
static RaycastHit ColliderRaycast (GameObject object, Ray ray);
///
/// Casts a ray for a given distance w.r.t a GameObject.
///
/// The GameObject to cast the ray to.
/// The ray to cast.
/// The distance to cast the ray.
/// The result of the raycast.
static RaycastHit ColliderRaycast (GameObject object, Ray ray, float distance);
///
/// Casts an infinite ray w.r.t a specific collider on a GameObject.
///
/// The GameObject to cast the ray to.
/// The collision shape index on the collider to cast to.
/// The ray to cast.
/// The result of the raycast.
static RaycastHit ColliderRaycast (GameObject object, int shapeIndex, Ray ray);
///
/// Casts a ray for a given distance w.r.t a specific collider on a GameObject.
///
/// The GameObject to cast the ray to.
/// The collision shape index on the collider to cast to.
/// The ray to cast.
/// The distance to cast the ray.
/// The result of the raycast.
static RaycastHit ColliderRaycast (GameObject object, int shapeIndex, Ray ray, float distance);
///
/// Casts a bounded ray w.r.t a GameObject.
///
/// The GameObject to cast the ray to.
/// The start of the bounded ray.
///
/// The result of the raycast.
static RaycastHit ColliderLineCast (GameObject object, Vector3 start, Vector3 end);
///
/// Casts a bounded ray w.r.t a specific collider on a GameObject.
///
/// The GameObject to cast the ray to.
/// The collision shape index on the collider to cast to.
/// The start of the bounded ray.
/// The end of the bounded ray.
/// The result of the raycast.
static RaycastHit ColliderLineCast (GameObject object, int shapeIndex, Vector3 start, Vector3 end);
private:
/*---------------------------------------------------------------------------------*/
/* Function Members */
/*---------------------------------------------------------------------------------*/
static RaycastHit generateDefaultResult ();
};
} // namespace SHADE