Browse Source

TVector from GLS.VectorGeometry renamed to TGLVector to be able use TVector from System.Math.Vectors without conflicts of names

GLScene 4 years ago
parent
commit
78258c3c8f
96 changed files with 1246 additions and 1256 deletions
  1. 2 2
      AdvDemos/Delphi/GLSViewer/GLSViewer.dproj
  2. 10 12
      Demos/CPP/physics/OdeSimple/Unit1.dfm
  3. 1 1
      Demos/Delphi/behaviours/DceFm.pas
  4. 2 2
      Demos/Delphi/behaviours/FpsMovementFm.pas
  5. 5 5
      Demos/Delphi/collisions/BoxedinFm.pas
  6. 1 1
      Demos/Delphi/collisions/FacevsFaceFm.pas
  7. 2 2
      Demos/Delphi/collisions/MeshHitFm.pas
  8. 1 1
      Demos/Delphi/collisions/OctreeFm.pas
  9. 1 1
      Demos/Delphi/collisions/OctreedemoFm.pas
  10. 2 2
      Demos/Delphi/collisions/RayCastFm.pas
  11. 2 2
      Demos/Delphi/physics/NewtonDensityFm.pas
  12. 1 1
      Packages/GLScene_RT.dproj
  13. 1 1
      Source/Cg.Shader.pas
  14. 24 24
      Source/DWS.Scene.pas
  15. 37 37
      Source/DWS.VectorGeometry.pas
  16. 3 3
      Source/Formats.B3D.pas
  17. 2 2
      Source/Formats.OCT.pas
  18. 1 1
      Source/Formats.X.pas
  19. 2 2
      Source/GLS.AnimationUtils.pas
  20. 11 11
      Source/GLS.Atmosphere.pas
  21. 7 7
      Source/GLS.Behaviours.pas
  22. 4 4
      Source/GLS.BitmapFont.pas
  23. 40 40
      Source/GLS.CameraController.pas
  24. 15 15
      Source/GLS.Collision.pas
  25. 5 5
      Source/GLS.Color.pas
  26. 5 5
      Source/GLS.Context.pas
  27. 27 27
      Source/GLS.Coordinates.pas
  28. 2 2
      Source/GLS.DCE.pas
  29. 1 1
      Source/GLS.ExplosionFx.pas
  30. 7 7
      Source/GLS.Extrusion.pas
  31. 1 1
      Source/GLS.FBORenderer.pas
  32. 16 16
      Source/GLS.FPSMovement.pas
  33. 1 1
      Source/GLS.Feedback.pas
  34. 5 5
      Source/GLS.File3DS.pas
  35. 8 8
      Source/GLS.File3DSSceneObjects.pas
  36. 3 3
      Source/GLS.FileASE.pas
  37. 1 1
      Source/GLS.FileLMTS.pas
  38. 2 2
      Source/GLS.FileOBJ.pas
  39. 7 7
      Source/GLS.FireFX.pas
  40. 52 52
      Source/GLS.GeomObjects.pas
  41. 26 26
      Source/GLS.GeometryBB.pas
  42. 25 25
      Source/GLS.Gizmo.pas
  43. 28 28
      Source/GLS.GizmoEx.pas
  44. 18 18
      Source/GLS.Imposter.pas
  45. 2 2
      Source/GLS.Isosurface.pas
  46. 5 5
      Source/GLS.MaterialEx.pas
  47. 6 6
      Source/GLS.MaterialMultiProxy.pas
  48. 4 4
      Source/GLS.Mesh.pas
  49. 6 6
      Source/GLS.MeshBSP.pas
  50. 1 1
      Source/GLS.MeshLines.pas
  51. 3 3
      Source/GLS.Mirror.pas
  52. 16 16
      Source/GLS.Movement.pas
  53. 5 5
      Source/GLS.MultiPolygon.pas
  54. 9 9
      Source/GLS.MultiProxy.pas
  55. 13 13
      Source/GLS.Navigator.pas
  56. 6 6
      Source/GLS.Nodes.pas
  57. 54 54
      Source/GLS.Objects.pas
  58. 33 33
      Source/GLS.Octree.pas
  59. 2 2
      Source/GLS.ParticleFX.pas
  60. 2 2
      Source/GLS.PerlinPFX.pas
  61. 22 22
      Source/GLS.ProxyObjects.pas
  62. 1 1
      Source/GLS.ROAMPatch.pas
  63. 18 18
      Source/GLS.RandomHDS.pas
  64. 4 4
      Source/GLS.RenderContextInfo.pas
  65. 172 172
      Source/GLS.Scene.pas
  66. 2 8
      Source/GLS.ShadowPlane.pas
  67. 10 10
      Source/GLS.SkyDome.pas
  68. 12 12
      Source/GLS.SmoothNavigator.pas
  69. 4 4
      Source/GLS.Sound.pas
  70. 5 5
      Source/GLS.SpaceText.pas
  71. 4 4
      Source/GLS.Spline.pas
  72. 65 65
      Source/GLS.State.pas
  73. 10 10
      Source/GLS.TerrainRenderer.pas
  74. 5 5
      Source/GLS.ThorFX.pas
  75. 4 4
      Source/GLS.Tree.pas
  76. 42 43
      Source/GLS.VectorFileObjects.pas
  77. 172 172
      Source/GLS.VectorGeometry.pas
  78. 25 25
      Source/GLS.VectorLists.pas
  79. 1 2
      Source/GLS.VectorTypesExt.pas
  80. 6 6
      Source/GLS.WaterPlane.pas
  81. 3 3
      Source/GLS.Windows.pas
  82. 6 6
      Source/GLS.zBuffer.pas
  83. 1 1
      Source/GLSL.AsmShader.pas
  84. 2 2
      Source/GLSL.BumpShaders.pas
  85. 2 2
      Source/GLSL.CustomShader.pas
  86. 2 2
      Source/GLSL.PhongShader.pas
  87. 2 2
      Source/GLSL.Shader.pas
  88. 1 1
      Source/GLSL.ShapeShaders.pas
  89. 31 31
      Source/Physics.NGDManager.pas
  90. 1 1
      Source/Physics.NGDRagdoll.pas
  91. 12 12
      Source/Physics.ODEManager.pas
  92. 6 6
      Source/Physics.ODEUtils.pas
  93. 2 2
      Source/Physics.SPIInertias.pas
  94. 3 3
      Source/Sounds.BASS.pas
  95. 3 3
      Source/Sounds.FMOD.pas
  96. 1 1
      Source/Sounds.OpenAL.pas

+ 2 - 2
AdvDemos/Delphi/GLSViewer/GLSViewer.dproj

@@ -100,14 +100,14 @@
     </PropertyGroup>
     <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
         <BT_BuildType>Debug</BT_BuildType>
-        <VerInfo_Build>92</VerInfo_Build>
+        <VerInfo_Build>93</VerInfo_Build>
         <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
         <VerInfo_AutoIncVersion>true</VerInfo_AutoIncVersion>
         <VerInfo_MinorVer>8</VerInfo_MinorVer>
         <VerInfo_Debug>true</VerInfo_Debug>
         <VerInfo_Locale>1033</VerInfo_Locale>
         <Icon_MainIcon>Resource\GLSViewer.ico</Icon_MainIcon>
-        <VerInfo_Keys>CompanyName=;FileVersion=1.8.0.92;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.8.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
+        <VerInfo_Keys>CompanyName=;FileVersion=1.8.0.93;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.8.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
         <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">

+ 10 - 12
Demos/CPP/physics/OdeSimple/Unit1.dfm

@@ -171,12 +171,12 @@ object Form1: TForm1
       Height = 10.000000000000000000
       Width = 10.000000000000000000
       BehavioursData = {
-        0458434F4C02010201060C54474C4F4445537461746963020012000000000200
-        0200120000000002000500000000006F1283F53F0800000500000000000000FA
-        0840050000000000000000000005000000000000000000000500000000000000
-        0000000500000000000000000000050000000000000000000005000000000000
-        0000000005000000000000000000000500000000000000000000050000000000
-        000000000002000458434F4C02010200}
+        0458434F4C02010201060C54474C4F44455374617469630200060A4F44452053
+        746174696302000200120000000002000500000000006F1283F53F0800000500
+        000000000000FA08400500000000000000000000050000000000000000000005
+        0000000000000000000005000000000000000000000500000000000000000000
+        0500000000000000000000050000000000000000000005000000000000000000
+        00050000000000000000000002000458434F4C02010200}
     end
     object ODEObjects: TGLDummyCube
       CubeSize = 1.000000000000000000
@@ -192,14 +192,12 @@ object Form1: TForm1
     Top = 72
   end
   object GLODEManager1: TGLODEManager
-    Gravity.Coordinates = {00000000C3F51CC1000000000000803F}
-    Solver = osmQuickStep
+    Solver = osmDefault
     Iterations = 3
     MaxContacts = 8
-    RenderPoint = GLRenderPoint1
     Visible = False
-    VisibleAtRunTime = True
-    Left = 280
-    Top = 8
+    VisibleAtRunTime = False
+    Left = 312
+    Top = 16
   end
 end

+ 1 - 1
Demos/Delphi/behaviours/DceFm.pas

@@ -227,7 +227,7 @@ procedure TFormDCE.AddMushrooms;
 var
   i: Integer;
   proxy: TGLFreeFormProxy;
-  s: TVector;
+  s: TGLVector;
   f: Single;
 begin
   // spawn some more mushrooms using proxy objects

+ 2 - 2
Demos/Delphi/behaviours/FpsMovementFm.pas

@@ -77,8 +77,8 @@ implementation
 var
   yangle: double = 90;
   xangle: double = 0;
-  //Velocity:TVector=(0,0,0,0);
-  //Gravity:TVector=(0,-9.81*20,0,0);
+  //Velocity:TGLVector=(0,0,0,0);
+  //Gravity:TGLVector=(0,-9.81*20,0,0);
   Wireframe: Boolean;
   //DisplayTime:Integer=2000;
 

+ 5 - 5
Demos/Delphi/collisions/BoxedinFm.pas

@@ -63,7 +63,7 @@ type
      
     colTotalTime : Single; // for timing collision detection
     colCount : Integer;
-    procedure AddToTrail(const p : TVector);
+    procedure AddToTrail(const p : TGLVector);
   public
      
     mousex, mousey: integer;
@@ -93,10 +93,10 @@ end;
 procedure TFormBoxedin.GLCadencer1Progress(Sender: TObject; const deltaTime,
   newTime: Double);
 var
-   rayStart, rayVector : TVector;
+   rayStart, rayVector : TGLVector;
    velocity : Single;
-   pPoint : TVector;
-   pNormal : TVector;
+   pPoint : TGLVector;
+   pNormal : TGLVector;
    t : Int64;
 begin
    if IsKeyDown(VK_ESCAPE) then close;
@@ -140,7 +140,7 @@ begin
    Inc(colCount);
 end;
 
-procedure TFormBoxedin.AddToTrail(const p : TVector);
+procedure TFormBoxedin.AddToTrail(const p : TGLVector);
 var
    i, k : Integer;
 begin

+ 1 - 1
Demos/Delphi/collisions/FacevsFaceFm.pas

@@ -221,7 +221,7 @@ procedure TFormFacevsFace.GLSceneViewer1MouseMove(Sender: TObject;
   Shift: TShiftState; X, Y: Integer);
 var
    dx, dy: Integer;
-   VX, VY: TVector;
+   VX, VY: TGLVector;
    Camera: TGLCamera;
 begin
    Camera := GLSceneViewer1.Camera;

+ 2 - 2
Demos/Delphi/collisions/MeshHitFm.pas

@@ -68,7 +68,7 @@ end;
 procedure TFormMeshHit.GLSceneViewer1MouseDown(Sender: TObject;
   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
 var
-   rayStart, rayVector, iPoint, iNormal : TVector;
+   rayStart, rayVector, iPoint, iNormal : TGLVector;
 begin
    // retrieve raycasting data:
    //    rayStart is obtained for camera and screen position
@@ -103,7 +103,7 @@ end;
 procedure TFormMeshHit.GLSceneViewer2MouseDown(Sender: TObject;
   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
 var
-   rayStart, rayVector, iPoint, iNormal : TVector;
+   rayStart, rayVector, iPoint, iNormal : TGLVector;
 begin
    // retrieve raycasting data:
    //    rayStart is the eye (camera) position

+ 1 - 1
Demos/Delphi/collisions/OctreeFm.pas

@@ -98,7 +98,7 @@ end;
 procedure TFormOctree.GLSceneViewer2MouseDown(Sender: TObject;
   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
 var
-   rayStart, rayVector, iPoint, iNormal : TVector;
+   rayStart, rayVector, iPoint, iNormal : TGLVector;
    t : Int64;
 begin
    SetVector(rayStart, GLCamera2.AbsolutePosition);

+ 1 - 1
Demos/Delphi/collisions/OctreedemoFm.pas

@@ -98,7 +98,7 @@ end;
 procedure TFormOctreedemo.GLSceneViewer2MouseDown(Sender: TObject;
   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
 var
-   rayStart, rayVector, iPoint, iNormal : TVector;
+   rayStart, rayVector, iPoint, iNormal : TGLVector;
    t : Int64;
 begin
    SetVector(rayStart, GLCamera2.AbsolutePosition);

+ 2 - 2
Demos/Delphi/collisions/RayCastFm.pas

@@ -65,8 +65,8 @@ implementation
 
 procedure TFormRayCast.BUCastClick(Sender: TObject);
 var
-  o, v, vLight, light, iPoint, iNormal: TVector;
-  up, right, dir: TVector;
+  o, v, vLight, light, iPoint, iNormal: TGLVector;
+  up, right, dir: TGLVector;
   x, y, dx, dy: Integer;
   f, d: Single;
   color: TColor;

+ 2 - 2
Demos/Delphi/physics/NewtonDensityFm.pas

@@ -84,7 +84,7 @@ function BuoyancyPlaneCallback(const collisionID: Integer; context: Pointer;
 var
   BodyMatrix: TMatrix;
   PlaneEquation: TGLVector;
-  pv: PVector;
+  pv: PGLVector;
   MyForm: TFormNewtonDensity;
 begin
   // Get the matrix of the actual body
@@ -98,7 +98,7 @@ begin
   PlaneEquation := MyForm.GLPlane1.Direction.AsVector;
   // the distance along this normal, to the origin.
   PlaneEquation.W := MyForm.GLPlane1.Position.Y;
-  PVector(globalSpacePlane)^ := PlaneEquation;
+  PGLVector(globalSpacePlane)^ := PlaneEquation;
   Result := 1;
 end;
 

+ 1 - 1
Packages/GLScene_RT.dproj

@@ -8,7 +8,7 @@
         <AppType>Package</AppType>
         <FrameworkType>VCL</FrameworkType>
         <ProjectVersion>19.0</ProjectVersion>
-        <Platform Condition="'$(Platform)'==''">Win32</Platform>
+        <Platform Condition="'$(Platform)'==''">Win64</Platform>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
         <Base>true</Base>

+ 1 - 1
Source/Cg.Shader.pas

@@ -199,7 +199,7 @@ type
     property Direction: TCGenum read FDirection write FDirection;
     property Variability: TCGenum read FVariability write FVariability;
     // GLScene-friendly properties
-    property AsVector: TVector write SetAsVector4f; // position f.i.
+    property AsVector: TGLVector write SetAsVector4f; // position f.i.
     property AsAffineVector: TAffineVector write SetAsVector3f; // normal f.i.
     property AsVector2f: TVector2f write SetAsVector2f; // texCoord f.i.
   end;

+ 24 - 24
Source/DWS.Scene.pas

@@ -322,13 +322,13 @@ type
   // ---------- Vector/Matrix to/from IInfo helper functions ----------
   // ----------
 
-function GetVectorFromInfo(Info: IInfo): TVector;
+function GetVectorFromInfo(Info: IInfo): TGLVector;
 begin
   Result := VectorMake(Info.Element([0]).Value, Info.Element([1]).Value,
     Info.Element([2]).Value, Info.Element([3]).Value);
 end;
 
-procedure SetInfoFromVector(Info: IInfo; vec: TVector);
+procedure SetInfoFromVector(Info: IInfo; vec: TGLVector);
 var
   i: Integer;
 begin
@@ -436,7 +436,7 @@ end;
 // TGLCoordinates.AsVector write access
 procedure TGLCoordinatesSetAsVectorMethod.Execute(var ExternalObject: TObject);
 var
-  v: TVector;
+  v: TGLVector;
 begin
   ValidateExternalObject(ExternalObject, TGLCoordinates);
   v := GetVectorFromInfo(Info.Vars['Value']);
@@ -446,7 +446,7 @@ end;
 // TGLCoordinates.AsVector read access
 procedure TGLCoordinatesGetAsVectorMethod.Execute(var ExternalObject: TObject);
 var
-  v: TVector;
+  v: TGLVector;
 begin
   ValidateExternalObject(ExternalObject, TGLCoordinates);
   v := TGLCoordinates(ExternalObject).AsVector;
@@ -463,7 +463,7 @@ end;
 // TGLCoordinates.Translate
 procedure TGLCoordinatesTranslateMethod.Execute(var ExternalObject: TObject);
 var
-  v: TVector;
+  v: TGLVector;
 begin
   ValidateExternalObject(ExternalObject, TGLCoordinates);
   v := GetVectorFromInfo(Info.Vars['translationVector']);
@@ -474,7 +474,7 @@ end;
 procedure TGLCoordinatesAddScaledVectorMethod.Execute(var ExternalObject
   : TObject);
 var
-  v: TVector;
+  v: TGLVector;
 begin
   ValidateExternalObject(ExternalObject, TGLCoordinates);
   v := GetVectorFromInfo(Info.Vars['translationVector']);
@@ -484,7 +484,7 @@ end;
 // TGLCoordinates.Rotate
 procedure TGLCoordinatesRotateMethod.Execute(var ExternalObject: TObject);
 var
-  v: TVector;
+  v: TGLVector;
 begin
   ValidateExternalObject(ExternalObject, TGLCoordinates);
   v := GetVectorFromInfo(Info.Vars['anAxis']);
@@ -515,7 +515,7 @@ end;
 // TGLCoordinates.Equals
 procedure TGLCoordinatesEqualsMethod.Execute(var ExternalObject: TObject);
 var
-  v: TVector;
+  v: TGLVector;
 begin
   ValidateExternalObject(ExternalObject, TGLCoordinates);
   v := GetVectorFromInfo(Info.Vars['aVector']);
@@ -871,23 +871,23 @@ begin
       '', ClassSym, SymbolTable);
   if not Assigned(ClassSym.Members.FindLocal('SetAsVector')) then
     TGLCoordinatesSetAsVectorMethod.Create(mkProcedure, [], 0, 'SetAsVector',
-      ['Value', 'TVector'], '', ClassSym, SymbolTable);
+      ['Value', 'TGLVector'], '', ClassSym, SymbolTable);
   if not Assigned(ClassSym.Members.FindLocal('GetAsVector')) then
     TGLCoordinatesGetAsVectorMethod.Create(mkFunction, [], 0, 'GetAsVector', [],
-      'TVector', ClassSym, SymbolTable);
+      'TGLVector', ClassSym, SymbolTable);
   if not Assigned(ClassSym.Members.FindLocal('GetAsString')) then
     TGLCoordinatesGetAsStringMethod.Create(mkFunction, [], 0, 'GetAsString', [],
       'String', ClassSym, SymbolTable);
   if not Assigned(ClassSym.Members.FindLocal('Translate')) then
     TGLCoordinatesTranslateMethod.Create(mkProcedure, [], 0, 'Translate',
-      ['translationVector', 'TVector'], '', ClassSym, SymbolTable);
+      ['translationVector', 'TGLVector'], '', ClassSym, SymbolTable);
   if not Assigned(ClassSym.Members.FindLocal('AddScaledVector')) then
     TGLCoordinatesAddScaledVectorMethod.Create(mkProcedure, [], 0,
-      'AddScaledVector', ['factor', 'Float', 'translationVector', 'TVector'],
+      'AddScaledVector', ['factor', 'Float', 'translationVector', 'TGLVector'],
       '', ClassSym, SymbolTable);
   if not Assigned(ClassSym.Members.FindLocal('Rotate')) then
     TGLCoordinatesRotateMethod.Create(mkProcedure, [], 0, 'Rotate',
-      ['anAxis', 'TVector', 'anAngle', 'Float'], '', ClassSym, SymbolTable);
+      ['anAxis', 'TGLVector', 'anAngle', 'Float'], '', ClassSym, SymbolTable);
   if not Assigned(ClassSym.Members.FindLocal('Normalize')) then
     TGLCoordinatesNormalizeMethod.Create(mkProcedure, [], 0, 'Normalize', [],
       '', ClassSym, SymbolTable);
@@ -899,7 +899,7 @@ begin
       ['factor', 'Float'], '', ClassSym, SymbolTable);
   if not Assigned(ClassSym.Members.FindLocal('Equals')) then
     TGLCoordinatesEqualsMethod.Create(mkFunction, [], 0, 'Equals',
-      ['aVector', 'TVector'], 'Boolean', ClassSym, SymbolTable);
+      ['aVector', 'TGLVector'], 'Boolean', ClassSym, SymbolTable);
 
   // Properties
   AddPropertyToClass('X', 'Float', 'GetX', 'SetX', '', False, ClassSym,
@@ -908,7 +908,7 @@ begin
     SymbolTable);
   AddPropertyToClass('Z', 'Float', 'GetZ', 'SetZ', '', False, ClassSym,
     SymbolTable);
-  AddPropertyToClass('AsVector', 'TVector', 'GetAsVector', 'SetAsVector', '',
+  AddPropertyToClass('AsVector', 'TGLVector', 'GetAsVector', 'SetAsVector', '',
     False, ClassSym, SymbolTable);
   AddPropertyToClass('AsString', 'String', 'GetAsString', '', '', False,
     ClassSym, SymbolTable);
@@ -942,22 +942,22 @@ begin
       'InvAbsoluteMatrix', [], 'TMatrix', ClassSym, SymbolTable);
   if not Assigned(ClassSym.Members.FindLocal('SetAbsolutePosition')) then
     TGLBaseSceneObjectSetAbsolutePositionMethod.Create(mkProcedure, [], 0,
-      'SetAbsolutePosition', ['Value', 'TVector'], '', ClassSym, SymbolTable);
+      'SetAbsolutePosition', ['Value', 'TGLVector'], '', ClassSym, SymbolTable);
   if not Assigned(ClassSym.Members.FindLocal('GetAbsolutePosition')) then
     TGLBaseSceneObjectGetAbsolutePositionMethod.Create(mkFunction, [], 0,
-      'GetAbsolutePosition', [], 'TVector', ClassSym, SymbolTable);
+      'GetAbsolutePosition', [], 'TGLVector', ClassSym, SymbolTable);
   if not Assigned(ClassSym.Members.FindLocal('SetAbsoluteUp')) then
     TGLBaseSceneObjectSetAbsoluteUpMethod.Create(mkProcedure, [], 0,
-      'SetAbsoluteUp', ['Value', 'TVector'], '', ClassSym, SymbolTable);
+      'SetAbsoluteUp', ['Value', 'TGLVector'], '', ClassSym, SymbolTable);
   if not Assigned(ClassSym.Members.FindLocal('GetAbsoluteUp')) then
     TGLBaseSceneObjectGetAbsoluteUpMethod.Create(mkFunction, [], 0,
-      'GetAbsoluteUp', [], 'TVector', ClassSym, SymbolTable);
+      'GetAbsoluteUp', [], 'TGLVector', ClassSym, SymbolTable);
   if not Assigned(ClassSym.Members.FindLocal('SetAbsoluteDirection')) then
     TGLBaseSceneObjectSetAbsoluteDirectionMethod.Create(mkProcedure, [], 0,
-      'SetAbsoluteDirection', ['Value', 'TVector'], '', ClassSym, SymbolTable);
+      'SetAbsoluteDirection', ['Value', 'TGLVector'], '', ClassSym, SymbolTable);
   if not Assigned(ClassSym.Members.FindLocal('GetAbsoluteDirection')) then
     TGLBaseSceneObjectGetAbsoluteDirectionMethod.Create(mkFunction, [], 0,
-      'GetAbsoluteDirection', [], 'TVector', ClassSym, SymbolTable);
+      'GetAbsoluteDirection', [], 'TGLVector', ClassSym, SymbolTable);
 
   if not Assigned(ClassSym.Members.FindLocal('SetPosition')) then
     TGLBaseSceneObjectSetPositionMethod.Create(mkProcedure, [], 0,
@@ -1023,11 +1023,11 @@ begin
     False, ClassSym, SymbolTable);
   AddPropertyToClass('Matrix', 'TMatrix', 'GetMatrix', 'SetMatrix', '', False,
     ClassSym, SymbolTable);
-  AddPropertyToClass('AbsolutePosition', 'TVector', 'GetAbsolutePosition',
+  AddPropertyToClass('AbsolutePosition', 'TGLVector', 'GetAbsolutePosition',
     'SetAbsolutePosition', '', False, ClassSym, SymbolTable);
-  AddPropertyToClass('AbsoluteUp', 'TVector', 'GetAbsoluteUp', 'SetAbsoluteUp',
+  AddPropertyToClass('AbsoluteUp', 'TGLVector', 'GetAbsoluteUp', 'SetAbsoluteUp',
     '', False, ClassSym, SymbolTable);
-  AddPropertyToClass('AbsoluteDirection', 'TVector', 'GetAbsoluteDirection',
+  AddPropertyToClass('AbsoluteDirection', 'TGLVector', 'GetAbsoluteDirection',
     'SetAbsoluteDirection', '', False, ClassSym, SymbolTable);
   AddPropertyToClass('Position', 'TGLBaseSceneObject', 'GetPosition',
     'SetPosition', '', False, ClassSym, SymbolTable);

+ 37 - 37
Source/DWS.VectorGeometry.pas

@@ -145,13 +145,13 @@ begin
   RegisterComponents('GLScene DWS', [TdwsVectorGeometryUnit]);
 end;
 
-function GetVectorFromInfo(Info: IInfo): TVector;
+function GetVectorFromInfo(Info: IInfo): TGLVector;
 begin
   Result := VectorMake(Info.Element([0]).Value, Info.Element([1]).Value,
     Info.Element([2]).Value, Info.Element([3]).Value);
 end;
 
-procedure SetInfoFromVector(Info: IInfo; vec: TVector);
+procedure SetInfoFromVector(Info: IInfo; vec: TGLVector);
 var
   i: Integer;
 begin
@@ -185,39 +185,39 @@ begin
   FloatSymbol := SymbolTable.FindSymbol('Float');
 
   // Array types
-  SymbolTable.AddSymbol(TStaticArraySymbol.Create('TVector',
+  SymbolTable.AddSymbol(TStaticArraySymbol.Create('TGLVector',
     FloatSymbol, 0, 3));
   SymbolTable.AddSymbol(TStaticArraySymbol.Create('TMatrix',
-    SymbolTable.FindSymbol('TVector'), 0, 3));
+    SymbolTable.FindSymbol('TGLVector'), 0, 3));
 
   // Vector functions
   TVectorMakeFunction.Create(SymbolTable, 'VectorMake',
-    ['x', 'Float', 'y', 'Float', 'z', 'Float', 'w', 'Float'], 'TVector');
+    ['x', 'Float', 'y', 'Float', 'z', 'Float', 'w', 'Float'], 'TGLVector');
   TSetVectorFunction.Create(SymbolTable, 'SetVector',
-    ['@v', 'TVector', 'x', 'Float', 'y', 'Float', 'z', 'Float', 'w',
+    ['@v', 'TGLVector', 'x', 'Float', 'y', 'Float', 'z', 'Float', 'w',
     'Float'], '');
   TVectorAddFunction.Create(SymbolTable, 'VectorAdd',
-    ['v1', 'TVector', 'v2', 'TVector'], 'TVector');
+    ['v1', 'TGLVector', 'v2', 'TGLVector'], 'TGLVector');
   TVectorSubtractFunction.Create(SymbolTable, 'VectorSubtract',
-    ['v1', 'TVector', 'v2', 'TVector'], 'TVector');
+    ['v1', 'TGLVector', 'v2', 'TGLVector'], 'TGLVector');
   TVectorScaleFunction.Create(SymbolTable, 'VectorScale',
-    ['v', 'TVector', 'f', 'Float'], 'TVector');
+    ['v', 'TGLVector', 'f', 'Float'], 'TGLVector');
   TCombineVectorFunction.Create(SymbolTable, 'CombineVector',
-    ['@vr', 'TVector', 'v', 'TVector', '@f', 'Float'], '');
+    ['@vr', 'TGLVector', 'v', 'TGLVector', '@f', 'Float'], '');
   TVectorCombineFunction.Create(SymbolTable, 'VectorCombine',
-    ['v1', 'TVector', 'v2', 'TVector', 'f1', 'Float', 'f2', 'Float'],
-    'TVector');
+    ['v1', 'TGLVector', 'v2', 'TGLVector', 'f1', 'Float', 'f2', 'Float'],
+    'TGLVector');
   TVectorCombine3Function.Create(SymbolTable, 'VectorCombine3',
-    ['v1', 'TVector', 'v2', 'TVector', 'v3', 'TVector', 'f1', 'Float', 'f2',
-    'Float', 'f3', 'Float'], 'TVector');
+    ['v1', 'TGLVector', 'v2', 'TGLVector', 'v3', 'TGLVector', 'f1', 'Float', 'f2',
+    'Float', 'f3', 'Float'], 'TGLVector');
   TVectorDotProductFunction.Create(SymbolTable, 'VectorDotProduct',
-    ['v1', 'TVector', 'v2', 'TVector'], 'Float');
+    ['v1', 'TGLVector', 'v2', 'TGLVector'], 'Float');
   TVectorCrossProductFunction.Create(SymbolTable, 'VectorCrossProduct',
-    ['v1', 'TVector', 'v2', 'TVector'], 'TVector');
+    ['v1', 'TGLVector', 'v2', 'TGLVector'], 'TGLVector');
   TVectorNormalizeFunction.Create(SymbolTable, 'VectorNormalize',
-    ['v', 'TVector'], 'TVector');
+    ['v', 'TGLVector'], 'TGLVector');
   TVectorTransformFunction.Create(SymbolTable, 'VectorTransform',
-    ['v', 'TVector', 'm', 'TMatrix'], 'TVector');
+    ['v', 'TGLVector', 'm', 'TMatrix'], 'TGLVector');
 
   // Matrix function
   TInvertMatrixFunction.Create(SymbolTable, 'InvertMatrix',
@@ -227,12 +227,12 @@ begin
   TMatrixMultiplyFunction.Create(SymbolTable, 'MatrixMultiply',
     ['m1', 'TMatrix', 'm2', 'TMatrix'], 'TMatrix');
   TCreateScaleMatrixFunction.Create(SymbolTable, 'CreateScaleMatrix',
-    ['v', 'TVector'], 'TMatrix');
+    ['v', 'TGLVector'], 'TMatrix');
   TCreateTranslationMatrixFunction.Create(SymbolTable,
-    'CreateTranslationMatrix', ['v', 'TVector'], 'TMatrix');
+    'CreateTranslationMatrix', ['v', 'TGLVector'], 'TMatrix');
   TCreateScaleAndTranslationMatrixFunction.Create(SymbolTable,
-    'CreateScaleAndTranslationMatrix', ['scale', 'TVector', 'offset',
-    'TVector'], 'TMatrix');
+    'CreateScaleAndTranslationMatrix', ['scale', 'TGLVector', 'offset',
+    'TGLVector'], 'TMatrix');
   TCreateRotationMatrixXFunction.Create(SymbolTable, 'CreateRotationMatrixX',
     ['angle', 'Float'], 'TMatrix');
   TCreateRotationMatrixYFunction.Create(SymbolTable, 'CreateRotationMatrixY',
@@ -240,7 +240,7 @@ begin
   TCreateRotationMatrixZFunction.Create(SymbolTable, 'CreateRotationMatrixZ',
     ['angle', 'Float'], 'TMatrix');
   TCreateRotationMatrixFunction.Create(SymbolTable, 'CreateRotationMatrix',
-    ['anAxis', 'TVector', 'angle', 'Float'], 'TMatrix');
+    ['anAxis', 'TGLVector', 'angle', 'Float'], 'TMatrix');
 end;
 
 constructor TdwsVectorGeometryUnit.Create(AOwner: TComponent);
@@ -267,7 +267,7 @@ end;
 
 procedure TVectorAddFunction.Execute;
 var
-  v1, v2, vr: TVector;
+  v1, v2, vr: TGLVector;
 begin
   v1 := GetVectorFromInfo(Info.Vars['v1']);
   v2 := GetVectorFromInfo(Info.Vars['v2']);
@@ -277,7 +277,7 @@ end;
 
 procedure TVectorSubtractFunction.Execute;
 var
-  v1, v2, vr: TVector;
+  v1, v2, vr: TGLVector;
 begin
   v1 := GetVectorFromInfo(Info.Vars['v1']);
   v2 := GetVectorFromInfo(Info.Vars['v2']);
@@ -287,7 +287,7 @@ end;
 
 procedure TVectorScaleFunction.Execute;
 var
-  v, vr: TVector;
+  v, vr: TGLVector;
   f: Single;
 begin
   v := GetVectorFromInfo(Info.Vars['v']);
@@ -298,7 +298,7 @@ end;
 
 procedure TCombineVectorFunction.Execute;
 var
-  vr, v: TVector;
+  vr, v: TGLVector;
   f: Single;
 begin
   vr := GetVectorFromInfo(Info.Vars['vr']);
@@ -311,7 +311,7 @@ end;
 
 procedure TVectorCombineFunction.Execute;
 var
-  v1, v2, vr: TVector;
+  v1, v2, vr: TGLVector;
   f1, f2: Single;
 begin
   v1 := GetVectorFromInfo(Info.Vars['v1']);
@@ -324,7 +324,7 @@ end;
 
 procedure TVectorCombine3Function.Execute;
 var
-  v1, v2, v3, vr: TVector;
+  v1, v2, v3, vr: TGLVector;
   f1, f2, f3: Single;
 begin
   v1 := GetVectorFromInfo(Info.Vars['v1']);
@@ -339,7 +339,7 @@ end;
 
 procedure TVectorDotProductFunction.Execute;
 var
-  v1, v2: TVector;
+  v1, v2: TGLVector;
 begin
   v1 := GetVectorFromInfo(Info.Vars['v1']);
   v2 := GetVectorFromInfo(Info.Vars['v2']);
@@ -348,7 +348,7 @@ end;
 
 procedure TVectorCrossProductFunction.Execute;
 var
