소스 검색

Fixed polyhedra unit

glscene 1 년 전
부모
커밋
ae1e2329ed

+ 3 - 3
Examples/Demos/materials/aMaterials.htm

@@ -121,16 +121,16 @@ ul
 <p class=MsoNormal><img border=0 width=402 height=358 src=dynamictexture/DynamicTexture.jpg></p>
 
 <ul style='margin-top:0cm' type=disc>
- <li class=MsoNormal><span lang=FR><a href="fire2D_gr32/Fire2D_GR32.dpr"><b>Fire2D</b></a><b>&nbsp;:</b></span></li>
+ <li class=MsoNormal><span lang=FR><a href="fire2D_gr32/Fire_GR32D.dpr"><b>Fire_GR32</b></a><b>&nbsp;:</b></span></li>
  <ul style='margin-top:0cm' type=circle>
   <li class=MsoNormal><span lang=FR>a dynamic (animated) texture evolving in
       real-time</span></li>
-  <li class=MsoNormal><span lang=FR>using Graphics32 (www.g32.org) to generate
+  <li class=MsoNormal><span lang=FR>using Graphics32 (www.g32.org) to generate 2D
       texture maps at run-time</span></li>
  </ul>
 </ul>
 
-<p class=MsoNormal><img border=0 width=275 height=242 src=fire2D_gr32/Fire2D.jpg></p>
+<p class=MsoNormal><img border=0 width=275 height=242 src=fire2D_gr32/Fire_GR32.jpg></p>
 
 <ul style='margin-top:0cm' type=disc>
  <li class=MsoNormal><span lang=FR><a href="MaterialScript/MatScriptD.dpr"><b>Material

BIN
Examples/Demos/materials/fire2D_gr32/Fire2D.jpg


+ 0 - 40
Examples/Demos/materials/fire2D_gr32/Fire2D_GR32.dpr

@@ -1,40 +0,0 @@
-{:
-  A demo for using Alex Denissov's Graphics32 library (http://www.g32.org)
-  to generate 2D texture for use with GLScene.
-
-  By Nelson Chu
-
-  Try lighting the white line near the bottom of the window with your mouse
-  pointer and see the fire spreads. Press ESC to quit.
-
-  To use Graphics32 with GLScene:
-
-  1. Make sure GLS_Graphics32_SUPPORT is defined in GLSCene.inc. Recompile if
-     needed.
-  2. In your program, use code like:
-
-       GLTexture.Image.GetBitmap32(0).assign(Bitmap32);
-       GLTexture.Image.NotifyChange(self);
-
-     to assign the Bitmap32 to your GLScene texture and notify GLScene.
-
-  To get fast assignment, remember to make the dimensions of your Bitmap32 equal
-  to a power of two, so that GLScene doesn't need to do conversion internally.
-
-  In this sample program, a 256 x 256 Graphics32 TByteMap is used to generate a
-  "fire" image. At each frame, the fire image is first "visualized" in a
-  Graphics32 Bitmap32. Then, the TBitmap32 is copied to the texture of a Cube.
-}
-program Fire2D_GR32;
-
-uses
-  Forms,
-  fFire2D_GR32 in 'fFire2D_GR32.pas' {FormFire2d_GR32};
-
-{$R *.RES}
-
-begin
-  Application.Initialize;
-  Application.CreateForm(TFormFire2d_GR32, FormFire2d_GR32);
-  Application.Run;
-end.

+ 0 - 133
Examples/Demos/materials/fire2D_gr32/Fire2D_GR32.dproj

