ソースを参照

Introduced Vector2 and Vector3 Square Lenght. (#1248)

* Introduced Vector2 and Vector3 Square Lenght.

* Square length functions renamed
pull/1251/head
ThePituLegend 5年前
committed by GitHub
コミット
d14c51aa2a
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: 4AEE18F83AFDEB23
1個のファイルの変更14行の追加0行の削除
  1. +14
    -0
      src/raymath.h

+ 14
- 0
src/raymath.h ファイルの表示

@ -207,6 +207,13 @@ RMDEF float Vector2Length(Vector2 v)
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
RMDEF float Vector2DotProduct(Vector2 v1, Vector2 v2)
{
@ -401,6 +408,13 @@ RMDEF float Vector3Length(const Vector3 v)
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
RMDEF float Vector3DotProduct(Vector3 v1, Vector3 v2)
{

読み込み中…
キャンセル
保存