Browse Source

* fix compilation

(cherry picked from commit f069f272670ebc7579e80238ab10a55e37bc3b8f)
Michaël Van Canneyt 4 years ago
parent
commit
07e09c6797
1 changed files with 35 additions and 0 deletions
  1. 35 0
      rtl/objpas/types.pp

+ 35 - 0
rtl/objpas/types.pp

@@ -166,6 +166,24 @@ type
 
   TDuplicates = (dupIgnore, dupAccept, dupError);
 
+  TPoint3D =
+  {$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
+    packed
+  {$endif FPC_REQUIRES_PROPER_ALIGNMENT}
+    record
+
+    public
+     Type TSingle3Array = array[0..2] of single;
+     constructor Create(const ax,ay,az:single);
+     procedure   Offset(const adeltax,adeltay,adeltaz:single); inline;
+     procedure   Offset(const adelta:TPoint3D); inline;
+   public  
+     case Integer of
+      0: (data:TSingle3Array);
+      1: (x,y,z : single);
+    end;
+
+
 type
   TOleChar = WideChar;
   POleStr = PWideChar;
@@ -705,6 +723,23 @@ begin
   bottom:=bottom+dy; top:=top+dy;
 end;
 
+{ TPoint3D }
+
+constructor TPoint3D.Create(const ax,ay,az:single);
+begin
+  x:=ax; y:=ay; z:=az;
+end;
+
+procedure   TPoint3D.Offset(const adeltax,adeltay,adeltaz:single);
+begin
+  x:=x+adeltax; y:=y+adeltay; z:=z+adeltaz;
+end;
+
+procedure   TPoint3D.Offset(const adelta:TPoint3D);
+begin
+  x:=x+adelta.x; y:=y+adelta.y; z:=z+adelta.z;
+end;
+
 {$ifndef VER3_0}
 generic class procedure TBitConverter.UnsafeFrom<T>(const ASrcValue: T; var ADestination: Array of Byte; AOffset: Integer = 0);
 begin