@@ -1,133 +0,0 @@
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-    <PropertyGroup>
-        <ProjectGuid>{1FFBE852-3304-420A-B4EF-CFB2FB2A617A}</ProjectGuid>
-        <MainSource>Fire2D_GR32.dpr</MainSource>
-        <Base>True</Base>
-        <Config Condition="'$(Config)'==''">Debug</Config>
-        <TargetedPlatforms>1</TargetedPlatforms>
-        <AppType>Application</AppType>
-        <FrameworkType>VCL</FrameworkType>
-        <ProjectVersion>20.1</ProjectVersion>
-        <Platform Condition="'$(Platform)'==''">Win32</Platform>
-    </PropertyGroup>
-    <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
-        <Base>true</Base>
-    </PropertyGroup>
-    <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
-        <Base_Win32>true</Base_Win32>
-        <CfgParent>Base</CfgParent>
-        <Base>true</Base>
-    </PropertyGroup>
-    <PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
-        <Base_Win64>true</Base_Win64>
-        <CfgParent>Base</CfgParent>
-        <Base>true</Base>
-    </PropertyGroup>
-    <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
-        <Cfg_1>true</Cfg_1>
-        <CfgParent>Base</CfgParent>
-        <Base>true</Base>
-    </PropertyGroup>
-    <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
-        <Cfg_2>true</Cfg_2>
-        <CfgParent>Base</CfgParent>
-        <Base>true</Base>
-    </PropertyGroup>
-    <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
-        <Cfg_2_Win32>true</Cfg_2_Win32>
-        <CfgParent>Cfg_2</CfgParent>
-        <Cfg_2>true</Cfg_2>
-        <Base>true</Base>
-    </PropertyGroup>
-    <PropertyGroup Condition="'$(Base)'!=''">
-        <DCC_F>false</DCC_F>
-        <DCC_S>false</DCC_S>
-        <DCC_K>false</DCC_K>
-        <DCC_ImageBase>00400000</DCC_ImageBase>
-        <DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)</DCC_Namespace>
-        <DCC_N>false</DCC_N>
-        <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=</VerInfo_Keys>
-        <SanitizedProjectName>Fire2D_GR32</SanitizedProjectName>
-        <DCC_E>false</DCC_E>
-        <VerInfo_Locale>1049</VerInfo_Locale>
-    </PropertyGroup>
-    <PropertyGroup Condition="'$(Base_Win32)'!=''">
-        <UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
-        <UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
-        <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
-        <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
-        <DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
-        <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
-        <VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(ModuleName);FileDescription=$(ModuleName);ProductName=$(ModuleName)</VerInfo_Keys>
-        <VerInfo_Locale>1033</VerInfo_Locale>
-    </PropertyGroup>
-    <PropertyGroup Condition="'$(Base_Win64)'!=''">
-        <UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
-        <UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
-    </PropertyGroup>
-    <PropertyGroup Condition="'$(Cfg_1)'!=''">
-        <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
-        <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
-        <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
-        <DCC_DebugInformation>0</DCC_DebugInformation>
-    </PropertyGroup>
-    <PropertyGroup Condition="'$(Cfg_2)'!=''">
-        <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
-        <DCC_Optimize>false</DCC_Optimize>
-        <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
-    </PropertyGroup>
-    <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
-        <BT_BuildType>Debug</BT_BuildType>
-        <DCC_UnitSearchPath>..\..\..\..\Source;D:\COMPONENTS\graphics32\Source;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
-        <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
-        <VerInfo_Locale>1033</VerInfo_Locale>
-        <VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
-        <AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
-        <Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
-    </PropertyGroup>
-    <ItemGroup>
-        <DelphiCompile Include="$(MainSource)">
-            <MainSource>MainSource</MainSource>
-        </DelphiCompile>
-        <DCCReference Include="fFire2D_GR32.pas">
-            <Form>FormFire2d_GR32</Form>
-        </DCCReference>
-        <BuildConfiguration Include="Base">
-            <Key>Base</Key>
-        </BuildConfiguration>
-        <BuildConfiguration Include="Release">
-            <Key>Cfg_1</Key>
-            <CfgParent>Base</CfgParent>
-        </BuildConfiguration>
-        <BuildConfiguration Include="Debug">
-            <Key>Cfg_2</Key>
-            <CfgParent>Base</CfgParent>
-        </BuildConfiguration>
-    </ItemGroup>
-    <ProjectExtensions>
-        <Borland.Personality>Delphi.Personality.12</Borland.Personality>
-        <Borland.ProjectType/>
-        <BorlandProject>
-            <Delphi.Personality>
-                <Source>
-                    <Source Name="MainSource">Fire2D_GR32.dpr</Source>
-                </Source>
-                <Excluded_Packages>
-                    <Excluded_Packages Name="$(BDSBIN)\bcboffice2k280.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
-                    <Excluded_Packages Name="$(BDSBIN)\bcbofficexp280.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
-                    <Excluded_Packages Name="$(BDSBIN)\dcloffice2k280.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
-                    <Excluded_Packages Name="$(BDSBIN)\dclofficexp280.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
-                </Excluded_Packages>
-            </Delphi.Personality>
-            <Platforms>
-                <Platform value="Win32">True</Platform>
-                <Platform value="Win64">False</Platform>
-            </Platforms>
-            <Deployment Version="4"/>
-        </BorlandProject>
-        <ProjectFileVersion>12</ProjectFileVersion>
-    </ProjectExtensions>
-    <Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
-    <Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
-    <Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
-</Project>

BIN
Examples/Demos/materials/fire2D_gr32/Fire_GR32.jpg


+ 29 - 62
Examples/Demos/materials/fire2D_gr32/fFire_GR32D.dfm

@@ -11,7 +11,7 @@ object FormFire2d_GR32: TFormFire2d_GR32
   BorderStyle = bsDialog
   Caption = 'Fire 2D'
   ClientHeight = 686
-  ClientWidth = 1145
+  ClientWidth = 1144
   Color = clBtnFace
   Constraints.MinHeight = 431
   Constraints.MinWidth = 448
@@ -27,71 +27,16 @@ object FormFire2d_GR32: TFormFire2d_GR32
   OnKeyDown = FormKeyDown
   PixelsPerInch = 168
   TextHeight = 23
-  object Label1: TLabel
-    Left = 11
-    Top = 63
-    Width = 424
-    Height = 22
-    Margins.Left = 5
-    Margins.Top = 5
-    Margins.Right = 5
-    Margins.Bottom = 5
-    Caption = 'The 2D fire animation below is a pure 2D animated'
-    Font.Charset = ANSI_CHARSET
-    Font.Color = clWindowText
-    Font.Height = -19
-    Font.Name = 'Arial'
-    Font.Style = []
-    ParentFont = False
-  end
-  object Label2: TLabel
-    Left = 14
-    Top = 98
-    Width = 397
-    Height = 22
-    Margins.Left = 5
-    Margins.Top = 5
-    Margins.Right = 5
-    Margins.Bottom = 5
-    Caption = 'texture using Graphics32 (www.graphics32.org)'
-    Font.Charset = ANSI_CHARSET
-    Font.Color = clWindowText
-    Font.Height = -19
-    Font.Name = 'Arial'
-    Font.Style = []
-    ParentFont = False
-  end
-  object Label3: TLabel
-    Left = 11
-    Top = 149
-    Width = 395
-    Height = 23
-    Margins.Left = 5
-    Margins.Top = 5
-    Margins.Right = 5
-    Margins.Bottom = 5
-    Caption = 'It is refreshed every 40 ms and used to update'
-  end
-  object Label4: TLabel
-    Left = 11
-    Top = 182
-    Width = 332
-    Height = 23
-    Margins.Left = 5
-    Margins.Top = 5
-    Margins.Right = 5
-    Margins.Bottom = 5
-    Caption = 'the cube'#39's texture you see on the right.'
-  end
   object Label5: TLabel
