Skip to content

Commit 6fefaa3

Browse files
committed
Added TIVector2.ToVector2
1 parent d31e6af commit 6fefaa3

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ Win64/
1818
*.dcu
1919
*.map
2020
*.deployproj
21+
*.rsm
22+
*.stat
2123
!FastMath/FastMathMacOS64CM.obj
2224
!FastMath/FastMathMacOS64RM.obj
2325
#ignore Delphi temp and backup files
26+
FastMath/Arm/fastmath-android/obj/
2427
*.~*
2528
#ignore Delphi local files
2629
*.dsk

FastMath/Neslib.FastMath.Common.inc

+14
Original file line numberDiff line numberDiff line change
@@ -2931,6 +2931,11 @@ begin
29312931
Result.Y := A.Y - B.Y;
29322932
end;
29332933

2934+
function TIVector2.ToVector2: TVector2;
2935+
begin
2936+
Result.Init(X, Y);
2937+
end;
2938+
29342939
{ TIVector3 }
29352940

29362941
class operator TIVector3.Add(const A: TIVector3; const B: Integer): TIVector3;
@@ -3072,6 +3077,11 @@ begin
30723077
Result.Z := A.Z - B.Z;
30733078
end;
30743079

3080+
function TIVector3.ToVector3: TVector3;
3081+
begin
3082+
Result.Init(X, Y, Z);
3083+
end;
3084+
30753085
{ TIVector4 }
30763086

30773087
class operator TIVector4.Add(const A: TIVector4; const B: Integer): TIVector4;
@@ -3229,3 +3239,7 @@ begin
32293239
Result.W := A.W - B.W;
32303240
end;
32313241

3242+
function TIVector4.ToVector4: TVector4;
3243+
begin
3244+
Result.Init(X, Y, Z, W);
3245+
end;

FastMath/Neslib.FastMath.pas

+9
Original file line numberDiff line numberDiff line change
@@ -3119,6 +3119,9 @@ TIVector2 = record
31193119
True if X and Y are 0 }
31203120
function IsZero: Boolean; inline;
31213121

3122+
{ Converts this vector to a floatint-point vector }
3123+
function ToVector2: TVector2; inline;
3124+
31223125
{ Returns the components of the vector.
31233126
This is identical to accessing the C-field, but this property can be used
31243127
as a default array property.
@@ -3303,6 +3306,9 @@ TIVector3 = record
33033306
True if X, Y and Z are 0 }
33043307
function IsZero: Boolean; inline;
33053308

3309+
{ Converts this vector to a floatint-point vector }
3310+
function ToVector3: TVector3; inline;
3311+
33063312
{ Returns the components of the vector.
33073313
This is identical to accessing the C-field, but this property can be used
33083314
as a default array property.
@@ -3490,6 +3496,9 @@ TIVector4 = record
34903496
True if X, Y, Z and W are 0 }
34913497
function IsZero: Boolean; inline;
34923498

3499+
{ Converts this vector to a floatint-point vector }
3500+
function ToVector4: TVector4; inline;
3501+
34933502
{ Returns the components of the vector.
34943503
This is identical to accessing the C-field, but this property can be used
34953504
as a default array property.

0 commit comments

Comments
 (0)