Dawn/src/physics/sphere.h
2021-08-17 08:25:20 -07:00

38 lines
1.1 KiB
C

/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include <dawn/dawn.h>
#include "vector.h"
/**
* Checks whether a point is colliding with a circle.
*
* @param x0 X Position of the vector.
* @param y0 Y position of the vector.
* @param x1 Center point of the circle. X Coordinate.
* @param y1 Center point of the circle. Y Coordinate.
* @param radius Radius of the circle
* @return True if the point is colliding, otherwise false.
*/
bool sphereDistance2D(float x0, float y0, float x1, float y1, float radius);
/**
* Checks whether a point is colliding with a sphere.
*
* @param x0 X Position of the vector.
* @param y0 Y Position of the vector.
* @param z0 Z Position of the vector.
* @param x1 Center point of the circle, X Coordinate.
* @param y1 Center point of the circle, Y Coordinate.
* @param z1 Center point of the circle, Z Coordinate.
* @param radius Radius of the sphere.
* @return True if the point is colliding with the sphere.
*/
bool sphereDistance3D(
float x0, float y0, float z0, float x1, float y1, float z1, float radius
);