-    Left = 11
-    Top = 14
-    Width = 228
+    Left = 0
+    Top = 0
+    Width = 1144
     Height = 33
     Margins.Left = 5
     Margins.Top = 5
     Margins.Right = 5
     Margins.Bottom = 5
+    Align = alTop
     Caption = 'Dynamic Texture'
     Font.Charset = ANSI_CHARSET
     Font.Color = clWindowText
@@ -99,9 +44,12 @@ object FormFire2d_GR32: TFormFire2d_GR32
     Font.Name = 'Arial'
     Font.Style = [fsBold]
     ParentFont = False
+    ExplicitLeft = 9
+    ExplicitTop = 10
+    ExplicitWidth = 228
   end
   object GLSceneViewer1: TGLSceneViewer
-    Left = 459
+    Left = 458
     Top = 0
     Width = 686
     Height = 686
@@ -121,7 +69,7 @@ object FormFire2d_GR32: TFormFire2d_GR32
   end
   object PaintBox32: TPaintBox32
     Left = 0
-    Top = 215
+    Top = 238
     Width = 448
     Height = 448
     Margins.Left = 5
@@ -133,6 +81,25 @@ object FormFire2d_GR32: TFormFire2d_GR32
     OnMouseMove = GLSceneViewer1MouseMove
     OnMouseUp = GLSceneViewer1MouseUp
   end
