mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-19 16:21:47 +00:00
Introduced Vector2 and Vector3 Square Lenght. (#1248)
* Introduced Vector2 and Vector3 Square Lenght. * Square length functions renamed
This commit is contained in:
@@ -207,6 +207,13 @@ RMDEF float Vector2Length(Vector2 v)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Calculate vector square length
|
||||||
|
RMDEF float Vector2LengthSqr(Vector2 v)
|
||||||
|
{
|
||||||
|
float result = (v.x*v.x) + (v.y*v.y);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate two vectors dot product
|
// Calculate two vectors dot product
|
||||||
RMDEF float Vector2DotProduct(Vector2 v1, Vector2 v2)
|
RMDEF float Vector2DotProduct(Vector2 v1, Vector2 v2)
|
||||||
{
|
{
|
||||||
@@ -401,6 +408,13 @@ RMDEF float Vector3Length(const Vector3 v)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Calculate vector square length
|
||||||
|
RMDEF float Vector3LengthSqr(const Vector3 v)
|
||||||
|
{
|
||||||
|
float result = v.x*v.x + v.y*v.y + v.z*v.z;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate two vectors dot product
|
// Calculate two vectors dot product
|
||||||
RMDEF float Vector3DotProduct(Vector3 v1, Vector3 v2)
|
RMDEF float Vector3DotProduct(Vector3 v1, Vector3 v2)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user