-  v1, v2, vr: TVector;
+  v1, v2, vr: TGLVector;
 begin
   v1 := GetVectorFromInfo(Info.Vars['v1']);
   v2 := GetVectorFromInfo(Info.Vars['v2']);
@@ -358,7 +358,7 @@ end;
 
 procedure TVectorNormalizeFunction.Execute;
 var
-  v, vr: TVector;
+  v, vr: TGLVector;
 begin
   v := GetVectorFromInfo(Info.Vars['v']);
   vr := VectorNormalize(v);
@@ -367,7 +367,7 @@ end;
 
 procedure TVectorTransformFunction.Execute;
 var
-  v, vr: TVector;
+  v, vr: TGLVector;
   mat: TMatrix;
 begin
   v := GetVectorFromInfo(Info.Vars['v']);
@@ -406,7 +406,7 @@ end;
 
 procedure TCreateScaleMatrixFunction.Execute;
 var
-  v: TVector;
+  v: TGLVector;
   mr: TMatrix;
 begin
   v := GetVectorFromInfo(Info.Vars['v']);
@@ -416,7 +416,7 @@ end;
 
 procedure TCreateTranslationMatrixFunction.Execute;
 var
-  v: TVector;
+  v: TGLVector;
   mr: TMatrix;
 begin
   v := GetVectorFromInfo(Info.Vars['v']);
@@ -426,7 +426,7 @@ end;
 
 procedure TCreateScaleAndTranslationMatrixFunction.Execute;
 var
-  scale, offset: TVector;
+  scale, offset: TGLVector;
   mr: TMatrix;
 begin
   scale := GetVectorFromInfo(Info.Vars['scale']);
@@ -468,7 +468,7 @@ end;
 procedure TCreateRotationMatrixFunction.Execute;
 var
   angle: Single;
-  anAxis: TVector;
+  anAxis: TGLVector;
   mr: TMatrix;
 begin
   anAxis := GetVectorFromInfo(Info.Vars['anAxis']);

+ 3 - 3
Source/Formats.B3D.pas

@@ -99,7 +99,7 @@ type
     frame: Integer; //where key occurs
     position: TAffineVector; //present if (flags&1)
     scale: TAffineVector; //present if (flags&2)
-    rotation: TVector; //present if (flags&4)
+    rotation: TGLVector; //present if (flags&4)
   end;
 
   PANIMChunk = ^TANIMChunk;
@@ -114,7 +114,7 @@ type
     name: array[0..255] of char; //name of node
     position: TAffineVector;  //local...
     scale: TAffineVector; //coord...
-    rotation: TVector; //system...
+    rotation: TGLVector; //system...
     //array of node elements
     //should be one of meshes or bones, support meshes only for now
     meshes: PMESHChunk; //what 'kind' of node this is - if unrecognized, just use a Blitz3D pivot.
@@ -542,7 +542,7 @@ begin
   Inc(Count, ReadString(aStream, Node^.name, 255));
   Inc(Count, aStream.Read(Node^.position.X, sizeof(TAffineVector)));
   Inc(Count, aStream.Read(Node^.scale.X, sizeof(TAffineVector)));
-  Inc(Count, aStream.Read(Node^.rotation.X, sizeof(TVector)));
+  Inc(Count, aStream.Read(Node^.rotation.X, sizeof(TGLVector)));
   while Count<aChunk.length do
   begin
     Inc(Count, aStream.Read(C, sizeof(TB3DChunk)));

+ 2 - 2
Source/Formats.OCT.pas

@@ -78,7 +78,7 @@ type
     procedure SaveToStream(aStream: TStream);
     procedure AddTriangles(vertexCoords: TAffineVectorList;
       texMapCoords: TAffineVectorList; const textureName: String);
-    procedure AddLight(const lightPos: TAffineVector; const lightColor: TVector;
+    procedure AddLight(const lightPos: TAffineVector; const lightColor: TGLVector;
       lightIntensity: Integer);
   end;
 
@@ -178,7 +178,7 @@ begin
 end;
 
 procedure TOCTFile.AddLight(const lightPos: TAffineVector;
-  const lightColor: TVector; lightIntensity: Integer);
+  const lightColor: TGLVector; lightIntensity: Integer);
 var
   n: Integer;
 begin

+ 1 - 1
Source/Formats.X.pas

@@ -296,7 +296,7 @@ var
     end;
   end;
 
-  function ReadVector4f: TVector;
+  function ReadVector4f: TGLVector;
   var
     str: String;
   begin

+ 2 - 2
Source/GLS.AnimationUtils.pas

@@ -62,7 +62,7 @@ type
 
 
   function Tweener(Current, Target: TAffineVector; Time, Duration: Single; EaseType: TEaseType): TAffineVector; overload;
-  function Tweener(Current, Target: TVector; Time, Duration: Single; EaseType: TEaseType): TVector; overload;
+  function Tweener(Current, Target: TGLVector; Time, Duration: Single; EaseType: TEaseType): TGLVector; overload;
   function Tweener(Current, Target: TVector2f; Time, Duration: Single; EaseType: TEaseType): TVector2f; overload;
   function Tweener(Current, Target: Single; Time, Duration: Single; EaseType: TEaseType): Single; overload;
 
@@ -918,7 +918,7 @@ begin
   end;
 end;
 
-function Tweener(Current, Target: TVector; Time, Duration: Single; EaseType: TEaseType): TVector;
+function Tweener(Current, Target: TGLVector; Time, Duration: Single; EaseType: TEaseType): TGLVector;
 var
   i: integer;
   EaseFunction : TEaseFunction;

+ 11 - 11
Source/GLS.Atmosphere.pas

@@ -90,7 +90,7 @@ type
     // Main rendering procedure.
     procedure DoRender(var rci: TGLRenderContextInfo; renderSelf, renderChildren: Boolean); override;
     // Used to determine extents.
-    function AxisAlignedDimensionsUnscaled : TVector; override;
+    function AxisAlignedDimensionsUnscaled : TGLVector; override;
   end;
 
   TGLAtmosphere = class(TGLCustomAtmosphere)
@@ -165,14 +165,14 @@ end;
 procedure TGLCustomAtmosphere.DoRender(var rci: TGLRenderContextInfo; renderSelf, renderChildren: Boolean);
 var
   radius, invAtmosphereHeight:    Single;
-  sunPos, eyePos, lightingVector: TVector;
-  diskNormal, diskRight, diskUp:  TVector;
+  sunPos, eyePos, lightingVector: TGLVector;
+  diskNormal, diskRight, diskUp:  TGLVector;
 
 
-  function AtmosphereColor(const rayStart, rayEnd: TVector): TColorVector;
+  function AtmosphereColor(const rayStart, rayEnd: TGLVector): TColorVector;
   var
     I, n:     Integer;
-    atmPoint, normal: TVector;
+    atmPoint, normal: TGLVector;
     altColor: TColorVector;
     alt, rayLength, contrib, decay, intensity, invN: Single;
   begin
@@ -214,10 +214,10 @@ var
   end;
 
 
-  function ComputeColor(var rayDest: TVector; mayHitGround: Boolean): TColorVector;
+  function ComputeColor(var rayDest: TGLVector; mayHitGround: Boolean): TColorVector;
   var
-    ai1, ai2, pi1, pi2: TVector;
-    rayVector: TVector;
+    ai1, ai2, pi1, pi2: TGLVector;
+    rayVector: TGLVector;
   begin
     rayVector := VectorNormalize(VectorSubtract(rayDest, eyePos));
     if RayCastSphereIntersect(eyePos, rayVector, NullHmgPoint,
@@ -363,7 +363,7 @@ begin
   if FSun <> nil then FSun.FreeNotification(Self);
 end;
 
-function TGLCustomAtmosphere.AxisAlignedDimensionsUnscaled : TVector;
+function TGLCustomAtmosphere.AxisAlignedDimensionsUnscaled : TGLVector;
 begin
   Result.X := FAtmosphereRadius;
   Result.Y := Result.X;
@@ -431,8 +431,8 @@ begin
     SetLength(sinCache, FSlices + 1);
     PrepareSinCosCache(sinCache, cosCache, 0, 360);
 
-    GetMem(pVertex, 2 * (FSlices + 1) * SizeOf(TVector));
-    GetMem(pColor, 2 * (FSlices + 1) * SizeOf(TVector));
+    GetMem(pVertex, 2 * (FSlices + 1) * SizeOf(TGLVector));
+    GetMem(pColor, 2 * (FSlices + 1) * SizeOf(TGLVector));
   end
   else
     raise EGLAtmosphereException.Create('Slices must be more than0!');

+ 7 - 7
Source/GLS.Behaviours.pas

@@ -89,9 +89,9 @@ type
     procedure DoProgress(const progressTime: TGLProgressTimes); override;
     // Adds time-proportionned acceleration to the speed. 
     procedure ApplyTranslationAcceleration(const deltaTime: double;
-      const accel: TVector);
+      const accel: TGLVector);
     // Applies a timed force to the inertia. If Mass is null, nothing is done. 
-    procedure ApplyForce(const deltaTime: Double; const Force: TVector);
+    procedure ApplyForce(const deltaTime: Double; const Force: TGLVector);
     (*Applies a timed torque to the inertia (yuck!).
       This gets a "yuck!" because it is as false as the rest of the rotation  model. *)
     procedure ApplyTorque(const deltaTime: double;
@@ -101,7 +101,7 @@ type
     (* Bounce speed as if hitting a surface. 
        restitution is the coefficient of restituted energy (1=no energy loss, 0=no bounce). 
 	   The normal is NOT assumed to be normalized. *)
-    procedure SurfaceBounce(const surfaceNormal: TVector; restitution: single);
+    procedure SurfaceBounce(const surfaceNormal: TGLVector; restitution: single);
   published
     property Mass: single read FMass write FMass;
     property TranslationSpeed: TGLCoordinates read FTranslationSpeed write SetTranslationSpeed;
@@ -405,7 +405,7 @@ end;
 
 procedure TGLBInertia.DoProgress(const progressTime: TGLProgressTimes);
 var
-  trnVector: TVector;
+  trnVector: TGLVector;
   speed, newSpeed: double;
 
   procedure ApplyRotationDamping(var rotationSpeed: single);
@@ -465,13 +465,13 @@ begin
 end;
 
 procedure TGLBInertia.ApplyTranslationAcceleration(const deltaTime: double;
-  const accel: TVector);
+  const accel: TGLVector);
 begin
   FTranslationSpeed.AsVector := VectorCombine(FTranslationSpeed.AsVector,
     accel, 1, deltaTime);
 end;
 
-procedure TGLBInertia.ApplyForce(const deltaTime: double; const force: TVector);
+procedure TGLBInertia.ApplyForce(const deltaTime: double; const force: TGLVector);
 begin
   if Mass <> 0 then
     FTranslationSpeed.AsVector :=
@@ -497,7 +497,7 @@ begin
   FTranslationSpeed.Invert;
 end;
 
-procedure TGLBInertia.SurfaceBounce(const surfaceNormal: TVector; restitution: single);
+procedure TGLBInertia.SurfaceBounce(const surfaceNormal: TGLVector; restitution: single);
 var
   f: single;
 begin

+ 4 - 4
Source/GLS.BitmapFont.pas

@@ -190,7 +190,7 @@ type
     procedure RenderString(var ARci: TGLRenderContextInfo;
       const aText: UnicodeString; aAlignment: TAlignment;
       aLayout: TTextLayout; const aColor: TColorVector;
-      aPosition: PVector = nil; aReverseY: boolean = False); overload; virtual;
+      aPosition: PGLVector = nil; aReverseY: boolean = False); overload; virtual;
     (* A simpler canvas-style TextOut helper for RenderString.
        The rendering is reversed along Y by default, to allow direct use
        with TGLCanvas *)
@@ -832,7 +832,7 @@ end;
 
 procedure TGLCustomBitmapFont.RenderString(var ARci: TGLRenderContextInfo;
   const aText: UnicodeString; aAlignment: TAlignment; aLayout: TTextLayout;
-  const aColor: TColorVector; aPosition: PVector = nil;
+  const aColor: TColorVector; aPosition: PGLVector = nil;
   aReverseY: boolean = False);
 
   function AlignmentAdjustement(p: Integer): Single;
@@ -875,7 +875,7 @@ var
   i, chi: Integer;
   pch: PCharInfo;
   TopLeft, BottomRight: TTexPoint;
-  vTopLeft, vBottomRight: TVector;
+  vTopLeft, vBottomRight: TGLVector;
   deltaV, spaceDeltaH: Single;
   currentChar: WideChar;
 begin
@@ -966,7 +966,7 @@ end;
 procedure TGLCustomBitmapFont.TextOut(var rci: TGLRenderContextInfo; X, Y: Single;
   const Text: UnicodeString; const Color: TColorVector);
 var
-  V: TVector;
+  V: TGLVector;
 begin
   V.X := X;
   V.Y := Y;

+ 40 - 40
Source/GLS.CameraController.pas

@@ -75,8 +75,8 @@ type
 
   TGLMoveToPosJob = class(TGLCameraJob)
   private
-    FInitialPos: TVector;
-    FFinalPos: TVector;
+    FInitialPos: TGLVector;
+    FFinalPos: TGLVector;
   public
     X: Double;
     Y: Double;
@@ -85,40 +85,40 @@ type
     procedure Step; override;
     procedure Init; override;
     // Properties.
-    property InitialPos: TVector read FInitialPos;
-    property FinalPos: TVector read FFinalPos;
+    property InitialPos: TGLVector read FInitialPos;
+    property FinalPos: TGLVector read FFinalPos;
   end;
 
   TGLZoomToDistanceJob = class(TGLCameraJob)
   private
-    FInitialPos: TVector;
-    FFinalPos: TVector;
+    FInitialPos: TGLVector;
+    FFinalPos: TGLVector;
   public
     Distance: Double;
     Time: Double;
     procedure Step; override;
     procedure Init; override;
     // Properties.
-    property InitialPos: TVector read FInitialPos;
-    property FinalPos: TVector read FFinalPos;
+    property InitialPos: TGLVector read FInitialPos;
+    property FinalPos: TGLVector read FFinalPos;
   end;
 
   TGLOrbitToPosJob = class(TGLCameraJob)
   private
-    FFinalPos: TVector; // Yep, FFinalPos is stored in relative coordinates.
+    FFinalPos: TGLVector; // Yep, FFinalPos is stored in relative coordinates.
     FRotateSpeed: TVector2f;
-    FCameraUpVector: TVector;
+    FCameraUpVector: TGLVector;
     // Absolute Coordinates, can even be not normalized by radius.
     // Procesed in Init, not used anywhere else.
-    FTargetPosition: TVector;
+    FTargetPosition: TGLVector;
     FTime: Double;
   public
     procedure Step; override;
     procedure Init; override;
     property RotateSpeed: TVector2f read FRotateSpeed;
-    property CameraUpVector: TVector read FCameraUpVector;
-    property TargetPosition: TVector read FTargetPosition;
-    property FinalPos: TVector read FFinalPos;
+    property CameraUpVector: TGLVector read FCameraUpVector;
+    property TargetPosition: TGLVector read FTargetPosition;
+    property FinalPos: TGLVector read FFinalPos;
     property Time: Double read FTime;
   end;
 
@@ -138,11 +138,11 @@ type
 
   TGLOrbitToPosAdvJob = class(TGLCameraJob)
   private
-    FInitialPos: TVector;
-    FFinalPos: TVector;
-    FInitialUp: TVector;
-    FInitialDir: TVector;
-    FRotAxis: TVector;
+    FInitialPos: TGLVector;
+    FFinalPos: TGLVector;
+    FInitialUp: TGLVector;
+    FInitialDir: TGLVector;
+    FRotAxis: TGLVector;
     FAngle: Double;
   public
     X: Double;
@@ -153,15 +153,15 @@ type
     procedure Step; override;
     procedure Init; override;
     // Properties.
-    property InitialPos: TVector read FInitialPos;
-    property InitialUp: TVector read FInitialUp;
-    property InitialDir: TVector read FInitialDir;
-    property FinalPos: TVector read FFinalPos;
+    property InitialPos: TGLVector read FInitialPos;
+    property InitialUp: TGLVector read FInitialUp;
+    property InitialDir: TGLVector read FInitialDir;
+    property FinalPos: TGLVector read FFinalPos;
   end;
 
   TGLSmoothOrbitToPosAdvJob = class(TGLOrbitToPosAdvJob)
   private
-    FPreviousPosition: TVector;
+    FPreviousPosition: TGLVector;
     FSmoothNavigator: TGLNavigatorSmoothChangeVector;
     FRestoreUpVector: boolean;
   public
@@ -212,11 +212,11 @@ type
     function OrbitToPos(X, Y, Z, Time: Double): TGLOrbitToPosJob;
     (* Same as OrbitToPos(), but makes use of SmoothNavigator to make
       sure all camera movements are smooth. *)