+  object Memo1: TMemo
+    Left = 0
+    Top = 43
+    Width = 448
+    Height = 185
+    Margins.Left = 5
+    Margins.Top = 5
+    Margins.Right = 5
+    Margins.Bottom = 5
+    Lines.Strings = (
+      'The 2D fire animation below is a pure 2D '
+      'animated'
+      'texture using Graphics32 '
+      '(www.graphics32.org)'
+      'It is refreshed every 40 ms and used to '
+      'update'
+      'the cube'#39's texture you see on the right.')
+    TabOrder = 2
+  end
   object AsyncTimer1: TGLAsyncTimer
     Interval = 80
     OnTimer = AsyncTimer1Timer

+ 4 - 9
Examples/Demos/materials/fire2D_gr32/fFire_GR32D.pas

@@ -44,12 +44,9 @@ type
     PaintBox32: TPaintBox32;
     Cube1: TGLCube;
     GLCadencer1: TGLCadencer;
-    Label1: TLabel;
-    Label2: TLabel;
-    Label3: TLabel;
-    Label4: TLabel;
     Label5: TLabel;
     GLMaterialLibrary1: TGLMaterialLibrary;
+    Memo1: TMemo;
     procedure FormCreate(Sender: TObject);
     procedure FormDestroy(Sender: TObject);
     procedure AsyncTimer1Timer(Sender: TObject);
@@ -88,11 +85,9 @@ implementation
 
 {$R *.DFM}
 
-(*
-  {.$IFDEF USE_GRAPHICS32}
-  Please rebuild GLScene with ($DEFINE USE_GRAPHICS32} in GLScene.inc
-  {.$ENDIF}
-*)
+  {$IFDEF USE_GRAPHICS32}
+//  Please rebuild GLScene with ($DEFINE USE_GRAPHICS32} in GLScene.inc
+  {$ENDIF}
 
 procedure TFormFire2d_GR32.AsyncTimer1Timer(Sender: TObject);
 begin

+ 15 - 6
Examples/Demos/utilities/HTFUtils/fNavD.dfm

@@ -1,24 +1,33 @@
 object NavForm: TNavForm
   Left = 276
   Top = 328
+  Margins.Left = 5
+  Margins.Top = 5
+  Margins.Right = 5
+  Margins.Bottom = 5
   BorderStyle = bsDialog
   Caption = 'Nav Form'
-  ClientHeight = 199
-  ClientWidth = 205
+  ClientHeight = 348
+  ClientWidth = 359
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
-  Font.Height = -11
+  Font.Height = -19
   Font.Name = 'MS Sans Serif'
   Font.Style = []
   FormStyle = fsStayOnTop
   Position = poScreenCenter
-  TextHeight = 13
+  PixelsPerInch = 168
+  TextHeight = 24
   object Image: TImage32
     Left = 0
     Top = 0
-    Width = 192
-    Height = 192
+    Width = 336
+    Height = 336
+    Margins.Left = 5
+    Margins.Top = 5
+    Margins.Right = 5
+    Margins.Bottom = 5
     Bitmap.ResamplerClassName = 'TNearestResampler'
     BitmapAlign = baTopLeft
     Scale = 1.000000000000000000

+ 88 - 36
Examples/Demos/utilities/HTFUtils/fViewerD.dfm

@@ -1,65 +1,99 @@
 object ViewerForm: TViewerForm
   Left = 99
   Top = 98
+  Margins.Left = 5
+  Margins.Top = 5
+  Margins.Right = 5
+  Margins.Bottom = 5
   Caption = 'HTFViewer'
-  ClientHeight = 482
-  ClientWidth = 629
+  ClientHeight = 844
+  ClientWidth = 1115
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
-  Font.Height = -11
+  Font.Height = -19
   Font.Name = 'MS Sans Serif'
   Font.Style = []
   Position = poScreenCenter
   OnCreate = FormCreate
   OnDestroy = FormDestroy
-  TextHeight = 13
+  PixelsPerInch = 168
+  TextHeight = 24
   object ToolBar: TToolBar
     Left = 0
     Top = 0
-    Width = 629
-    Height = 26
+    Width = 1115
+    Height = 43
+    Margins.Left = 5
+    Margins.Top = 5
+    Margins.Right = 5
+    Margins.Bottom = 5
     AutoSize = True
     BorderWidth = 1
-    ButtonWidth = 41
+    ButtonHeight = 39
+    ButtonWidth = 72
     Caption = 'ToolBar'
     Images = ImageList
     TabOrder = 0
     object ToolButton1: TToolButton
       Left = 0
       Top = 0
+      Margins.Left = 5
+      Margins.Top = 5
+      Margins.Right = 5
+      Margins.Bottom = 5
       Action = ACOpen
     end
     object ToolButton3: TToolButton
-      Left = 41
+      Left = 72
       Top = 0
+      Margins.Left = 5
+      Margins.Top = 5
+      Margins.Right = 5
+      Margins.Bottom = 5
       Action = ACExit
     end
     object ToolButton2: TToolButton
-      Left = 82
+      Left = 144
       Top = 0
-      Width = 8
+      Width = 14
+      Margins.Left = 5
+      Margins.Top = 5
+      Margins.Right = 5
+      Margins.Bottom = 5
       Caption = 'ToolButton2'
       ImageIndex = 1
       Style = tbsSeparator
     end
     object ToolButton6: TToolButton
-      Left = 90
+      Left = 158
       Top = 0
+      Margins.Left = 5
+      Margins.Top = 5
+      Margins.Right = 5
+      Margins.Bottom = 5
       Action = ACNavMap
     end
     object ToolButton5: TToolButton
-      Left = 131
+      Left = 230
       Top = 0
-      Width = 8
+      Width = 14
+      Margins.Left = 5
+      Margins.Top = 5
+      Margins.Right = 5
+      Margins.Bottom = 5
       Caption = 'ToolButton5'
       ImageIndex = 3
       Style = tbsSeparator
     end
     object TBGrid: TToolButton
-      Left = 139
+      Left = 244
       Top = 0
       Hint = 'Toggle Grid'
+      Margins.Left = 5
+      Margins.Top = 5
+      Margins.Right = 5
+      Margins.Bottom = 5
       Caption = 'TBGrid'
       Down = True
       ImageIndex = 3
@@ -67,29 +101,41 @@ object ViewerForm: TViewerForm
       OnClick = TBGridClick
     end
     object ToolButton7: TToolButton
-      Left = 180
+      Left = 316
       Top = 0
+      Margins.Left = 5
+      Margins.Top = 5
+      Margins.Right = 5
+      Margins.Bottom = 5
       Action = ACPalette
       DropdownMenu = PMPalettes
       Style = tbsDropDown
     end
     object ToolButton4: TToolButton
-      Left = 240
+      Left = 417
       Top = 0
-      Width = 8
+      Width = 14
+      Margins.Left = 5
+      Margins.Top = 5
+      Margins.Right = 5
+      Margins.Bottom = 5
       Caption = 'ToolButton4'
       ImageIndex = 2
       Style = tbsSeparator
     end
     object LAMap: TLabel
-      Left = 248
+      Left = 431
       Top = 0
-      Width = 49
-      Height = 22
+      Width = 88
+      Height = 39
+      Margins.Left = 5
+      Margins.Top = 5
+      Margins.Right = 5
+      Margins.Bottom = 5
       Caption = ' No map'
       Font.Charset = ANSI_CHARSET
       Font.Color = clWindowText
-      Font.Height = -13
+      Font.Height = -23
       Font.Name = 'Arial'
       Font.Style = [fsItalic]
       ParentFont = False
@@ -98,47 +144,53 @@ object ViewerForm: TViewerForm
   end
   object PaintBox: TPaintBox32
     Left = 0
-    Top = 26
-    Width = 629
-    Height = 436
+    Top = 43
+    Width = 1115
+    Height = 766
     Cursor = crCross
+    Margins.Left = 5
+    Margins.Top = 5
+    Margins.Right = 5
+    Margins.Bottom = 5
     Align = alClient
     TabOrder = 1
     OnMouseDown = PaintBoxMouseDown
     OnMouseMove = PaintBoxMouseMove
     OnMouseUp = PaintBoxMouseUp
     OnResize = PaintBoxResize
-    ExplicitTop = 56
-    ExplicitHeight = 406
   end
   object StatusBar: TStatusBar
     Left = 0
-    Top = 462
-    Width = 629
-    Height = 20
+    Top = 809
+    Width = 1115
+    Height = 35
+    Margins.Left = 5
+    Margins.Top = 5
+    Margins.Right = 5
+    Margins.Bottom = 5
     Font.Charset = ANSI_CHARSET
     Font.Color = clBtnText
-    Font.Height = -11
+    Font.Height = -19
     Font.Name = 'Arial'
     Font.Style = []
     Panels = <
       item
-        Width = 65
+        Width = 114
       end
       item
-        Width = 65
+        Width = 114
       end
       item
-        Width = 65
+        Width = 114
       end
       item
-        Width = 65
+        Width = 114
       end
       item
-        Width = 105
+        Width = 184
       end
       item
-        Width = 50
+        Width = 88
       end>
     UseSystemFont = False
   end

+ 113 - 0
Source/GLS.CyborgManager.pas

@@ -0,0 +1,113 @@
+unit GLS.CyborgManager;
+(*
+  The CyborgManager is a class that provides a way to manage
+  AI models for master objects and thier proxies at runtime.
+  You just need to have the model filename and it will load it
+  into the list or return the already existing model
+*)
+
+interface
+
+uses
+  System.SysUtils,
+  System.Classes,
+  GLS.Scene,
+  GLS.Objects,
+  GLS.SmartObjects,
+  GLS.File3DS,
+  GLS.FilePly,
+  GLS.FileOBJ;
+
+type
+
+  TGLCyborgManager = class
+  private
+    FMasterObject: TGLDummyCube;
+    FModelList: TStringList;
+    FModelPath: string;
+    (* Changing the path to the models and refresh the
+      already existing freeforms *)
+    procedure SetPathToModel(const Value: String);
+  public
+    (* It will create the list, assign the path to the
+      models and the master object where the new models will be loaded *)
+    constructor Create(AMaster: TGLDummyCube; APath: string); virtual;
+    (* It will free all the loaded models *)
+    destructor Destroy; override;
+    (* It will load a new model if it's not in the list and then return the new
+      freeform.  If it,s already in the list, it will return the existing freeform *)
+    function LoadModel(AFilename: string): TGLCyborg;
+    property MasterObject: TGLDummyCube read FMasterObject;
+    property ModelList: TStringList read FModelList;
+    property Path: string read FModelPath write SetPathToModel;
+  end;
+
+// ============================================================================
+implementation
+// ============================================================================
+
+constructor TGLCyborgManager.Create(AMaster: TGLDummyCube; APath: string);
+begin
+  // Set the master object
+  FMasterObject := AMaster;
+  // Create the model list
+  FModelList := TStringList.Create;
+  FModelList.CaseSensitive := false;
+  FModelList.Sorted := true;
+  // Set the path to the models
+  SetPathToModel(APath);
+end;
+
+// --------------------------------
+destructor TGLCyborgManager.Destroy;
+var
+  i: Integer;
+begin
+  // Destroy every models
+  for i := 0 to Pred(FModelList.Count) do
+    FModelList.Objects[i].Destroy;
+  // Destroy the list
+  FModelList.Destroy;
+  inherited;
+end;
+
+// --------------------------------------------------------------
+function TGLCyborgManager.LoadModel(AFilename: string): TGLCyborg;
+var
+  i: Integer;
+  NewFreeForm: TGLCyborg;
+begin
+  with FModelList do
+  begin
+    if Find(AFilename, i) then
+      Result := TGLCyborg(Objects[i])
+    else
+    begin
+      NewFreeForm := TGLCyborg(FMasterObject.AddNewChild(TGLCyborg));
+      NewFreeForm.LoadFromFile(FModelPath + AFilename);
+      FModelList.AddObject(AFilename, NewFreeForm);
+      Result := NewFreeForm;
+    end;
+  end;
+end;
+
+// ----------------------------------------------------------
+procedure TGLCyborgManager.SetPathToModel(const Value: String);
+var
+  Len: Integer;
+  i: Integer;
+begin
+  // Set the path
+  FModelPath := Value;
+  Len := Length(Value);
+  // Correct it if there is no '\'
+  if (Len > 0) then
+    if (Value[Len - 1] <> '\') then
+      FModelPath := Value + '\';
+  // Reload the models
+  for i := 0 to Pred(FModelList.Count) do
+    TGLCyborg(FModelList.Objects[i])
+      .LoadFromFile(FModelPath + FModelList.Strings[i]);
+end;
+
+end.

+ 89 - 61
Source/GLS.GeomObjects.pas

@@ -499,15 +499,16 @@ implementation
 procedure TGLTetrahedron.BuildList(var rci: TGLRenderContextInfo);
 const
   Vertices: packed array [0 .. 3] of TAffineVector =
-       ((X: 1.0;  Y: 1.0;  Z: 1.0),
-        (X: 1.0;  Y: -1.0; Z: -1.0),
-        (X: -1.0; Y: 1.0;  Z: -1.0),
-        (X: -1.0; Y: -1.0; Z: 1.0));
+       ((X: 0.5;  Y: 0.5;  Z: 0.5),   // 0
+        (X: 0.5;  Y: -0.5; Z: -0.5),  // 1
+        (X: -0.5; Y: 0.5;  Z: -0.5),  // 2
+        (X: -0.5; Y: -0.5; Z: 0.5));  // 3
   Triangles: packed array [0 .. 3] of packed array [0 .. 2] of Byte =
-    ((0, 1, 3),
-     (2, 1, 0),
-     (3, 2, 0),
-     (1, 2, 3));
+    ((0, 1, 3),  // 0
+     (2, 1, 0),  // 1
+     (3, 2, 0),  // 2
+     (1, 2, 3)); // 3
+
 var
   i, j: Integer;
   n: TAffineVector;
@@ -533,21 +534,21 @@ end;
 procedure TGLOctahedron.BuildList(var rci: TGLRenderContextInfo);
 const
   Vertices: packed array [0 .. 5] of TAffineVector =
-      ((X: 1.0; Y: 0.0; Z: 0.0),
-       (X:-1.0; Y: 0.0; Z: 0.0),
-       (X: 0.0; Y: 1.0; Z: 0.0),
-       (X: 0.0; Y: -1.0; Z: 0.0),
-       (X: 0.0; Y: 0.0; Z: 1.0),
-       (X: 0.0; Y: 0.0; Z: -1.0));
+      ((X: 1.0; Y: 0.0; Z: 0.0),   // 0
+       (X:-1.0; Y: 0.0; Z: 0.0),   // 1
+       (X: 0.0; Y: 1.0; Z: 0.0),   // 2
+       (X: 0.0; Y: -1.0; Z: 0.0),  // 3
+       (X: 0.0; Y: 0.0; Z: 1.0),   // 4
+       (X: 0.0; Y: 0.0; Z: -1.0)); // 5
   Triangles: packed array [0 .. 7] of packed array [0 .. 2] of Byte =
-    ((0, 4, 2),
-     (1, 2, 4),
-     (0, 3, 4),
-     (1, 4, 3),
-     (0, 2, 5),
-     (1, 5, 2),
-     (0, 5, 3),
-     (1, 3, 5));
+    ((0, 4, 2),  // 0
+     (1, 2, 4),  // 1
+     (0, 3, 4),  // 2
+     (1, 4, 3),  // 3
+     (0, 2, 5),  // 4
+     (1, 5, 2),  // 5
+     (0, 5, 3),  // 6
+     (1, 3, 5)); // 7
 var
   i, j: Integer;
   n: TAffineVector;
@@ -596,7 +597,8 @@ begin
   for i := 0 to 4 do
   begin
     faceIndices := @Quadrangles[i, 0];
-    n := CalcPlaneNormal(vertices[faceIndices^[0]], vertices[faceIndices^[1]], vertices[faceIndices^[2]]);
+    n := CalcPlaneNormal(vertices[faceIndices^[0]],
+      vertices[faceIndices^[1]], vertices[faceIndices^[2]]);
     gl.Normal3fv(@n);
     gl.Begin_(GL_QUADS);
       for j := 0 to 7 do
@@ -605,6 +607,70 @@ begin
   end;
 end;
 
+
+// ------------------
+// ------------------ TGLIcosahedron ------------------
+// ------------------
+
+procedure TGLIcosahedron.BuildList(var rci: TGLRenderContextInfo);
+const
+  B = 0.309017; // 1/(1+Sqrt(5))
+const
+  Vertices: packed array [0 .. 11] of TAffineVector =
+   ((X: 0; Y: - B; Z: - 0.5),    // 0
+    (X: 0; Y: - B; Z: 0.5),      // 1
+    (X: 0; Y: B; Z: - 0.5),      // 2
+    (X: 0; Y: B; Z: 0.5),        // 3
+    (X: - 0.5; Y: 0; Z: - B),    // 4
+    (X: - 0.5; Y: 0; Z: B),      // 5
+    (X: 0.5; Y: 0; Z: - B),      // 6
+    (X: 0.5; Y: 0; Z: B),        // 7
+    (X: - B; Y: - 0.5; Z: 0),    // 8
+    (X: - B; Y: 0.5; Z: 0),      // 9
+    (X: B; Y: - 0.5; Z: 0),      // 10
+    (X: B; Y: 0.5; Z: 0));       // 11
+  Triangles: packed array [0 .. 19] of packed array [0 .. 2] of Byte =
+   ((2, 9, 11),   // 0
+    (3, 11, 9),   // 1
+    (3, 5, 1),    // 2
+    (3, 1, 7),    // 3
+    (2, 6, 0),    // 4
+    (2, 0, 4),    // 5
+    (1, 8, 10),   // 6
+    (0, 10, 8),   // 7
+    (9, 4, 5),    // 8
+    (8, 5, 4),    // 9
+    (11, 7, 6),   // 10
+    (10, 6, 7),   // 11
+    (3, 9, 5),    // 12
+    (3, 7, 11),   // 13
+    (2, 4, 9),    // 14
+    (2, 11, 6),   // 15
+    (0, 8, 4),    // 16
+    (0, 6, 10),   // 17
+    (1, 5, 8),    // 18
+    (1, 10, 7));  //     19
+
+var
+  i, j: Integer;
+  n: TAffineVector;
+  faceIndices: PByteArray;
+begin
+  for i := 0 to 19 do
+  begin
+    faceIndices := @triangles[i, 0];
+
+    n := CalcPlaneNormal(vertices[faceIndices^[0]], vertices[faceIndices^[1]],
+      vertices[faceIndices^[2]]);
+    gl.Normal3fv(@n);
+    gl.Begin_(GL_TRIANGLES);
+    for j := 0 to 2 do
+      gl.Vertex3fv(@vertices[faceIndices^[j]]);
+    gl.End_;
+  end;
+end;
+
+
 // ------------------
 // ------------------ TGLDodecahedron ------------------
 // ------------------
@@ -654,44 +720,6 @@ begin
   end;
 end;
 
-// ------------------
-// ------------------ TGLIcosahedron ------------------
-// ------------------
-
-procedure TGLIcosahedron.BuildList(var rci: TGLRenderContextInfo);
-const
-  A = 0.5;
-  B = 0.30901699437; // 1/(1+Sqrt(5))
-const
-  Vertices: packed array [0 .. 11] of TAffineVector =
-   ((X: 0; Y: - B; Z: - A), (X: 0; Y: - B; Z: A), (X: 0; Y: B; Z: - A),
-    (X: 0; Y: B; Z: A), (X: - A; Y: 0; Z: - B), (X: - A; Y: 0; Z: B),
-    (X: A; Y: 0; Z: - B), (X: A; Y: 0; Z: B), (X: - B; Y: - A; Z: 0),
-    (X: - B; Y: A; Z: 0), (X: B; Y: - A; Z: 0), (X: B; Y: A; Z: 0));
-  Triangles: packed array [0 .. 19] of packed array [0 .. 2] of Byte =
-   ((2, 9, 11), (3, 11, 9), (3, 5, 1), (3, 1, 7), (2, 6, 0),
-    (2, 0, 4), (1, 8, 10), (0, 10, 8), (9, 4, 5), (8, 5, 4), (11, 7, 6),
-    (10, 6, 7), (3, 9, 5), (3, 7, 11), (2, 4, 9), (2, 11, 6), (0, 8, 4),
-    (0, 6, 10), (1, 5, 8), (1, 10, 7));
-
-var
-  i, j: Integer;
-  n: TAffineVector;
-  faceIndices: PByteArray;
-begin
-  for i := 0 to 19 do
-  begin
-    faceIndices := @triangles[i, 0];
-
-    n := CalcPlaneNormal(vertices[faceIndices^[0]], vertices[faceIndices^[1]],
-      vertices[faceIndices^[2]]);
-    gl.Normal3fv(@n);
-    gl.Begin_(GL_TRIANGLES);
-    for j := 0 to 2 do
-      gl.Vertex3fv(@vertices[faceIndices^[j]]);
-    gl.End_;
-  end;
-end;
 
 // ------------------
 // ------------------ TGLDisk ------------------

+ 80 - 0
Source/GLS.Polyhedra.pas

@@ -0,0 +1,80 @@
+//
+// The graphics engine GLScene https://github.com/glscene
+//
+unit GLS.Polyhedra;
+
+(*
+  Polyhedra support.
+  The polyhedra are subclasses of polygon structures.
+  The registered classes are:
+    [TGLPolyTet, TGLPolyOct, TGLPolyHec, TGLPolyIso, TGLPolyDod, TGLPolyhedron, TGLPolyhedra]
+*)
+
+interface
+
+{$I GLS.Scene.inc}
+
+uses
+  Winapi.OpenGL,
+  Winapi.OpenGLext,
+  System.Classes,
+  System.SysUtils,
+  System.Types,
+  System.Math,
+  VCL.Consts,
+
+  GLS.OpenGLTokens,
+  GLS.VectorTypes,
+  GLS.VectorTypesExt,
+  GLS.TextureFormat,
+
+  GLS.VectorGeometry,
+  GLS.Scene,
+  GLS.BaseClasses,
+  GLS.Objects,
+  GLS.GeomObjects,
+  GLS.Portal,
+  GLS.VectorLists,
+  GLS.PersistentClasses,
+  GLS.Silhouette,
+  GLS.Strings,
+  GLS.Texture,
+  GLS.Material,
+  GLS.Mesh,
+  GLS.Logger,
+  GLS.Octree,
+  GLS.GeometryBB,
+  GLS.ApplicationFileIO,
+  GLS.Context,
+  GLS.Color;
+
+
+type
+
+  (*
+  A PolyTet object that handles polygyns for tetrahedron
+  *)
+  TGLPolyTet = class(TGLPolygon)
+  public
+    constructor CreateOwned(AOwner: TGLPolygon);
+    destructor Destroy; override;
+  end;
+
+
+implementation
+
+
+{ TGLPolyTet }
+
+constructor TGLPolyTet.CreateOwned(AOwner: TGLPolygon);
+begin
+ //
+end;
+
+destructor TGLPolyTet.Destroy;
+begin
+  //
+  inherited;
+end;
+
+end.

+ 3 - 1
Source/GLS.Portal.pas

@@ -7,6 +7,9 @@ unit GLS.Portal;
   Portal Rendering support for GLScene.
   The portal structures are subclasses of the Mesh structures, with a "sector"
   being assimilated to a "MeshObject" and sector polygons to facegroups.
+  The registered classes are:
+    [TGLPortal, TGLSectorMeshObject, TFGPolygon, TFGPortalPolygon]
+
 *)
 
 interface
@@ -269,7 +272,6 @@ end;
 initialization
 // ------------------------------------------------------------------
 
-// class registrations
 RegisterClasses([TGLPortal, TGLSectorMeshObject, TFGPolygon, TFGPortalPolygon]);
 
 end.

+ 1 - 1
Source/GLS.Scene.inc

@@ -12,7 +12,7 @@
 
 // Activate support Graphics32 library
 // Can be found at https://github.com/graphics32
-{.$DEFINE USE_GRAPHICS32}
+{$DEFINE USE_GRAPHICS32}
 
 // Activate support FastMath library
 // Use https://github.com/neslib/FastMath

+ 65 - 27
Source/GLS.SmartObjects.pas

@@ -4,9 +4,14 @@
 unit GLS.SmartObjects;
 
 (*
-  The smart spatial objects that have sences and artifitial intelligence
-  to interact with player, base geometric and other smart objects:
-  TGLGerm, TGLSmartCells, TGLSmartSwarm, TGLSmartNet, TGLCyborg, TGLCyborgs
+  These objects have built-in properties and methods to support sound, vision,
+  physics, and finding shortest paths through obstacle terrains. In addition,
+  they have artificial intelligence to conduct dialogues and make
+  independent decisions. The smart spatial objects are used to interact
+  with other smart objects.
+
+  The registered classes:
+   [TGLSmartGerm, TGLSmartCells, TGLSmartSwarm, TGLSmartNet, TGLCyborg, TGLCyborgs]
 *)
 
 interface
@@ -28,7 +33,6 @@ uses
   GLS.VectorTypesExt,
   GLS.Strings,
   GLS.PipelineTransformation,
-  GLS.Logger,
 
   GLS.Scene,
   GLS.VectorLists,
@@ -39,6 +43,8 @@ uses
   GLS.Mesh,
   GLS.Octree,
   GLS.GeometryBB,
+  GLS.Objects,
+  GLS.GeomObjects,
   GLS.ApplicationFileIO,
   GLS.Context,
   GLS.Color,
@@ -53,8 +59,10 @@ uses
 
 type
 
-  TGLCyborgSmartReference = (csrNone, csrWeak, csrStrong);
-  TGLCyborgThinkingMode = (ctmSelf, ctmSleep, ctmOutside, ctmZombie, ctmDeath);
+  TGLSmartSwarmMode = (isNone, isRandom, isTetra, isGrid);
+
+  TGLCyborgReference = (crNone, crWeak, crStrong);
+  TGLCyborgThinkMode = (ctmSelf, ctmSleep, ctmOutside, ctmZombie, ctmDeath);
 
   TGLCyborgOption = (coCollide, coContact, coJoin);
   TGLCyborgSenceOrgans = (csoVision, csoHearing, csoSmell, csoTouch, taste);
@@ -62,7 +70,7 @@ type
   TGLCyborgOptions = set of TGLCyborgOption;
   TGLCyborgThinks = class(TCollection);
 
-  // A list of thinking periods for TGLCyborgThinkingMode
+  // A list of thinking periods for TGLCyborgThinkMode
   TGLCyborgThinksList = class(TGLPersistentObjectList);
 
 const
@@ -76,16 +84,15 @@ type
   TGLCyborg = class(TGLActor)
   private
     FBirthTime, FDeathTime: TDateTime;
-    FSmartReference: TGLCyborgSmartReference;
-    FThinkingMode: TGLCyborgThinkingMode;
+    FReference: TGLCyborgReference;
+    FThinkMode: TGLCyborgThinkMode;
     FControlers: TList;
     FInterval: Integer;
     FOptions: TGLCyborgOptions;
     FThinkings: TGLCyborgThinks;
-    FReference: TGLCyborgSmartReference;
   protected
-    procedure SetReference(val: TGLCyborgSmartReference);
-    procedure SetThinking(const val: TGLCyborgThinkingMode);
+    procedure SetReference(val: TGLCyborgReference);
+    procedure SetThinking(const val: TGLCyborgThinkMode);
     function StoreThinking: Boolean;
     procedure SetOptions(const val: TGLCyborgOptions);
     procedure DoThink; virtual;
@@ -101,12 +108,12 @@ type
     // Indicates whether the cyborg is currently thinking
     function IsThinking: Boolean;
   published
-    // See TGLCyborgThinkingMode.
-    property ThinkingMode: TGLCyborgThinkingMode read FThinkingMode
-	  write FThinkingMode default ctmSelf;
+    // See TGLCyborgThinkMode.
+    property ThinkingMode: TGLCyborgThinkMode read FThinkMode
+	  write FThinkMode default ctmSelf;
     // Reference Frame Animation mode. Allows specifying if the model is primarily morph or skeleton based
-    property SmartReference: TGLCyborgSmartReference read FReference
-      write FSmartReference default csrNone;
+    property SmartReference: TGLCyborgReference read FReference
+      write FReference default crNone;
 
     // Interval between thinking frames, in milliseconds.
     property Interval: Integer read FInterval write FInterval;
@@ -116,13 +123,23 @@ type
     ///property Thinkings: TGLCyborgThinks read FThinkings write SetThinking stored StoreThinking;
   end;
 
-
-    (* Synchronize self thinking with an other thinkers.
-      Copies Start/Current/End Frame values, CurrentFrameDelta,
-      ThinkingMode and FrameInterpolation.
-    procedure Synchronize(ReferenceCyborg: TGLCyborg);
-     *)
-
+  (*
+     Synchronize self thinking with an other thinkers in the swarm
+     Copies Ai/Current/End values,ThinkingMode and GridInterpolation.
+     procedure Synchronize(IntelSwarm: TGLIntelSwarm);
+   *)
+  TGLSwartSwarm = class(TGLPoints)
+  private
+    FBirthTime, FDeathTime: TDateTime;
+    FReference: TGLCyborgReference;
+    FThinkMode: TGLSmartSwarmMode;
+  public
+    constructor Create(aOwner: TComponent); override;
+    destructor Destroy; override;
+    procedure Assign(Source: TPersistent); override;
+  published
+    property ThinkingMode: TGLSmartSwarmMode read FThinkMode;
+  end;
 
 var
   vGLSmartObjectsAllocate: Boolean = True;
@@ -196,12 +213,12 @@ begin
 //
 end;
 
-procedure TGLCyborg.SetReference(val: TGLCyborgSmartReference);
+procedure TGLCyborg.SetReference(val: TGLCyborgReference);
 begin
 //
 end;
 
-procedure TGLCyborg.SetThinking(const val: TGLCyborgThinkingMode);
+procedure TGLCyborg.SetThinking(const val: TGLCyborgThinkMode);
 begin
 //
 end;
@@ -217,11 +234,32 @@ begin
 //
 end;
 
+
 // ------------------------------------------------------------------
+{ TGLSwartSwarm }
+
+procedure TGLSwartSwarm.Assign(Source: TPersistent);
+begin
+  inherited;
+  //
+end;
+
+constructor TGLSwartSwarm.Create(aOwner: TComponent);
+begin
+  inherited;
+  //
+end;
+
+destructor TGLSwartSwarm.Destroy;
+begin
+  //
+  inherited;
+end;
+
 initialization
 // ------------------------------------------------------------------
 
-  RegisterClasses([TGLCyborg{, TGLGerm, TGLCyborgNet, TGLSmartSwarm}]);
+  RegisterClasses([TGLCyborg (*, TGLSmartSwarm*)]);
 
 finalization