-    function OrbitToPosSmooth(const ATargetPosition: TVector;
+    function OrbitToPosSmooth(const ATargetPosition: TGLVector;
       const ATime: Double;
       const ASmoothNavigator: TGLNavigatorSmoothChangeVector;
       const AFNeedToRecalculateZoom: boolean;
-      const ACameraUpVector: PVector = nil): TGLSmoothOrbitToPos;
+      const ACameraUpVector: PGLVector = nil): TGLSmoothOrbitToPos;
     (* Same function as OrbitToPos but support all camera states
       PreferUpAxis value is to setup if function use Camera Up based rotation axis
       instead of Camera direction based rotation axis when destination and camera
@@ -386,9 +386,9 @@ begin
   Result.FTime := Time;
 end;
 
-function TGLCameraController.OrbitToPosSmooth(const ATargetPosition: TVector;
+function TGLCameraController.OrbitToPosSmooth(const ATargetPosition: TGLVector;
   const ATime: Double; const ASmoothNavigator: TGLNavigatorSmoothChangeVector;
-  const AFNeedToRecalculateZoom: boolean; const ACameraUpVector: PVector = nil)
+  const AFNeedToRecalculateZoom: boolean; const ACameraUpVector: PGLVector = nil)
   : TGLSmoothOrbitToPos;
 begin
   Result := TGLSmoothOrbitToPos.Create(FCameraJobList);
@@ -572,7 +572,7 @@ end;
 
 procedure TGLMoveToPosJob.Step;
 var
-  Vect: TVector;
+  Vect: TGLVector;
 begin
   if FElapsedTime < FProceedTime then
   begin
@@ -607,7 +607,7 @@ end;
 
 procedure TGLZoomToDistanceJob.Step;
 var
-  Vect: TVector;
+  Vect: TGLVector;
 begin
   if FElapsedTime < FProceedTime then
   begin
@@ -672,8 +672,8 @@ end;
 
 procedure TGLOrbitToPosAdvJob.Init;
 var
-  Right: TVector;
-  lAbsVectorToTarget: TVector;
+  Right: TGLVector;
+  lAbsVectorToTarget: TGLVector;
 begin
   FProceedTime := Time;
   FInitialPos := VectorSubtract(FJoblist.FController.FCamera.AbsolutePosition,
@@ -725,7 +725,7 @@ end;
 
 procedure TGLOrbitToPosAdvJob.Step;
 var
-  tempUp, tempDir, tempPos: TVector;
+  tempUp, tempDir, tempPos: TGLVector;
 begin
   if FElapsedTime < FProceedTime then
   begin
@@ -771,7 +771,7 @@ end;
 
 procedure TGLSmoothOrbitToPosAdvJob.Init;
 var
-  Right: TVector;
+  Right: TGLVector;
 begin
   FProceedTime := Time;
   FInitialPos := VectorSubtract(FPreviousPosition,
@@ -823,7 +823,7 @@ end;
 
 procedure TGLSmoothOrbitToPosAdvJob.Step;
 var
-  tempUp, tempDir, tempPos: TVector;
+  tempUp, tempDir, tempPos: TGLVector;
 begin
   if FElapsedTime < FProceedTime then
   begin
@@ -889,14 +889,14 @@ end;
 procedure TGLSmoothOrbitToPos.Step;
 var
   lCurrentDistanceToTarget: Single;
-  lTargetPosition: TVector;
+  lTargetPosition: TGLVector;
   lCurrentMatrix: TMatrix;
   lAngle: Single;
-  lAbsTargetPosition: TVector;
+  lAbsTargetPosition: TGLVector;
 
   procedure RestoreDistanceToTarget();
   var
-    lDirection: TVector;
+    lDirection: TGLVector;
   begin
     lDirection := VectorNormalize
       (VectorSubtract(FJoblist.FController.FCameraTarget.AbsolutePosition,
@@ -907,7 +907,7 @@ var
       VectorScale(lDirection, -lCurrentDistanceToTarget));
   end;
 
-  procedure SetTargetValueRelative(const AAbsolutePosition: TVector);
+  procedure SetTargetValueRelative(const AAbsolutePosition: TGLVector);
   begin
     if FJoblist.FController.FCamera.Parent = nil then
       FSmoothNavigator.TargetValue.DirectVector := AAbsolutePosition
@@ -918,7 +918,7 @@ var
 
   procedure ApplyDistanceToResult();
   var
-    lDirection, lNewTargetPosition: TVector;
+    lDirection, lNewTargetPosition: TGLVector;
   begin
     lDirection := VectorNormalize
       (VectorSubtract(FJoblist.FController.FCameraTarget.AbsolutePosition,

+ 15 - 15
Source/GLS.Collision.pas

@@ -164,7 +164,7 @@ end;
 
 function FastCheckPointVsEllipsoid(obj1, obj2: TGLBaseSceneObject): Boolean;
 var
-  v: TVector;
+  v: TGLVector;
 begin
   // calc vector expressed in local coordinates (for obj2)
   v := VectorTransform(obj1.AbsolutePosition, obj2.InvAbsoluteMatrix);
@@ -181,7 +181,7 @@ end;
 
 function FastCheckPointVsCube(obj1, obj2: TGLBaseSceneObject): Boolean;
 var
-  v: TVector;
+  v: TGLVector;
 begin
   // calc vector expressed in local coordinates (for obj2)
   v := VectorTransform(obj1.AbsolutePosition, obj2.InvAbsoluteMatrix);
@@ -205,8 +205,8 @@ end;
 
 function FastCheckSphereVsEllipsoid(obj1, obj2: TGLBaseSceneObject): Boolean;
 var
-  v: TVector;
-  aad: TVector;
+  v: TGLVector;
+  aad: TGLVector;
 begin
   // express in local coordinates (for obj2)
   v := VectorTransform(obj1.AbsolutePosition, obj2.InvAbsoluteMatrix);
@@ -222,8 +222,8 @@ end;
 
 function FastCheckSphereVsCube(obj1, obj2: TGLBaseSceneObject): Boolean;
 var
-  v: TVector;
-  aad: TVector;
+  v: TGLVector;
+  aad: TGLVector;
   r, r2: Single;
 begin
   // express in local coordinates (for cube "obj2")
@@ -314,7 +314,7 @@ end;
 
 function FastCheckEllipsoidVsEllipsoid(obj1, obj2: TGLBaseSceneObject): Boolean;
 var
-  v1, v2: TVector;
+  v1, v2: TGLVector;
 begin
   // express in local coordinates (for obj2)
   v1 := VectorTransform(obj1.AbsolutePosition, obj2.InvAbsoluteMatrix);
@@ -335,8 +335,8 @@ end;
 function FastCheckEllipsoidVsCube(obj1, obj2: TGLBaseSceneObject): Boolean;
 { current implementation assumes Ellipsoid as Sphere }
 var
-  v: TVector;
-  aad: TVector;
+  v: TGLVector;
+  aad: TGLVector;
 begin
   // express in local coordinates (for obj2)
   v := VectorTransform(obj1.AbsolutePosition, obj2.InvAbsoluteMatrix);
@@ -365,7 +365,7 @@ begin
   Result := FastCheckEllipsoidVsCube(obj2, obj1);
 end;
 
-procedure InitArray(v: TVector; var pt: array of TVector);
+procedure InitArray(v: TGLVector; var pt: array of TGLVector);
 // calculate the cube edge points from the axis aligned dimension
 begin
   pt[0] := VectorMake(-v.X, -v.Y, -v.Z, 1);
@@ -383,7 +383,7 @@ function DoCubesIntersectPrim(obj1, obj2: TGLBaseSceneObject): Boolean;
 // else, for each "wire" in then wireframe of the "cube" obj1, check if it
 // intersects with one of the "planes" of "cube" obj2
 
-  function CheckWire(p0, p1, pl: TVector): Boolean;
+  function CheckWire(p0, p1, pl: TGLVector): Boolean;
   // check "wire" line (p0,p1) for intersection with each plane, given from
   // axis aligned dimensions pl
   // - calculate "direction" d: p0 -> p1
@@ -396,7 +396,7 @@ function DoCubesIntersectPrim(obj1, obj2: TGLBaseSceneObject): Boolean;
   // - do the same for opposite plane -pl[I]
   var
     t: Single;
-    d, s: TVector;
+    d, s: TGLVector;
     i, j, k: Integer;
   begin
     Result := true;
@@ -440,10 +440,10 @@ const
   cWires: array [0 .. 11, 0 .. 1] of Integer = ((0, 1), (1, 2), (2, 3), (3, 0),
     (4, 5), (5, 6), (6, 7), (7, 4), (0, 4), (1, 5), (2, 6), (3, 7));
 var
-  pt1: array [0 .. 7] of TVector;
+  pt1: array [0 .. 7] of TGLVector;
   M: TMatrix;
   i: Integer;
-  aad: TVector;
+  aad: TGLVector;
 begin
   Result := true;
   aad := obj2.AxisAlignedDimensionsUnscaled; // DanB experiment
@@ -467,7 +467,7 @@ end;
 
 function FastCheckCubeVsCube(obj1, obj2: TGLBaseSceneObject): Boolean;
 { var
-  aad1,aad2 : TVector;
+  aad1,aad2 : TGLVector;
   D1,D2,D : Double;
 }
 begin

+ 5 - 5
Source/GLS.Color.pas

@@ -44,8 +44,8 @@ type
     procedure DefineProperties(Filer: TFiler); override;
     procedure ReadData(Stream: TStream);
     procedure WriteData(Stream: TStream);
-    function GetHSVA: TVector;
-    procedure SetHSVA(const hsva: TVector);
+    function GetHSVA: TGLVector;
+    procedure SetHSVA(const hsva: TGLVector);
   public
     constructor Create(AOwner: TPersistent); override;
     constructor CreateInitialized(AOwner: TPersistent;
@@ -60,7 +60,7 @@ type
     property Color: TColorVector read FColor write SetColorVector;
     property DirectColor: TColorVector read FColor write SetDirectColorVector;
     property AsWinColor: TColor read GetAsWinColor write SetAsWinColor;
-    property hsva: TVector read GetHSVA write SetHSVA;
+    property hsva: TGLVector read GetHSVA write SetHSVA;
     property DefaultColor: TColorVector read FColor;
   published
     property Red: Single index 0 read GetColorComponent write SetColorComponent
@@ -613,7 +613,7 @@ begin
   NotifyChange(Self);
 end;
 
-function TGLColor.GetHSVA: TVector;
+function TGLColor.GetHSVA: TGLVector;
 var
   delta, min: Single;
 const
@@ -649,7 +649,7 @@ begin
   Result.W := Alpha;
 end;
 
-procedure TGLColor.SetHSVA(const hsva: TVector);
+procedure TGLColor.SetHSVA(const hsva: TGLVector);
 var
   f, hTemp, p, q, t: Single;
 const

+ 5 - 5
Source/GLS.Context.pas

@@ -810,8 +810,8 @@ type
     procedure SetUniform2f(const index: string; const val: TVector2f);
     function GetUniform3f(const index: string): TAffineVector;
     procedure SetUniform3f(const index: string; const val: TAffineVector);
-    function GetUniform4f(const index: string): TVector;
-    procedure SetUniform4f(const index: string; const val: TVector);
+    function GetUniform4f(const index: string): TGLVector;
+    procedure SetUniform4f(const index: string; const val: TGLVector);
     function GetUniformMatrix2fv(const index: string): TMatrix2f;
     procedure SetUniformMatrix2fv(const index: string; const val: TMatrix2f);
     function GetUniformMatrix3fv(const index: string): TMatrix3f;
@@ -865,7 +865,7 @@ type
     property Uniform1f[const index: string]: Single read GetUniform1f write SetUniform1f;
     property Uniform2f[const index: string]: TVector2f read GetUniform2f write SetUniform2f;
     property Uniform3f[const index: string]: TAffineVector read GetUniform3f write SetUniform3f;
-    property Uniform4f[const index: string]: TVector read GetUniform4f write SetUniform4f;
+    property Uniform4f[const index: string]: TGLVector read GetUniform4f write SetUniform4f;
     property UniformMatrix2fv[const index: string]: TMatrix2f read GetUniformMatrix2fv write SetUniformMatrix2fv;
     property UniformMatrix3fv[const index: string]: TMatrix3f read GetUniformMatrix3fv write SetUniformMatrix3fv;
     property UniformMatrix4fv[const index: string]: TMatrix read GetUniformMatrix4fv write SetUniformMatrix4fv;
@@ -3226,12 +3226,12 @@ begin
   gl.Uniform3f(GetUniformLocation(index), val.X, val.Y, val.Z);
 end;
 
-function TGLProgramHandle.GetUniform4f(const index: string): TVector;
+function TGLProgramHandle.GetUniform4f(const index: string): TGLVector;
 begin
   gl.GetUniformfv(GetHandle, GetUniformLocation(index), @Result);
 end;
 
-procedure TGLProgramHandle.SetUniform4f(const index: string; const val: TVector);
+procedure TGLProgramHandle.SetUniform4f(const index: string; const val: TGLVector);
 begin
   gl.Uniform4f(GetUniformLocation(index), val.X, val.Y, val.Z, val.W);
 end;

+ 27 - 27
Source/GLS.Coordinates.pas

@@ -28,17 +28,17 @@ type
   TGLCoordinatesStyle = (csPoint2D, csPoint, csVector, csUnknown);
 
   (* Stores and homogeneous vector.
-    This class is basicly a container for a TVector, allowing proper use of
+    This class is basicly a container for a TGLVector, allowing proper use of
     delphi property editors and editing in the IDE. Vector/Coordinates
     manipulation methods are only minimal.
     Handles dynamic default values to save resource file space.  *)
   TGLCustomCoordinates = class(TGLUpdateAbleObject)
   private
-   FCoords: TVector;
+   FCoords: TGLVector;
     FStyle: TGLCoordinatesStyle; // NOT Persistent
-    FPDefaultCoords: PVector;
+    FPDefaultCoords: PGLVector;
     procedure SetAsPoint2D(const Value: TVector2f);
-    procedure SetAsVector(const Value: TVector);
+    procedure SetAsVector(const Value: TGLVector);
     procedure SetAsAffineVector(const Value: TAffineVector);
     function GetAsAffineVector: TAffineVector; inline;
     function GetAsPoint2D: TVector2f;
@@ -48,18 +48,18 @@ type
     function GetDirectCoordinate(const Index: Integer): Single; inline;
     procedure SetDirectCoordinate(const Index: Integer; const AValue: Single);
   protected
-    procedure SetDirectVector(const V: TVector); inline;
+    procedure SetDirectVector(const V: TGLVector); inline;
     procedure DefineProperties(Filer: TFiler); override;
     procedure ReadData(Stream: TStream);
     procedure WriteData(Stream: TStream);
   public
-    constructor CreateInitialized(AOwner: TPersistent; const AValue: TVector;
+    constructor CreateInitialized(AOwner: TPersistent; const AValue: TGLVector;
       const AStyle: TGLCoordinatesStyle = CsUnknown);
     destructor Destroy; override;
     procedure Assign(Source: TPersistent); override;
     procedure WriteToFiler(Writer: TWriter);
     procedure ReadFromFiler(Reader: TReader);
-    procedure Initialize(const Value: TVector);
+    procedure Initialize(const Value: TGLVector);
     procedure NotifyChange(Sender: TObject); override;
     (* Identifies the coordinates styles.
       The property is NOT persistent, csUnknown by default, and should be
@@ -68,36 +68,36 @@ type
       to detect "misuses" or "misunderstandings" of what the homogeneous
       coordinates system implies. *)
     property Style: TGLCoordinatesStyle read FStyle write FStyle;
-    procedure Translate(const TranslationVector: TVector); overload;
+    procedure Translate(const TranslationVector: TGLVector); overload;
     procedure Translate(const TranslationVector: TAffineVector); overload;
-    procedure AddScaledVector(const Factor: Single; const TranslationVector: TVector); overload;
+    procedure AddScaledVector(const Factor: Single; const TranslationVector: TGLVector); overload;
     procedure AddScaledVector(const Factor: Single; const TranslationVector: TAffineVector); overload;
     procedure Rotate(const AnAxis: TAffineVector; AnAngle: Single); overload;
-    procedure Rotate(const AnAxis: TVector; AnAngle: Single); overload;
+    procedure Rotate(const AnAxis: TGLVector; AnAngle: Single); overload;
     procedure Normalize; inline;
     procedure Invert;
     procedure Scale(Factor: Single);
     function VectorLength: Single;
     function VectorNorm: Single;
     function MaxXYZ: Single;
-    function Equals(const AVector: TVector): Boolean; reintroduce;
+    function Equals(const AVector: TGLVector): Boolean; reintroduce;
     procedure SetVector(const X, Y: Single; Z: Single = 0); overload;
     procedure SetVector(const X, Y, Z, W: Single); overload;
     procedure SetVector(const V: TAffineVector); overload;
-    procedure SetVector(const V: TVector); overload;
+    procedure SetVector(const V: TGLVector); overload;
     procedure SetPoint(const X, Y, Z: Single); overload;
     procedure SetPoint(const V: TAffineVector); overload;
-    procedure SetPoint(const V: TVector); overload;
+    procedure SetPoint(const V: TGLVector); overload;
     procedure SetPoint2D(const X, Y: Single); overload;
     procedure SetPoint2D(const Vector: TAffineVector); overload;
-    procedure SetPoint2D(const Vector: TVector); overload;
+    procedure SetPoint2D(const Vector: TGLVector); overload;
     procedure SetPoint2D(const Vector: TVector2f); overload;
     procedure SetToZero;
     function AsAddress: PSingle; inline;
     (* The coordinates viewed as a vector.
       Assigning a value to this property will trigger notification events,
       if you don't want so, use DirectVector instead. *)
-    property AsVector: TVector read FCoords write SetAsVector;
+    property AsVector: TGLVector read FCoords write SetAsVector;
     (* The coordinates viewed as an affine vector.
       Assigning a value to this property will trigger notification events,
       if you don't want so, use DirectVector instead.
@@ -115,7 +115,7 @@ type
     // The coordinates, in-between brackets, separated by semi-colons.
     property AsString: String read GetAsString;
     // Similar to AsVector but does not trigger notification events
-    property DirectVector: TVector read FCoords write SetDirectVector;
+    property DirectVector: TGLVector read FCoords write SetDirectVector;
     property DirectX: Single index 0 read GetDirectCoordinate write SetDirectCoordinate;
     property DirectY: Single index 1 read GetDirectCoordinate write SetDirectCoordinate;
     property DirectZ: Single index 2 read GetDirectCoordinate write SetDirectCoordinate;
@@ -253,7 +253,7 @@ const
   // ------------------
 
 constructor TGLCustomCoordinates.CreateInitialized(AOwner: TPersistent;
-  const AValue: TVector; const AStyle: TGLCoordinatesStyle = CsUnknown);
+  const AValue: TGLVector; const AStyle: TGLCoordinatesStyle = CsUnknown);
 begin
   Create(AOwner);
   Initialize(AValue);
@@ -267,7 +267,7 @@ begin
   inherited;
 end;
 
-procedure TGLCustomCoordinates.Initialize(const Value: TVector);
+procedure TGLCustomCoordinates.Initialize(const Value: TGLVector);
 begin
   FCoords := Value;
   if VUseDefaultCoordinateSets then
@@ -347,7 +347,7 @@ begin
   inherited NotifyChange(Sender);
 end;
 
-procedure TGLCustomCoordinates.Translate(const TranslationVector: TVector);
+procedure TGLCustomCoordinates.Translate(const TranslationVector: TGLVector);
 begin
   FCoords.X := FCoords.X + TranslationVector.X;
   FCoords.Y := FCoords.Y + TranslationVector.Y;
@@ -365,7 +365,7 @@ begin
 end;
 
 procedure TGLCustomCoordinates.AddScaledVector(const Factor: Single;
-  const TranslationVector: TVector);
+  const TranslationVector: TGLVector);
 var
   F: Single;
 begin
@@ -391,7 +391,7 @@ begin
   NotifyChange(Self);
 end;
 
-procedure TGLCustomCoordinates.Rotate(const AnAxis: TVector; AnAngle: Single);
+procedure TGLCustomCoordinates.Rotate(const AnAxis: TGLVector; AnAngle: Single);
 begin
   RotateVector(FCoords, AnAxis, AnAngle);
   NotifyChange(Self);
@@ -430,7 +430,7 @@ begin
   Result := MaxXYZComponent(FCoords);
 end;
 
-function TGLCustomCoordinates.Equals(const AVector: TVector): Boolean;
+function TGLCustomCoordinates.Equals(const AVector: TGLVector): Boolean;
 begin
   Result := VectorEquals(FCoords, AVector);
 end;
@@ -449,7 +449,7 @@ begin
   NotifyChange(Self);
 end;
 
-procedure TGLCustomCoordinates.SetVector(const V: TVector);
+procedure TGLCustomCoordinates.SetVector(const V: TGLVector);
 begin
   Assert(FStyle = csVector, csVectorHelp);
   GLS.VectorGeometry.SetVector(FCoords, V);
@@ -469,7 +469,7 @@ begin
   FCoords.V[index] := AValue;
 end;
 
-procedure TGLCustomCoordinates.SetDirectVector(const V: TVector);
+procedure TGLCustomCoordinates.SetDirectVector(const V: TGLVector);
 begin
   FCoords.X := V.X;
   FCoords.Y := V.Y;
@@ -503,7 +503,7 @@ begin
   NotifyChange(Self);
 end;
 
-procedure TGLCustomCoordinates.SetPoint(const V: TVector);
+procedure TGLCustomCoordinates.SetPoint(const V: TGLVector);
 begin
   Assert(FStyle = CsPoint, CsPointHelp);
   MakePoint(FCoords, V);
@@ -524,7 +524,7 @@ begin
   NotifyChange(Self);
 end;
 
-procedure TGLCustomCoordinates.SetPoint2D(const Vector: TVector);
+procedure TGLCustomCoordinates.SetPoint2D(const Vector: TGLVector);
 begin
   Assert(FStyle = CsPoint2D, CsPoint2DHelp);
   MakeVector(FCoords, Vector);
@@ -543,7 +543,7 @@ begin
   Result := @FCoords;
 end;
 
-procedure TGLCustomCoordinates.SetAsVector(const Value: TVector);
+procedure TGLCustomCoordinates.SetAsVector(const Value: TGLVector);
 begin
   FCoords := Value;
   case FStyle of

+ 2 - 2
Source/GLS.DCE.pas

@@ -318,7 +318,7 @@ procedure ECAddFreeForm(var MovePack: TECMovePack; FreeForm: TGLBaseSceneObject;
   Solid: Boolean; ObjectID: Integer);
 var
   i, count: Integer;
-  Pos: TVector;
+  Pos: TGLVector;
   Master: TGLBaseSceneObject;
   d1, d2: single;
 begin
@@ -502,7 +502,7 @@ end;
 function RotateVectorByObject(obj: TGLBaseSceneObject; const v: TAffineVector)
   : TAffineVector;
 var
-  v2: TVector;
+  v2: TGLVector;
 begin
   SetVector(v2, v);
   SetVector(result, VectorTransform(v2, obj.Matrix^));

+ 1 - 1
Source/GLS.ExplosionFx.pas

@@ -167,7 +167,7 @@ procedure TGLBExplosionFx.CacheInfo;
 var
   Face: integer;
   p1, p2, p3, v1, v2, posi: TAffineVector;
-  Normal: TVector;
+  Normal: TGLVector;
 begin
   // make sure we can explode this object
   if not OwnerBaseSceneObject.InheritsFrom(TGLBaseMesh) then begin

+ 7 - 7
Source/GLS.Extrusion.pas

@@ -59,7 +59,7 @@ type
     FTriangleCount: Integer;
     FNormalDirection: TGLNormalDirection;
     FParts: TGLRevolutionSolidParts;
-    FAxisAlignedDimensionsCache: TVector;
+    FAxisAlignedDimensionsCache: TGLVector;
   protected
     procedure SetStartAngle(const val: Single);
     procedure SetStopAngle(const val: Single);
@@ -76,7 +76,7 @@ type
     procedure BuildList(var rci: TGLRenderContextInfo); override;
     {Number of triangles used for rendering. }
     property TriangleCount: Integer read FTriangleCount;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
     procedure StructureChanged; override;
   published
     (* Parts of the rotation solid to be generated for rendering.
@@ -122,7 +122,7 @@ type
     FHeight: TGLFloat;
     FMinSmoothAngle: Single;
     FMinSmoothAngleCos: Single;
-    FAxisAlignedDimensionsCache: TVector;
+    FAxisAlignedDimensionsCache: TGLVector;
     procedure SetHeight(const Value: TGLFloat);
     procedure SetMinSmoothAngle(const Value: Single);
   protected
@@ -137,7 +137,7 @@ type
     procedure BuildList(var rci: TGLRenderContextInfo); override;
     // Number of triangles used for rendering.
     property TriangleCount: Integer read FTriangleCount;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
     procedure StructureChanged; override;
   published
     property Parts: TGLExtrusionSolidParts read FParts write SetParts default [espOutside];
@@ -652,7 +652,7 @@ begin
   end;
 end;
 
-function TGLRevolutionSolid.AxisAlignedDimensionsUnscaled: TVector;
+function TGLRevolutionSolid.AxisAlignedDimensionsUnscaled: TGLVector;
 var
   maxRadius: Single;
   maxHeight: Single;
@@ -982,7 +982,7 @@ const
   end;
 
   procedure RenderDisk(row: PRowData;
-    const center: TVector; const normal: TAffineVector;
+    const center: TGLVector; const normal: TAffineVector;
     invert: Boolean; TextCoordTileS: Single);
   var
     i: Integer;
@@ -1734,7 +1734,7 @@ begin
 end;
 
 
-function TGLExtrusionSolid.AxisAlignedDimensionsUnscaled: TVector;
+function TGLExtrusionSolid.AxisAlignedDimensionsUnscaled: TGLVector;
 var
   dMin, dMax: TAffineVector;
 begin

+ 1 - 1
Source/GLS.FBORenderer.pas

@@ -196,7 +196,7 @@ type
     FPostGenerateMipmap: Boolean;
     FMaxSize: Integer;
     FMaxAttachment: Integer;
-    FStoreCamera: array[0..2] of TVector;
+    FStoreCamera: array[0..2] of TGLVector;
     FOnSetTextureTargets: TSetTextureTargetsEvent;
     // implementing IGLMaterialLibrarySupported
     function GetMaterialLibrary: TGLAbstractMaterialLibrary;

+ 16 - 16
Source/GLS.FPSMovement.pas

@@ -36,12 +36,12 @@ uses
 
 type
   TGLContactPoint = record
-    intPoint, intNormal: TVector;
+    intPoint, intNormal: TGLVector;
   end;
 
   TGLCollisionState = class
   public
-    Position: TVector;
+    Position: TGLVector;
     Contact: TGLContactPoint;
     Time: Int64;
   end;
@@ -92,7 +92,7 @@ type
     FScene: TGLScene;
     procedure SetNavigator(value: TGLNavigator);
     procedure setScene(value: TGLScene);
-    procedure DrawArrows(intPoint, intNormal, Ray: TVector;
+    procedure DrawArrows(intPoint, intNormal, Ray: TGLVector;
       Arrow1, Arrow2: TGLArrowLine);
   protected
     procedure Loaded; override;
@@ -109,10 +109,10 @@ type
       (e.g. floor + multiple walls + ceiling) limit iterations to 4 or 5 for now,
       may need to be higher for more complex maps or fast motion *)
     function SphereSweepAndSlide(freeform: TGLFreeForm;
-      behaviour: TGLBFPSMovement; SphereStart: TVector;
-      var Velocity, newPosition: TVector; sphereRadius: single): boolean; overload;
+      behaviour: TGLBFPSMovement; SphereStart: TGLVector;
+      var Velocity, newPosition: TGLVector; sphereRadius: single): boolean; overload;
     procedure SphereSweepAndSlide(behaviour: TGLBFPSMovement;
-      SphereStart: TVector; var Velocity, newPosition: TVector;
+      SphereStart: TGLVector; var Velocity, newPosition: TGLVector;
       sphereRadius: single); overload;
   published
     property Maps: TGLMapCollection read FMaps write FMaps;
@@ -131,7 +131,7 @@ type
       ArrowLine6: TGLArrowLine;
     dirGl: TGLDirectOpenGL;
     tickCount: Int64;
-    oldPosition: TVector;
+    oldPosition: TGLVector;
     FGravityEnabled: boolean;
     FSphereRadius: single;
     FShowArrows: boolean;
@@ -144,7 +144,7 @@ type
     procedure ReadFromFiler(reader: TReader); override;
     procedure Loaded; override;
   public
-    Velocity: TVector;
+    Velocity: TGLVector;
     constructor Create(aOwner: TXCollection); override;
     destructor Destroy; override;
     procedure DoProgress(const progressTime: TGLProgressTimes); override;
@@ -419,7 +419,7 @@ begin
   end;
 end;
 
-procedure TGLFPSMovementManager.DrawArrows(intPoint, intNormal, Ray: TVector;
+procedure TGLFPSMovementManager.DrawArrows(intPoint, intNormal, Ray: TGLVector;
   Arrow1, Arrow2: TGLArrowLine);
 begin
   Arrow1.Position.AsVector := intPoint;
@@ -434,7 +434,7 @@ begin
 end;
 
 procedure TGLFPSMovementManager.SphereSweepAndSlide(behaviour: TGLBFPSMovement;
-  SphereStart: TVector; var Velocity, newPosition: TVector;
+  SphereStart: TGLVector; var Velocity, newPosition: TGLVector;
   sphereRadius: single);
 var
   i: integer;
@@ -450,14 +450,14 @@ begin
 end;
 
 function TGLFPSMovementManager.SphereSweepAndSlide(freeform: TGLFreeForm;
-  behaviour: TGLBFPSMovement; SphereStart: TVector;
-  var Velocity, newPosition: TVector; sphereRadius: single): boolean;
+  behaviour: TGLBFPSMovement; SphereStart: TGLVector;
+  var Velocity, newPosition: TGLVector; sphereRadius: single): boolean;
 var
-  oldPosition, Ray: TVector;
+  oldPosition, Ray: TGLVector;
   vel, slidedistance: single;
-  intPoint, intNormal: TVector;
+  intPoint, intNormal: TGLVector;
   newDirection, newRay, collisionPosition, pointOnSphere,
-    point2OnSphere: TVector;
+    point2OnSphere: TGLVector;
   i: integer;
   CollisionState: TGLCollisionState;
   SphereRadiusRel: single; // mrqzzz
@@ -796,7 +796,7 @@ end;
 
 procedure TGLBFPSMovement.DoProgress(const progressTime: TGLProgressTimes);
 var
-  newPosition: TVector;
+  newPosition: TGLVector;
   CollisionState: TGLCollisionState;
 begin
   inherited DoProgress(progressTime);

+ 1 - 1
Source/GLS.Feedback.pas

@@ -193,7 +193,7 @@ procedure TGLFeedback.BuildMeshFromBuffer(
 var
   value: Single;
   i, j, LCount, skip: Integer;
-  vertex, color, texcoord: TVector;
+  vertex, color, texcoord: TGLVector;
   tempVertices, tempNormals, tempTexCoords: TAffineVectorList;
   tempColors: TVectorList;
   tempIndices: TIntegerList;

+ 5 - 5
Source/GLS.File3DS.pas

@@ -40,7 +40,7 @@ type
   // A record that holds all the information that is used during 3ds animation.
   TGLFile3DSAnimationData = packed record
     ModelMatrix: TMatrix;
-    Color: TVector; // Omni Light.
+    Color: TGLVector; // Omni Light.
     TargetPos: TAffineVector; // Spot Light.
     SpotLightCutOff: Single;
     HotSpot: Single;
@@ -335,7 +335,7 @@ end;
 
 function MakeRotationQuaternion(const axis: TAffineVector; angle: Single): TQuaternion;
 var
-  v: TVector;
+  v: TGLVector;
   halfAngle, invAxisLengthMult: Single;
 begin
   halfAngle := (angle) / 2;
@@ -353,7 +353,7 @@ end;
 function QuaternionToRotateMatrix(const Quaternion: TQuaternion): TMatrix;
 var
   wx, wy, wz, xx, yy, yz, xy, xz, zz, x2, y2, z2: Single;
-  quat: TVector;
+  quat: TGLVector;
   m: TMatrix;
 begin
   quat := VectorMake(Quaternion.ImagPart);
@@ -1506,7 +1506,7 @@ var
   function GetOrAllocateMaterial(materials: TMaterialList; const Name: string): string;
   var
     material: PMaterial3DS;
-    specColor: TVector;
+    specColor: TGLVector;
     matLib: TGLMaterialLibrary;
     libMat, SecondMaterial: TGLLibMaterial;
   begin
@@ -1709,7 +1709,7 @@ var
     I, Index: Integer;
     boolY: Boolean;
     m: TMatrix;
-    v4: TVector;
+    v4: TGLVector;
     factor: Single;
   begin
     with Objects do

+ 8 - 8
Source/GLS.File3DSSceneObjects.pas

@@ -85,8 +85,8 @@ type
     destructor Destroy; override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
     procedure CoordinateChanged(Sender: TGLCustomCoordinates); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
-    function BarycenterAbsolutePosition: TVector; override;
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
+    function BarycenterAbsolutePosition: TGLVector; override;
   published
     property S_Rot3DS: TGLCoordinates4 read FS_Rot3DS;
     property Rot3DS: TGLCoordinates4 read FRot3DS;
@@ -102,7 +102,7 @@ implementation
 
 function MakeRotationQuaternion(const axis: TAffineVector; angle: Single): TQuaternion;
 var
-  v: Tvector;
+  v: TGLVector;
   halfAngle, invAxisLengthMult: Single;
 begin
   halfAngle := (angle) / 2;
@@ -120,7 +120,7 @@ end;
 function QuaternionToRotateMatrix(const Quaternion: TQuaternion): TMatrix;
 var
   wx, wy, wz, xx, yy, yz, xy, xz, zz, x2, y2, z2: Single;
-  quat: TVector;
+  quat: TGLVector;
   m: TMatrix;
 begin
   quat := VectorMake(Quaternion.ImagPart);
@@ -375,7 +375,7 @@ end;
 
 procedure TGLFile3DSFreeForm.ReadMesh(Stream: TStream);
 var
-  v: TVector;
+  v: TGLVector;
   virt: TGLBinaryReader;
 begin
   virt := TGLBinaryReader.Create(Stream);
@@ -395,7 +395,7 @@ end;
 procedure TGLFile3DSFreeForm.WriteMesh(Stream: TStream);
 var
   virt: TGLBinaryWriter;
-  v: TVector;
+  v: TGLVector;
 begin
   virt := TGLBinaryWriter.Create(Stream);
 
@@ -457,7 +457,7 @@ begin
   end;
 end;
 
-function TGLFile3DSFreeForm.AxisAlignedDimensionsUnscaled: TVector;
+function TGLFile3DSFreeForm.AxisAlignedDimensionsUnscaled: TGLVector;
 var
   dMin, dMax: TAffineVector;
   mat: TMatrix;
@@ -476,7 +476,7 @@ begin
   Result.W := 0;
 end;
 
-function TGLFile3DSFreeForm.BarycenterAbsolutePosition: TVector;
+function TGLFile3DSFreeForm.BarycenterAbsolutePosition: TGLVector;
 var
   dMin, dMax: TAffineVector;
   mat: TMatrix;

+ 3 - 3
Source/GLS.FileASE.pas

@@ -96,7 +96,7 @@ type
     FInheritedRotation: TAffineVector;
     FRotationAngle: Single;
     FRotationAxis: TAffineVector;
-    FPosition: TVector;
+    FPosition: TGLVector;
     FScale: TAffineVector;
     FScaleAxisAngle: Single;
     FScaleAxis: TAffineVector;
@@ -117,7 +117,7 @@ type
     property InheritedPosition: TAffineVector read FInheritedPosition;
     property InheritedRotation: TAffineVector read FInheritedRotation;
     property InheritedScale: TAffineVector read FInheritedScale;
-    property Position: TVector read FPosition;
+    property Position: TGLVector read FPosition;
     property RotationAxis: TAffineVector read FRotationAxis;
     property RotationAngle: Single read FRotationAngle;
     property Scale: TAffineVector read FScale;
@@ -676,7 +676,7 @@ procedure CopyASEToMesh(aASEMesh: TGLASEMeshObject; aMesh: TMeshObject; aASEMate
   function GetOrAllocateMaterial(const aIndex, aSubID: Integer): string;
   var
     material : TGLASEMaterial;
-    specColor : TVector;
+    specColor : TGLVector;
     matLib : TGLMaterialLibrary;
     libMat : TGLLibMaterial;
     TM: TGLASEMaterialTextureMap;

+ 1 - 1
Source/GLS.FileLMTS.pas

@@ -85,7 +85,7 @@ type
   TMaterialInfo = record
     FShininess, BShininess: TGLShininess;
     FAmbient, FDiffuse, FEmission, FSpecular, BAmbient, BDiffuse, BEmission,
-      BSpecular: TVector;
+      BSpecular: TGLVector;
     ImageAlpha: TGLTextureImageAlpha;
     magFilter: TGLMagFilter;
     minFilter: TGLMinFilter;

+ 2 - 2
Source/GLS.FileOBJ.pas

@@ -88,7 +88,7 @@ type
     procedure Prepare;
     function MaterialStringProperty(const materialName, propertyName: string): string;
     function MaterialVectorProperty(const materialName, propertyName: string;
-      const defaultValue: TVector): TVector;
+      const defaultValue: TGLVector): TGLVector;
   end;
 
 var
@@ -1350,7 +1350,7 @@ begin
 end;
 
 function TGLMTLFile.MaterialVectorProperty(const materialName, propertyName: string;
-  const defaultValue: TVector): TVector;
+  const defaultValue: TGLVector): TGLVector;
 var
   i: Integer;
   sl: TStringList;

+ 7 - 7
Source/GLS.FireFX.pas

@@ -36,8 +36,8 @@ uses
 type
   PFireParticle = ^TFireParticle;
   TFireParticle = record
-    Position: TVector;
-    Speed: TVector;
+    Position: TGLVector;
+    Speed: TGLVector;
     Alpha: Single;
     TimeToLive, LifeLength: Single;
   end;
@@ -394,7 +394,7 @@ procedure TGLFireFXManager.IsotropicExplosion(minInitialSpeed, maxInitialSpeed,
   nbParticles: Integer = -1);
 var
   n: Integer;
-  tmp, refPos: TVector;
+  tmp, refPos: TGLVector;
 begin
   if nbParticles < 0 then
     n := MaxInt
@@ -429,7 +429,7 @@ procedure TGLFireFXManager.RingExplosion(minInitialSpeed, maxInitialSpeed, lifeB
   nbParticles: Integer = -1);
 var
   n: Integer;
-  tmp, refPos: TVector;
+  tmp, refPos: TGLVector;
   fx, fy, d: Single;
 begin
   if nbParticles < 0 then
@@ -467,7 +467,7 @@ procedure TGLFireFXManager.CalcFire(deltaTime: Double;
 var
   N, I: Integer;
   Fdelta: Single;
-  tmp, refPos: TVector;
+  tmp, refPos: TGLVector;
 begin
   // Process live stuff
   N := 0;
@@ -528,7 +528,7 @@ end;
 
 procedure TGLFireFXManager.AffParticle3d(Color2: TColorVector; const mat: TMatrix);
 var
-  vx, vy: TVector;
+  vx, vy: TGLVector;
   i: Integer;
 begin
   for i := 0 to 2 do
@@ -653,7 +653,7 @@ procedure TGLBFireFX.Render(var rci: TGLRenderContextInfo);
 var
   n: Integer;
   i: Integer;
-  innerColor: TVector;
+  innerColor: TGLVector;
   lastTr: TAffineVector;
   distList: TSingleList;
   objList: TList;

+ 52 - 52
Source/GLS.GeomObjects.pas

@@ -98,9 +98,9 @@ type
     constructor Create(AOwner: TComponent); override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
     procedure Assign(Source: TPersistent); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
-    function RayCastIntersect(const rayStart, rayVector: TVector;
-      intersectPoint: PVector = nil; intersectNormal: PVector = nil) : Boolean; override;
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
+    function RayCastIntersect(const rayStart, rayVector: TGLVector;
+      intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil) : Boolean; override;
   published
     //  Allows defining a "hole" in the disk 
     property InnerRadius: Single read FInnerRadius write SetInnerRadius;
@@ -158,9 +158,9 @@ type
     constructor Create(AOwner: TComponent); override;
     procedure Assign(Source: TPersistent); override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
-    function RayCastIntersect(const rayStart, rayVector: TVector;
-      intersectPoint: PVector = nil; intersectNormal: PVector = nil)
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
+    function RayCastIntersect(const rayStart, rayVector: TGLVector;
+      intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil)
       : Boolean; override;
   published
     property Parts: TGLConeParts read FParts write SetParts
@@ -186,11 +186,11 @@ type
     constructor Create(AOwner: TComponent); override;
     procedure Assign(Source: TPersistent); override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
-    function RayCastIntersect(const rayStart, rayVector: TVector;
-      intersectPoint: PVector = nil; intersectNormal: PVector = nil)
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
+    function RayCastIntersect(const rayStart, rayVector: TGLVector;
+      intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil)
       : Boolean; override;
-    procedure Align(const startPoint, endPoint: TVector); overload;
+    procedure Align(const startPoint, endPoint: TGLVector); overload;
     procedure Align(const startObj, endObj: TGLBaseSceneObject); overload;
     procedure Align(const startPoint, endPoint: TAffineVector); overload;
   published
@@ -221,11 +221,11 @@ type
     constructor Create(AOwner: TComponent); override;
     procedure Assign(Source: TPersistent); override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
-    function RayCastIntersect(const rayStart, rayVector: TVector;
-      intersectPoint: PVector = nil; intersectNormal: PVector = nil)
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
+    function RayCastIntersect(const rayStart, rayVector: TGLVector;
+      intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil)
       : Boolean; override;
-    procedure Align(const startPoint, endPoint: TVector); overload;
+    procedure Align(const startPoint, endPoint: TGLVector); overload;
     procedure Align(const startObj, endObj: TGLBaseSceneObject); overload;
     procedure Align(const startPoint, endPoint: TAffineVector); overload;
   published
@@ -258,9 +258,9 @@ type
     constructor Create(AOwner: TComponent); override;
     procedure Assign(Source: TPersistent); override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
-    function RayCastIntersect(const rayStart, rayVector: TVector;
-      intersectPoint: PVector = nil; intersectNormal: PVector = nil)
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
+    function RayCastIntersect(const rayStart, rayVector: TGLVector;
+      intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil)
       : Boolean; override;
   published
     property BottomInnerRadius: Single read FBottomInnerRadius
@@ -294,9 +294,9 @@ type
   public
     constructor Create(AOwner: TComponent); override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
-    function RayCastIntersect(const rayStart, rayVector: TVector;
-      intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean; override;
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
+    function RayCastIntersect(const rayStart, rayVector: TGLVector;
+      intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean; override;
   published
     property MajorRadius: Single read FMajorRadius write SetMajorRadius;
     property MinorRadius: Single read FMinorRadius write SetMinorRadius;
@@ -471,7 +471,7 @@ type
     function TopDepth: Single;
     function TopWidth: Single;
     function AxisAlignedBoundingBoxUnscaled: TAABB;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
   published
     property ApexHeight: Single read FApexHeight write SetApexHeight stored False;
     property BaseDepth: Single read FBaseDepth write SetBaseDepth stored False;
@@ -490,7 +490,7 @@ type
     FGrid: Cardinal;
   public
     constructor Create(AOwner: TComponent); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
     procedure DoRender(var ARci: TGLRenderContextInfo;
       ARenderSelf, ARenderChildren: Boolean); override;
@@ -797,7 +797,7 @@ begin
   inherited Assign(Source);
 end;
 
-function TGLDisk.AxisAlignedDimensionsUnscaled: TVector;
+function TGLDisk.AxisAlignedDimensionsUnscaled: TGLVector;
 var
   r: Single;
 begin
@@ -805,13 +805,13 @@ begin
   Result := VectorMake(r, r, 0);
 end;
 
-function TGLDisk.RayCastIntersect(const rayStart, rayVector: TVector;
-  intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean;
+function TGLDisk.RayCastIntersect(const rayStart, rayVector: TGLVector;
+  intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean;
 var
-  ip: TVector;
+  ip: TGLVector;
   d: Single;
   angle, beginAngle, endAngle: Single;
-  localIntPoint: TVector;
+  localIntPoint: TGLVector;
 begin
   Result := False;
   if SweepAngle > 0 then
@@ -1038,7 +1038,7 @@ begin
   inherited Assign(Source);
 end;
 
-function TGLCone.AxisAlignedDimensionsUnscaled: TVector;
+function TGLCone.AxisAlignedDimensionsUnscaled: TGLVector;
 var
   r: Single;
 begin
@@ -1052,10 +1052,10 @@ begin
   Result := 0;
 end;
 
-function TGLCone.RayCastIntersect(const rayStart, rayVector: TVector;
-  intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean;
+function TGLCone.RayCastIntersect(const rayStart, rayVector: TGLVector;
+  intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean;
 var
-  ip, localRayStart, localRayVector: TVector;
+  ip, localRayStart, localRayVector: TGLVector;
   poly: array [0 .. 2] of Double;
   roots: TDoubleArray;
   minRoot: Double;
@@ -1210,7 +1210,7 @@ begin
   inherited Assign(Source);
 end;
 
-function TGLCylinder.AxisAlignedDimensionsUnscaled: TVector;
+function TGLCylinder.AxisAlignedDimensionsUnscaled: TGLVector;
 var
   r, r1: Single;
 begin
@@ -1222,12 +1222,12 @@ begin
   // ScaleVector(Result, Scale.AsVector);
 end;
 
-function TGLCylinder.RayCastIntersect(const rayStart, rayVector: TVector;
-  intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean;
+function TGLCylinder.RayCastIntersect(const rayStart, rayVector: TGLVector;
+  intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean;
 const
   cOne: Single = 1;
 var
-  locRayStart, locRayVector, ip: TVector;
+  locRayStart, locRayVector, ip: TGLVector;
   poly: array [0 .. 2] of Double;
   roots: TDoubleArray;
   minRoot: Double;
@@ -1342,7 +1342,7 @@ begin
     SetLength(roots, 0);
 end;
 
-procedure TGLCylinder.Align(const startPoint, endPoint: TVector);
+procedure TGLCylinder.Align(const startPoint, endPoint: TGLVector);
 var
   dir: TAffineVector;
 begin
@@ -1567,7 +1567,7 @@ begin
   inherited Assign(Source);
 end;
 
-function TGLCapsule.AxisAlignedDimensionsUnscaled: TVector;
+function TGLCapsule.AxisAlignedDimensionsUnscaled: TGLVector;
 var
   r, r1: Single;
 begin
@@ -1579,12 +1579,12 @@ begin
   // ScaleVector(Result, Scale.AsVector);
 end;
 
-function TGLCapsule.RayCastIntersect(const rayStart, rayVector: TVector;
-  intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean;
+function TGLCapsule.RayCastIntersect(const rayStart, rayVector: TGLVector;
+  intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean;
 const
   cOne: Single = 1;
 var
-  locRayStart, locRayVector, ip: TVector;
+  locRayStart, locRayVector, ip: TGLVector;
   poly: array [0 .. 2] of Double;
   roots: TDoubleArray;
   minRoot: Double;
@@ -1698,7 +1698,7 @@ begin
     SetLength(roots, 0);
 end;
 
-procedure TGLCapsule.Align(const startPoint, endPoint: TVector);
+procedure TGLCapsule.Align(const startPoint, endPoint: TGLVector);
 var
   dir: TAffineVector;
 begin
@@ -1816,7 +1816,7 @@ begin
   inherited Assign(Source);
 end;
 
-function TGLAnnulus.AxisAlignedDimensionsUnscaled: TVector;
+function TGLAnnulus.AxisAlignedDimensionsUnscaled: TGLVector;
 var
   r, r1: Single;
 begin
@@ -1827,12 +1827,12 @@ begin
   Result := VectorMake(r, 0.5 * FHeight, r);
 end;
 
-function TGLAnnulus.RayCastIntersect(const rayStart, rayVector: TVector;
-  intersectPoint, intersectNormal: PVector): Boolean;
+function TGLAnnulus.RayCastIntersect(const rayStart, rayVector: TGLVector;
+  intersectPoint, intersectNormal: PGLVector): Boolean;
 const
   cOne: Single = 1;
 var
-  locRayStart, locRayVector, ip: TVector;
+  locRayStart, locRayVector, ip: TGLVector;
   poly: array [0 .. 2] of Double;
   t, tr2, invRayVector1: Single;
   tPlaneMin, tPlaneMax: Single;
@@ -2318,7 +2318,7 @@ begin
   end;
 end;
 
-function TGLTorus.AxisAlignedDimensionsUnscaled: TVector;
+function TGLTorus.AxisAlignedDimensionsUnscaled: TGLVector;
 var
   r, r1: Single;
 begin
@@ -2327,15 +2327,15 @@ begin
   Result := VectorMake(r + r1, r + r1, r1); // Danb
 end;
 
-function TGLTorus.RayCastIntersect(const rayStart, rayVector: TVector;
-  intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean;
+function TGLTorus.RayCastIntersect(const rayStart, rayVector: TGLVector;
+  intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean;
 var
   i: integer;
   fRo2, fRi2, fDE, fVal, r, nearest: Double;
   polynom: array [0 .. 4] of Double;
   polyRoots: TDoubleArray;
-  localStart, localVector: TVector;
-  vi, vc: TVector;
+  localStart, localVector: TGLVector;
+  vi, vc: TGLVector;
 begin
   // compute coefficients of quartic polynomial
   fRo2 := Sqr(MajorRadius);
@@ -3388,7 +3388,7 @@ begin
   end;
 end;
 
-function TGLFrustrum.AxisAlignedDimensionsUnscaled: TVector;
+function TGLFrustrum.AxisAlignedDimensionsUnscaled: TGLVector;
 begin
   Result.X := FBaseWidth * 0.5;
   Result.Y := FHeight * 0.5;
@@ -3475,7 +3475,7 @@ begin
   FGrid := 5;
 end;
 
-function TGLTeapot.AxisAlignedDimensionsUnscaled: TVector;
+function TGLTeapot.AxisAlignedDimensionsUnscaled: TGLVector;
 begin
   SetVector(Result, 0.55, 0.25, 0.35);
 end;

+ 26 - 26
Source/GLS.GeometryBB.pas

@@ -22,7 +22,7 @@ type
   PHmgBoundingBox = ^THmgBoundingBox;
 
   THmgBoundingBox = record
-    BBox: array [0 .. 7] of TVector;
+    BBox: array [0 .. 7] of TGLVector;
   end;
 
   //  Structure for storing Axis Aligned Bounding Boxes 
@@ -74,8 +74,8 @@ function BoundingBoxesAreEqual(const ABoundingBox1, ABoundingBox2: PHmgBoundingB
 function AddBB(var C1: THmgBoundingBox; const C2: THmgBoundingBox): THmgBoundingBox;
 procedure AddAABB(var Aabb: TAABB; const Aabb1: TAABB);
 
-procedure SetBB(var C: THmgBoundingBox; const V: TVector);
-procedure SetAABB(var Bb: TAABB; const V: TVector); inline;
+procedure SetBB(var C: THmgBoundingBox; const V: TGLVector);
+procedure SetAABB(var Bb: TAABB; const V: TGLVector); inline;
 
 procedure BBTransform(var C: THmgBoundingBox; const M: TMatrix);
 procedure AABBTransform(var Bb: TAABB; const M: TMatrix);
@@ -91,7 +91,7 @@ function BBMaxZ(const C: THmgBoundingBox): Single;
 // Resize the AABB if necessary to include p.
 procedure AABBInclude(var Bb: TAABB; const P: TAffineVector);
 // Make an AABB that is formed by sweeping a sphere (or AABB) from Start to Dest 
-procedure AABBFromSweep(var SweepAABB: TAABB; const Start, Dest: TVector; const Radius: Single);
+procedure AABBFromSweep(var SweepAABB: TAABB; const Start, Dest: TGLVector; const Radius: Single);
 (* Returns the intersection AABB of two AABBs. 
   If the AABBs don't intersect, will return a degenerated AABB (plane, line or point). *)
 function AABBIntersection(const Aabb1, Aabb2: TAABB): TAABB;
@@ -103,12 +103,12 @@ function AABBToBB(const AnAABB: TAABB): THmgBoundingBox; overload;
 function AABBToBB(const AnAABB: TAABB; const M: TMatrix): THmgBoundingBox; overload;
 //  Adds delta to min and max of the AABB. 
 procedure OffsetAABB(var Aabb: TAABB; const Delta: TAffineVector); overload;
-procedure OffsetAABB(var Aabb: TAABB; const Delta: TVector); overload;
+procedure OffsetAABB(var Aabb: TAABB; const Delta: TGLVector); overload;
 //  Adds delta to min and max of the BB.
 procedure OffsetBB(var Bb: THmgBoundingBox; const Delta: TAffineVector); overload;
-procedure OffsetBB(var Bb: THmgBoundingBox; const Delta: TVector); overload;
+procedure OffsetBB(var Bb: THmgBoundingBox; const Delta: TGLVector); overload;
 // The same as above but uses AddPoint() instead of AddVector().
-procedure OffsetBBPoint(var Bb: THmgBoundingBox; const Delta: TVector); overload;
+procedure OffsetBBPoint(var Bb: THmgBoundingBox; const Delta: TGLVector); overload;
 (* Determines if two AxisAlignedBoundingBoxes intersect.
   The matrices are the ones that convert one point to the other's AABB system *)
 function IntersectAABBs(const Aabb1, Aabb2: TAABB; const M1To2, M2To1: TMatrix): Boolean; overload;
@@ -124,7 +124,7 @@ function AABBFitsInAABBAbsolute(const Aabb1, Aabb2: TAABB): Boolean;
 
 // Checks if a point "p" is inside an AABB
 function PointInAABB(const P: TAffineVector; const Aabb: TAABB): Boolean; overload;
-function PointInAABB(const P: TVector; const Aabb: TAABB): Boolean; overload;
+function PointInAABB(const P: TGLVector; const Aabb: TAABB): Boolean; overload;
 
 // Checks if a plane (given by the normal+d) intersects the AABB
 function PlaneIntersectAABB(const Normal: TAffineVector; D: Single; const Aabb: TAABB): Boolean;
@@ -154,7 +154,7 @@ procedure AABBToBSphere(const AABB: TAABB; var BSphere: TBSphere);
 // Convert a BSphere to an AABB 
 procedure BSphereToAABB(const BSphere: TBSphere; var AABB: TAABB); overload;
 function BSphereToAABB(const Center: TAffineVector; Radius: Single): TAABB; overload;
-function BSphereToAABB(const Center: TVector; Radius: Single): TAABB; overload;
+function BSphereToAABB(const Center: TGLVector; Radius: Single): TAABB; overload;
 
 // Determines to which extent one AABB contains another AABB 
 function AABBContainsAABB(const MainAABB, TestAABB: TAABB): TSpaceContains;
@@ -184,10 +184,10 @@ function AABBToClipRect(const Aabb: TAABB; const ModelViewProjection: TMatrix;
   ViewportSizeX, ViewportSizeY: Integer): TClipRect;
 
 // Finds the intersection between a ray and an axis aligned bounding box. 
-function RayCastAABBIntersect(const RayOrigin, RayDirection: TVector;
+function RayCastAABBIntersect(const RayOrigin, RayDirection: TGLVector;
   const Aabb: TAABB; out TNear, TFar: Single): Boolean; overload;
-function RayCastAABBIntersect(const RayOrigin, RayDirection: TVector;
-  const Aabb: TAABB; IntersectPoint: PVector = nil): Boolean; overload;
+function RayCastAABBIntersect(const RayOrigin, RayDirection: TGLVector;
+  const Aabb: TAABB; IntersectPoint: PGLVector = nil): Boolean; overload;
 
 type
   TPlanIndices = array [0 .. 3] of Integer;
@@ -281,7 +281,7 @@ begin
     Aabb.Max.Z := Aabb1.Max.Z;
 end;
 
-procedure SetBB(var C: THmgBoundingBox; const V: TVector);
+procedure SetBB(var C: THmgBoundingBox; const V: TGLVector);
 begin
   SetPlanBB(C, 0, V.X);
   SetPlanBB(C, 1, -V.X);
@@ -291,7 +291,7 @@ begin
   SetPlanBB(C, 5, -V.Z);
 end;
 
-procedure SetAABB(var Bb: TAABB; const V: TVector);
+procedure SetAABB(var Bb: TAABB; const V: TGLVector);
 begin
   Bb.Max.X := Abs(V.X);
   Bb.Max.Y := Abs(V.Y);
@@ -408,7 +408,7 @@ begin
     Bb.Max.Z := P.Z;
 end;
 
-procedure AABBFromSweep(var SweepAABB: TAABB; const Start, Dest: TVector;
+procedure AABBFromSweep(var SweepAABB: TAABB; const Start, Dest: TGLVector;
   const Radius: Single);
 begin
   if Start.X < Dest.X then
@@ -504,7 +504,7 @@ begin
   AddVector(Aabb.Max, Delta);
 end;
 
-procedure OffsetAABB(var Aabb: TAABB; const Delta: TVector);
+procedure OffsetAABB(var Aabb: TAABB; const Delta: TGLVector);
 begin
   AddVector(Aabb.Min, Delta);
   AddVector(Aabb.Max, Delta);
@@ -513,14 +513,14 @@ end;
 procedure OffsetBB(var Bb: THmgBoundingBox; const Delta: TAffineVector);
 var
   I: Integer;
-  TempVector: TVector;
+  TempVector: TGLVector;
 begin
   TempVector := VectorMake(Delta, 0);
   for I := 0 to 7 do
     AddVector(Bb.BBox[I], TempVector);
 end;
 
-procedure OffsetBB(var Bb: THmgBoundingBox; const Delta: TVector);
+procedure OffsetBB(var Bb: THmgBoundingBox; const Delta: TGLVector);
 var
   I: Integer;
 begin
@@ -528,7 +528,7 @@ begin
     AddVector(Bb.BBox[I], Delta);
 end;
 
-procedure OffsetBBPoint(var Bb: THmgBoundingBox; const Delta: TVector);
+procedure OffsetBBPoint(var Bb: THmgBoundingBox; const Delta: TGLVector);
 var
   I: Integer;
 begin
@@ -577,7 +577,7 @@ var
   Planes2: array [0 .. 5] of THmgPlane;
   I, T: Integer;
   V: TVertex;
-  P: TVector;
+  P: TGLVector;
 begin
   Result := False;
 
@@ -706,7 +706,7 @@ begin
     (P.Z >= Aabb.Min.Z);
 end;
 
-function PointInAABB(const P: TVector; const Aabb: TAABB): Boolean;
+function PointInAABB(const P: TGLVector; const Aabb: TAABB): Boolean;
 begin
   Result := (P.X <= Aabb.Max.X) and
     (P.X >= Aabb.Min.X) and (P.Y <= Aabb.Max.Y) and
@@ -1040,7 +1040,7 @@ begin
   Result.Max := VectorAdd(Center, Radius);
 end;
 
-function BSphereToAABB(const Center: TVector; Radius: Single): TAABB;
+function BSphereToAABB(const Center: TGLVector; Radius: Single): TAABB;
 begin
   SetVector(Result.Min, VectorSubtract(Center, Radius));
   SetVector(Result.Max, VectorAdd(Center, Radius));
@@ -1292,7 +1292,7 @@ function AABBToClipRect(const Aabb: TAABB; const ModelViewProjection: TMatrix;
   ViewportSizeX, ViewportSizeY: Integer): TClipRect;
 var
   I: Integer;
-  V, Vt: TVector;
+  V, Vt: TGLVector;
   Minmax: array [0 .. 1] of PAffineVector;
 begin
   Minmax[0] := @Aabb.Min;
@@ -1322,7 +1322,7 @@ begin
   end;
 end;
 
-function RayCastAABBIntersect(const RayOrigin, RayDirection: TVector;
+function RayCastAABBIntersect(const RayOrigin, RayDirection: TGLVector;
   const Aabb: TAABB; out TNear, TFar: Single): Boolean; overload;
 const
   Infinity = 1.0 / 0.0;
@@ -1370,8 +1370,8 @@ begin
   Result := True;
 end;
 
-function RayCastAABBIntersect(const RayOrigin, RayDirection: TVector;
-  const Aabb: TAABB; IntersectPoint: PVector = nil): Boolean; overload;
+function RayCastAABBIntersect(const RayOrigin, RayDirection: TGLVector;
+  const Aabb: TAABB; IntersectPoint: PGLVector = nil): Boolean; overload;
 var
   TNear, TFar: Single;
 begin

+ 25 - 25
Source/GLS.Gizmo.pas

@@ -139,9 +139,9 @@ type
     gpRotateGizmo);
 
   TGLGizmoAcceptEvent = procedure(Sender: TObject; var Obj: TGLBaseSceneObject;
-    var Accept: Boolean; var Dimensions: TVector) of object;
+    var Accept: Boolean; var Dimensions: TGLVector) of object;
   TGLGizmoUpdateEvent = procedure(Sender: TObject; Obj: TGLBaseSceneObject;
-    Axis: TGLGizmoAxis; Operation: TGLGizmoOperation; var Vector: TVector)
+    Axis: TGLGizmoAxis; Operation: TGLGizmoOperation; var Vector: TGLVector)
     of object;
 
   TGLGizmoPickMode = (pmGetPickedObjects, pmRayCast);
@@ -149,7 +149,7 @@ type
   TGLGizmoRayCastHitData = class(TPersistent)
   public
     Obj: TGLBaseSceneObject;
-    Point: TVector;
+    Point: TGLVector;
   end;
 
   TGLGizmoPickCube = class(TGLCube)
@@ -204,8 +204,8 @@ type
     Rx, Ry: Integer;
     dglEnable, dglDisable, dgtEnable, dgtDisable, dgcEnable, dgcDisable,
       dglaEnable, dglaDisable, dgliEnable, dgliDisable: TGLDirectOpenGL;
-    LastMousePos: TVector;
-    ObjDimensions: TVector;
+    LastMousePos: TGLVector;
+    ObjDimensions: TGLVector;
     FOnBeforeSelect: TGLGizmoAcceptEvent;
     FOnBeforeUpdate: TGLGizmoUpdateEvent;
     FOnSelectionLost: TNotifyEvent;
@@ -225,7 +225,7 @@ type
     procedure SetExcludeObjectsList(const AValue: TStrings);
     procedure DirectGlDisable(Sender: TObject; var Rci: TGLRenderContextInfo);
     procedure DirectGlEnable(Sender: TObject; var Rci: TGLRenderContextInfo);
-    function MouseWorldPos(const X, Y: Integer): TVector;
+    function MouseWorldPos(const X, Y: Integer): TGLVector;
     function CheckObjectInExcludeList(const Obj: TGLBaseSceneObject): Boolean;
     procedure UpdateVisibleInfoLabels;
     procedure SetGLGizmoThickness(const Value: Single);
@@ -246,9 +246,9 @@ type
     procedure ViewerMouseDown(const X, Y: Integer);
     procedure ViewerMouseUp(const X, Y: Integer);
     procedure UpdateGizmo; overload;
-    procedure UpdateGizmo(const NewDimensions: TVector); overload;
+    procedure UpdateGizmo(const NewDimensions: TGLVector); overload;
     procedure SetVisible(const AValue: Boolean);
-    function GetPickedObjectPoint(const Obj: TGLBaseSceneObject): TVector;
+    function GetPickedObjectPoint(const Obj: TGLBaseSceneObject): TGLVector;
     procedure LooseSelection; virtual;
     procedure UndoAdd(const AObject: TGLCustomSceneObject);
     property RootGizmo: TGLBaseSceneObject read FRootGizmo write SetRootGizmo;
@@ -922,7 +922,7 @@ begin
     Rci.GLStates.Enable(StDepthTest);
 end;
 
-function TGLGizmo.GetPickedObjectPoint(const Obj: TGLBaseSceneObject): TVector;
+function TGLGizmo.GetPickedObjectPoint(const Obj: TGLBaseSceneObject): TGLVector;
 var
   T: Integer;
   R: TGLGizmoRayCastHitData;
@@ -942,7 +942,7 @@ function TGLGizmo.InternalGetPickedObjects(const X1, Y1, X2, Y2: Integer;
   const GuessCount: Integer): TGLPickList;
 var
   T: Integer;
-  RayStart, RayVector, IPoint, INormal: TVector;
+  RayStart, RayVector, IPoint, INormal: TGLVector;
   O: TGLBaseSceneObject;
   Dist: Single;
   HitData: TGLGizmoRayCastHitData;
@@ -1107,9 +1107,9 @@ begin
   end;
 end;
 
-function TGLGizmo.MouseWorldPos(const X, Y: Integer): TVector;
+function TGLGizmo.MouseWorldPos(const X, Y: Integer): TGLVector;
 var
-  V: TVector;
+  V: TGLVector;
   InvertedY: Integer;
 begin
   InvertedY := Viewer.Height - Y;
@@ -1158,7 +1158,7 @@ end;
 procedure TGLGizmo.ViewerMouseMove(const X, Y: Integer);
 var
   PickList: TGLPickList;
-  MousePos: TVector;
+  MousePos: TGLVector;
 
   function IndexOf(Obj: TGLBaseSceneObject): Integer;
   var
@@ -1173,7 +1173,7 @@ var
       end;
   end;
 
-  function LightLine(const Line: TGLLines; const Dark: TVector;
+  function LightLine(const Line: TGLLines; const Dark: TGLVector;
     const Axis: TGLGizmoAxis; AlterStyle: Boolean = False): Boolean;
   var
     PickObj: TGLBaseSceneObject;
@@ -1215,7 +1215,7 @@ var
     end;
   end;
 
-  function LightTorus(const Torus: TGLGizmoPickTorus; const Dark: TVector;
+  function LightTorus(const Torus: TGLGizmoPickTorus; const Dark: TGLVector;
     const Axis: TGLGizmoAxis; AlterStyle: Boolean = False): Boolean;
   begin
     if IndexOf(Torus) > -1 then
@@ -1240,7 +1240,7 @@ var
     end;
   end;
 
-  function LightCube(const Cube: TGLCube; const Dark: TVector;
+  function LightCube(const Cube: TGLCube; const Dark: TGLVector;
     const Axis: TGLGizmoAxis; AlterStyle: Boolean = False): Boolean;
   begin
     if IndexOf(Cube) > -1 then
@@ -1265,10 +1265,10 @@ var
     end;
   end;
 
-  procedure OpeMove(MousePos: TVector);
+  procedure OpeMove(MousePos: TGLVector);
   var
-    Vec1, Vec2: TVector;
-    QuantizedMousePos, QuantizedMousePos2: TVector;
+    Vec1, Vec2: TGLVector;
+    QuantizedMousePos, QuantizedMousePos2: TGLVector;
     T: Integer;
   begin
     for T := 0 to 3 do
@@ -1310,7 +1310,7 @@ var
 
   procedure OpeRotate(const X, Y: Integer);
   var
-    Vec1: TVector;
+    Vec1: TGLVector;
     RotV: TAffineVector;
     Pmat: TMatrix;
 
@@ -1390,10 +1390,10 @@ var
     end;
   end;
 
-  procedure OpeScale(const MousePos: TVector);
+  procedure OpeScale(const MousePos: TGLVector);
   var
-    Vec1, Vec2: TVector;
-    QuantizedMousePos, QuantizedMousePos2: TVector;
+    Vec1, Vec2: TGLVector;
+    QuantizedMousePos, QuantizedMousePos2: TGLVector;
     T: Integer;
   begin
     for T := 0 to 3 do
@@ -1528,7 +1528,7 @@ var
   Pick: TGLPickList;
   I: Integer;
   Accept: Boolean;
-  Dimensions: TVector;
+  Dimensions: TGLVector;
   GotPick: Boolean;
   PickedObj: TGLBaseSceneObject;
 begin
@@ -1685,7 +1685,7 @@ begin
   _GZOrootVisibleInfoLabels.Scale.AsVector := VectorMake(D, D, D);
 end;
 
-procedure TGLGizmo.UpdateGizmo(const NewDimensions: TVector);
+procedure TGLGizmo.UpdateGizmo(const NewDimensions: TGLVector);
 begin
   ObjDimensions := NewDimensions;
   UpdateGizmo;

+ 28 - 28
Source/GLS.GizmoEx.pas

@@ -48,7 +48,7 @@ type
 
   TGLGizmoExObjectItem = class(TCollectionItem)
   private
-    FOldAutoScaling: TVector;
+    FOldAutoScaling: TGLVector;
     FEffectedObject: TGLBaseSceneObject;
     FParentOldObject: TGLBaseSceneObject;
     FIndexOldObject: Integer;
@@ -318,7 +318,7 @@ type
     fLastCursorPos: TPoint;
     fChangeRate: TAffineVector;   //total rotate angle
     FEnableLoopCursorMoving: Boolean;
-    lastMousePos: TVector;
+    lastMousePos: TGLVector;
     FOnUpdate: TNotifyEvent;
     FOnSelect: TGLGizmoExAcceptEvent;
     FOnOperationChange: TNotifyEvent;
@@ -347,7 +347,7 @@ type
     procedure SetHistoryStepsCount(aValue: Integer);
     procedure SetExcludeObjectsList(const AValue: TStrings);
     procedure SetExcludeClassNameList(const AValue: TStrings);
-    function MouseWorldPos(const X, Y: Integer): TVector;
+    function MouseWorldPos(const X, Y: Integer): TGLVector;
     function CheckObjectInExcludeList(const Obj: TGLBaseSceneObject): Boolean;
     function CheckClassNameInExcludeList(const Obj: TGLBaseSceneObject): Boolean;
     procedure UpdateVisibleInfoLabels;
@@ -2110,7 +2110,7 @@ procedure TGLGizmoEx.InternalRender(Sender: TObject; var rci: TGLRenderContextIn
   var
     I, J:    Byte;
     BB:      THmgBoundingBox;
-    AVector: TVector;
+    AVector: TGLVector;
   begin
     if aObject = nil then
       Exit;
@@ -2134,7 +2134,7 @@ procedure TGLGizmoEx.InternalRender(Sender: TObject; var rci: TGLRenderContextIn
 
   //test#12 result is positive, but only for 2d
   //
-  procedure ShowText(const Text: UnicodeString; Position: Tvector; Scale: TVector; Color: Tvector);
+  procedure ShowText(const Text: UnicodeString; Position: TGLVector; Scale: TGLVector; Color: TGLVector);
   var
     FLayout: TTextLayout;
     FAlignment: TAlignment;
@@ -2897,7 +2897,7 @@ function TGLGizmoEx.InternalGetPickedObjects(const x1, y1, x2, y2: Integer; cons
   var
     t:    Integer;
     dist: Single;
-    rayStart, rayVector, iPoint, iNormal: TVector;
+    rayStart, rayVector, iPoint, iNormal: TGLVector;
   begin
     SetVector(rayStart, Viewer.Camera.AbsolutePosition);
     SetVector(rayVector, Viewer.Buffer.ScreenToVector(AffineVectorMake(X, Viewer.Height - Y, 0)));
@@ -3073,9 +3073,9 @@ begin
 
 end;
 
-function TGLGizmoEx.MouseWorldPos(const X, Y: Integer): TVector;
+function TGLGizmoEx.MouseWorldPos(const X, Y: Integer): TGLVector;
 var
-  v: TVector;
+  v: TGLVector;
   InvertedY: Integer;
 begin
 
@@ -3100,7 +3100,7 @@ end;
 
 procedure TGLGizmoEx.ActivatingElements(PickList: TGLPickList);
 
-  procedure ActlightRotateLine(const line: TGLLines; const dark: TVector);
+  procedure ActlightRotateLine(const line: TGLLines; const dark: TGLVector);
   var
     v: TVector4f;
     I: Integer;
@@ -3122,7 +3122,7 @@ procedure TGLGizmoEx.ActivatingElements(PickList: TGLPickList);
     end;
   end;
 
-  procedure DeActlightRotateLine(const line: TGLLines; const dark: TVector);
+  procedure DeActlightRotateLine(const line: TGLLines; const dark: TGLVector);
   var
     v: TVector4f;
     I: Integer;
@@ -3151,7 +3151,7 @@ procedure TGLGizmoEx.ActivatingElements(PickList: TGLPickList);
     line.Options := [];
   end;
 
-  procedure DeActlightLine(const line: TGLLines; const dark: TVector; alterStyle: Boolean = False);
+  procedure DeActlightLine(const line: TGLLines; const dark: TGLVector; alterStyle: Boolean = False);
   begin
     with  line.LineColor do
       if (AsWinColor = FSelectedColor.AsWinColor) then
@@ -3163,13 +3163,13 @@ procedure TGLGizmoEx.ActivatingElements(PickList: TGLPickList);
       end;
   end;
 
-  procedure ActlightRotateArrowLine(const line: TGLLines; Color: TVector);
+  procedure ActlightRotateArrowLine(const line: TGLLines; Color: TGLVector);
   begin
     line.LineColor.color := Color;
     line.Options := [];
   end;
 
-  procedure DeActlightRotateArrowLine(const line: TGLLines; const dark: TVector);
+  procedure DeActlightRotateArrowLine(const line: TGLLines; const dark: TGLVector);
   begin
     if not VectorEquals(line.LineColor.Color, dark) then
     begin
@@ -3194,19 +3194,19 @@ procedure TGLGizmoEx.ActivatingElements(PickList: TGLPickList);
     FlatText.ModulateColor.Color := FSelectedColor.Color;
   end;
 
-  procedure DeActlightText(const FlatText: TGLFlatText; const dark: TVector);
+  procedure DeActlightText(const FlatText: TGLFlatText; const dark: TGLVector);
   begin
     with FlatText.ModulateColor do
       if AsWinColor = FSelectedColor.AsWinColor then
         Color := dark;
   end;
 
-  procedure ActlightTextRotate(const FlatText: TGLFlatText; Color: TVector);
+  procedure ActlightTextRotate(const FlatText: TGLFlatText; Color: TGLVector);
   begin
     FlatText.ModulateColor.Color := Color;
   end;
 
-  procedure DeActlightTextRotate(const FlatText: TGLFlatText; const dark: TVector);
+  procedure DeActlightTextRotate(const FlatText: TGLFlatText; const dark: TGLVector);
   begin
     with FlatText.ModulateColor do
       if not VectorEquals(Color, dark) then
@@ -3458,7 +3458,7 @@ end;
 procedure TGLGizmoEx.ViewerMouseMove(const X, Y: Integer);
 var
   pickList:  TGLPickList;
-  mousePos:  TVector;
+  mousePos:  TGLVector;
   includeCh: Boolean;
 
   function FindParent(parent: TGLBaseSceneObject): Boolean;
@@ -3472,10 +3472,10 @@ var
     end;
   end;
 
-  procedure OpeMove(mousePos: TVector);
+  procedure OpeMove(mousePos: TGLVector);
   var
-    vec1, vec2: TVector;
-    quantizedMousePos, quantizedMousePos2: TVector;
+    vec1, vec2: TGLVector;
+    quantizedMousePos, quantizedMousePos2: TGLVector;
     I: Integer;
   begin
     if VectorNorm(lastMousePos) = 0 then
@@ -3558,12 +3558,12 @@ var
 
   procedure OpeRotate(const X, Y: Integer);
   var
-    vec1: TVector;
+    vec1: TGLVector;
     rotV: TAffineVector;
     pmat: TMatrix;
     I:    Integer;
     IncludeCh: Boolean;
-    v:    TVector;
+    v:    TGLVector;
   begin
 
     vec1.X := 0;
@@ -3657,10 +3657,10 @@ var
       end;
   end;
 
-  procedure OpeScale(const mousePos: TVector);
+  procedure OpeScale(const mousePos: TGLVector);
   var
-    vec1, vec2: TVector;
-    quantizedMousePos, quantizedMousePos2: TVector;
+    vec1, vec2: TGLVector;
+    quantizedMousePos, quantizedMousePos2: TGLVector;
     t: Integer;
   begin
     if VectorNorm(lastMousePos) = 0 then
@@ -3881,9 +3881,9 @@ end;
 
 procedure TGLGizmoEx.ViewerMouseDown(const X, Y: Integer);
 
-  function SetInitialDiskPostition(aObject, aObject2: TGLCustomSceneObject): TVector;
+  function SetInitialDiskPostition(aObject, aObject2: TGLCustomSceneObject): TGLVector;
   var
-    rayStart, rayVector, iPoint, iNormal: TVector;
+    rayStart, rayVector, iPoint, iNormal: TGLVector;
   begin
     if (Viewer = nil) then
       Exit;
@@ -4042,7 +4042,7 @@ end;
 procedure TGLGizmoEx.UpdateGizmo;
 var
   d: Single;
-  v: TVector;
+  v: TGLVector;
   I: Integer;
 begin
   if not Assigned(RootGizmo)   or

+ 18 - 18
Source/GLS.Imposter.pas

@@ -72,22 +72,22 @@ type
     FAspectRatio: Single;
     FModulated: Boolean;
   protected
-    FVx, FVy: TVector;
-    FStaticOffset: TVector;
-    FQuad: array[0..3] of TVector;
+    FVx, FVy: TGLVector;
+    FStaticOffset: TGLVector;
+    FQuad: array[0..3] of TGLVector;
     FStaticScale: Single;
     procedure PrepareTexture(var rci: TGLRenderContextInfo); virtual;
-    procedure RenderQuad(const texExtents, objPos: TVector; size: Single);
+    procedure RenderQuad(const texExtents, objPos: TGLVector; size: Single);
   public
     constructor Create(aBuilder: TGLImposterBuilder); virtual;
     destructor Destroy; override;
     procedure BeginRender(var rci: TGLRenderContextInfo); virtual;
     procedure Render(var rci: TGLRenderContextInfo;
-      const objPos, localCameraPos: TVector;
+      const objPos, localCameraPos: TGLVector;
       size: Single); virtual;
     procedure EndRender(var rci: TGLRenderContextInfo); virtual;
     procedure RenderOnce(var rci: TGLRenderContextInfo;
-      const objPos, localCameraPos: TVector;
+      const objPos, localCameraPos: TGLVector;
       size: Single);
     property AspectRatio: Single read FAspectRatio write FAspectRatio;
     property Builder: TGLImposterBuilder read FBuilder;
@@ -244,7 +244,7 @@ type
   TStaticImposter = class(TImposter)
   public
     procedure Render(var rci: TGLRenderContextInfo;
-      const objPos, localCameraPos: TVector;
+      const objPos, localCameraPos: TGLVector;
       size: Single); override;
   end;
 
@@ -499,17 +499,17 @@ begin
 end;
 
 procedure TImposter.Render(var rci: TGLRenderContextInfo;
-  const objPos, localCameraPos: TVector;
+  const objPos, localCameraPos: TGLVector;
   size: Single);
 const
-  cQuadTexExtents: TVector = (X:0; Y:0; Z:1; W:1);
+  cQuadTexExtents: TGLVector = (X:0; Y:0; Z:1; W:1);
 begin
   RenderQuad(cQuadTexExtents, objPos, size);
 end;
 
-procedure TImposter.RenderQuad(const texExtents, objPos: TVector; size: Single);
+procedure TImposter.RenderQuad(const texExtents, objPos: TGLVector; size: Single);
 var
-  pos: TVector;
+  pos: TGLVector;
 begin
   VectorCombine(objPos, FQuad[0], size, pos);
   gl.TexCoord2f(texExtents.Z, texExtents.W);
@@ -532,7 +532,7 @@ begin
 end;
 
 procedure TImposter.RenderOnce(var rci: TGLRenderContextInfo;
-  const objPos, localCameraPos: TVector;
+  const objPos, localCameraPos: TGLVector;
   size: Single);
 begin
   BeginRender(rci);
@@ -930,14 +930,14 @@ end;
 // ----------
 
 procedure TStaticImposter.Render(var rci: TGLRenderContextInfo;
-  const objPos, localCameraPos: TVector;
+  const objPos, localCameraPos: TGLVector;
   size: Single);
 var
   azimuthAngle: Single;
   i: Integer;
   x, y: Word;
   bestCorona: TGLStaticImposterBuilderCorona;
-  texExtents: TVector;
+  texExtents: TGLVector;
   tdx, tdy: Single;
   siBuilder: TGLStaticImposterBuilder;
 begin // inherited; exit;
@@ -1120,7 +1120,7 @@ procedure TGLStaticImposterBuilder.Render(var rci: TGLRenderContextInfo;
 var
   i, coronaIdx, curSample: Integer;
   radius: Single;
-  cameraDirection, cameraOffset: TVector;
+  cameraDirection, cameraOffset: TGLVector;
   xDest, xSrc, yDest, ySrc: Integer;
   corona: TGLStaticImposterBuilderCorona;
   fx, fy, yOffset: Single;
@@ -1303,7 +1303,7 @@ var
   i, size, Left, Top, Width, Height : Integer;
   imposter : TGLImposter;
   mat, projection, modelview : TMatrix;
-  BackColor, pos, temp : TVector;
+  BackColor, pos, temp : TGLVector;
   rad : Single;
   AABB : TAABB;
 begin
@@ -1454,7 +1454,7 @@ end;
 procedure TGLImposter.DoRender(var ARci: TGLRenderContextInfo;
   ARenderSelf, ARenderChildren: Boolean);
 var
-  camPos: TVector;
+  camPos: TGLVector;
   imposter: TImposter;
 begin
   if ARenderSelf and Assigned(Builder) and Assigned(ImpostoredObject) then
@@ -1503,7 +1503,7 @@ begin
 end;
 
 {
-function TGLImposter.AxisAlignedDimensionsUnscaled : TVector;
+function TGLImposter.AxisAlignedDimensionsUnscaled : TGLVector;
 begin
    Result:=NullHMGVector;
 end;

+ 2 - 2
Source/GLS.Isosurface.pas

@@ -1496,7 +1496,7 @@ var
   i: Integer;
   vx1, vx2, vx3: TGLVertexData;
 
-  function GetNrmColor(Nrm: TAffineVector): TVector;
+  function GetNrmColor(Nrm: TAffineVector): TGLVector;
   begin
     Result.V[0] := 0;
     if Nrm.V[0] > 0.0 then
@@ -1524,7 +1524,7 @@ var
     Result.V[3] := 0.3
   end;
 
-  function GetColor(H: TxScalarValue): TVector;
+  function GetColor(H: TxScalarValue): TGLVector;
   begin
     Result := VectorMake(0.890, 0.855, 0.788, Alpha)
     (*

+ 5 - 5
Source/GLS.MaterialEx.pas

@@ -738,7 +738,7 @@ type
     function GetFloat: Single; virtual;
     function GetVec2: TVector2f; virtual;
     function GetVec3: TVector3f; virtual;
-    function GetVec4: TVector; virtual;
+    function GetVec4: TGLVector; virtual;
     function GetInt: TGLint; virtual;
     function GetIVec2: TVector2i; virtual;
     function GetIVec3: TVector3i; virtual;
@@ -787,7 +787,7 @@ type
     function GetFloat: Single; override;
     function GetVec2: TVector2f; override;
     function GetVec3: TVector3f; override;
-    function GetVec4: TVector; override;
+    function GetVec4: TGLVector; override;
     function GetInt: Integer; override;
     function GetIVec2: TVector2i; override;
     function GetIVec3: TVector3i; override;
@@ -3180,7 +3180,7 @@ end;
 procedure TGLMultitexturingProperties.Apply(var ARci: TGLRenderContextInfo);
 var
   N, U: Integer;
-  LDir: TVector;
+  LDir: TGLVector;
 begin
   if FEnabled then
   begin
@@ -5775,7 +5775,7 @@ begin
   FillChar(Result, SizeOf(Result), $00);
 end;
 
-function TGLAbstractShaderUniform.GetVec4: TVector;
+function TGLAbstractShaderUniform.GetVec4: TGLVector;
 begin
   FillChar(Result, SizeOf(Result), $00);
 end;
@@ -5985,7 +5985,7 @@ begin
   gl.GetUniformfv(GetProgram, FLocation, @Result);
 end;
 
-function TGLShaderUniform.GetVec4: TVector;
+function TGLShaderUniform.GetVec4: TGLVector;
 begin
   gl.GetUniformfv(GetProgram, FLocation, @Result);
 end;

+ 6 - 6
Source/GLS.MaterialMultiProxy.pas

@@ -125,8 +125,8 @@ type
     destructor Destroy; override;
     procedure Assign(Source: TPersistent); override;
     procedure DoRender(var rci: TGLRenderContextInfo; renderSelf, renderChildren: Boolean); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
-    function RayCastIntersect(const rayStart, rayVector: TVector; intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean; override;
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
+    function RayCastIntersect(const rayStart, rayVector: TGLVector; intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean; override;
     function GenerateSilhouette(const silhouetteParameters: TGLSilhouetteParameters): TGLSilhouette; override;
   published
     property MasterObjects: TGLMaterialMultiProxyMasters read FMasterObjects write SetMasterObjects;
@@ -451,7 +451,7 @@ begin
     Result := nil;
 end;
 
-function TGLMaterialMultiProxy.AxisAlignedDimensionsUnscaled: TVector;
+function TGLMaterialMultiProxy.AxisAlignedDimensionsUnscaled: TGLVector;
 var
   Master: TGLBaseSceneObject;
 begin
@@ -462,10 +462,10 @@ begin
     Result := inherited AxisAlignedDimensionsUnscaled;
 end;
 
-function TGLMaterialMultiProxy.RayCastIntersect(const rayStart, rayVector: TVector;
-  intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean;
+function TGLMaterialMultiProxy.RayCastIntersect(const rayStart, rayVector: TGLVector;
+  intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean;
 var
-  localRayStart, localRayVector: TVector;
+  localRayStart, localRayVector: TGLVector;
   Master: TGLBaseSceneObject;
 begin
   Master := PrimaryMaster;

+ 4 - 4
Source/GLS.Mesh.pas

@@ -50,7 +50,7 @@ type
 
   TGLVertexData = packed record
     textCoord: TTexPoint;
-    color: TVector;
+    color: TGLVector;
     normal: TAffineVector;
     coord: TVertex;
   end;
@@ -159,7 +159,7 @@ type
     FVertices: TGLVertexList;
     FMode: TGLMeshMode;
     FVertexMode: TGLVertexMode;
-    FAxisAlignedDimensionsCache: TVector;
+    FAxisAlignedDimensionsCache: TGLVector;
   protected
     procedure SetMode(AValue: TGLMeshMode);
     procedure SetVertices(AValue: TGLVertexList);
@@ -172,7 +172,7 @@ type
     procedure BuildList(var rci: TGLRenderContextInfo); override;
     procedure CalcNormals(Frontface: TGLFaceWinding);
     property Vertices: TGLVertexList read FVertices write SetVertices;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
     procedure StructureChanged; override;
     function Length: Single;
     function Area: Single;
@@ -743,7 +743,7 @@ begin
     inherited Assign(Source);
 end;
 
-function TGLMesh.AxisAlignedDimensionsUnscaled: TVector;
+function TGLMesh.AxisAlignedDimensionsUnscaled: TGLVector;
 var
   dMin, dMax: TAffineVector;
 begin

+ 6 - 6
Source/GLS.MeshBSP.pas

@@ -29,13 +29,13 @@ uses
 type
 
   TBSPCullingSphere = record
-    position: TVector;
+    position: TGLVector;
     radius: Single;
   end;
 
   TBSPRenderContextInfo = record
     // Local coordinates of the camera (can be a vector or point)
-    cameraLocal: TVector;
+    cameraLocal: TGLVector;
     rci: PRenderContextInfo;
     faceGroups: TList;
     cullingSpheres: array of TBSPCullingSphere;
@@ -85,7 +85,7 @@ type
       of tree balancing (structurally speaking, not polygon-wise). *)
     function AverageDepth: Single;
     // Traverses the tree to the given point and returns the node index.
-    function FindNodeByPoint(const aPoint: TVector): TFGBSPNode;
+    function FindNodeByPoint(const aPoint: TGLVector): TFGBSPNode;
     (*  Rendering sort mode.
       This sort mode can currently *not* blend with the sort by materials
       flag, default mode is rsBackToFront.
@@ -278,10 +278,10 @@ var
   renderNode: Boolean;
   camNode: TFGBSPNode;
 
-  procedure AbsoluteSphereToLocal(const absPos: TVector; absRadius: Single;
+  procedure AbsoluteSphereToLocal(const absPos: TGLVector; absRadius: Single;
     var local: TBSPCullingSphere);
   var
-    v: TVector;
+    v: TGLVector;
   begin
     local.position := Owner.Owner.AbsoluteToLocal(absPos);
     SetVector(v, absRadius, absRadius, absRadius, 0);
@@ -500,7 +500,7 @@ begin
   end;
 end;
 
-function TBSPMeshObject.FindNodeByPoint(const aPoint: TVector): TFGBSPNode;
+function TBSPMeshObject.FindNodeByPoint(const aPoint: TGLVector): TFGBSPNode;
 
   function Traverse(nodeIndex: Integer): Integer;
   var

+ 1 - 1
Source/GLS.MeshLines.pas

@@ -602,7 +602,7 @@ end;
 
 procedure TGLMeshLines.DrawCircle(Radius: Single);
 var
-  inner,outer,p1,p2: TVector;
+  inner,outer,p1,p2: TGLVector;
   i: Integer;
   a: Single;
   lUp: TAffineVector;

+ 3 - 3
Source/GLS.Mirror.pas

@@ -79,7 +79,7 @@ type
       ARenderSelf, ARenderChildren: Boolean); override;
     procedure BuildList(var ARci: TGLRenderContextInfo); override;
     procedure Assign(Source: TPersistent); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
   published
     // Selects the object to mirror. If nil, the whole scene is mirrored 
     property MirrorObject: TGLBaseSceneObject read FMirrorObject write
@@ -142,7 +142,7 @@ var
   refMat, curMat, ModelMat: TMatrix;
   clipPlane: TDoubleHmgPlane;
   bgColor: TColorVector;
-  cameraPosBackup, cameraDirectionBackup: TVector;
+  cameraPosBackup, cameraDirectionBackup: TGLVector;
   CurrentBuffer: TGLSceneBuffer;
 begin
   if FRendering then
@@ -411,7 +411,7 @@ begin
 end;
 
 
-function TGLMirror.AxisAlignedDimensionsUnscaled: TVector;
+function TGLMirror.AxisAlignedDimensionsUnscaled: TGLVector;
 begin
   Result := VectorMake(0.5 * Abs(FWidth),
     0.5 * Abs(FHeight), 0);

+ 16 - 16
Source/GLS.Movement.pas

@@ -34,15 +34,15 @@ type
 
   TGLPathNode = class (TCollectionItem)
   private
-    FPosition: TVector;
-    FScale: TVector;
-    FRotation: TVector;
-    FDirection: TVector;
-    FUp: TVector;
+    FPosition: TGLVector;
+    FScale: TGLVector;
+    FRotation: TGLVector;
+    FDirection: TGLVector;
+    FUp: TGLVector;
     FSpeed: single;
-    procedure SetPositionAsVector(const Value: TVector);
-    procedure SetRotationAsVector(const Value: TVector);
-    procedure SetScaleAsVector(const Value: TVector);
+    procedure SetPositionAsVector(const Value: TGLVector);
+    procedure SetRotationAsVector(const Value: TGLVector);
+    procedure SetScaleAsVector(const Value: TGLVector);
     function GetPositionCoordinate(const Index: Integer): TGLFloat;
     procedure SetPositionCoordinate(const Index: integer; const AValue: TGLFloat);
     function GetRotationCoordinate(const Index: Integer): TGLFloat; inline;
@@ -69,11 +69,11 @@ type
     {Warning: does not take speed into account. }
     function EqualNode(const aNode: TGLPathNode): boolean;
     {Rotation.X means PitchAngle, Rotation.Y means TurnAngle, Rotation.Z means RollAngle.}
-    property RotationAsVector: TVector Read FRotation Write SetRotationAsVector;
-    property PositionAsVector: TVector Read FPosition Write SetPositionAsVector;
-    property ScaleAsVector: TVector Read FScale Write SetScaleAsVector;
-    property UpAsVector: TVector read FUp write FUp;
-    property DirectionAsVector: TVector read FDirection write FDirection;
+    property RotationAsVector: TGLVector Read FRotation Write SetRotationAsVector;
+    property PositionAsVector: TGLVector Read FPosition Write SetPositionAsVector;
+    property ScaleAsVector: TGLVector Read FScale Write SetScaleAsVector;
+    property UpAsVector: TGLVector read FUp write FUp;
+    property DirectionAsVector: TGLVector read FDirection write FDirection;
   published
     property X: TGLFloat index 0 Read GetPositionCoordinate Write SetPositionCoordinate;
     property Y: TGLFloat index 1 Read GetPositionCoordinate Write SetPositionCoordinate;
@@ -303,19 +303,19 @@ begin
   inherited Destroy;
 end;
 
-procedure TGLPathNode.SetPositionAsVector(const Value: TVector);
+procedure TGLPathNode.SetPositionAsVector(const Value: TGLVector);
 begin
   FPosition := Value;
     (Collection as TGLPathNodes).NotifyChange;
 end;
 
-procedure TGLPathNode.SetRotationAsVector(const Value: TVector);
+procedure TGLPathNode.SetRotationAsVector(const Value: TGLVector);
 begin
   FRotation := Value;
     (Collection as TGLPathNodes).NotifyChange;
 end;
 
-procedure TGLPathNode.SetScaleAsVector(const Value: TVector);
+procedure TGLPathNode.SetScaleAsVector(const Value: TGLVector);
 begin
   FScale := Value;
     (Collection as TGLPathNodes).NotifyChange;

+ 5 - 5
Source/GLS.MultiPolygon.pas

@@ -121,7 +121,7 @@ type
     FContours: TGLContours;
     FOutline: TGLPolygonList;
     FContoursNormal: TAffineVector;
-    FAxisAlignedDimensionsCache: TVector;
+    FAxisAlignedDimensionsCache: TGLVector;
     procedure SetContours(const Value: TGLContours);
     function GetPath(i: Integer): TGLContourNodes;
     procedure SetPath(i: Integer; const value: TGLContourNodes);
@@ -139,12 +139,12 @@ type
     procedure Assign(Source: TPersistent); override;
     procedure AddNode(const i: Integer; const coords: TGLCoordinates); overload;
     procedure AddNode(const i: Integer; const X, Y, Z: TGLfloat); overload;
-    procedure AddNode(const i: Integer; const value: TVector); overload;
+    procedure AddNode(const i: Integer; const value: TGLVector); overload;
     procedure AddNode(const i: Integer; const value: TAffineVector); overload;
     property Path[i: Integer]: TGLContourNodes read GetPath write SetPath;
     property Outline: TGLPolygonList read GetOutline;
     property ContoursNormal: TAffineVector read FContoursNormal write SetContoursNormal;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
     procedure StructureChanged; override;
   published
     property Contours: TGLContours read FContours write SetContours;
@@ -422,7 +422,7 @@ begin
 end;
 
 
-procedure TGLMultiPolygonBase.AddNode(const i: Integer; const value: TVector);
+procedure TGLMultiPolygonBase.AddNode(const i: Integer; const value: TGLVector);
 begin
   Path[i].AddNode(value);
 end;
@@ -758,7 +758,7 @@ begin
 end;
 
 
-function TGLMultiPolygonBase.AxisAlignedDimensionsUnscaled: TVector;
+function TGLMultiPolygonBase.AxisAlignedDimensionsUnscaled: TGLVector;
 var
   dMin, dMax: TAffineVector;
 begin

+ 9 - 9
Source/GLS.MultiProxy.pas

@@ -98,10 +98,10 @@ type
 	      procedure Assign(Source: TPersistent); override;
          procedure DoRender(var rci : TGLRenderContextInfo;
                             renderSelf, renderChildren : Boolean); override;
-         function AxisAlignedDimensionsUnscaled : TVector; override;
-         function RayCastIntersect(const rayStart, rayVector : TVector;
-                                 intersectPoint : PVector = nil;
-                                 intersectNormal : PVector = nil) : Boolean; override;
+         function AxisAlignedDimensionsUnscaled : TGLVector; override;
+         function RayCastIntersect(const rayStart, rayVector : TGLVector;
+                                 intersectPoint : PGLVector = nil;
+                                 intersectNormal : PGLVector = nil) : Boolean; override;
          function GenerateSilhouette(const silhouetteParameters : TGLSilhouetteParameters) : TGLSilhouette; override;
       published
          property MasterObjects : TGLMultiProxyMasters read FMasterObjects write SetMasterObjects;
@@ -352,7 +352,7 @@ begin
    else Result:=nil;
 end;
 
-function TGLMultiProxy.AxisAlignedDimensionsUnscaled : TVector;
+function TGLMultiProxy.AxisAlignedDimensionsUnscaled : TGLVector;
 var
    master : TGLBaseSceneObject;
 begin
@@ -362,11 +362,11 @@ begin
    end else Result:=inherited AxisAlignedDimensionsUnscaled;
 end;
 
-function TGLMultiProxy.RayCastIntersect(const rayStart, rayVector : TVector;
-                                 intersectPoint : PVector = nil;
-                                 intersectNormal : PVector = nil) : Boolean;
+function TGLMultiProxy.RayCastIntersect(const rayStart, rayVector : TGLVector;
+                                 intersectPoint : PGLVector = nil;
+                                 intersectNormal : PGLVector = nil) : Boolean;
 var
-   localRayStart, localRayVector : TVector;
+   localRayStart, localRayVector : TGLVector;
    master : TGLBaseSceneObject;
 begin
    master:=PrimaryMaster;

+ 13 - 13
Source/GLS.Navigator.pas

@@ -57,7 +57,7 @@ type
   TGLNavigator = class(TComponent)
   private
     FObject: TGLBaseSceneObject;
-    FVirtualRight: TVector;
+    FVirtualRight: TGLVector;
     FVirtualUp: TGLCoordinates;
     FUseVirtualUp: boolean;
     FAutoUpdateObject: boolean;
@@ -74,7 +74,7 @@ type
     procedure SetObject(NewObject: TGLBaseSceneObject); virtual;
     procedure SetUseVirtualUp(UseIt: boolean);
     procedure SetVirtualUp(Up: TGLCoordinates);
-    function CalcRight: TVector;
+    function CalcRight: TGLVector;
   public
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
@@ -160,7 +160,7 @@ type
     FDelta, FFps, FTimer, FInactiveTime: single;
     FCube: TGLDummyCube;
     FSel: integer;
-    FSelPos: TVector;
+    FSelPos: TGLVector;
     FCam, FNaviCam: TGLCamera;
     FHud: TGLHUDSprite;
     FMem: TGLMemoryViewer;
@@ -168,8 +168,8 @@ type
     FReady, FMouse: boolean;
     FMouseRotation: boolean;
     FMousePos: TPoint;
-    FPosAnimationStart: TVector;
-    FPosAnimationEnd: TVector;
+    FPosAnimationStart: TGLVector;
+    FPosAnimationEnd: TGLVector;
   public
     constructor CreateAsChild(aParentOwner: TGLBaseSceneObject); reintroduce;
     procedure DoProgress(const pt: TGLProgressTimes); override;
@@ -241,7 +241,7 @@ begin
   inherited;
 end;
 
-Function TGLNavigator.CalcRight: TVector;
+Function TGLNavigator.CalcRight: TGLVector;
 
 begin
   If Assigned(FObject) then
@@ -259,7 +259,7 @@ end;
 procedure TGLNavigator.TurnHorizontal(Angle: single);
 
 Var
-  T: TVector;
+  T: TGLVector;
   U: TAffineVector;
   TempVal: single;
 
@@ -299,7 +299,7 @@ Var
   ExpectedAngle: single;
   CosAngle, SinAngle: single;
   TempVal: single;
-  Direction: TVector;
+  Direction: TGLVector;
 
 begin
   ExpectedAngle := FCurrentVAngle + Angle;
@@ -379,8 +379,8 @@ end;
 procedure TGLNavigator.Straighten;
 
 Var
-  R: TVector;
-  D: TVector;
+  R: TGLVector;
+  D: TGLVector;
   A: single;
 
 begin
@@ -778,7 +778,7 @@ end;
 
 procedure TGLNaviCube.DoProgress(const pt: TGLProgressTimes);
 const
-  tb: array [0 .. 1] of array [0 .. 3] of TVector = (((x: 0; Y: 20; z: 1;
+  tb: array [0 .. 1] of array [0 .. 3] of TGLVector = (((x: 0; Y: 20; z: 1;
     W: 0), (x: 1; Y: 20; z: 0; W: 0), (x: 0; Y: 20; z: - 1; W: 0), (x: - 1;
     Y: 20; z: 0; W: 0)), ((x: 0; Y: - 20; z: 1; W: 0), (x: 1; Y: - 20; z: 0;
     W: 0), (x: 0; Y: - 20; z: - 1; W: 0), (x: - 1; Y: - 20; z: 0; W: 0)));
@@ -786,10 +786,10 @@ var
   mp: TPoint;
   mover: boolean;
   i: integer;
-  v0, v1, v2, v: TVector;
+  v0, v1, v2, v: TGLVector;
   obj: TGLBaseSceneObject;
 
-  procedure moveTo(trgv: TVector);
+  procedure moveTo(trgv: TGLVector);
   begin
     FPosAnimationStart := FCam.Position.AsVector;
     FPosAnimationEnd := FCam.TargetObject.AbsoluteToLocal

+ 6 - 6
Source/GLS.Nodes.pas

@@ -26,9 +26,9 @@ uses
 type
   TGLNode = class(TCollectionItem)
   private
-    FCoords: TVector;
+    FCoords: TGLVector;
     FTagObject: TObject;
-    procedure SetAsVector(const Value: TVector);
+    procedure SetAsVector(const Value: TGLVector);
     procedure SetAsAffineVector(const Value: TAffineVector);
     function GetAsAffineVector: TAffineVector;
     procedure SetCoordinate(AIndex: Integer; AValue: TGLFloat);
@@ -44,7 +44,7 @@ type
     (* The coordinates viewed as a vector.
       Assigning a value to this property will trigger notification events,
       if you don't want so, use DirectVector instead. *)
-    property AsVector: TVector read FCoords write SetAsVector;
+    property AsVector: TGLVector read FCoords write SetAsVector;
     (* The coordinates viewed as an affine vector.
       Assigning a value to this property will trigger notification events,
       if you don't want so, use DirectVector instead.
@@ -76,7 +76,7 @@ type
     // AddNode (TGLCustomCoordinates)
     procedure AddNode(const Coords: TGLCustomCoordinates); overload;
     procedure AddNode(const X, Y, Z: TGLfloat); overload;
-    procedure AddNode(const Value: TVector); overload;
+    procedure AddNode(const Value: TGLVector); overload;
     procedure AddNode(const Value: TAffineVector); overload;
     procedure AddXYArc(XRadius, YRadius: Single; StartAngle, StopAngle: Single; NbSegments: Integer;
       const Center: TAffineVector);
@@ -153,7 +153,7 @@ begin
   Result := @FCoords;
 end;
 
-procedure TGLNode.SetAsVector(const Value: TVector);
+procedure TGLNode.SetAsVector(const Value: TGLVector);
 begin
   FCoords := Value;
   (Collection as TGLNodes).NotifyChange;
@@ -278,7 +278,7 @@ begin
   Add.AsVector := PointMake(X, Y, Z);
 end;
 
-procedure TGLNodes.AddNode(const Value: TVector);
+procedure TGLNodes.AddNode(const Value: TGLVector);
 begin
   Add.AsVector := Value;
 end;

+ 54 - 54
Source/GLS.Objects.pas

@@ -87,15 +87,15 @@ type
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
     procedure Assign(Source: TPersistent); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
-    function RayCastIntersect(const rayStart, rayVector: TVector;
-      intersectPoint: PVector = nil; intersectNormal: PVector = nil)
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
+    function RayCastIntersect(const rayStart, rayVector: TGLVector;
+      intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil)
       : Boolean; override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
     procedure DoRender(var rci: TGLRenderContextInfo;
       renderSelf, renderChildren: Boolean); override;
     procedure StructureChanged; override;
-    function BarycenterAbsolutePosition: TVector; override;
+    function BarycenterAbsolutePosition: TGLVector; override;
   published
     property CubeSize: TGLFloat read FCubeSize write SetCubeSize;
     property EdgeColor: TGLColor read FEdgeColor write SetEdgeColor;
@@ -161,16 +161,16 @@ type
     procedure BuildList(var rci: TGLRenderContextInfo); override;
     function GenerateSilhouette(const silhouetteParameters
       : TGLSilhouetteParameters): TGLSilhouette; override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
-    function RayCastIntersect(const rayStart, rayVector: TVector;
-      intersectPoint: PVector = nil; intersectNormal: PVector = nil)
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
+    function RayCastIntersect(const rayStart, rayVector: TGLVector;
+      intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil)
       : Boolean; override;
     (* Computes the screen coordinates of the smallest rectangle encompassing the plane.
       Returned extents are NOT limited to any physical screen extents. *)
     function ScreenRect(aBuffer: TGLSceneBuffer): TRect;
     (* Computes the signed distance to the point.
       Point coordinates are expected in absolute coordinates. *)
-    function PointDistance(const aPoint: TVector): Single;
+    function PointDistance(const aPoint: TGLVector): Single;
   published
     property Height: TGLFloat read FHeight write SetHeight;
     property Width: TGLFloat read FWidth write SetWidth;
@@ -206,7 +206,7 @@ type
     constructor Create(AOwner: TComponent); override;
     procedure Assign(Source: TPersistent); override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
     procedure SetSize(const Width, Height: TGLFloat);
     // Set width and height to "size"
     procedure SetSquareSize(const Size: TGLFloat);
@@ -410,10 +410,10 @@ type
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
     procedure Assign(Source: TPersistent); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
     procedure AddNode(const coords: TGLCoordinates); overload;
     procedure AddNode(const X, Y, Z: TGLFloat); overload;
-    procedure AddNode(const Value: TVector); overload;
+    procedure AddNode(const Value: TGLVector); overload;
     procedure AddNode(const Value: TAffineVector); overload;
   published
     // Default color for nodes. lnaInvisible and lnaAxes ignore this setting
@@ -503,9 +503,9 @@ type
       : TGLSilhouetteParameters): TGLSilhouette; override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
     procedure Assign(Source: TPersistent); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
-    function RayCastIntersect(const rayStart, rayVector: TVector;
-      intersectPoint: PVector = nil; intersectNormal: PVector = nil)
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
+    function RayCastIntersect(const rayStart, rayVector: TGLVector;
+      intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil)
       : Boolean; override;
   published
     property CubeWidth: TGLFloat index 0 read GetCubeWHD write SetCubeWHD
@@ -578,9 +578,9 @@ type
     constructor Create(AOwner: TComponent); override;
     procedure Assign(Source: TPersistent); override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
-    function RayCastIntersect(const rayStart, rayVector: TVector;
-      intersectPoint: PVector = nil; intersectNormal: PVector = nil)
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
+    function RayCastIntersect(const rayStart, rayVector: TGLVector;
+      intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil)
       : Boolean; override;
     function GenerateSilhouette(const silhouetteParameters
       : TGLSilhouetteParameters): TGLSilhouette; override;
@@ -615,7 +615,7 @@ type
     procedure NotifyChange(Sender: TObject); override;
     procedure AddNode(const coords: TGLCoordinates); overload;
     procedure AddNode(const X, Y, Z: TGLFloat); overload;
-    procedure AddNode(const Value: TVector); overload;
+    procedure AddNode(const Value: TGLVector); overload;
     procedure AddNode(const Value: TAffineVector); overload;
   published
     // The nodes list.
@@ -655,9 +655,9 @@ type
     constructor Create(AOwner: TComponent); override;
     procedure Assign(Source: TPersistent); override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
-    function RayCastIntersect(const rayStart, rayVector: TVector;
-      intersectPoint: PVector = nil; intersectNormal: PVector = nil)
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
+    function RayCastIntersect(const rayStart, rayVector: TGLVector;
+      intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil)
       : Boolean; override;
     function GenerateSilhouette(const silhouetteParameters
       : TGLSilhouetteParameters): TGLSilhouette; override;
@@ -774,7 +774,7 @@ begin
   inherited Assign(Source);
 end;
 
-function TGLDummyCube.AxisAlignedDimensionsUnscaled: TVector;
+function TGLDummyCube.AxisAlignedDimensionsUnscaled: TGLVector;
 begin
   Result.X := 0.5 * Abs(FCubeSize);
   Result.Y := Result.X;
@@ -782,8 +782,8 @@ begin
   Result.W := 0;
 end;
 
-function TGLDummyCube.RayCastIntersect(const rayStart, rayVector: TVector;
-  intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean;
+function TGLDummyCube.RayCastIntersect(const rayStart, rayVector: TGLVector;
+  intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean;
 begin
   Result := False;
 end;
@@ -831,7 +831,7 @@ begin
   inherited;
 end;
 
-function TGLDummyCube.BarycenterAbsolutePosition: TVector;
+function TGLDummyCube.BarycenterAbsolutePosition: TGLVector;
 var
   i: Integer;
 begin
@@ -919,17 +919,17 @@ begin
   inherited Assign(Source);
 end;
 
-function TGLPlane.AxisAlignedDimensionsUnscaled: TVector;
+function TGLPlane.AxisAlignedDimensionsUnscaled: TGLVector;
 begin
   Result.X := 0.5 * Abs(FWidth);
   Result.Y := 0.5 * Abs(FHeight);
   Result.Z := 0;
 end;
 
-function TGLPlane.RayCastIntersect(const rayStart, rayVector: TVector;
-  intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean;
+function TGLPlane.RayCastIntersect(const rayStart, rayVector: TGLVector;
+  intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean;
 var
-  locRayStart, locRayVector, ip: TVector;
+  locRayStart, locRayVector, ip: TGLVector;
   t: Single;
 begin
   locRayStart := AbsoluteToLocal(rayStart);
@@ -1143,7 +1143,7 @@ end;
 
 function TGLPlane.ScreenRect(aBuffer: TGLSceneBuffer): TRect;
 var
-  v: array [0 .. 3] of TVector;
+  v: array [0 .. 3] of TGLVector;
   buf: TGLSceneBuffer;
   hw, hh: TGLFloat;
 begin
@@ -1166,7 +1166,7 @@ begin
     FillChar(Result, SizeOf(TRect), 0);
 end;
 
-function TGLPlane.PointDistance(const aPoint: TVector): Single;
+function TGLPlane.PointDistance(const aPoint: TGLVector): Single;
 begin
   Result := VectorDotProduct(VectorSubtract(aPoint, AbsolutePosition),
     AbsoluteDirection);
@@ -1290,7 +1290,7 @@ begin
   inherited Assign(Source);
 end;
 
-function TGLSprite.AxisAlignedDimensionsUnscaled: TVector;
+function TGLSprite.AxisAlignedDimensionsUnscaled: TGLVector;
 begin
   Result.X := 0.5 * Abs(FWidth);
   Result.Y := 0.5 * Abs(FHeight);
@@ -1608,7 +1608,7 @@ end;
 procedure TGLPoints.BuildList(var rci: TGLRenderContextInfo);
 var
   n: Integer;
-  v: TVector;
+  v: TGLVector;
 begin
   n := FPositions.Count;
   if n = 0 then
@@ -2023,7 +2023,7 @@ begin
   gl.PopMatrix;
 end;
 
-function TGLNodedLines.AxisAlignedDimensionsUnscaled: TVector;
+function TGLNodedLines.AxisAlignedDimensionsUnscaled: TGLVector;
 var
   i: Integer;
 begin
@@ -2054,7 +2054,7 @@ begin
   StructureChanged;
 end;
 
-procedure TGLNodedLines.AddNode(const Value: TVector);
+procedure TGLNodedLines.AddNode(const Value: TGLVector);
 var
   n: TGLNode;
 begin
@@ -2154,9 +2154,9 @@ var
   A, B, C: TGLFloat;
   f: Single;
   Spline: TCubicSpline;
-  vertexColor: TVector;
+  vertexColor: TGLVector;
   nodeBuffer: array of TAffineVector;
-  colorBuffer: array of TVector;
+  colorBuffer: array of TGLVector;
   nurbsRenderer: PGLUNurbs;
 begin
   if Nodes.Count > 1 then
@@ -2549,7 +2549,7 @@ begin
   inherited Assign(Source);
 end;
 
-function TGLCube.AxisAlignedDimensionsUnscaled: TVector;
+function TGLCube.AxisAlignedDimensionsUnscaled: TGLVector;
 begin
   Result.X := FCubeSize.X * 0.5;
   Result.Y := FCubeSize.Y * 0.5;
@@ -2557,12 +2557,12 @@ begin
   Result.W := 0;
 end;
 
-function TGLCube.RayCastIntersect(const rayStart, rayVector: TVector;
-  intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean;
+function TGLCube.RayCastIntersect(const rayStart, rayVector: TGLVector;
+  intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean;
 var
-  p: array [0 .. 5] of TVector;
-  rv: TVector;
-  rs, r: TVector;
+  p: array [0 .. 5] of TGLVector;
+  rv: TGLVector;
+  rs, r: TGLVector;
   i: Integer;
   t: Single;
   eSize: TAffineVector;
@@ -2873,11 +2873,11 @@ begin
   rci.GLStates.PopAttrib;
 end;
 
-function TGLSphere.RayCastIntersect(const rayStart, rayVector: TVector;
-  intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean;
+function TGLSphere.RayCastIntersect(const rayStart, rayVector: TGLVector;
+  intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean;
 var
-  i1, i2: TVector;
-  localStart, localVector: TVector;
+  i1, i2: TGLVector;
+  localStart, localVector: TGLVector;
 begin
   // compute coefficients of quartic polynomial
   SetVector(localStart, AbsoluteToLocal(rayStart));
@@ -3036,7 +3036,7 @@ begin
   inherited Assign(Source);
 end;
 
-function TGLSphere.AxisAlignedDimensionsUnscaled: TVector;
+function TGLSphere.AxisAlignedDimensionsUnscaled: TGLVector;
 begin
   Result.X := Abs(FRadius);
   Result.Y := Result.X;
@@ -3131,7 +3131,7 @@ begin
   StructureChanged;
 end;
 
-procedure TGLPolygonBase.AddNode(const Value: TVector);
+procedure TGLPolygonBase.AddNode(const Value: TGLVector);
 var
   n: TGLNode;
 begin
@@ -3436,11 +3436,11 @@ end;
 
 // This will probably not work, karamba
 // RayCastSphereIntersect -> RayCastSuperellipsoidIntersect ??????
-function TGLSuperellipsoid.RayCastIntersect(const rayStart, rayVector: TVector;
-  intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean;
+function TGLSuperellipsoid.RayCastIntersect(const rayStart, rayVector: TGLVector;
+  intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean;
 var
-  i1, i2: TVector;
-  localStart, localVector: TVector;
+  i1, i2: TGLVector;
+  localStart, localVector: TGLVector;
 begin
   // compute coefficients of quartic polynomial
   SetVector(localStart, AbsoluteToLocal(rayStart));
@@ -3617,7 +3617,7 @@ begin
   inherited Assign(Source);
 end;
 
-function TGLSuperellipsoid.AxisAlignedDimensionsUnscaled: TVector;
+function TGLSuperellipsoid.AxisAlignedDimensionsUnscaled: TGLVector;
 begin
   Result.X := Abs(FRadius);
   Result.Y := Result.X;

+ 33 - 33
Source/GLS.Octree.pas

@@ -64,13 +64,13 @@ type
       V3: TAffineFLTVector): BOOLEAN;
     // Check if a sphere (at point C with radius) lies within the AABB specified by min and max entents
     function SphereInNode(const MinExtent, MaxExtent: TAffineVector;
-      const C: TVector; Radius: Single): Boolean;
+      const C: TGLVector; Radius: Single): Boolean;
     procedure WalkTriToLeafx(Onode: POctreeNode;
       const V1, V2, V3: TAffineFLTVector);
     procedure WalkPointToLeafx(ONode: POctreeNode; const P: TAffineVector);
-    procedure WalkSphereToLeafx(Onode: POctreeNode; const P: TVector;
+    procedure WalkSphereToLeafx(Onode: POctreeNode; const P: TGLVector;
       Radius: Single);
-    procedure WalkRayToLeafx(Onode: POctreeNode; const P, V: TVector);
+    procedure WalkRayToLeafx(Onode: POctreeNode; const P, V: TGLVector);
     function GetExtent(const Flags: array of Byte; ParentNode: POctreeNode)
       : TAffineFLTVector;
     //  Recursive routine to build nodes from parent to max depth level.
@@ -79,7 +79,7 @@ type
     procedure WalkPointToLeaf(ONode: POctreeNode; const P: TAffineVector);
     procedure WalkTriToLeaf(Onode: POctreeNode;
       const V1, V2, V3: TAffineVector);
-    procedure WalkRayToLeaf(Onode: POctreeNode; const P, V: TVector);
+    procedure WalkRayToLeaf(Onode: POctreeNode; const P, V: TGLVector);
     // Example of how to process each node in the tree
     procedure ConvertR4(ONode: POctreeNode; const Scale: TAffineFLTVector);
     procedure CreateTree(Depth: Integer);
@@ -96,7 +96,7 @@ type
     ResultArray: array of POctreeNode;
     // holds the result nodes of various calls
     TriangleFiler: TAffineVectorList;
-    procedure WalkSphereToLeaf(Onode: POctreeNode; const P: TVector;
+    procedure WalkSphereToLeaf(Onode: POctreeNode; const P: TGLVector;
       Radius: Single);
     (*  Initializes the tree from the triangle list.
       All triangles must be contained in the world extent to be properly
@@ -106,12 +106,12 @@ type
       const ATreeDepth: Integer);
     procedure DisposeTree;
     destructor Destroy; override;
-    function RayCastIntersect(const RayStart, RayVector: TVector;
-      IntersectPoint: PVector = nil; IntersectNormal: PVector = nil;
+    function RayCastIntersect(const RayStart, RayVector: TGLVector;
+      IntersectPoint: PGLVector = nil; IntersectNormal: PGLVector = nil;
       TriangleInfo: POctreeTriangleInfo = nil): Boolean;
-    function SphereSweepIntersect(const RayStart, RayVector: TVector;
-      const Velocity, Radius: Single; IntersectPoint: PVector = nil;
-      IntersectNormal: PVector = nil): Boolean;
+    function SphereSweepIntersect(const RayStart, RayVector: TGLVector;
+      const Velocity, Radius: Single; IntersectPoint: PGLVector = nil;
+      IntersectNormal: PGLVector = nil): Boolean;
     function TriangleIntersect(const V1, V2, V3: TAffineVector): Boolean;
     //  Returns all triangles in the AABB.
     function GetTrianglesFromNodesIntersectingAABB(const ObjAABB: TAABB)
@@ -138,7 +138,7 @@ implementation
 // Return: TRUE if point is in sphere, FALSE if not.
 // -----------------------------------------------------------------------
 
-function CheckPointInSphere(const Point, SO: TVector; const SR: Single)
+function CheckPointInSphere(const Point, SO: TGLVector; const SR: Single)
   : Boolean;
 begin
   // Allow small margin of error
@@ -293,7 +293,7 @@ begin
 end;
 
 function HitBoundingBox(const MinB, MaxB: TAffineFLTVector;
-  const Origin, Dir: TVector; var Coord: TVector): BOOLEAN;
+  const Origin, Dir: TGLVector; var Coord: TGLVector): BOOLEAN;
 const
   NUMDIM = 2;
   RIGHT = 0;
@@ -985,7 +985,7 @@ begin
 end;
 
 function TGLOctree.SphereInNode(const MinExtent, MaxExtent: TAffineVector;
-  const C: TVector; Radius: Single): Boolean;
+  const C: TGLVector; Radius: Single): Boolean;
 // Sphere-AABB intersection by Miguel Gomez
 var
   S, D: Single;
@@ -1014,14 +1014,14 @@ begin
     Result := FALSE;
 end;
 
-procedure TGLOctree.WalkSphereToLeaf(Onode: POctreeNode; const P: TVector;
+procedure TGLOctree.WalkSphereToLeaf(Onode: POctreeNode; const P: TGLVector;
   Radius: Single);
 begin
   Finalize(Resultarray);
   WalkSphereToLeafx(Onode, P, Radius);
 end;
 
-procedure TGLOctree.WalkSphereToLeafx(Onode: POctreeNode; const P: TVector;
+procedure TGLOctree.WalkSphereToLeafx(Onode: POctreeNode; const P: TGLVector;
   Radius: Single);
 var
   N: Integer;
@@ -1040,17 +1040,17 @@ begin
 end;
 
 // Cast a ray (point p, vector v) into the Octree (ie: ray-box intersect).
-procedure TGLOctree.WalkRayToLeaf(Onode: POctreeNode; const P, V: TVector);
+procedure TGLOctree.WalkRayToLeaf(Onode: POctreeNode; const P, V: TGLVector);
 begin
   Finalize(Resultarray);
 
   WalkRayToLeafx(Onode, P, V);
 end;
 
-procedure TGLOctree.WalkRayToLeafx(Onode: POctreeNode; const P, V: TVector);
+procedure TGLOctree.WalkRayToLeafx(Onode: POctreeNode; const P, V: TGLVector);
 var
   N: Integer;
-  Coord: TVector;
+  Coord: TGLVector;
 begin
   if HitBoundingBox(Onode^.MinExtent, Onode^.MaxExtent, P, V, Coord) then
   begin
@@ -1132,8 +1132,8 @@ begin
   end;
 end;
 
-function TGLOctree.RayCastIntersect(const RayStart, RayVector: TVector;
-  IntersectPoint: PVector = nil; IntersectNormal: PVector = nil;
+function TGLOctree.RayCastIntersect(const RayStart, RayVector: TGLVector;
+  IntersectPoint: PGLVector = nil; IntersectNormal: PGLVector = nil;
   TriangleInfo: POctreeTriangleInfo = nil): Boolean;
 const
   CInitialMinD: Single = 1E40;
@@ -1141,7 +1141,7 @@ var
   I, T, K: Integer;
   D, MinD: Single;
   P: POctreeNode;
-  IPoint, INormal: TVector;
+  IPoint, INormal: TGLVector;
 begin
   WalkRayToLeaf(RootNode, RayStart, RayVector);
 
@@ -1215,9 +1215,9 @@ end;
 //
 // Return the polygon intersection point and the closest triangle's normal if hit.
 //
-function TGLOctree.SphereSweepIntersect(const RayStart, RayVector: TVector;
-  const Velocity, Radius: Single; IntersectPoint: PVector = nil;
-  IntersectNormal: PVector = nil): Boolean;
+function TGLOctree.SphereSweepIntersect(const RayStart, RayVector: TGLVector;
+  const Velocity, Radius: Single; IntersectPoint: PGLVector = nil;
+  IntersectNormal: PGLVector = nil): Boolean;
 const
   CInitialMinD2: Single = 1E40;
   CEpsilon: Single = 0.05;
@@ -1228,12 +1228,12 @@ var
   DistanceToTravel, DistanceToTravelMinusRadius2: Single;
   P: POctreeNode;
   PNormal: TAffineVector;
-  PNormal4: TVector;
-  NEGpNormal4: TVector;
-  SIPoint, SIPoint2: TVector; // sphere intersection point
-  PIPoint: TVector; // plane intersection point
-  PolyIPoint: TVector; // polygon intersection point
-  NEGVelocity: TVector; // sphere's forward velocity
+  PNormal4: TGLVector;
+  NEGpNormal4: TGLVector;
+  SIPoint, SIPoint2: TGLVector; // sphere intersection point
+  PIPoint: TGLVector; // plane intersection point
+  PolyIPoint: TGLVector; // polygon intersection point
+  NEGVelocity: TGLVector; // sphere's forward velocity
   DirectHit: Boolean;
 
   P1, P2, P3: PAffineVector;
@@ -1241,9 +1241,9 @@ var
   // SphereSweepAABB:TAABB;
 
   // response identifiers (for future use)
-  // destinationPoint, newdestinationPoint: TVector;
-  // slidePlaneOrigin, slidePlaneNormal: TVector;
-  // newvelocityVector: TVector;
+  // destinationPoint, newdestinationPoint: TGLVector;
+  // slidePlaneOrigin, slidePlaneNormal: TGLVector;
+  // newvelocityVector: TGLVector;
   // v: single;
   // L: double;
 begin

+ 2 - 2
Source/GLS.ParticleFX.pas

@@ -763,7 +763,7 @@ procedure RndVector(const dispersion: TGLSourcePFXDispersionMode;
 
 var
   f2: Single;
-  p: TVector;
+  p: TGLVector;
 begin
   f2 := 2 * f;
   if Assigned(dispersionRange) then
@@ -1917,7 +1917,7 @@ var
   list: PGLParticleArray;
   doFriction, doPack: Boolean;
   frictionScale: Single;
-  //pos4: TVector;
+  //pos4: TGLVector;
 begin
   maxAge := MaxParticleAge;
   accelVector := Acceleration.AsAffineVector;

+ 2 - 2
Source/GLS.PerlinPFX.pas

@@ -103,7 +103,7 @@ type
     function Noise(const x, y: Single): Single; overload;
     function Noise(const x, y, z: Single): Single; overload;
     function Noise(const v: TAffineVector): Single; overload;
-    function Noise(const v: TVector): Single; overload;
+    function Noise(const v: TGLVector): Single; overload;
   end;
 
 
@@ -432,7 +432,7 @@ begin
   Result := Noise(AffineVectorMake(x, y, z));
 end;
 
-function TGLPerlin3DNoise.Noise(const v: TVector): Single;
+function TGLPerlin3DNoise.Noise(const v: TGLVector): Single;
 begin
   Result := Noise(PAffineVector(@v)^);
 end;

+ 22 - 22
Source/GLS.ProxyObjects.pas

@@ -102,12 +102,12 @@ type
   public
     (* If the MasterObject is a FreeForm, you can raycast against the Octree,
        which is alot faster.  You must build the octree before using. *)
-    function OctreeRayCastIntersect(const rayStart, rayVector: TVector;
-      intersectPoint: PVector = nil;  intersectNormal: PVector = nil): Boolean;
+    function OctreeRayCastIntersect(const rayStart, rayVector: TGLVector;
+      intersectPoint: PGLVector = nil;  intersectNormal: PGLVector = nil): Boolean;
     // WARNING: This function is not yet 100% reliable with scale+rotation. 
-    function OctreeSphereSweepIntersect(const rayStart, rayVector: TVector;
+    function OctreeSphereSweepIntersect(const rayStart, rayVector: TGLVector;
       const velocity, radius, modelscale: Single;
-      intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean;
+      intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean;
   published
 
    // Redeclare as TGLFreeForm.
@@ -176,9 +176,9 @@ type
     function BoneMatrix(BoneName: string): TMatrix; overload;
     procedure BoneMatricesClear;
     // A standard version of the RayCastIntersect function. 
-    function RayCastIntersect(const rayStart, rayVector: TVector;
-      intersectPoint: PVector = nil;
-      intersectNormal: PVector = nil): Boolean; override;
+    function RayCastIntersect(const rayStart, rayVector: TGLVector;
+      intersectPoint: PGLVector = nil;
+      intersectNormal: PGLVector = nil): Boolean; override;
     (* Raycasts on self, but actually on the "RefActor" Actor.
        Note that the "RefActor" parameter does not necessarily have to be
        the same Actor refernced by the MasterObject property:
@@ -186,9 +186,9 @@ type
        while using a high-poly Actor in the "MasterObject" property,
        of course we assume that the two Masterobject Actors have same animations.  *)
     function RayCastIntersectEx(RefActor: TGLActor; const rayStart, rayVector:
-      TVector;
-      intersectPoint: PVector = nil;
-      intersectNormal: PVector = nil): Boolean; overload;
+      TGLVector;
+      intersectPoint: PGLVector = nil;
+      intersectNormal: PGLVector = nil): Boolean; overload;
   published
     property AnimationMode: TGLActorProxyAnimationMode read FAnimationMode write FAnimationMode default pamInherited;
     property Animation: TGLActorAnimationName read FAnimation write SetAnimation;
@@ -292,11 +292,11 @@ end;
 // ------------------
 
 function TGLFreeFormProxy.OctreeRayCastIntersect(const rayStart, rayVector:
-  TVector;
-  intersectPoint: PVector = nil;
-  intersectNormal: PVector = nil): Boolean;
+  TGLVector;
+  intersectPoint: PGLVector = nil;
+  intersectNormal: PGLVector = nil): Boolean;
 var
-  localRayStart, localRayVector: TVector;
+  localRayStart, localRayVector: TGLVector;
 begin
   if Assigned(MasterObject) then
   begin
@@ -330,12 +330,12 @@ begin
 end;
 
 function TGLFreeFormProxy.OctreeSphereSweepIntersect(const rayStart, rayVector:
-  TVector;
+  TGLVector;
   const velocity, radius, modelscale: Single;
-  intersectPoint: PVector = nil;
-  intersectNormal: PVector = nil): Boolean;
+  intersectPoint: PGLVector = nil;
+  intersectNormal: PGLVector = nil): Boolean;
 var
-  localRayStart, localRayVector: TVector;
+  localRayStart, localRayVector: TGLVector;
   localVelocity, localRadius: single;
 begin
   Result := False;
@@ -618,8 +618,8 @@ begin
   end;
 end;
 
-function TGLActorProxy.RayCastIntersect(const rayStart, rayVector: TVector;
-  intersectPoint, intersectNormal: PVector): Boolean;
+function TGLActorProxy.RayCastIntersect(const rayStart, rayVector: TGLVector;
+  intersectPoint, intersectNormal: PGLVector): Boolean;
 begin
   if MasterObject <> nil then
     Result := RayCastIntersectEx(GetMasterActorObject, rayStart, rayVector,
@@ -634,9 +634,9 @@ type
   TGLDummyActor = class(TGLActor);
 
 function TGLActorProxy.RayCastIntersectEx(RefActor: TGLActor; const rayStart,
-  rayVector: TVector; intersectPoint, intersectNormal: PVector): Boolean;
+  rayVector: TGLVector; intersectPoint, intersectNormal: PGLVector): Boolean;
 var
-  localRayStart, localRayVector: TVector;
+  localRayStart, localRayVector: TGLVector;
   cf, sf, ef: Integer;
   cfd: Single;
   HaspooTransformation: boolean;

+ 1 - 1
Source/GLS.ROAMPatch.pas

@@ -180,7 +180,7 @@ procedure DrawContours(Vertices: TAffineVectorList; VertexIndices: TIntegerList;
 var
   i: Integer;
   Isolines: TAffineVectorList;
-  CurColor: TVector;
+  CurColor: TGLVector;
 
 begin
   if ContourInterval > 0 then

+ 18 - 18
Source/GLS.RandomHDS.pas

@@ -103,12 +103,12 @@ type
   end;
 
   TMapOfSingle = array of array of single;
-  TMapOfVector = array of array of TVector;
+  TMapOfVector = array of array of TGLVector;
 
   TGLBaseRandomHDS = class;
 
   // Function type to use for topography-based texture
-  TOnDrawTexture = function(const Sender: TGLBaseRandomHDS; x, y: integer; z: double; Normal: TVector): TColorVector of object;
+  TOnDrawTexture = function(const Sender: TGLBaseRandomHDS; x, y: integer; z: double; Normal: TGLVector): TColorVector of object;
 
   TSingleClamp = procedure(var x, y: single) of object;
   TIntegerClamp = procedure(var x, y: integer) of object;
@@ -129,7 +129,7 @@ type
     FSize: integer;
     FMaterialName: string;
     FLighting: boolean;
-    FLightDirection: TVector;
+    FLightDirection: TGLVector;
     FTerrainRenderer: TGLTerrainRenderer;
     FLightColor: TColorVector;
     FShadows: boolean;
@@ -145,11 +145,11 @@ type
     FPrimerLandscape: boolean;
     FLandTileInfo: TLandTileInfo;
     FOnDrawTexture: TOnDrawTexture;
-    function OnDrawTextureDefault(const Sender: TGLBaseRandomHDS; x, y: integer; z: double; Normal: TVector): TColorVector;
+    function OnDrawTextureDefault(const Sender: TGLBaseRandomHDS; x, y: integer; z: double; Normal: TGLVector): TColorVector;
     procedure SetSeed(const Value: integer);
     procedure SetMaterialName(const Value: string);
     procedure SetLighting(const Value: boolean);
-    procedure SetLightDirection(const Value: TVector);
+    procedure SetLightDirection(const Value: TGLVector);
     procedure SetTerrainRenderer(const Value: TGLTerrainRenderer); virtual; abstract;
     procedure SetLightColor(const Value: TColorVector);
     procedure SetShadows(const Value: boolean);
@@ -179,7 +179,7 @@ type
     // Usually white, but you can generate e.g.sunset ambiance by setting it to red
     property LightColor: TColorVector read FLightColor write SetLightColor;
     // Light is parallel (sun light)
-    property LightDirection: TVector read FLightDirection write SetLightDirection;
+    property LightDirection: TGLVector read FLightDirection write SetLightDirection;
     (* This function must be supplied by the user. Here he/she can define which
       colour to use depending on coordinates, elevation and normal. This provides
       a great flexibility. If no function is supplied (OnDrawTexture=nil), a default
@@ -269,7 +269,7 @@ type
       - Compute the casted shadows
       - Perform a basic smoothing if TextureScale>1 *)
     procedure BuildLightMap; overload;
-    procedure BuildLightMap(const aLightDirection: TVector); overload;
+    procedure BuildLightMap(const aLightDirection: TGLVector); overload;
     // Normals are needed for lighting and slope-based textures
     procedure BuildNormals;
     (* For every pixel of the texture, computes slope and interpolated height and
@@ -329,7 +329,7 @@ type
     property MaxHeight: single read FMaxHeight;
     property MinHeight: single read FMinHeight;
     // Vector normal to the terrain at the position
-    function Normal(const Position: TVector): TVector;
+    function Normal(const Position: TGLVector): TGLVector;
     // Max height - min height
     property RangeHeight: single read FRangeHeight;
     (* Scale of the Terrain Renderer. They are set so as giving a identical
@@ -726,7 +726,7 @@ begin
   Result := FLandTileInfo;
 end;
 
-function TGLBaseRandomHDS.OnDrawTextureDefault(const Sender: TGLBaseRandomHDS; x, y: integer; z: double; Normal: TVector)
+function TGLBaseRandomHDS.OnDrawTextureDefault(const Sender: TGLBaseRandomHDS; x, y: integer; z: double; Normal: TGLVector)
   : TColorVector;
 begin
   if z > Sender.SeaLevel * VSF then
@@ -775,9 +775,9 @@ begin
   FLightColor := Value;
 end;
 
-procedure TGLBaseRandomHDS.SetLightDirection(const Value: TVector);
+procedure TGLBaseRandomHDS.SetLightDirection(const Value: TGLVector);
 var
-  v: TVector;
+  v: TGLVector;
 begin
   v := Value;
   NormalizeVector(v);
@@ -949,8 +949,8 @@ var
   i, j, k, m, n: integer;
   x, y: single;
   t: single;
-  v1, v2: TVector;
-  l: TVector;
+  v1, v2: TGLVector;
+  l: TGLVector;
   Shade: single;
 begin
   if FSize = 0 then
@@ -1038,7 +1038,7 @@ begin
   end; // if
 end;
 
-procedure TGLCustomRandomHDS.BuildLightMap(const aLightDirection: TVector);
+procedure TGLCustomRandomHDS.BuildLightMap(const aLightDirection: TGLVector);
 begin
   FLightDirection := aLightDirection;
   BuildLightMap;
@@ -1048,9 +1048,9 @@ procedure TGLCustomRandomHDS.BuildNormals;
 var
   i, j: integer;
   z0: single;
-  v1, v2: TVector;
-  n1: TVector;
-  Normal: TVector;
+  v1, v2: TGLVector;
+  n1: TGLVector;
+  Normal: TGLVector;
 begin
   FTask := 'Normal computation';
 
@@ -1813,7 +1813,7 @@ begin
   Result := (x >= 0) and (x <= FSize) and (y >= 0) and (y <= FSize);
 end;
 
-function TGLCustomRandomHDS.Normal(const Position: TVector): TVector;
+function TGLCustomRandomHDS.Normal(const Position: TGLVector): TGLVector;
 var
   x, y: integer;
 begin

+ 4 - 4
Source/GLS.RenderContextInfo.pas

@@ -52,8 +52,8 @@ type
   TGLVisibilityCulling = (vcInherited, vcNone, vcObjectBased, vcHierarchical);
 
   TRenderContextClippingInfo = record
-    Origin: TVector;
-    ClippingDirection: TVector;
+    Origin: TGLVector;
+    ClippingDirection: TGLVector;
     ViewPortRadius: Single; // viewport bounding radius per distance unit
     NearClippingDistance: Single;
     FarClippingDistance: Single;
@@ -64,8 +64,8 @@ type
   TGLRenderContextInfo = record
     Scene: TObject; //usually TGLScene
     Buffer: TObject; //usually TGLSceneBuffer
-    CameraPosition: TVector;
-    CameraDirection, CameraUp: TVector;
+    CameraPosition: TGLVector;
+    CameraDirection, CameraUp: TGLVector;
     ViewPortSize: TGLSize;
     RenderDPI: Integer;
     MaterialLibrary: TObject; //usually TGLMaterialLibrary;

File diff suppressed because it is too large
+ 172 - 172
Source/GLS.Scene.pas


+ 2 - 8
Source/GLS.ShadowPlane.pas

@@ -1,14 +1,13 @@
 //
 // The graphics rendering engine GLScene http://glscene.org
 //
-
 unit GLS.ShadowPlane;
 
 (*
    Implements a basic shadow plane.
 
-   It is strongly recommended to read and understand the explanations in the
-   materials/mirror demo before using this component.
+   It is strongly recommended to read and understand the explanations
+   in the materials/mirror demo before using this component.
 *)
 
 interface
@@ -36,9 +35,7 @@ uses
   GLS.Texture,
   GLS.Utils;
 
-
 type
-
   TShadowPlaneOption = (spoUseStencil, spoScissor, spoTransparent, spoIgnoreZ);
   TShadowPlaneOptions = set of TShadowPlaneOption;
 
@@ -278,7 +275,6 @@ begin
   end;
 end;
 
-
 procedure TGLShadowPlane.Notification(AComponent: TComponent; Operation: TOperation);
 begin
   if Operation = opRemove then
@@ -291,7 +287,6 @@ begin
   inherited;
 end;
 
-
 procedure TGLShadowPlane.SetShadowingObject(const val: TGLBaseSceneObject);
 begin
   if FShadowingObject <> val then
@@ -305,7 +300,6 @@ begin
   end;
 end;
 
-
 procedure TGLShadowPlane.SetShadowedLight(const val: TGLLightSource);
 begin
   if FShadowedLight <> val then

+ 10 - 10
Source/GLS.SkyDome.pas

@@ -297,7 +297,7 @@ function StarRecordPositionZUp(const starRecord: TGLStarRecord): TAffineVector;
 // Computes position on the unit sphere of a star record (Y=up)
 function StarRecordPositionYUp(const starRecord: TGLStarRecord): TAffineVector;
 // Computes star color from BV index (RGB) and magnitude (alpha)
-function StarRecordColor(const starRecord: TGLStarRecord; bias: Single): TVector;
+function StarRecordColor(const starRecord: TGLStarRecord; bias: Single): TGLVector;
 
 // ------------------------------------------------------------------
 implementation
@@ -667,13 +667,13 @@ begin
 end;
 
 function StarRecordColor(const starRecord: TGLStarRecord; bias: Single)
-  : TVector;
+  : TGLVector;
 const
   // very *rough* approximation
-  cBVm035: TVector = (X: 0.7; Y: 0.8; Z: 1.0; W: 1);
-  cBV015: TVector = (X: 1.0; Y: 1.0; Z: 1.0; W: 1);
-  cBV060: TVector = (X: 1.0; Y: 1.0; Z: 0.7; W: 1);
-  cBV135: TVector = (X: 1.0; Y: 0.8; Z: 0.7; W: 1);
+  cBVm035: TGLVector = (X: 0.7; Y: 0.8; Z: 1.0; W: 1);
+  cBV015: TGLVector = (X: 1.0; Y: 1.0; Z: 1.0; W: 1);
+  cBV060: TGLVector = (X: 1.0; Y: 1.0; Z: 0.7; W: 1);
+  cBV135: TGLVector = (X: 1.0; Y: 0.8; Z: 0.7; W: 1);
 var
   bvIndex100: Integer;
 begin
@@ -795,7 +795,7 @@ procedure TGLSkyDomeBand.BuildList(var rci: TGLRenderContextInfo);
   var
     i: Integer;
     f, r, r2: Single;
-    vertex1, vertex2: TVector;
+    vertex1, vertex2: TGLVector;
   begin
     vertex1.W := 1;
     if start = -90 then
@@ -1582,7 +1582,7 @@ var
   // coordinates system note: X is forward, Y is left and Z is up
   // always rendered as sphere of radius 1
 
-  function CalculateCosGamma(const p: TVector): Single;
+  function CalculateCosGamma(const p: TGLVector): Single;
   begin
     Result := 1 - VectorAngleCosine(PAffineVector(@p)^, sunPos);
   end;
@@ -1591,7 +1591,7 @@ var
   var
     i: Integer;
     r, thetaStart: Single;
-    vertex1: TVector;
+    vertex1: TGLVector;
     Color: TColorVector;
   begin
     r := 0;
@@ -1618,7 +1618,7 @@ var
   var
     i: Integer;
     r, r2, thetaStart, thetaStop: Single;
-    vertex1, vertex2: TVector;
+    vertex1, vertex2: TGLVector;
     Color: TColorVector;
   begin
     vertex1.W := 1;

+ 12 - 12
Source/GLS.SmoothNavigator.pas

@@ -117,8 +117,8 @@ type
   end;
 
   TGLNavigatorSmoothChangeVector = class;
-  TGLNavigatorSmoothChangeVectorGetEvent = function(const ASender: TGLNavigatorSmoothChangeVector): TVector of object;
-  TGLNavigatorSmoothChangeVectorSetEvent = procedure(const ASender: TGLNavigatorSmoothChangeVector; const AValue: TVector) of object;
+  TGLNavigatorSmoothChangeVectorGetEvent = function(const ASender: TGLNavigatorSmoothChangeVector): TGLVector of object;
+  TGLNavigatorSmoothChangeVectorSetEvent = procedure(const ASender: TGLNavigatorSmoothChangeVector; const AValue: TGLVector) of object;
 
   // Smoothly change any Vector4f value, so it will become TargetValue in the end.
   TGLNavigatorSmoothChangeVector = class(TGLNavigatorSmoothChangeItem)
@@ -335,10 +335,10 @@ type
     function MoveAroundTarget(const PitchDelta, TurnDelta : Single; const ADeltaTime: Double): Boolean;
     function MoveObjectAround(const AObject: TGLBaseSceneObject; PitchDelta, TurnDelta : Single; ADeltaTime: Double): Boolean;
     // Uses AdjustDistanceParams.
-    function AdjustDistanceToPoint(const  APoint: TVector; const DistanceRatio : Single; ADeltaTime: Double): Boolean;
+    function AdjustDistanceToPoint(const  APoint: TGLVector; const DistanceRatio : Single; ADeltaTime: Double): Boolean;
     function AdjustDistanceToTarget(const DistanceRatio : Single; const ADeltaTime: Double): Boolean;
     // Uses AdjustDistanceParamsEx.
-    function AdjustDistanceToPointEx(const  APoint: TVector; ADeltaTime: Double): Boolean;
+    function AdjustDistanceToPointEx(const  APoint: TGLVector; ADeltaTime: Double): Boolean;
     function AdjustDistanceToTargetEx(const ADeltaTime: Double): Boolean;
     // Uses CustomAnimatedItems.
     procedure AnimateCustomItems(const ADeltaTime: Double); virtual;
@@ -696,7 +696,7 @@ var
   FinalPitch: Single;
   FinalTurn:  Single;
 
-  lUp: TVector;
+  lUp: TGLVector;
 begin
   Result := False;
   FinalPitch := 0;
@@ -733,13 +733,13 @@ begin
 end;
 
 
-function TGLSmoothNavigator.AdjustDistanceToPoint(const APoint: TVector;
+function TGLSmoothNavigator.AdjustDistanceToPoint(const APoint: TGLVector;
   const DistanceRatio: Single; ADeltaTime: Double): Boolean;
 
   // Based on TGLCamera.AdjustDistanceToTarget
   procedure DoAdjustDistanceToPoint(const DistanceRatio: Single);
   var
-    vect: TVector;
+    vect: TGLVector;
   begin
     vect := VectorSubtract(MovingObject.AbsolutePosition, APoint);
     ScaleVector(vect, (distanceRatio - 1));
@@ -791,17 +791,17 @@ begin
   FAdjustDistanceParams.Assign(Value);
 end;
 
-function TGLSmoothNavigator.AdjustDistanceToPointEx(const APoint: TVector;
+function TGLSmoothNavigator.AdjustDistanceToPointEx(const APoint: TGLVector;
   ADeltaTime: Double): Boolean;
 
 var
-  lAbsolutePosition: TVector;
+  lAbsolutePosition: TGLVector;
   lCurrentDistance: Single;
   lDistanceDifference, lTempCurrentDistance: Single;
 
   procedure DoAdjustDistanceToPoint(const DistanceValue: Single);
   var
-    vect: TVector;
+    vect: TGLVector;
   begin
     vect := VectorSubtract(APoint, lAbsolutePosition);
     NormalizeVector(vect);
@@ -1564,14 +1564,14 @@ end;
 
 function TGLNavigatorSmoothChangeVector.Proceed(ADeltaTime: Double): Boolean;
 var
-  lAbsolutePosition: TVector;
+  lAbsolutePosition: TGLVector;
   lCurrentDistance: Single;
   lTotalDistanceToTravelThisTime, lDistanceToTravelThisTime: Single;
   lMaxExpectedDeltaTime: Double;
 
   procedure DoAdjustDistanceToPoint();
   var
-    vect: TVector;
+    vect: TGLVector;
   begin
     vect := VectorScale(VectorNormalize(VectorSubtract(FTargetValue.DirectVector, lAbsolutePosition)), lTotalDistanceToTravelThisTime);
     AddVector(vect, lAbsolutePosition);

+ 4 - 4
Source/GLS.Sound.pas

@@ -222,7 +222,7 @@ type
     FPause: Boolean;
     FMasterVolume: Single;
     FListener: TGLBaseSceneObject;
-    FLastListenerPosition: TVector;
+    FLastListenerPosition: TGLVector;
     FSources: TGLSoundSources;
     FMaxChannels: Integer;
     FOutputFrequency: Integer;
@@ -257,7 +257,7 @@ type
     procedure SetSoundEnvironment(const val: TGLSoundEnvironment);
     procedure Loaded; override;
     procedure DefineProperties(Filer: TFiler); override;
-    procedure ListenerCoordinates(var position, velocity, direction, up: TVector);
+    procedure ListenerCoordinates(var position, velocity, direction, up: TGLVector);
     function DoActivate: Boolean; virtual;
     // Invoked AFTER all sources have been stopped
     procedure DoDeActivate; virtual;
@@ -1321,9 +1321,9 @@ end;
 
 
 procedure TGLSoundManager.ListenerCoordinates(var position, velocity, direction,
-  up: TVector);
+  up: TGLVector);
 var
-  right: TVector;
+  right: TGLVector;
 begin
   if Listener <> nil then
   begin

+ 5 - 5
Source/GLS.SpaceText.pas

@@ -127,8 +127,8 @@ type
     procedure NotifyFontChanged;
     procedure NotifyChange(sender: TObject); override;
     procedure DefaultHandler(var Message); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
-    function BarycenterAbsolutePosition: TVector; override;
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
+    function BarycenterAbsolutePosition: TGLVector; override;
   published
     (* Adjusts the 3D font extrusion.
       If Extrusion=0, the characters will be flat (2D), values >0 will
@@ -615,10 +615,10 @@ begin
   end;
 end;
 
-function TGLSpaceText.BarycenterAbsolutePosition: TVector;
+function TGLSpaceText.BarycenterAbsolutePosition: TGLVector;
 var
   lWidth, lHeightMax, lHeightMin: Single;
-  AdjustVector: TVector;
+  AdjustVector: TGLVector;
 begin
   TextMetrics(Text, lWidth, lHeightMax, lHeightMin);
 
@@ -657,7 +657,7 @@ begin
   Result := LocalToAbsolute(AdjustVector);
 end;
 
-function TGLSpaceText.AxisAlignedDimensionsUnscaled: TVector;
+function TGLSpaceText.AxisAlignedDimensionsUnscaled: TGLVector;
 var
   lWidth, lHeightMax, lHeightMin: Single;
   charScale: Single;

+ 4 - 4
Source/GLS.Spline.pas

@@ -57,9 +57,9 @@ type
     procedure SplineAffineVector(const t: Single;
       var vector: TAffineVector); overload;
     // Calculates vector at time t. 
-    function SplineVector(const t: Single): TVector; overload;
+    function SplineVector(const t: Single): TGLVector; overload;
     // Calculates vector at time t. 
-    procedure SplineVector(const t: Single; var vector: TVector); overload;
+    procedure SplineVector(const t: Single; var vector: TGLVector); overload;
     // Calculates X component slope at time t. 
     function SplineSlopeX(const t: Single): Single;
     // Calculates Y component slope at time t. 
@@ -269,7 +269,7 @@ begin
   vector.Z := MATValeurSpline(matZ, t, FNb);
 end;
 
-function TCubicSpline.SplineVector(const t: Single): TVector;
+function TCubicSpline.SplineVector(const t: Single): TGLVector;
 begin
   Result.X := MATValeurSpline(matX, t, FNb);
   Result.Y := MATValeurSpline(matY, t, FNb);
@@ -277,7 +277,7 @@ begin
   Result.W := MATValeurSpline(matW, t, FNb);
 end;
 
-procedure TCubicSpline.SplineVector(const t: Single; var vector: TVector);
+procedure TCubicSpline.SplineVector(const t: Single; var vector: TGLVector);
 begin
   vector.X := MATValeurSpline(matX, t, FNb);
   vector.Y := MATValeurSpline(matY, t, FNb);

+ 65 - 65
Source/GLS.State.pas

@@ -152,23 +152,23 @@ type
   TGLHintType = (hintDontCare, hintFastest, hintNicest);
 
   TGLLightSourceState = packed record
-    Position: array [0 .. MAX_HARDWARE_LIGHT - 1] of TVector;
-    Ambient: array [0 .. MAX_HARDWARE_LIGHT - 1] of TVector;
-    Diffuse: array [0 .. MAX_HARDWARE_LIGHT - 1] of TVector;
-    Specular: array [0 .. MAX_HARDWARE_LIGHT - 1] of TVector;
-    SpotDirection: array [0 .. MAX_HARDWARE_LIGHT - 1] of TVector;
-    SpotCosCutoffExponent: array [0 .. MAX_HARDWARE_LIGHT - 1] of TVector;
-    Attenuation: array [0 .. MAX_HARDWARE_LIGHT - 1] of TVector;
+    Position: array [0 .. MAX_HARDWARE_LIGHT - 1] of TGLVector;
+    Ambient: array [0 .. MAX_HARDWARE_LIGHT - 1] of TGLVector;
+    Diffuse: array [0 .. MAX_HARDWARE_LIGHT - 1] of TGLVector;
+    Specular: array [0 .. MAX_HARDWARE_LIGHT - 1] of TGLVector;
+    SpotDirection: array [0 .. MAX_HARDWARE_LIGHT - 1] of TGLVector;
+    SpotCosCutoffExponent: array [0 .. MAX_HARDWARE_LIGHT - 1] of TGLVector;
+    Attenuation: array [0 .. MAX_HARDWARE_LIGHT - 1] of TGLVector;
   end;
 
   TGLShaderLightSourceState = packed record
-    Position: array [0 .. MAX_SHADER_LIGHT - 1] of TVector;
-    Ambient: array [0 .. MAX_SHADER_LIGHT - 1] of TVector;
-    Diffuse: array [0 .. MAX_SHADER_LIGHT - 1] of TVector;
-    Specular: array [0 .. MAX_SHADER_LIGHT - 1] of TVector;
-    SpotDirection: array [0 .. MAX_SHADER_LIGHT - 1] of TVector;
-    SpotCosCutoffExponent: array [0 .. MAX_SHADER_LIGHT - 1] of TVector;
-    Attenuation: array [0 .. MAX_SHADER_LIGHT - 1] of TVector;
+    Position: array [0 .. MAX_SHADER_LIGHT - 1] of TGLVector;
+    Ambient: array [0 .. MAX_SHADER_LIGHT - 1] of TGLVector;
+    Diffuse: array [0 .. MAX_SHADER_LIGHT - 1] of TGLVector;
+    Specular: array [0 .. MAX_SHADER_LIGHT - 1] of TGLVector;
+    SpotDirection: array [0 .. MAX_SHADER_LIGHT - 1] of TGLVector;
+    SpotCosCutoffExponent: array [0 .. MAX_SHADER_LIGHT - 1] of TGLVector;
+    Attenuation: array [0 .. MAX_SHADER_LIGHT - 1] of TGLVector;
   end;
 
   TGLOnLightsChanged = procedure(Sender: TObject);
@@ -190,7 +190,7 @@ type
   TGLStateCache = class
   strict private
     // Legacy state
-    FFrontBackColors: array [0 .. 1, 0 .. 3] of TVector;
+    FFrontBackColors: array [0 .. 1, 0 .. 3] of TGLVector;
     FFrontBackShininess: array [0 .. 1] of Integer;
     FAlphaFunc: TGLComparisonFunction;
     FAlphaRef: Single;
@@ -292,7 +292,7 @@ type
     FBlendDstAlpha: TGLDstBlendFunction;
     FBlendEquationRGB: TGLBlendEquation;
     FBlendEquationAlpha: TGLBlendEquation;
-    FBlendColor: TVector;
+    FBlendColor: TGLVector;
     FEnableFramebufferSRGB: TGLboolean;
     FEnableDither: TGLboolean;
     FEnableColorLogicOp: TGLboolean;
@@ -302,7 +302,7 @@ type
     FDepthWriteMask: TGLboolean;
     FStencilWriteMask: Cardinal;
     FStencilBackWriteMask: Cardinal;
-    FColorClearValue: TVector;
+    FColorClearValue: TGLVector;
     FDepthClearValue: TGLfloat;
     FStencilClearValue: Cardinal;
     // Framebuffer state
@@ -335,7 +335,7 @@ type
     FUniformBufferBinding: Cardinal;
     FUBOStates: array [TGLBufferBindingTarget, 0 .. MAX_HARDWARE_UNIFORM_BUFFER_BINDING - 1] of TUBOStates;
     // Vector + Geometry Shader state
-    FCurrentVertexAttrib: array [0 .. 15] of TVector;
+    FCurrentVertexAttrib: array [0 .. 15] of TGLVector;
     FEnableProgramPointSize: TGLboolean;
     // Transform Feedback state
     FTransformFeedbackBufferBinding: Cardinal;
@@ -430,7 +430,7 @@ type
     procedure SetDepthFunc(const Value: TGLDepthFunction); inline;
     function GetEnableBlend(index: Integer): TGLboolean; inline;
     procedure SetEnableBlend(index: Integer; const Value: TGLboolean); inline;
-    procedure SetBlendColor(const Value: TVector); inline;
+    procedure SetBlendColor(const Value: TGLVector); inline;
     procedure SetEnableFramebufferSRGB(const Value: TGLboolean); inline;
     procedure SetEnableDither(const Value: TGLboolean); inline;
     procedure SetEnableColorLogicOp(const Value: TGLboolean); inline;
@@ -441,7 +441,7 @@ type
     procedure SetDepthWriteMask(const Value: TGLboolean); inline;
     procedure SetStencilWriteMask(const Value: Cardinal); inline;
     procedure SetStencilBackWriteMask(const Value: Cardinal); inline;
-    procedure SetColorClearValue(const Value: TVector); inline;
+    procedure SetColorClearValue(const Value: TGLVector); inline;
     procedure SetDepthClearValue(const Value: TGLfloat); inline;
     procedure SetStencilClearValue(const Value: Cardinal); inline;
     // Framebuffer
@@ -473,8 +473,8 @@ type
     procedure SetUniformBufferBinding(const Value: Cardinal); inline;
     function GetMaxTextureUnits: Cardinal; inline;
     // Vector + Geometry Shader state
-    function GetCurrentVertexAttrib(index: Integer): TVector; inline;
-    procedure SetCurrentVertexAttrib(index: Integer; const Value: TVector); inline;
+    function GetCurrentVertexAttrib(index: Integer): TGLVector; inline;
+    procedure SetCurrentVertexAttrib(index: Integer; const Value: TGLVector); inline;
     procedure SetEnableProgramPointSize(const Value: TGLboolean); inline;
     // Transform Feedback state
     procedure SetTransformFeedbackBufferBinding(const Value: Cardinal); inline;
@@ -495,16 +495,16 @@ type
     function GetMaxLights: Integer; inline;
     function GetLightEnabling(I: Integer): Boolean; inline;
     procedure SetLightEnabling(I: Integer; Value: Boolean); inline;
-    function GetLightPosition(I: Integer): TVector; inline;
-    procedure SetLightPosition(I: Integer; const Value: TVector); inline;
+    function GetLightPosition(I: Integer): TGLVector; inline;
+    procedure SetLightPosition(I: Integer; const Value: TGLVector); inline;
     function GetLightSpotDirection(I: Integer): TAffineVector; inline;
     procedure SetLightSpotDirection(I: Integer; const Value: TAffineVector); inline;
-    function GetLightAmbient(I: Integer): TVector; inline;
-    procedure SetLightAmbient(I: Integer; const Value: TVector); inline;
-    function GetLightDiffuse(I: Integer): TVector; inline;
-    procedure SetLightDiffuse(I: Integer; const Value: TVector); inline;
-    function GetLightSpecular(I: Integer): TVector; inline;
-    procedure SetLightSpecular(I: Integer; const Value: TVector); inline;
+    function GetLightAmbient(I: Integer): TGLVector; inline;
+    procedure SetLightAmbient(I: Integer; const Value: TGLVector); inline;
+    function GetLightDiffuse(I: Integer): TGLVector; inline;
+    procedure SetLightDiffuse(I: Integer; const Value: TGLVector); inline;
+    function GetLightSpecular(I: Integer): TGLVector; inline;
+    procedure SetLightSpecular(I: Integer; const Value: TGLVector); inline;
     function GetSpotCutoff(I: Integer): Single; inline;
     procedure SetSpotCutoff(I: Integer; const Value: Single); inline;
     function GetSpotExponent(I: Integer): Single; inline;
@@ -516,10 +516,10 @@ type
     function GetQuadAtten(I: Integer): Single; inline;
     procedure SetQuadAtten(I: Integer; const Value: Single); inline;
     procedure SetForwardContext(Value: Boolean); inline;
-    function GetMaterialAmbient(const aFace: TGLCullFaceMode): TVector; inline;
-    function GetMaterialDiffuse(const aFace: TGLCullFaceMode): TVector; inline;
-    function GetMaterialSpecular(const aFace: TGLCullFaceMode): TVector; inline;
-    function GetMaterialEmission(const aFace: TGLCullFaceMode): TVector; inline;
+    function GetMaterialAmbient(const aFace: TGLCullFaceMode): TGLVector; inline;
+    function GetMaterialDiffuse(const aFace: TGLCullFaceMode): TGLVector; inline;
+    function GetMaterialSpecular(const aFace: TGLCullFaceMode): TGLVector; inline;
+    function GetMaterialEmission(const aFace: TGLCullFaceMode): TGLVector; inline;
     function GetMaterialShininess(const aFace: TGLCullFaceMode): Integer; inline;
   public
     constructor Create; virtual;
@@ -540,26 +540,26 @@ type
     procedure SetGLFrontFaceCW; deprecated; inline;
     procedure ResetAll; deprecated; inline;
     // Adjusts material colors for a face
-    procedure SetGLMaterialColors(const aFace: TGLCullFaceMode; const emission, Ambient, Diffuse, Specular: TVector;
+    procedure SetGLMaterialColors(const aFace: TGLCullFaceMode; const emission, Ambient, Diffuse, Specular: TGLVector;
       const shininess: Integer);
-    property MaterialAmbient[const aFace: TGLCullFaceMode]: TVector read GetMaterialAmbient;
-    property MaterialDiffuse[const aFace: TGLCullFaceMode]: TVector read GetMaterialDiffuse;
-    property MaterialSpecular[const aFace: TGLCullFaceMode]: TVector read GetMaterialSpecular;
-    property MaterialEmission[const aFace: TGLCullFaceMode]: TVector read GetMaterialEmission;
+    property MaterialAmbient[const aFace: TGLCullFaceMode]: TGLVector read GetMaterialAmbient;
+    property MaterialDiffuse[const aFace: TGLCullFaceMode]: TGLVector read GetMaterialDiffuse;
+    property MaterialSpecular[const aFace: TGLCullFaceMode]: TGLVector read GetMaterialSpecular;
+    property MaterialEmission[const aFace: TGLCullFaceMode]: TGLVector read GetMaterialEmission;
     property MaterialShininess[const aFace: TGLCullFaceMode]: Integer read GetMaterialShininess;
     // Adjusts material alpha channel for a face
     procedure SetGLMaterialAlphaChannel(const aFace: Cardinal; const alpha: TGLfloat);
     // Adjusts material diffuse color for a face
-    procedure SetGLMaterialDiffuseColor(const aFace: Cardinal; const Diffuse: TVector);
+    procedure SetGLMaterialDiffuseColor(const aFace: Cardinal; const Diffuse: TGLVector);
     // Lighting states
     property FixedFunctionPipeLight: Boolean read FFFPLight write SetFFPLight;
     property MaxLights: Integer read GetMaxLights;
     property LightEnabling[Index: Integer]: Boolean read GetLightEnabling write SetLightEnabling;
-    property LightPosition[Index: Integer]: TVector read GetLightPosition write SetLightPosition;
+    property LightPosition[Index: Integer]: TGLVector read GetLightPosition write SetLightPosition;
     property LightSpotDirection[Index: Integer]: TAffineVector read GetLightSpotDirection write SetLightSpotDirection;
-    property LightAmbient[Index: Integer]: TVector read GetLightAmbient write SetLightAmbient;
-    property LightDiffuse[Index: Integer]: TVector read GetLightDiffuse write SetLightDiffuse;
-    property LightSpecular[Index: Integer]: TVector read GetLightSpecular write SetLightSpecular;
+    property LightAmbient[Index: Integer]: TGLVector read GetLightAmbient write SetLightAmbient;
+    property LightDiffuse[Index: Integer]: TGLVector read GetLightDiffuse write SetLightDiffuse;
+    property LightSpecular[Index: Integer]: TGLVector read GetLightSpecular write SetLightSpecular;
     property LightSpotCutoff[Index: Integer]: Single read GetSpotCutoff write SetSpotCutoff;
     property LightSpotExponent[Index: Integer]: Single read GetSpotExponent write SetSpotExponent;
     property LightConstantAtten[Index: Integer]: Single read GetConstantAtten write SetConstantAtten;
@@ -771,7 +771,7 @@ type
     // Sets the blend equations for RGB + alpha separately.
     procedure SetBlendEquationSeparate(const modeRGB, modeAlpha: TGLBlendEquation); inline;
     // A constant blend color, that can be used in the blend equation.
-    property BlendColor: TVector read FBlendColor write SetBlendColor;
+    property BlendColor: TGLVector read FBlendColor write SetBlendColor;
     // Enables/disables framebuffer SRGB.
     property EnableFramebufferSRGB: TGLboolean read FEnableFramebufferSRGB write SetEnableFramebufferSRGB;
     // Enables/disables dithering.
@@ -791,7 +791,7 @@ type
     // The stencil back write mask.
     property StencilBackWriteMask: Cardinal read FStencilBackWriteMask write SetStencilBackWriteMask;
     // The color clear value.
-    property ColorClearValue: TVector read FColorClearValue write SetColorClearValue;
+    property ColorClearValue: TGLVector read FColorClearValue write SetColorClearValue;
     // The depth clear value.
     property DepthClearValue: TGLfloat read FDepthClearValue write SetDepthClearValue;
     // The stencil clear value.
@@ -853,7 +853,7 @@ type
     procedure SetBufferIndexedBinding(const Value: Cardinal; ATarget: TGLBufferBindingTarget; AIndex: Cardinal;
       AOffset: TGLintptr; ARangeSize: TGLsizeiptr); overload; inline;
     // Default values to be used when a vertex array is not used for that attribute
-    property CurrentVertexAttrib[Index: Integer]: TVector read GetCurrentVertexAttrib write SetCurrentVertexAttrib;
+    property CurrentVertexAttrib[Index: Integer]: TGLVector read GetCurrentVertexAttrib write SetCurrentVertexAttrib;
     // Enables/disables program point size
     property EnableProgramPointSize: TGLboolean read FEnableProgramPointSize write SetEnableProgramPointSize;
     // Currently bound transform feedbac buffer
@@ -1331,7 +1331,7 @@ begin
 end;
 
 procedure TGLStateCache.SetGLMaterialColors(const aFace: TGLCullFaceMode;
-  const emission, ambient, diffuse, specular: TVector;
+  const emission, ambient, diffuse, specular: TGLVector;
   const shininess: Integer);
 var
   I: Integer;
@@ -1417,7 +1417,7 @@ begin
   end;
 end;
 
-procedure TGLStateCache.SetGLMaterialDiffuseColor(const aFace: Cardinal; const Diffuse: TVector);
+procedure TGLStateCache.SetGLMaterialDiffuseColor(const aFace: Cardinal; const Diffuse: TGLVector);
 var
   I: Integer;
 begin
@@ -1554,7 +1554,7 @@ begin
   end;
 end;
 
-procedure TGLStateCache.SetBlendColor(const Value: TVector);
+procedure TGLStateCache.SetBlendColor(const Value: TGLVector);
 begin
   if not VectorEquals(Value, FBlendColor) or FInsideList then
   begin
@@ -1704,7 +1704,7 @@ begin
   end;
 end;
 
-procedure TGLStateCache.SetCurrentVertexAttrib(index: Integer; const Value: TVector);
+procedure TGLStateCache.SetCurrentVertexAttrib(index: Integer; const Value: TGLVector);
 begin
   if not VectorEquals(Value, FCurrentVertexAttrib[Index]) then
   begin
@@ -2034,7 +2034,7 @@ begin
   Result := FCurrentQuery[Index];
 end;
 
-function TGLStateCache.GetCurrentVertexAttrib(index: Integer): TVector;
+function TGLStateCache.GetCurrentVertexAttrib(index: Integer): TGLVector;
 begin
   Result := FCurrentVertexAttrib[Index];
 end;
@@ -2071,17 +2071,17 @@ begin
   Result := FMaxTextureSize;
 end;
 
-function TGLStateCache.GetMaterialAmbient(const aFace: TGLCullFaceMode): TVector;
+function TGLStateCache.GetMaterialAmbient(const aFace: TGLCullFaceMode): TGLVector;
 begin
   Result := FFrontBackColors[ord(aFace)][1];
 end;
 
-function TGLStateCache.GetMaterialDiffuse(const aFace: TGLCullFaceMode): TVector;
+function TGLStateCache.GetMaterialDiffuse(const aFace: TGLCullFaceMode): TGLVector;
 begin
   Result := FFrontBackColors[ord(aFace)][2];
 end;
 
-function TGLStateCache.GetMaterialEmission(const aFace: TGLCullFaceMode): TVector;
+function TGLStateCache.GetMaterialEmission(const aFace: TGLCullFaceMode): TGLVector;
 begin
   Result := FFrontBackColors[ord(aFace)][0];
 end;
@@ -2091,7 +2091,7 @@ begin
   Result := FFrontBackShininess[ord(aFace)];
 end;
 
-function TGLStateCache.GetMaterialSpecular(const aFace: TGLCullFaceMode): TVector;
+function TGLStateCache.GetMaterialSpecular(const aFace: TGLCullFaceMode): TGLVector;
 begin
   Result := FFrontBackColors[ord(aFace)][3];
 end;
@@ -2588,7 +2588,7 @@ begin
   end;
 end;
 
-procedure TGLStateCache.SetColorClearValue(const Value: TVector);
+procedure TGLStateCache.SetColorClearValue(const Value: TGLVector);
 begin
   if not VectorEquals(Value, FColorClearValue) or FInsideList then
   begin
@@ -3158,12 +3158,12 @@ begin
   Result := @FShaderLightStates;
 end;
 
-function TGLStateCache.GetLightPosition(I: Integer): TVector;
+function TGLStateCache.GetLightPosition(I: Integer): TGLVector;
 begin
   Result := FLightStates.Position[I];
 end;
 
-procedure TGLStateCache.SetLightPosition(I: Integer; const Value: TVector);
+procedure TGLStateCache.SetLightPosition(I: Integer; const Value: TGLVector);
 begin
   if not VectorEquals(Value, FLightStates.Position[I]) then
   begin
@@ -3190,12 +3190,12 @@ begin
   end;
 end;
 
-function TGLStateCache.GetLightAmbient(I: Integer): TVector;
+function TGLStateCache.GetLightAmbient(I: Integer): TGLVector;
 begin
   Result := FLightStates.Ambient[I];
 end;
 
-procedure TGLStateCache.SetLightAmbient(I: Integer; const Value: TVector);
+procedure TGLStateCache.SetLightAmbient(I: Integer; const Value: TGLVector);
 begin
   if not VectorEquals(Value, FLightStates.Ambient[I]) or FInsideList then
   begin
@@ -3213,12 +3213,12 @@ begin
   end;
 end;
 
-function TGLStateCache.GetLightDiffuse(I: Integer): TVector;
+function TGLStateCache.GetLightDiffuse(I: Integer): TGLVector;
 begin
   Result := FLightStates.Diffuse[I];
 end;
 
-procedure TGLStateCache.SetLightDiffuse(I: Integer; const Value: TVector);
+procedure TGLStateCache.SetLightDiffuse(I: Integer; const Value: TGLVector);
 begin
   if not VectorEquals(Value, FLightStates.Diffuse[I]) or FInsideList then
   begin
@@ -3236,12 +3236,12 @@ begin
   end;
 end;
 
-function TGLStateCache.GetLightSpecular(I: Integer): TVector;
+function TGLStateCache.GetLightSpecular(I: Integer): TGLVector;
 begin
   Result := FLightStates.Specular[I];
 end;
 
-procedure TGLStateCache.SetLightSpecular(I: Integer; const Value: TVector);
+procedure TGLStateCache.SetLightSpecular(I: Integer; const Value: TGLVector);
 begin
   if not VectorEquals(Value, FLightStates.Specular[I]) or FInsideList then
   begin

+ 10 - 10
Source/GLS.TerrainRenderer.pas

@@ -110,11 +110,11 @@ type
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
-    function RayCastIntersect(const rayStart, rayVector: TVector;
-      intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean; override;
+    function RayCastIntersect(const rayStart, rayVector: TGLVector;
+      intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean; override;
     (* Interpolates height for the given point.
        Expects a point expressed in absolute coordinates. *)
-    function InterpolatedHeight(const p: TVector): Single; overload;
+    function InterpolatedHeight(const p: TGLVector): Single; overload;
     function InterpolatedHeight(const p: TAffineVector): Single; overload;
     // Triangle count for the last render
     property LastTriangleCount: Integer read FLastTriangleCount;
@@ -286,14 +286,14 @@ begin
     HeightDataSource.Clear;
 end;
 
-function TGLTerrainRenderer.RayCastIntersect(const rayStart, rayVector: TVector;
-  intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean;
+function TGLTerrainRenderer.RayCastIntersect(const rayStart, rayVector: TGLVector;
+  intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean;
 var
-  p1, d, p2, p3: TVector;
+  p1, d, p2, p3: TGLVector;
   step, i, h, minH, maxH, p1height: Single;
   startedAbove: Boolean;
   failSafe: Integer;
-  AbsX, AbsY, AbsZ: TVector;
+  AbsX, AbsY, AbsZ: TGLVector;
 begin
   Result := False;
   if Assigned(HeightDataSource) then
@@ -411,9 +411,9 @@ begin
   end;
 end;
 
-function TGLTerrainRenderer.InterpolatedHeight(const p: TVector): Single;
+function TGLTerrainRenderer.InterpolatedHeight(const p: TGLVector): Single;
 var
-  pLocal: TVector;
+  pLocal: TGLVector;
 begin
   if Assigned(HeightDataSource) then
   begin
@@ -432,7 +432,7 @@ end;
 
 procedure TGLTerrainRenderer.BuildList(var rci: TGLRenderContextInfo);
 var
-  vEye, vEyeDirection: TVector;
+  vEye, vEyeDirection: TGLVector;
   TilePos, AbsTilePos, Observer: TAffineVector;
   DeltaX, nbX, iX: Integer;
   DeltaY, nbY, iY: Integer;

+ 5 - 5
Source/GLS.ThorFX.pas

@@ -38,7 +38,7 @@ type
   PThorpoint = ^TThorpoint;
 
   TThorpoint = record
-    Position: TVector; // Position
+    Position: TGLVector; // Position
     Size: single; // particle size
   end;
 
@@ -293,7 +293,7 @@ end;
 procedure TGLThorFXManager.CalcThor;
 var
   N: integer;
-  vec, axs, nvec: TVector;
+  vec, axs, nvec: TGLVector;
   dist: single;
   a, b: single;
   len: single;
@@ -463,14 +463,14 @@ procedure TGLBThorFX.Render(var rci: TGLRenderContextInfo);
 var
   N: integer;
   i: integer;
-  // absPos :TVector;
-  InnerColor: TVector;
+  // absPos :TGLVector;
+  InnerColor: TGLVector;
   distList: TSingleList;
   objList: TList;
   fp: PThorpoint;
   mat: TMatrix;
 
-  vx, vy: TVector;
+  vx, vy: TGLVector;
   m: integer;
   Icol, Ocol, Ccol: TColorVector;
   Ppos, Ppos2: TAffineVector;

+ 4 - 4
Source/GLS.Tree.pas

@@ -168,7 +168,7 @@ type
     FLeafBackMaterialName: TGLLibMaterialName;
     FBranchMaterialName: TGLLibMaterialName;
     FRebuildTree: Boolean;
-    FAxisAlignedDimensionsCache: TVector;
+    FAxisAlignedDimensionsCache: TGLVector;
   protected
    procedure SetDepth(const Value: Integer);
     procedure SetBranchFacets(const Value: Integer);
@@ -205,7 +205,7 @@ type
     procedure ForceTotalRebuild;
     procedure Clear;
     procedure GetExtents(var min, max: TAffineVector);
-    function AxisAlignedDimensionsUnscaled: TVector; override;
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
     procedure LoadFromStream(aStream: TStream);
     procedure SaveToStream(aStream: TStream);
     procedure LoadFromFile(const aFileName: String);
@@ -287,7 +287,7 @@ end;
 procedure TGLTreeLeaves.AddNew(matrix: TMatrix);
 var
   radius: Single;
-  pos: TVector;
+  pos: TGLVector;
 begin
   radius := Owner.LeafSize;
   Inc(FCount);
@@ -1339,7 +1339,7 @@ begin
   max.Z := MaxFloat([lmin.Z, lmax.Z, bmin.Z, bmax.Z]);
 end;
 
-function TGLTree.AxisAlignedDimensionsUnscaled: TVector;
+function TGLTree.AxisAlignedDimensionsUnscaled: TGLVector;
 var
   dMin, dMax: TAffineVector;
 begin

+ 42 - 43
Source/GLS.VectorFileObjects.pas

@@ -1,7 +1,6 @@
 //
 // The graphics rendering engine GLScene http://glscene.org
 //
-
 unit GLS.VectorFileObjects;
 
 (* Vector File related objects *)
@@ -22,6 +21,7 @@ uses
   GLS.OpenGLTokens,
   GLS.Scene,
   GLS.VectorGeometry,
+  GLS.VectorTypes,
   GLS.VectorTypesExt,
   GLS.VectorLists,
   GLS.PersistentClasses,
@@ -468,16 +468,16 @@ type
     procedure GetExtents(out min, max: TAffineVector); overload; virtual;
     procedure GetExtents(out aabb: TAABB); overload; virtual;
     // Barycenter from vertices data
-    function GetBarycenter: TVector;
+    function GetBarycenter: TGLVector;
     // Precalculate whatever is needed for rendering, called once
     procedure Prepare; virtual;
     function PointInObject(const aPoint: TAffineVector): Boolean; virtual;
     // Returns the triangle data for a given triangle
     procedure GetTriangleData(tri: Integer; list: TAffineVectorList; var v0, v1, v2: TAffineVector); overload;
-    procedure GetTriangleData(tri: Integer; list: TVectorList; var v0, v1, v2: TVector); overload;
+    procedure GetTriangleData(tri: Integer; list: TVectorList; var v0, v1, v2: TGLVector); overload;
     // Sets the triangle data of a given triangle
     procedure SetTriangleData(tri: Integer; list: TAffineVectorList; const v0, v1, v2: TAffineVector); overload;
-    procedure SetTriangleData(tri: Integer; list: TVectorList; const v0, v1, v2: TVector); overload;
+    procedure SetTriangleData(tri: Integer; list: TVectorList; const v0, v1, v2: TGLVector); overload;
     (* Build the tangent space from the mesh object's vertex, normal
       and texcoord data, filling the binormals and tangents where specified. *)
     procedure BuildTangentSpace(buildBinormals: Boolean = True; buildTangents: Boolean = True);
@@ -846,9 +846,9 @@ type
     FNormalsOrientation: TGLMeshNormalsOrientation;
     FMaterialLibrary: TGLMaterialLibrary;
     FLightmapLibrary: TGLMaterialLibrary;
-    FAxisAlignedDimensionsCache: TVector;
+    FAxisAlignedDimensionsCache: TGLVector;
     FBaryCenterOffsetChanged: Boolean;
-    FBaryCenterOffset: TVector;
+    FBaryCenterOffset: TGLVector;
     FUseMeshMaterials: Boolean;
     FOverlaySkeleton: Boolean;
     FIgnoreMissingTextures: Boolean;
@@ -891,10 +891,10 @@ type
     destructor Destroy; override;
     procedure Assign(Source: TPersistent); override;
     procedure Notification(AComponent: TComponent; Operation: TOperation); override;
-    function AxisAlignedDimensionsUnscaled: TVector; override;
-    function BarycenterOffset: TVector;
-    function BarycenterPosition: TVector;
-    function BarycenterAbsolutePosition: TVector; override;
+    function AxisAlignedDimensionsUnscaled: TGLVector; override;
+    function BarycenterOffset: TGLVector;
+    function BarycenterPosition: TGLVector;
+    function BarycenterAbsolutePosition: TGLVector; override;
     procedure BuildList(var rci: TGLRenderContextInfo); override;
     procedure DoRender(var rci: TGLRenderContextInfo; renderSelf, renderChildren: Boolean); override;
     procedure StructureChanged; override;
@@ -904,8 +904,8 @@ type
       (ie. invalid collision detection). Use with caution. *)
     procedure StructureChangedNoPrepare;
     // BEWARE! Utterly inefficient implementation! 
-    function RayCastIntersect(const rayStart, rayVector: TVector; intersectPoint: PVector = nil;
-	  intersectNormal: PVector = nil): Boolean; override;
+    function RayCastIntersect(const rayStart, rayVector: TGLVector; intersectPoint: PGLVector = nil;
+	  intersectNormal: PGLVector = nil): Boolean; override;
     function GenerateSilhouette(const silhouetteParameters: TGLSilhouetteParameters): TGLSilhouette; override;
     (* This method allows fast shadow volumes for GLActors.
       If your actor/mesh doesn't change, you don't need to call this.
@@ -999,14 +999,14 @@ type
   public
     constructor Create(aOwner: TComponent); override;
     destructor Destroy; override;
-    function OctreeRayCastIntersect(const rayStart, rayVector: TVector; intersectPoint: PVector = nil;
-      intersectNormal: PVector = nil): Boolean;
-    function OctreeSphereSweepIntersect(const rayStart, rayVector: TVector; const velocity, radius: Single;
-      intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean;
+    function OctreeRayCastIntersect(const rayStart, rayVector: TGLVector; intersectPoint: PGLVector = nil;
+      intersectNormal: PGLVector = nil): Boolean;
+    function OctreeSphereSweepIntersect(const rayStart, rayVector: TGLVector; const velocity, radius: Single;
+      intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean;
     function OctreeTriangleIntersect(const v1, v2, v3: TAffineVector): Boolean;
     (* Returns true if Point is inside the free form - this will only work
       properly on closed meshes. Requires that Octree has been prepared. *)
-    function OctreePointInMesh(const Point: TVector): Boolean;
+    function OctreePointInMesh(const Point: TGLVector): Boolean;
     function OctreeAABBIntersect(const AABB: TAABB; objMatrix, invObjMatrix: TMatrix;
       triangles: TAffineVectorList = nil): Boolean;
     // TODO:  function OctreeSphereIntersect
@@ -1313,8 +1313,7 @@ uses
   GLS.MeshUtils,
   GLS.State,
   GLS.Utils,
-  GLS.BaseMeshSilhouette,
-  GLS.VectorTypes;
+  GLS.BaseMeshSilhouette;
 
 var
   vVectorFileFormats: TGLVectorFileFormatsList;
@@ -3121,7 +3120,7 @@ begin
   aabb := FExtentCache;
 end;
 
-function TMeshObject.GetBarycenter: TVector;
+function TMeshObject.GetBarycenter: TGLVector;
 var
   dMin, dMax: TAffineVector;
 begin
@@ -3299,7 +3298,7 @@ begin
   end;
 end;
 
-procedure TMeshObject.GetTriangleData(tri: Integer; list: TVectorList; var v0, v1, v2: TVector);
+procedure TMeshObject.GetTriangleData(tri: Integer; list: TVectorList; var v0, v1, v2: TGLVector);
 var
   i, LastCount, Count: Integer;
   fg: TFGVertexIndexList;
@@ -3451,7 +3450,7 @@ begin
   end;
 end;
 
-procedure TMeshObject.SetTriangleData(tri: Integer; list: TVectorList; const v0, v1, v2: TVector);
+procedure TMeshObject.SetTriangleData(tri: Integer; list: TVectorList; const v0, v1, v2: TGLVector);
 var
   i, LastCount, Count: Integer;
   fg: TFGVertexIndexList;
@@ -3574,7 +3573,7 @@ procedure TMeshObject.BuildTangentSpace(buildBinormals: Boolean = True; buildTan
 var
   i, j: Integer;
   v, n, t: array [0 .. 2] of TAffineVector;
-  tangent, binormal: array [0 .. 2] of TVector;
+  tangent, binormal: array [0 .. 2] of TGLVector;
   vt, tt: TAffineVector;
   interp, dot: Single;
 
@@ -3757,7 +3756,7 @@ begin
             if FUseVBO then
               FTexCoordsVBO[i].Bind;
             gl.ClientActiveTexture(GL_TEXTURE0 + i);
-            gl.TexCoordPointer(4, GL_FLOAT, SizeOf(TVector), tlists[i]);
+            gl.TexCoordPointer(4, GL_FLOAT, SizeOf(TGLVector), tlists[i]);
             gl.EnableClientState(GL_TEXTURE_COORD_ARRAY);
           end;
         end;
@@ -3955,7 +3954,7 @@ begin
 
     if FColorsVBO.IsDataNeedUpdate then
     begin
-      FColorsVBO.BindBufferData(Colors.list, SizeOf(TVector) * Colors.Count, BufferUsage);
+      FColorsVBO.BindBufferData(Colors.list, SizeOf(TGLVector) * Colors.Count, BufferUsage);
       FColorsVBO.NotifyDataUpdated;
       FColorsVBO.UnBind;
     end;
@@ -4011,7 +4010,7 @@ begin
 
       if FTexCoordsVBO[i].IsDataNeedUpdate then
       begin
-        FTexCoordsVBO[i].BindBufferData(TexCoordsEx[i].list, SizeOf(TVector) * TexCoordsEx[i].Count, BufferUsage);
+        FTexCoordsVBO[i].BindBufferData(TexCoordsEx[i].list, SizeOf(TGLVector) * TexCoordsEx[i].Count, BufferUsage);
         FTexCoordsVBO[i].NotifyDataUpdated;
         FTexCoordsVBO[i].UnBind;
       end;
@@ -4913,7 +4912,7 @@ var
   invMesh: TGLBaseMeshObject;
   invMat: TMatrix;
   Bone: TGLSkeletonBone;
-  p: TVector;
+  p: TGLVector;
 begin
   // cleanup existing stuff
   for i := 0 to FBoneMatrixInvertedMeshes.Count - 1 do
@@ -4991,7 +4990,7 @@ procedure TGLSkeletonMeshObject.ApplyCurrentSkeletonFrame(normalize: Boolean);
 var
   i, j, BoneID: Integer;
   refVertices, refNormals: TAffineVectorList;
-  n, nt: TVector;
+  n, nt: TGLVector;
   Bone: TGLSkeletonBone;
   Skeleton: TGLSkeleton;
   tempvert, tempnorm: TAffineVector;
@@ -6175,7 +6174,7 @@ begin
   inherited;
 end;
 
-function TGLBaseMesh.AxisAlignedDimensionsUnscaled: TVector;
+function TGLBaseMesh.AxisAlignedDimensionsUnscaled: TGLVector;
 var
   dMin, dMax: TAffineVector;
 begin
@@ -6190,7 +6189,7 @@ begin
   SetVector(Result, FAxisAlignedDimensionsCache);
 end;
 
-function TGLBaseMesh.BarycenterOffset: TVector;
+function TGLBaseMesh.BarycenterOffset: TGLVector;
 var
   dMin, dMax: TAffineVector;
 begin
@@ -6207,12 +6206,12 @@ begin
   Result := FBaryCenterOffset;
 end;
 
-function TGLBaseMesh.BarycenterPosition: TVector;
+function TGLBaseMesh.BarycenterPosition: TGLVector;
 begin
   Result := VectorAdd(Position.DirectVector, BarycenterOffset);
 end;
 
-function TGLBaseMesh.BarycenterAbsolutePosition: TVector;
+function TGLBaseMesh.BarycenterAbsolutePosition: TGLVector;
 begin
   Result := LocalToAbsolute(BarycenterPosition);
 end;
@@ -6390,14 +6389,14 @@ begin
   inherited StructureChanged;
 end;
 
-function TGLBaseMesh.RayCastIntersect(const rayStart, rayVector: TVector; intersectPoint: PVector = nil;
-  intersectNormal: PVector = nil): Boolean;
+function TGLBaseMesh.RayCastIntersect(const rayStart, rayVector: TGLVector; intersectPoint: PGLVector = nil;
+  intersectNormal: PGLVector = nil): Boolean;
 
 var
   i,j: Integer;
   Obj: TMeshObject;
   Tris: TAffineVectorList;
-  locRayStart, locRayVector, iPoint, iNormal: TVector;
+  locRayStart, locRayVector, iPoint, iNormal: TGLVector;
   d, minD: Single;
 
 begin
@@ -6529,10 +6528,10 @@ begin
   end;
 end;
 
-function TGLFreeForm.OctreeRayCastIntersect(const rayStart, rayVector: TVector; intersectPoint: PVector = nil;
-  intersectNormal: PVector = nil): Boolean;
+function TGLFreeForm.OctreeRayCastIntersect(const rayStart, rayVector: TGLVector; intersectPoint: PGLVector = nil;
+  intersectNormal: PGLVector = nil): Boolean;
 var
-  locRayStart, locRayVector: TVector;
+  locRayStart, locRayVector: TGLVector;
 begin
   Assert(Assigned(FOctree), strOctreeMustBePreparedBeforeUse);
   SetVector(locRayStart, AbsoluteToLocal(rayStart));
@@ -6551,11 +6550,11 @@ begin
   end;
 end;
 
-function TGLFreeForm.OctreePointInMesh(const Point: TVector): Boolean;
+function TGLFreeForm.OctreePointInMesh(const Point: TGLVector): Boolean;
 const
   cPointRadiusStep = 10000;
 var
-  rayStart, rayVector, hitPoint, hitNormal: TVector;
+  rayStart, rayVector, hitPoint, hitNormal: TGLVector;
   BRad: double;
   HitCount: Integer;
   hitDot: double;
@@ -6605,10 +6604,10 @@ begin
   end;
 end;
 
-function TGLFreeForm.OctreeSphereSweepIntersect(const rayStart, rayVector: TVector; const velocity, radius: Single;
-  intersectPoint: PVector = nil; intersectNormal: PVector = nil): Boolean;
+function TGLFreeForm.OctreeSphereSweepIntersect(const rayStart, rayVector: TGLVector; const velocity, radius: Single;
+  intersectPoint: PGLVector = nil; intersectNormal: PGLVector = nil): Boolean;
 var
-  locRayStart, locRayVector: TVector;
+  locRayStart, locRayVector: TGLVector;
 begin
   Assert(Assigned(FOctree), strOctreeMustBePreparedBeforeUse);
   SetVector(locRayStart, AbsoluteToLocal(rayStart));

File diff suppressed because it is too large
+ 172 - 172
Source/GLS.VectorGeometry.pas


+ 25 - 25
Source/GLS.VectorLists.pas

@@ -129,7 +129,7 @@ type
     constructor Create; override;
     procedure Assign(Src: TPersistent); override;
     function Add(const item: TAffineVector): Integer; overload;
-    function Add(const item: TVector): Integer; overload;
+    function Add(const item: TGLVector): Integer; overload;
     procedure Add(const i1, i2: TAffineVector); overload;
     procedure Add(const i1, i2, i3: TAffineVector); overload;
     function Add(const item: TVector2f): Integer; overload;
@@ -172,33 +172,33 @@ type
     procedure Scale(const factors: TAffineVector); overload;
   end;
 
-  (* A list of TVector.
-   Similar to TList, but using TVector as items.
+  (* A list of TGLVector.
+   Similar to TList, but using TGLVector as items.
    The list has stack-like push/pop methods *)
   TVectorList = class(TBaseVectorList)
   private
     FList: PVectorArray;
   protected
-    function Get(Index: Integer): TVector; inline;
-    procedure Put(Index: Integer; const item: TVector); inline;
+    function Get(Index: Integer): TGLVector; inline;
+    procedure Put(Index: Integer; const item: TGLVector); inline;
     procedure SetCapacity(NewCapacity: Integer); override;
   public
     constructor Create; override;
     procedure Assign(Src: TPersistent); override;
-    function Add(const item: TVector): Integer; overload; inline;
+    function Add(const item: TGLVector): Integer; overload; inline;
     function Add(const item: TAffineVector; w: Single): Integer; overload; inline;
     function Add(const X, Y, Z, w: Single): Integer; overload; inline;
     procedure Add(const i1, i2, i3: TAffineVector; w: Single); overload; inline;
     function AddVector(const item: TAffineVector): Integer; overload;
     function AddPoint(const item: TAffineVector): Integer; overload;
     function AddPoint(const X, Y: Single; const Z: Single = 0): Integer; overload;
-    procedure Push(const Val: TVector);
-    function Pop: TVector;
-    function IndexOf(const item: TVector): Integer;
-    function FindOrAdd(const item: TVector): Integer;
+    procedure Push(const Val: TGLVector);
+    function Pop: TGLVector;
+    function IndexOf(const item: TGLVector): Integer;
+    function FindOrAdd(const item: TGLVector): Integer;
     function FindOrAddPoint(const item: TAffineVector): Integer;
-    procedure Insert(Index: Integer; const item: TVector);
-    property Items[Index: Integer]: TVector read Get write Put; default;
+    procedure Insert(Index: Integer; const item: TGLVector);
+    property Items[Index: Integer]: TGLVector read Get write Put; default;
     property List: PVectorArray read FList;
     procedure Lerp(const list1, list2: TBaseVectorList; lerpFactor: Single); override;
   end;
@@ -1220,7 +1220,7 @@ begin
   Inc(FRevision);
 end;
 
-function TAffineVectorList.Add(const item: TVector): Integer;
+function TAffineVectorList.Add(const item: TGLVector): Integer;
 begin
   Result := Add(PAffineVector(@item)^);
 end;
@@ -1546,7 +1546,7 @@ end;
 
 constructor TVectorList.Create;
 begin
-  FItemSize := SizeOf(TVector);
+  FItemSize := SizeOf(TGLVector);
   inherited Create;
   FGrowthDelta := cDefaultListGrowthDelta;
 end;
@@ -1557,13 +1557,13 @@ begin
   begin
     inherited;
     if (Src is TVectorList) then
-      System.Move(TVectorList(Src).FList^, FList^, FCount * SizeOf(TVector));
+      System.Move(TVectorList(Src).FList^, FList^, FCount * SizeOf(TGLVector));
   end
   else
     Clear;
 end;
 
-function TVectorList.Add(const item: TVector): Integer;
+function TVectorList.Add(const item: TGLVector): Integer;
 begin
   Result := FCount;
   if Result = FCapacity then
@@ -1610,7 +1610,7 @@ begin
   Result := Add(PointMake(X, Y, Z));
 end;
 
-function TVectorList.Get(Index: Integer): TVector;
+function TVectorList.Get(Index: Integer): TGLVector;
 begin
 {$IFOPT R+}
     Assert(Cardinal(Index) < Cardinal(FCount));
@@ -1618,7 +1618,7 @@ begin
   Result := FList^[Index];
 end;
 
-procedure TVectorList.Insert(Index: Integer; const Item: TVector);
+procedure TVectorList.Insert(Index: Integer; const Item: TGLVector);
 begin
 {$IFOPT R+}
     Assert(Cardinal(Index) < Cardinal(FCount));
@@ -1627,12 +1627,12 @@ begin
     SetCapacity(FCapacity + FGrowthDelta);
   if Index < FCount then
     System.Move(FList[Index], FList[Index + 1],
-      (FCount - Index) * SizeOf(TVector));
+      (FCount - Index) * SizeOf(TGLVector));
   FList^[Index] := Item;
   Inc(FCount);
 end;
 
-procedure TVectorList.Put(Index: Integer; const Item: TVector);
+procedure TVectorList.Put(Index: Integer; const Item: TGLVector);
 begin
 {$IFOPT R+}
     Assert(Cardinal(Index) < Cardinal(FCount));
@@ -1646,12 +1646,12 @@ begin
   FList := PVectorArray(FBaseList);
 end;
 
-procedure TVectorList.Push(const Val: TVector);
+procedure TVectorList.Push(const Val: TGLVector);
 begin
   Add(Val);
 end;
 
-function TVectorList.Pop: TVector;
+function TVectorList.Pop: TGLVector;
 begin
   if FCount > 0 then
   begin
@@ -1662,7 +1662,7 @@ begin
     Result := NullHmgVector;
 end;
 
-function TVectorList.IndexOf(const item: TVector): Integer;
+function TVectorList.IndexOf(const item: TGLVector): Integer;
 var
   I: Integer;
 begin
@@ -1675,7 +1675,7 @@ begin
     end;
 end;
 
-function TVectorList.FindOrAdd(const item: TVector): Integer;
+function TVectorList.FindOrAdd(const item: TGLVector): Integer;
 begin
   Result := IndexOf(item);
   if Result < 0 then
@@ -1684,7 +1684,7 @@ end;
 
 function TVectorList.FindOrAddPoint(const item: TAffineVector): Integer;
 var
-  ptItem: TVector;
+  ptItem: TGLVector;
 begin
   MakePoint(ptItem, item);
   Result := IndexOf(ptItem);

+ 1 - 2
Source/GLS.VectorTypesExt.pas

@@ -1,7 +1,6 @@
 //
 // The graphics rendering engine GLScene http://glscene.org
 //
-
 unit GLS.VectorTypesExt;
 
 (* Defines common vector types as advanced records using
@@ -1024,7 +1023,7 @@ procedure Init(Obj, TypeInfoOfObj: Pointer; Offset: Integer = 0);
 const
   DefaultRowCount = 3;
   DefaultColCount = 3;
-  VectorTypeName = 'TVector';
+  VectorTypeName = 'TGLVector';
   MatrixTypeName = 'TMatrix';
 var
   RTTIContext: TRttiContext;

+ 6 - 6
Source/GLS.WaterPlane.pas

@@ -79,10 +79,10 @@ const
      procedure DoProgress(const progressTime: TGLProgressTimes); override;
      procedure BuildList(var rci: TGLRenderContextInfo); override;
      procedure Assign(Source: TPersistent); override;
-     function AxisAlignedDimensionsUnscaled: TVector; override;
+     function AxisAlignedDimensionsUnscaled: TGLVector; override;
      procedure CreateRippleAtGridPos(X, Y: Integer);
      procedure CreateRippleAtWorldPos(const X, Y, z: Single); overload;
-     procedure CreateRippleAtWorldPos(const pos: TVector); overload;
+     procedure CreateRippleAtWorldPos(const pos: TGLVector); overload;
      procedure CreateRippleRandom;
      procedure Reset;
      // CPU time (in seconds) taken by the last iteration step.
@@ -206,16 +206,16 @@ end;
 
 procedure TGLWaterPlane.CreateRippleAtWorldPos(const X, Y, z: Single);
 var
-  vv: TVector;
+  vv: TGLVector;
 begin
   vv := AbsoluteToLocal(PointMake(X, Y, z));
   CreateRippleAtGridPos(Round((vv.X + 0.5) * Resolution),
     Round((vv.z + 0.5) * Resolution));
 end;
 
-procedure TGLWaterPlane.CreateRippleAtWorldPos(const pos: TVector);
+procedure TGLWaterPlane.CreateRippleAtWorldPos(const pos: TGLVector);
 var
-  vv: TVector;
+  vv: TGLVector;
 begin
   vv := AbsoluteToLocal(PointMake(pos));
   CreateRippleAtGridPos(Round((vv.X + 0.5) * Resolution),
@@ -477,7 +477,7 @@ begin
   inherited Assign(Source);
 end;
 
-function TGLWaterPlane.AxisAlignedDimensionsUnscaled: TVector;
+function TGLWaterPlane.AxisAlignedDimensionsUnscaled: TGLVector;
 begin
   Result.X := 0.5 * Abs(Resolution);
   Result.Y := 0;

+ 3 - 3
Source/GLS.Windows.pas

@@ -1645,7 +1645,7 @@ end;
 procedure TGLBaseFontControl.WriteTextAt(var rci: TGLRenderContextInfo; const X,
   Y: TGLFloat; const Data: UnicodeString; const Color: TColorVector);
 var
-  Position: TVector;
+  Position: TGLVector;
 begin
   if Assigned(BitmapFont) then
   begin
@@ -1660,7 +1660,7 @@ end;
 procedure TGLBaseFontControl.WriteTextAt(var rci: TGLRenderContextInfo; const X1,
   Y1, X2, Y2: TGLFloat; const Data: UnicodeString; const Color: TColorVector);
 var
-  Position: TVector;
+  Position: TGLVector;
 begin
   if Assigned(BitmapFont) then
   begin
@@ -2772,7 +2772,7 @@ end;
 procedure TGLLabel.InternalRender(var rci: TGLRenderContextInfo; renderSelf,
   renderChildren: Boolean);
 var
-  TekstPos: TVector;
+  TekstPos: TGLVector;
   Tekst: UnicodeString;
   TextColor: TColorVector;
 begin

+ 6 - 6
Source/GLS.zBuffer.pas

@@ -357,7 +357,7 @@ end;
 procedure TGLzBuffer.DoCalcVectors;
 var
   axs: TAffineVector;
-  Hnorm, hcvec: TVector;
+  Hnorm, hcvec: TGLVector;
   vec: TAffineVector;
   w, h: integer;
   wrp: single;
@@ -485,7 +485,7 @@ function TGLzBuffer.PixelToWorld(const x, y: Integer): TAffineVector;
 var
   z, dst: single;
   fy: integer;
-  camvec: TVector;
+  camvec: TGLVector;
 begin
   // if (Cardinal(x)<Cardinal(FWidth)) and (Cardinal(y)<Cardinal(FWidth)) then begin       //xres,yres?
   if (x < FWidth) and (y < FHeight) then
@@ -509,7 +509,7 @@ end;
 function TGLzBuffer.WorldToPixel(const aPoint: TAffineVector; out pixX, pixY:
   integer; out pixZ: single): boolean;
 var
-  camPos: TVector;
+  camPos: TGLVector;
   x, y, z, v0, v1, zscal: single;
 begin
   //---Takes x,y,z world coordinate.
@@ -546,7 +546,7 @@ end;
 function TGLzBuffer.WorldToPixelZ(const aPoint: TAffineVector; out pixX, pixY:
   integer; out pixZ: single): boolean; //OVERLOAD
 var
-  camPos: TVector;
+  camPos: TGLVector;
   x, y, z, v0, v1, zscal: single;
 begin
   //---Takes x,y,z world coordinate.
@@ -585,7 +585,7 @@ end;
 function TGLzBuffer.WorldToPixelZ(const aPoint: TAffineVector; out pixX, pixY:
   single; out pixZ: single): boolean; //OVERLOAD
 var
-  camPos: TVector;
+  camPos: TGLVector;
   x, y, z, invZ, v0, v1, zscal: single;
 begin
   //---Takes x,y,z world coordinate. (aPoint)
@@ -625,7 +625,7 @@ end;
 function TGLzBuffer.OrthWorldToPixelZ(const aPoint: TAffineVector; out pixX,
   pixY: single; out pixZ: single): boolean;
 var
-  camPos: TVector;
+  camPos: TGLVector;
   x, y, z: single;
 begin
   campos := cam.AbsolutePosition;

+ 1 - 1
Source/GLSL.AsmShader.pas

@@ -41,7 +41,7 @@ type
     function GetAsVector2i: TVector2i; override;
     function GetAsVector3f: TVector3f; override;
     function GetAsVector3i: TVector3i; override;
-    function GetAsVector4f: TVector; override;
+    function GetAsVector4f: TGLVector; override;
     function GetAsVector4i: TVector4i; override;
 
     procedure SetAsVector1f(const Value: Single); override;

+ 2 - 2
Source/GLSL.BumpShaders.pas

@@ -1593,7 +1593,7 @@ procedure TGLBumpShader.DoLightPass(var rci: TGLRenderContextInfo;
 var
   dummyHandle, tempHandle: Integer;
   lightPos, lightAtten,
-    materialDiffuse, lightDiffuse, lightSpecular: TVector;
+    materialDiffuse, lightDiffuse, lightSpecular: TGLVector;
 begin
   FVertexProgramHandle.Enable;
   FVertexProgramHandle.Bind;
@@ -1763,7 +1763,7 @@ end;
 
 function TGLBumpShader.DoUnApply(var rci: TGLRenderContextInfo): Boolean;
 var
-  ambient, LMaterialAmbient: TVector;
+  ambient, LMaterialAmbient: TGLVector;
 begin
   Result := False;
   if (csDesigning in ComponentState) and not DesignTimeEnabled then

+ 2 - 2
Source/GLSL.CustomShader.pas

@@ -170,7 +170,7 @@ type
     function GetAsVector1f: Single; virtual; abstract;
     function GetAsVector2f: TVector2f; virtual; abstract;
     function GetAsVector3f: TVector3f; virtual; abstract;
-    function GetAsVector4f: TVector; virtual; abstract;
+    function GetAsVector4f: TGLVector; virtual; abstract;
     function GetAsVector1i: Integer; virtual; abstract;
     function GetAsVector2i: TVector2i; virtual; abstract;
     function GetAsVector3i: TVector3i; virtual; abstract;
@@ -224,7 +224,7 @@ type
     procedure SetToTextureOf(const LibMaterial: TGLLibMaterial; const TextureIndex: Integer); overload;
     procedure SetToTextureOf(const Texture: TGLTexture; const TextureIndex: Integer); overload;
     // GLScene-friendly properties.
-    property AsVector: TVector read GetAsVector4f write SetAsVector4f;
+    property AsVector: TGLVector read GetAsVector4f write SetAsVector4f;
     property AsAffineVector: TAffineVector read GetAsVector3f write SetAsVector3f;
      // Standard types.
     property AsFloat: Single read GetAsVector1f write SetAsVector1f;

+ 2 - 2
Source/GLSL.PhongShader.pas

@@ -215,7 +215,7 @@ end;
 
 procedure TGLPhongShader.DoAmbientPass(var rci: TGLRenderContextInfo);
 var
-  ambient, materialAmbient: TVector;
+  ambient, materialAmbient: TGLVector;
 begin
   rci.GLStates.Disable(stLighting);
 
@@ -227,7 +227,7 @@ end;
 
 procedure TGLPhongShader.DoLightPass(lightID: Cardinal);
 var
-  LightParam: TVector;
+  LightParam: TGLVector;
 begin
   Self.ApplyShaderPrograms();
 

+ 2 - 2
Source/GLSL.Shader.pas

@@ -106,7 +106,7 @@ type
     function GetAsVector1f: Single; override;
     function GetAsVector2f: TVector2f; override;
     function GetAsVector3f: TVector3f; override;
-    function GetAsVector4f: TVector; override;
+    function GetAsVector4f: TGLVector; override;
     function GetAsVector1i: Integer; override;
     function GetAsVector2i: TVector2i; override;
     function GetAsVector3i: TVector3i; override;
@@ -499,7 +499,7 @@ begin
   gl.GetUniformiv(FGLSLProg.Handle, FParameterID, @Result);
 end;
 
-function TGLSLShaderParameter.GetAsVector4f: TVector;
+function TGLSLShaderParameter.GetAsVector4f: TGLVector;
 begin
   gl.GetUniformfv(FGLSLProg.Handle, FParameterID, @Result);
 end;

+ 1 - 1
Source/GLSL.ShapeShaders.pas

@@ -800,7 +800,7 @@ end;
 
 procedure TGLCelShader.DoApply(var rci: TGLRenderContextInfo; Sender: TObject);
 var
-  light: TVector;
+  light: TGLVector;
 begin
   if (csDesigning in ComponentState) then
     exit;

+ 31 - 31
Source/Physics.NGDManager.pas

@@ -23,7 +23,7 @@ uses
   /// Import.Newton,    // new version
 
   GLS.VectorTypes,
-  GLS.VectorGeometry, // PVector TVector TMatrix PMatrix NullHmgVector...
+  GLS.VectorGeometry, // PGLVector TGLVector TMatrix PMatrix NullHmgVector...
   GLS.VectorLists, // TAffineVectorList for Tree
   GLS.XCollection, // TXCollection file function
   GLS.GeometryBB, // For show debug
@@ -188,7 +188,7 @@ type
     function GetConstraintCount: Integer;
     procedure AddNode(const coords: TGLCustomCoordinates); overload;
     procedure AddNode(const X, Y, Z: Single); overload;
-    procedure AddNode(const Value: TVector); overload;
+    procedure AddNode(const Value: TGLVector); overload;
     procedure AddNode(const Value: TAffineVector); overload;
     procedure RebuildAllMaterial;
     procedure RebuildAllJoint(Sender: TObject);
@@ -365,16 +365,16 @@ type
   public
     constructor Create(AOwner: TXCollection); override;
     destructor Destroy; override;
-    procedure AddImpulse(const veloc, pointposit: TVector);
-    function GetOmega: TVector;
-    procedure SetOmega(const Omega: TVector);
-    function GetVelocity: TVector;
-    procedure SetVelocity(const Velocity: TVector);
+    procedure AddImpulse(const veloc, pointposit: TGLVector);
+    function GetOmega: TGLVector;
+    procedure SetOmega(const Omega: TGLVector);
+    function GetVelocity: TGLVector;
+    procedure SetVelocity(const Velocity: TGLVector);
     class function FriendlyName: string; override;
     property CustomForceAndTorqueEvent: TApplyForceAndTorqueEvent
       read FCustomForceAndTorqueEvent write FCustomForceAndTorqueEvent;
-    property Velocity: TVector read GetVelocity write SetVelocity;
-    property Omega: TVector read GetOmega write SetOmega;
+    property Velocity: TGLVector read GetVelocity write SetVelocity;
+    property Omega: TGLVector read GetOmega write SetOmega;
   published
     property Force: TGLCoordinates read FForce write FForce;
     property Torque: TGLCoordinates read FTorque write FTorque;
@@ -632,7 +632,7 @@ type
   public
     constructor Create(Collection: TCollection); override;
     destructor Destroy; override;
-    procedure KinematicControllerPick(pickpoint: TVector;
+    procedure KinematicControllerPick(pickpoint: TGLVector;
       PickedActions: TGLNGDPickedActions);
   published
     property BallAndSocketOptions: TGLNGDJointPivot read FBallAndSocketOptions
@@ -781,7 +781,7 @@ end;
 // ------------------------
 // TGLNGDManager
 // ------------------------
-procedure TGLNGDManager.AddNode(const Value: TVector);
+procedure TGLNGDManager.AddNode(const Value: TGLVector);
 begin
   if Assigned(FGLLines) then
   begin
@@ -821,7 +821,7 @@ end;
 
 constructor TGLNGDManager.Create(AOwner: TComponent);
 var
-  minworld, maxworld: TVector;
+  minworld, maxworld: TGLVector;
 begin
   inherited;
   FNGDBehaviours := TGLNGDBehaviourList.Create;
@@ -1418,13 +1418,13 @@ end;
 
 function TGLNGDBehaviour.GetBBoxCollision: PNewtonCollision;
 var
-  vc: array [0 .. 7] of TVector;
+  vc: array [0 .. 7] of TGLVector;
   I: Integer;
 begin
   for I := 0 to 8 - 1 do
     vc[I] := AABBToBB(FOwnerBaseSceneObject.AxisAlignedBoundingBoxEx).BBox[I];
   Result := NewtonCreateConvexHull(FManager.FNewtonWorld, 8, @vc[0],
-    SizeOf(TVector), 0.01, 0, nil);
+    SizeOf(TGLVector), 0.01, 0, nil);
 end;
 
 function TGLNGDBehaviour.GetBSphereCollision: PNewtonCollision;
@@ -1952,7 +1952,7 @@ end;
 // TGLNGDDynamic
 //-------------------------
 
-procedure TGLNGDDynamic.AddImpulse(const veloc, pointposit: TVector);
+procedure TGLNGDDynamic.AddImpulse(const veloc, pointposit: TGLVector);
 begin
   if Assigned(FNewtonBody) then
     NewtonBodyAddImpulse(FNewtonBody, @veloc, @pointposit);
@@ -2090,7 +2090,7 @@ procedure TGLNGDDynamic.Render;
     cnt: PNewtonJoint;
     thisContact: PNewtonJoint;
     material: PNewtonMaterial;
-    pos, nor: TVector;
+    pos, nor: TGLVector;
   begin
     FManager.FCurrentColor := FManager.DebugOption.ContactColor;
     cnt := NewtonBodyGetFirstContactJoint(FNewtonBody);
@@ -2112,7 +2112,7 @@ procedure TGLNGDDynamic.Render;
     end;
   end;
 
-  function GetAbsCom(): TVector;
+  function GetAbsCom(): TGLVector;
   var
     M: TMatrix;
   begin
@@ -2126,8 +2126,8 @@ procedure TGLNGDDynamic.Render;
 
   procedure DrawForce;
   var
-    pos: TVector;
-    nor: TVector;
+    pos: TGLVector;
+    nor: TGLVector;
   begin
     pos := GetAbsCom;
 
@@ -2158,7 +2158,7 @@ procedure TGLNGDDynamic.Render;
 
   procedure DrawCoM;
   var
-    com: TVector;
+    com: TGLVector;
     size: Single;
   begin
     FManager.FCurrentColor := FManager.DebugOption.CenterOfMassColor;
@@ -2203,8 +2203,8 @@ end;
 
 procedure TGLNGDDynamic.SetDensity(const Value: Single);
 var
-  inertia: TVector;
-  origin: TVector;
+  inertia: TGLVector;
+  origin: TGLVector;
 begin
   if Assigned(FManager) then
     if Value >= 0 then
@@ -2238,22 +2238,22 @@ begin
       NewtonBodySetLinearDamping(FNewtonBody, FLinearDamping);
 end;
 
-function TGLNGDDynamic.GetOmega: TVector;
+function TGLNGDDynamic.GetOmega: TGLVector;
 begin
   NewtonBodyGetOmega(FNewtonBody, @Result);
 end;
 
-procedure TGLNGDDynamic.SetOmega(const Omega: TVector);
+procedure TGLNGDDynamic.SetOmega(const Omega: TGLVector);
 begin
   NewtonBodySetOmega(FNewtonBody, @Omega);
 end;
 
-function TGLNGDDynamic.GetVelocity: TVector;
+function TGLNGDDynamic.GetVelocity: TGLVector;
 begin
   NewtonBodyGetVelocity(FNewtonBody, @Result);
 end;
 
-procedure TGLNGDDynamic.SetVelocity(const Velocity: TVector);
+procedure TGLNGDDynamic.SetVelocity(const Velocity: TGLVector);
 begin
   NewtonBodySetVelocity(FNewtonBody, @Velocity);
 end;
@@ -2371,7 +2371,7 @@ end;
 procedure TGLNGDDynamic.OnApplyForceAndTorqueEvent(const cbody: PNewtonBody;
   timestep: NGDFloat; threadIndex: Integer);
 var
-  worldGravity: TVector;
+  worldGravity: TGLVector;
 begin
   // Read Only: We get the force and torque resulting from every interaction on this body
   NewtonBodyGetForce(cbody, @(FAppliedForce.AsVector));
@@ -2642,7 +2642,7 @@ begin
   end;
 end;
 
-procedure TGLNGDJoint.KinematicControllerPick(pickpoint: TVector;
+procedure TGLNGDJoint.KinematicControllerPick(pickpoint: TGLVector;
   PickedActions: TGLNGDPickedActions);
 begin
   (* CustomDestroyJoint(FNewtonUserJoint);  //from dJointLibrary.dll
@@ -2691,7 +2691,7 @@ end;
 
 procedure TGLNGDJoint.Render;
 
-  procedure DrawPivot(pivot: TVector);
+  procedure DrawPivot(pivot: TGLVector);
   var
     size: Single;
   begin
@@ -2705,14 +2705,14 @@ procedure TGLNGDJoint.Render;
     FManager.AddNode(VectorAdd(pivot, VectorMake(-size, 0, 0)));
   end;
 
-  procedure DrawPin(pin, pivot: TVector);
+  procedure DrawPin(pin, pivot: TGLVector);
   begin
     FManager.FCurrentColor := FManager.DebugOption.JointAxisColor;
     FManager.AddNode(VectorAdd(pivot, pin));
     FManager.AddNode(VectorAdd(pivot, VectorNegate(pin)));
   end;
 
-  procedure DrawJoint(pivot: TVector);
+  procedure DrawJoint(pivot: TGLVector);
   begin
     FManager.FCurrentColor := FManager.DebugOption.CustomColor;
     FManager.AddNode(FParentObject.AbsolutePosition);

+ 1 - 1
Source/Physics.NGDRagdoll.pas

@@ -49,7 +49,7 @@ procedure Conform;
 destructor Destroy; override;
 procedure LoadFromFile(filename: string);
 procedure SaveToFile(filename: string);
-function TranslatePos(n: integer; add: boolean): TVector;
+function TranslatePos(n: integer; add: boolean): TGLVector;
 end;
 
 function GetBoneParent(actor: TGLActor; bone: integer): integer;

+ 12 - 12
Source/Physics.ODEManager.pas

@@ -2681,7 +2681,7 @@ end;
 
 procedure TGLODEElementBase.CoordinateChanged(Sender: TObject);
 var
-  rightVector: TVector;
+  rightVector: TGLVector;
 begin
   if FIsCalculating then
     Exit;
@@ -4369,7 +4369,7 @@ end;
 
 procedure TGLODEJointHinge.AxisChange(Sender: TObject);
 var
-  vec: TVector;
+  vec: TGLVector;
 begin
   vec := FAxis.DirectVector;
   NormalizeVector(vec);
@@ -4558,7 +4558,7 @@ end;
 
 procedure TGLODEJointSlider.AxisChange(Sender: TObject);
 var
-  vec: TVector;
+  vec: TGLVector;
 begin
   vec := FAxis.DirectVector;
   NormalizeVector(vec);
@@ -4738,7 +4738,7 @@ end;
 
 procedure TGLODEJointHinge2.Axis1Change(Sender: TObject);
 var
-  vec: TVector;
+  vec: TGLVector;
 begin
   vec := FAxis1.DirectVector;
   NormalizeVector(vec);
@@ -4749,7 +4749,7 @@ end;
 
 procedure TGLODEJointHinge2.Axis2Change(Sender: TObject);
 var
-  vec: TVector;
+  vec: TGLVector;
 begin
   vec := FAxis2.DirectVector;
   NormalizeVector(vec);
@@ -4924,7 +4924,7 @@ end;
 
 procedure TGLODEJointUniversal.Axis1Change(Sender: TObject);
 var
-  vec: TVector;
+  vec: TGLVector;
 begin
   vec := FAxis1.DirectVector;
   NormalizeVector(vec);
@@ -4935,7 +4935,7 @@ end;
 
 procedure TGLODEJointUniversal.Axis2Change(Sender: TObject);
 var
-  vec: TVector;
+  vec: TGLVector;
 begin
   vec := FAxis2.DirectVector;
   NormalizeVector(vec);
@@ -5315,7 +5315,7 @@ end;
 function TGLODEHeightField.Collide(aPos: TAffineVector; var Depth: Single;
   var cPos, cNorm: TAffineVector): Boolean;
 
-  function AbsoluteToLocal(vec: TVector): TVector;
+  function AbsoluteToLocal(vec: TGLVector): TGLVector;
   var
     mat: TMatrix;
   begin
@@ -5332,7 +5332,7 @@ function TGLODEHeightField.Collide(aPos: TAffineVector; var Depth: Single;
       Assert(False);
   end;
 
-  function LocalToAbsolute(vec: TVector): TVector;
+  function LocalToAbsolute(vec: TGLVector): TGLVector;
   var
     mat: TMatrix;
   begin
@@ -5348,9 +5348,9 @@ function TGLODEHeightField.Collide(aPos: TAffineVector; var Depth: Single;
       Assert(False);
   end;
 
-  function GetHeight(pos: TVector; var height: Single): Boolean;
+  function GetHeight(pos: TGLVector; var height: Single): Boolean;
   var
-    dummy1: TVector;
+    dummy1: TGLVector;
     dummy2: TTexPoint;
   begin
     Result := False;
@@ -5373,7 +5373,7 @@ function TGLODEHeightField.Collide(aPos: TAffineVector; var Depth: Single;
 const
   cDelta = 0.1;
 var
-  localPos: TVector;
+  localPos: TGLVector;
   height: Single;
   temp1, temp2: TAffineVector;
 begin

+ 6 - 6
Source/Physics.ODEUtils.pas

@@ -74,10 +74,10 @@ function CreateTriMeshFromBaseMesh(
   var Indices: PdIntegerArray): PdxGeom;
 
 function GLMatrixFromGeom(Geom: PdxGeom): TMatrix;
-function GLDirectionFromGeom(Geom: PdxGeom): TVector;
+function GLDirectionFromGeom(Geom: PdxGeom): TGLVector;
 function CreateODEPlaneFromGLPlane(Plane: TGLPlane; Space: PdxSpace): PdxGeom;
 procedure RenderGeomList(GeomList: TGeomList);
-function RandomColorVector: TVector;
+function RandomColorVector: TGLVector;
 
 {.$ EXTERNALSYM GL_ZERO}
 
@@ -344,7 +344,7 @@ begin
   end;
 end;
 
-function GLDirectionFromGeom(Geom: PdxGeom): TVector;
+function GLDirectionFromGeom(Geom: PdxGeom): TGLVector;
 var
   m: TMatrix;
 begin
@@ -375,7 +375,7 @@ end;
 
 procedure CopyPosFromGeomToGL(Geom: PdxGeom; GLBaseSceneObject: TGLBaseSceneObject);
 var
-  v: TVector;
+  v: TGLVector;
   m: TMatrix;
 
   R: PdMatrix3;
@@ -551,7 +551,7 @@ end;
 
 function CreateODEPlaneFromGLPlane(Plane: TGLPlane; Space: PdxSpace): PdxGeom;
 var
-  Pos, Direction: TVector;
+  Pos, Direction: TGLVector;
   d: single;
 begin
   Direction := Plane.AbsoluteDirection;
@@ -564,7 +564,7 @@ begin
   result := dCreatePlane(space, Direction.X, Direction.Y, Direction.Z, d);
 end;
 
-function RandomColorVector: TVector;
+function RandomColorVector: TGLVector;
 begin
   result := VectorMake(Random, Random, Random, 1);
 end;

+ 2 - 2
Source/Physics.SPIInertias.pas

@@ -69,7 +69,7 @@ type
     (* Bounce speed as if hitting a surface.
       restitution is the coefficient of restituted energy (1=no energy loss,
       0=no bounce). The normal is NOT assumed to be normalized. *)
-    procedure SurfaceBounce(const surfaceNormal: TVector; restitution: Single);
+    procedure SurfaceBounce(const surfaceNormal: TGLVector; restitution: Single);
   published
     property Mass: Single read FMass write FMass;
     property TranslationSpeed: TGLCoordinates read FTranslationSpeed
@@ -465,7 +465,7 @@ begin
   FTranslationSpeed.Invert;
 end;
 
-procedure TGLParticleInertia.SurfaceBounce(const surfaceNormal: TVector;
+procedure TGLParticleInertia.SurfaceBounce(const surfaceNormal: TGLVector;
   restitution: Single);
 var
   f: Single;

+ 3 - 3
Source/Sounds.BASS.pas

@@ -68,7 +68,7 @@ type
 
   PBASSInfo = ^TBASSInfo;
 
-procedure VectorToBASSVector(const aVector: TVector;
+procedure VectorToBASSVector(const aVector: TGLVector;
   var aBASSVector: BASS_3DVECTOR);
 begin
   aBASSVector.x := aVector.x;
@@ -177,7 +177,7 @@ procedure TGLSMBASS.UpdateSource(aSource: TGLBaseSoundSource);
 var
   i: Integer;
   p: PBASSInfo;
-  objPos, objOri, objVel: TVector;
+  objPos, objOri, objVel: TGLVector;
   position, orientation, velocity: BASS_3DVECTOR;
   res: Boolean;
 begin
@@ -289,7 +289,7 @@ end;
 
 procedure TGLSMBASS.UpdateSources;
 var
-  objPos, objVel, objDir, objUp: TVector;
+  objPos, objVel, objDir, objUp: TGLVector;
   position, velocity, fwd, top: BASS_3DVECTOR;
 begin
   // update listener

+ 3 - 3
Source/Sounds.FMOD.pas

@@ -67,7 +67,7 @@ type
 
   PFMODInfo = ^TFMODInfo;
 
-procedure VectorToFMODVector(const aVector: TVector; var aFMODVector: TFSoundVector);
+procedure VectorToFMODVector(const aVector: TGLVector; var aFMODVector: TFSoundVector);
 begin
   aFMODVector.X := aVector.X;
   aFMODVector.Y := aVector.Y;
@@ -211,7 +211,7 @@ end;
 procedure TGLSMFMOD.UpdateSource(aSource: TGLBaseSoundSource);
 var
   p: PFMODInfo;
-  objPos, objVel: TVector;
+  objPos, objVel: TGLVector;
   position, velocity: TFSoundVector;
 begin
   if (sscSample in aSource.Changes) then
@@ -297,7 +297,7 @@ end;
 
 procedure TGLSMFMOD.UpdateSources;
 var
-  objPos, objVel, objDir, objUp: TVector;
+  objPos, objVel, objDir, objUp: TGLVector;
   position, velocity, fwd, top: TFSoundVector;
 begin
   // update listener

+ 1 - 1
Source/Sounds.OpenAL.pas

@@ -306,7 +306,7 @@ end;
 
 procedure TGLSMOpenAL.UpdateSources;
 var
-  pos, dir, up, vel: TVector;
+  pos, dir, up, vel: TGLVector;
   DirUp: array [0 .. 5] of TALfloat; // orientation
 begin
   ListenerCoordinates(pos, vel, dir, up);

Some files were not shown because too many files changed in this diff