1000 lines (886 with data), 50.0 kB
#a3dge.etDbg
This can be assigned to @code(Application.EventLogFilter).
#a3dge.etAll
This can be assigned to @code(Application.EventLogFilter).
#a3dge.etNone
This can be assigned to @code(Application.EventLogFilter).
#a3dge.etDefault
This can be assigned to @code(Application.EventLogFilter).
#a3dge.FPS
@seealso(TA3DGEApplication.TicksPerSecond)
#a3dge.TConfigurationFile
It gets values from a configuration file, which uses the INI file format, and also from command line options.
#a3dge.TConfigurationFile.Create
Note you must call method @link(Load) to actually load the configuration file.
@seealso(TConfigurationFile.FileName) @seealso(TConfigurationFile.Load)
#a3dge.TConfigurationFile.Destroy
Note that changes in the configuration file won't be saved. You must call @link(Save) to do it.
@seealso(TConfigurationFile.Save)
#a3dge.TConfigurationFile.Load
@seealso(TConfigurationFile.FileName)
#a3dge.TConfigurationFile.GetValue
@param(aSection Section name. It can be an empty string for the global section.)
@param(aKey Key name.)
@param(aDefault Default value returned if the key doesn't exist in file.)
@return(The value of the key, or @code(Default) if it doesn't exists. Note that if the key exists, but is empty, an empty string will be returned.)
@seealso(TConfigurationFile.SetValue) @seealso(TConfigurationFile.GetBoolValue) @seealso(TConfigurationFile.GetIntValue)
#a3dge.TConfigurationFile.GetIntValue
@param(aSection Section name. It can be an empty string for the global section.)
@param(aKey Key name.)
@param(aDefault Default value returned if the key doesn't exist in file.)
@seealso(TConfigurationFile.SetIntValue) @seealso(TConfigurationFile.GetValue)
#a3dge.TConfigurationFile.GetBoolValue
@param(aSection Section name. It can be an empty string for the global section.)
@param(aKey Key name.)
@param(aDefault Default value returned if the key doesn't exist in file.)
@seealso(TConfigurationFile.SetBoolValue) @seealso(TConfigurationFile.GetValue)
#a3dge.TConfigurationFile.SetValue
This method doesn't save the new value to the file. You must call @link(Save) for this.
@param(aSection Section name. It can be an empty string for the global section.)
@param(aKey Key name.)
@param(aValue The new value.)
@seealso(TConfigurationFile.Save) @seealso(TConfigurationFile.GetValue) @seealso(TConfigurationFile.SetBoolValue) @seealso(TConfigurationFile.SetIntValue)
#a3dge.TConfigurationFile.SetIntValue
@param(aSection Section name. It can be an empty string for the global section.)
@param(aKey Key name.)
@param(aValue The new value.)
@seealso(TConfigurationFile.GetIntValue) @seealso(TConfigurationFile.SetValue)
#a3dge.TConfigurationFile.SetBoolValue
@param(aSection Section name. It can be an empty string for the global section.)
@param(aKey Key name.)
@param(aValue The new value.)
@seealso(TConfigurationFile.GetBoolValue) @seealso(TConfigurationFile.SetValue)
#a3dge.TConfigurationFile.Save
@seealso(TConfigurationFile.SetValue) @seealso(TConfigurationFile.FileName)
#a3dge.TConfigurationFile.FileName
Default is @code(GetAppConfigFile @(False, False@)).
Note that assign this property will load the file if it exists.
@seealso(TConfigurationFile.Load) @seealso(TConfigurationFile.Save)
#a3dge.TDisplay
This is a quite simple display configured for OpenGL.
@seealso(TA3DGEApplication.Display)
#a3dge.TDisplay.GetDisplayFlags
Note that @link(Open) will use only flags that are compatible with the display configuration.
@seealso(TDisplay.Open) @seealso(TDisplay.GetWindowSize)
#a3dge.TDisplay.GetDisplaySize
@seealso(TDisplay.GetWindowSize) @seealso(TDisplay.Open) @seealso(TDisplay.GetDisplayFlags)
#a3dge.TDisplay.GetWindowSize
Right now it returns a window that fits in the current desktop with 16:9 proportion.
@seealso(TDisplay.GetDisplaySize) @seealso(TDisplay.Open) @seealso(TDisplay.GetDisplayFlags)
#a3dge.TDisplay.Close
Note that this will destroy the Allegro display (if exists) so if it is used as source of events it will not be used anymore, and video bitmaps will be invalidated. Read Allegro documentation for details.
@seealso(TDisplay.Open)
@seealso(TDisplay.OnClose)
#a3dge.TDisplay.Open
It will @link(close) the previous display if exists.
You're unlikely to use this method as it will be called by the initialization method of the application object.
@seealso(TDisplay.IsOpen) @seealso(TDisplay.Windowed)
@seealso(TDisplay.Title) @seealso(TDisplay.FlipDisplay)
@seealso(TDisplay.GetDisplayFlags) @seealso(TDisplay.GetDisplaySize) @seealso(TDisplay.GetWindowSize)
@seealso(TDisplay.SetOrthographicProjection)
@seealso(TDisplay.OnOpen) @seealso(TDisplay.OnClose)
@seealso(TA3DGEApplication.Initialize)
#a3dge.TDisplay.IsOpen
@seealso(TDisplay.Open) @seealso(TDisplay.Close)
@seealso(TDisplay.OnOpen) @seealso(TDisplay.OnClose)
#a3dge.TDisplay.SetOrthographicProjection
Note this method will also change the viewport to the whole display.
For OpenGL, screen coordinates are -1 to 1 in both height and width. For Allegro, it is pixel coordinates.
@seealso(TDisplay.Width) @seealso(TDisplay.Height)
@seealso(TDisplay.Open)
@seealso(TCamera.SetOrthographicProjection)
#a3dge.TDisplay.SetAsTarget
@seealso(TDisplay.FlipDisplay) @seealso(TDisplay.Open)
#a3dge.TDisplay.FlipDisplay
@seealso(TDisplay.Open) @seealso(TDisplay.SetAsTarget)
#a3dge.TDisplay.Title
You can set it before or after opening the display.
#a3dge.TDisplay.Windowed
If the display is opened, it will be closed and then reopened. That will trigger the @link(OnClose) and @link(OnOpen) events in order.
If @code(DEBUGMODE) is defined default is @true, else default is @false.
@seealso(TDisplay.Open)
#a3dge.TDisplay.OnOpen
@seealso(TDisplay.Open) @seealso(TDisplay.IsOpen) @seealso(TDisplay.OnClose)
#a3dge.TDisplay.OnClose
This will be notified @italic(before) the display is closed.
@seealso(TDisplay.Close) @seealso(TDisplay.IsOpen) @seealso(TDisplay.OnOpen)
#TKeyboard
You don't need to create it, use it through @link(TA3DGEApplication.Keyboard).
#TKeyboard.Clear
@seealso(TKeyboard.Readkey) @seealso(TKeyboard.KeyState)
#TKeyboard.Keypressed
@seealso(TKeyboard.Readkey) @seealso(TKeyboard.UReadkey)
#TKeyboard.Readkey
It returns the next character from the keyboard buffer, in ASCII format. If key buffer is empty it returns @code(0). You can see if there are queued keypresses with @link(Keypressed).
The low byte of the return value contains the ASCII code of the key, and the high byte the scancode. The scancode remains the same whatever the state of the shift, ctrl and alt keys, while the ASCII code is affected by shift and ctrl in the normal way (shift changes case, ctrl+letter gives the position of that letter in the alphabet, eg. ctrl+A = 1, ctrl+B = 2, etc). Pressing alt+key returns only the scancode, with a zero ASCII code in the low byte. For example:
@longcode(#
var
Key: LongInt;
...
Key := a3dge.Application.Keyboard.Readkey;
if (Key and $FF) = ord ('d') then
WriteLn ('You pressed "d"');
if (Key shr 8) = ALLEGRO_KEY_SPACE then
WriteLn ('You pressed Space');
if (Key and $FF) = 3 then
WriteLn ('You pressed Control+C');
if Key = (ALLEGRO_KEY_X shl 8) then
WriteLn ('You pressed Alt+X');
#)
This function cannot return character values greater than 255.
@seealso(TKeyboard.UReadkey) @seealso(TKeyboard.KeyModifiers) @seealso(TKeyboard.Clear) @seealso(TKeyboard.KeyState)
#TKeyboard.UReadkey
It returns the next character from the keyboard buffer, in Unicode format. If the buffer is empty, it returns @code(0). You can see if there are queued keypresses with @link(Keypressed). The return value contains the Unicode value of the key, and the argument will be set to the scancode. Unlike @link(Readkey), this function is able to return character values greater than 255. Example:
@longcode(#
var
Key, Scancode: LongInt;
...
Key := a3dge.Application.keyboard.UReadkey (Scancode);
if Key = $00F1 then
WriteLn ('You pressed n with tilde');
if Key = $00DF then
WriteLn ('You pressed sharp s');
#)
You should be able to find Unicode character maps at http://www.unicode.org/.
@seealso(TKeyboard.Readkey) @seealso(TKeyboard.KeyModifiers) @seealso(TKeyboard.Clear)
#TKeyboard.KeyModifiers
It returns the key modifiers of the current keyboard buffer. If keyboard buffer is empty, this will return invalid values. For example:
@longcode(#
var
Key, Modifier: LongInt;
...
Modifier := Game.Keyboard.KeyModifiers;
Key := Game.Keyboard.Readkey;
if (Key shr 8) = ALLEGRO_KEY_LEFT then
begin
if (Modifier and ALLEGRO_KEY_MOD_SHIFT) <> 0 then
X := X - 10
else
X := X - 1
end;
if (Key shr 8) = ALLEGRO_KEY_RIGHT then
begin
if (Modifier and ALLEGRO_KEY_MOD_SHIFT) <> 0 then
X := X + 10
else
X := X + 1
end;
#)
Note you should call to @code(KeyModifiers) before than @code(Readkey).
@seealso(TKeyboard.Readkey) @seealso(TKeyboard.UReadkey) @seealso(TKeyboard.KeyModifiers)
#TKeyboard.KeyState
@seealso(TKeyboard.Clear) @seealso(TKeyboard.Keypressed)
#a3dge.TGameState
This class extends the @link(TState) class adding rendering capabilities.
@seealso(TState.Update) @seealso(TGameState.Render) @seealso(TGameState.Enter) @seealso(TState.Leave)
@seealso(TA3DGEApplication.GameState)
#a3dge.TGameState.Enter
@seealso(TState.Enter)
#a3dge.TGameState.Render
This method doesn't need to call @link(TDisplay.FlipDisplay).
@seealso(TA3DGEApplication.GameState)
#a3dge.TGameStateManager
This class extends @link(TStateMachine) adding the needed functionality to manage game states.
@seealso(TA3DGEApplication.GameState)
#a3dge.TGameStateManager.Render
The @link(Global) state will be rendered over the @link(Current) one.
You don't need to call this as @link(a3dge.Application) will do it for you.
@param(aSender The object that does the call. In most cases will be the @link(Application) object.)
@seealso(TGameState.Render)
#a3dge.TGameStateManager.Current
This state will be updated everytime game tick.
Assigning this property will trigger the execution the @code(Leave) and @code(Enter) methods of the old and new state in the next game tick.
@seealso(TGameStateManager.Global)
#a3dge.TGameStateManager.Global
@seealso(TGameStateManager.Current)
#a3dge.TA3DGEApplication
It works much like LCL and VCL @code(TCustomApplication) class, so Lazarus and Delphi users should be used to this kind of stuff.
Only one application object should exist. If you create more than one an exception will raise.
You should call @link(Initialize) after creation.
@seealso(Application) @seealso(TA3DGEApplication.Initialize)
#a3dge.TA3DGEApplication.PrintCommandLineOptions
By default it prints information about default command line options.
Note that this information will be printed on the console terminal. On Windows it means you must compile without the @code(-WG) option or it will fail with an exception. Another option is to override this method to prevent printing on console.
@seealso(ParseCommandLineOptions)
#a3dge.TA3DGEApplication.ParseCommandLineOptions
These are the options parsed by this method:@unorderedlist(
@item(@code(-f, --fullscreen) will set @link(TDisplay.Windowed) to @false.)
@item(@code(-h, --help) will call @link(PrintCommandLineOptions) then end.)
@item(@code(--log) will allow to change the log configuration.)
@item(@code(-w, --Windowed) will set @link(TDisplay.Windowed) to @true.)
)
Note that options `-h` and `--log` won't be overriden as they're @italic(hard-wired) to the core.
@seealso(PrintCommandLineOptions)
#a3dge.TA3DGEApplication.Destroy
This also destoys all owned components and game states.
@seealso(TA3DGEApplication.AddGameState)
#a3dge.TA3DGEApplication.ShowErrorMessage
If the @link(Display) is open then it will try to render the message on it. If not it will print it in the standard output (the console or command terminal).
This is used internally to show uncatched exception messages.
@param(aMessage The error message.)
#a3dge.TA3DGEApplication.Initialize
You must call this before the game execution.
It will:
@orderedlist(
@item(Checks and initializes @code(EventLogFilter), @link(Configuration) and @link(Display).)
@item(Loads configuration file and parses command line options.)
@item(Initializes Allegro and base subsystems.)
@item(Opens the display.)
)
@seealso(TA3DGEApplication.ParseCommandLineOptions)
@seealso(TDisplay.Open)
#a3dge.TA3DGEApplication.AddGameState
@code(AddGameState) adds the given state the list of @italic(gamestates) in the application. If it is the first game state adde, it will be assigned as the current @link(GameState).
Adding the state after @link(Initialize) will log it as @code(etDebug), but adding it before will not.
@param(aGameState The game state to add.)
@param(aName If set, it will assign the name to the state.)
@seealso(TA3DGEApplication.GameState) @seealso(TA3DGEApplication.FindGameState)
#a3dge.TA3DGEApplication.FindGameState
Search is case-insensitive.
@param(aName Name of the state ot search.)
@returns(The reference of the state or @nil if it can't find it.)
@seealso(TA3DGEApplication.GameState) @seealso(TA3DGEApplication.AddGameState)
#a3dge.TA3DGEApplication.PauseUpdates
This will stop to update the current game state but other events will be triggered normally. You can use this while loading game data to prevent time jumps.
@bold(Do not forget to call @link(ResumeUpdates) to restore the normal game execution.)
@seealso(TA3DGEApplication.ResumeUpdates)
#a3dge.TA3DGEApplication.ResumeUpdates
@seealso(TA3DGEApplication.PauseUpdates) @seealso(TA3DGEApplication.TicksPerSecond)
#a3dge.TA3DGEApplication.Configuration
Default configuration file is @code(GetAppConfigFile @(False, False@)). You can override it by assigning the configuration name (@link(TConfigurationFile.FileName)) before calling @link(Initialize).
@seealso(Initialize)
#a3dge.TA3DGEApplication.TicksPerSecond
Default value is @link(FPS).
#a3dge.TA3DGEApplication.GameState
@seealso(TA3DGEApplication.AddGameState) @seealso(TA3DGEApplication.FindGameState)
#A3DGEException.Create
@seealso(A3DGEException.CreateFmt)
#A3DGEException.CreateFmt
@param(aFmt A formatting string as in @code(Format).)
@param(aArgs List of arguments to be combined with the @code(aFmt) parameter.)
@seealso(A3DGEException.Create)
#TState
@code(TState) implements an abstract class to define a state. It introduces methods to define the behaviour of this state.
You can use the states or through a @link(TStateMachine). Note that the object that uses the state may be not the @code(Owner) of the state. The owner is the object that contains the state. The object that uses the state is passed as a parameter to the @link(Update) method.
An instance of @code(TState) is never created directly, instead a descendant should be created. This is because @code(TState) is an abstract class which does not implement all methods.
@seealso(TStateMachine)
#TState.Enter
This is called before the first use of the state to initialize it and the entity.
@param(aEntity Object entity asociated with the state.)
@seealso(TState.Leave)
#TState.Update
@param(aEntity Object entity asociated with the state.)
@seealso(TState.Enter) @seealso(TState.Leave)
#TState.Leave
This is called after the last use of the state, because it changed, to clean and release resources when needed.
Remember that this method is called only when changing states and not when destroyed, so you should also add cleaning code in the destructor.
@param(aEntity Object entity asociated with the state.)
@seealso(TState.Enter)
#TStateMachine
This object keeps track of the current states. It also calls the @code(Enter) and @code(Leave) state methods when current state changes.
To use this object create a @link(TStateMachine) object. Then assign the @link(Current) state and call the @link(Update) method to execute the state.
@seealso(TState) @seealso(TStateMachine.Current) @seealso(TStateMachine.Update)
#TStateMachine.Update
@param(aEntity Object entity asociated with the state.)
@seealso(TStateMachine.SwapPreviousState)
@seealso(TStateMachine.Current) @seealso(TStateMachine.Global)
#TStateMachine.SwapPreviousState
@seealso(TStateMachine.Current) @seealso(TStateMachine.Global)
#TStateMachine.Current
Assigning this property will trigger the execution the @code(Leave) and @code(Enter) methods of the old and new state in the next call to @link(Update).
@seealso(TStateMachine.Update)
@seealso(TStateMachine.Global) @seealso(TStateMachine.SwapPreviousState)
#TStateMachine.Global
This state won't be affected by @link(SwapPreviousState).
@seealso(TStateMachine.Current) @seealso(TStateMachine.SwapPreviousState)
#THeightmap
Please refer to the unit's documentation for more information.
@seealso(TWorld3D.Heightmap)
@seealso(SetData)
#THeightmap.Clear
This removes all heightmap data, including the @link(TextureMap). It also sets @link(Visible) to @false.
@seealso(THeightmap.SetData) @seealso(THeightmap.TextureMap) @seealso(THeightmap.Visible)
#THeightmap.SetData
Bitmaps doesn't need to be the same size but heightmap size must be power of two and at least of 512 by 512 pixels.
Calling this method won't change the @link(Visible) property.
@param(aHeightmapBmp A bitmap containing the heightmap data. If it's 8bpp it will use the index, else it will use the red channel.)
@param(aTextureBmp A bitmap containing the texture used to map the heightmap.)
@seealso(THeightmap.TextureMap) @seealso(THeightmap.Clear) @seealso(THeightmap.OwnsTextureMap)
@seealso(THeightmap.MapScale) @seealso(THeightmap.HeightScale)
#THeightmap.Render
@param(aX Camera X coordinates) @param(aZ Camera Z coordinate.)
@seealso(THeightmap.Visible) @seealso(THeightmap.UseLight)
#THeightmap.UseLight
Setting it to @false may improve the heightmap looking if the texture map includes shading. Also would make it render a tad faster.
Default is @true
@seealso(THeightmap.Render) @seealso(THeightmap.TextureMap)
#THeightmap.MapScale
@seealso(THeightmap.HeightScale)
#THeightmap.HeightScale
@seealso(THeightmap.MapScale)
#THeightmap.OwnsTextureMap
@seealso(THeightmap.TextureMap) @seealso(THeightmap.SetData)
#THeightmap.Visible
Default if @false.
@seealso(THeightmap.Render) @seealso(THeightmap.Clear)
#THeightmap.TextureMap
@seealso(THeightmap.OwnsTextureMap) @seealso(THeightmap.SetData)
#TColorDescription
Each element of the array is a different color component, from @code(0) (black) to @code(1) (full color).
@seealso(cR) @seealso(cG) @seealso(cB) @seealso(cA)
#Color
Each component is a number between @code(0) (black) and @code(255) (full color).
@param(aR Red component.) @param(aG Green component.) @param(aB Blue component.)
@param(aA Alpha component. This is, transparency. @code(0) is transparent, @code(255) is solid. Default is @code(255).)
@seealso(Colorf)
#Colorf
Each component is a number between @code(0) (black) and @code(1) (full color).
@param(aR Red component.) @param(aG Green component.) @param(aB Blue component.)
@param(aA Alpha component. This is, transparency. @code(0) is transparent, @code(1) is solid. Default is @code(1).)
@seealso(Color)
#TMaterial
A material is defined by different components, each one of a different color. It may also contain a texture that will be mixed with the other components.
@seealso(TMaterialList)
#TMaterial.Create
It sets all components as a neutral white material.
@param(aFreeTextures Should texture be freed when destroyed?)
@seealso(OwnsTexture)
#TMaterial.Destroy
If @link(OwnsTexture) is @true it will destroy the @link(Texture).
#TMaterial.Apply
@code(Apply) will activate or deactivate 2D texturing depending it has a @link(Texture) assigned.
#TMaterial.Name
@seealso(TMaterialList.Find)
#TMaterial.TextureName
This is just to identify the @link(Texture). It's not used by the texture itself.
Assigning it won't imply the @code(Texture) is assigned.
#TMaterial.OwnsTexture
Default is @true.
@seealso(TMaterial.Create) @seealso(TMaterial.Texture) @seealso(TMaterial.Destroy)
#TMaterial.Texture
When assigned, if @link(OwnsTexture) is @true the previous texture will be destroyed.
#TMaterialList
By default it also manages the materials: when an material is deleted or removed from the list, it is automatically freed. This behaviour can be disabled when the list is created.
@seealso(TMaterialList.OwnsMaterials)
#TMaterialList.Create
@param(aFreeMaterials Should materials be freed when destroyed?)
@seealso(TMaterialList.OwnsMaterials)
#TMaterialList.Destroy
@code(Destroy) clears the list, freeing all materials in the list if @link(OwnsMaterials) is @true.
#TMaterialList.Add
Note that when @link(OwnsMaterials) is @true, a material should not be added twice to the list: this will result in memory corruption when the object is freed (as it will be freed twice). The @code(Add) method does not check this, however.
@returns(The material index.)
@seealso(TMaterialList.Delete) @seealso(TMaterialList.Extract) @seealso(TMaterialList.OwnsMaterials)
@seealso(TMaterialList.Find)
#TMaterialList.Delete
@code(Delete) removes the material at index @code(Ndx) from the list. When @link(OwnsMaterials) is @ŧrue, it is also freed.
An access violation may occur when @link(OwnsMaterials) is @true and either the material was freed externally, or when the same material is in the same list twice.
@param(Ndx Index of the object to delete.)
@seealso(TMaterialList.Extract) @seealso(TMaterialList.OwnsMaterials) @seealso(TMaterialList.Add) @seealso(TMaterialList.Clear)
#TMaterialList.Extract
@code(Extract) removes the material at index @code(Ndx) from the list. It returns the material if it was found or @nil if item was not present in the list.
Note that the object is not freed, and that only the first found object is removed from the list.
@seealso(TMaterialList.Delete) @seealso(TMaterialList.Clear) @seealso(TMaterialList.Add)
#TMaterialList.Assign
@code(Assign) copies the contents of @code(aMaterialList).
@seealso(TMaterialList.Add) @seealso(TMaterialList.OwnsMaterials) @seealso(TMaterialList.Clear)
#TMaterialList.Find
The search is performed case-insensitively.
@param(aName Name to search.)
@return(The index of the material or @code(-1) if there's no material with that name in the list.)
@seealso(TMaterialList.Materials) @seealso(TMaterial.Name)
#TMaterialList.Count
@seealso(TMaterialList.Materials)
#TMaterialList.OwnsMaterials
@code(OwnsMaterials) determines whether the materials in the list should be freed when they are removed (not extracted) from the list, or when the list is cleared. If the property is @true then they are freed. If the property is @false the elements are not freed.
The value is usually set in the constructor, and is seldom changed during the lifetime of the list. It defaults to @true.
@seealso(TMaterialList.Create) @seealso(TMaterialList.Destroy) @seealso(TMaterialList.Delete) @seealso(TMaterialList.Extract) @seealso(TMaterialList.Clear)
#TMaterialList.Materials
@code(Materials) is the default property of the list. It provides indexed access to the elements in the list. The index @code(Ndx) is zero based, i.e., runs from 0 (zero) to @code(@link(Count)-1).
@seealso(TMaterialList.Add) @seealso(TMaterialList.Count) @seealso(TMaterialList.Find)
#Deg2Rad
@bold(Usage)
@longcode(?
Radians := Degrees * Deg2Rad;
?)
@seealso(Rad2Deg)
#Rad2Deg
@bold(Usage)
@longcode(?
Degrees := Radians * Deg2Rad;
?)
@seealso(Deg2Rad)
#TVector3D
A @code(TVector3D) can be used to represent a point, a direction or an axis.
@seealso(Vector3D) @seealso(GetOppositeVector) @seealso(TVector3DList) @seealso(TMatrix3D)
@seealso(GetVectorLength) @seealso(GetNormalizedVector)
@seealso(AddVectors)
#TVector4D
A @code(TVector4D) can be used to represent a plane, where components @code(Vx,) @code(Vy) and @code(Vz) is the plane normal and @code(Vw) is the distance to the origin.
@seealso(Vector4D) @seealso(TVector3D)
#Vector0
@seealso(VectorFront)
#VectorFront
@seealso(Vector0)
#Vector3D
@seealso(Vector4D) @seealso(GetOppositeVector)
#Vector4D
@seealso(Vector3D)
#GetVectorLength
If you only need to compare lengths of vectors, you can use @link(GetVectorLength2) wich is faster.
@param(Vector A vector.)
@return(Length @code(Vector).)
@seealso(GetVectorLength2) @seealso(GetNormalizedVector)
#GetVectorLength2
To calculate vector length a @italic(square root) is used, wich is slow. Calculating the squared length is quite faster as it only uses addition and multiplication. Since squares are proportional to the base, compare squared lengths have the same result than compare lengths but faster.
@param(Vector A vector.)
@return(Squared length @code(Vector).)
@seealso(GetVectorLength)
#GetNormalizedVector
If vector is too small then vector will became a zero vector (i.e. a vector with all components equal zero).
@param(Vector A vector.)
@return(A vector in the same direction than @code(Vector) but length @code(1) @(one@).)
@seealso(GetVectorLength)
#GetOppositeVector
This returns a vector with same direction and magnitude but opposite direction.
#AddVectors
@seealso(SubVectors) @seealso(MultiplyVector) @seealso(DivideVector)
#SubVectors
@seealso(AddVectors) @seealso(MultiplyVector) @seealso(DivideVector)
#MultiplyVector
@seealso(AddVectors) @seealso(SubVectors) @seealso(DivideVector)
#DivideVector
@seealso(AddVectors) @seealso(SubVectors) @seealso(MultiplyVector)
#VectorAsString
Useful for logging and debugging.
#GetCrossProduct
@param(aV1 A vector. No need to be normalized.)
@param(aV2 A vector. No need to be normalized.)
@return(A vector that is perpendicular to both @code(aV1) and @code(aV2).)
@seealso(GetDotProduct) @seealso(GetNormalizedVector) @seealso(GetPlaneNormal)
#GetDotProduct
For normalized vectors, the result is proportional to the angle between both vectors, returning @code(1) if both point in the same direction, @code(0) if they're perpendicular or @code(-1) if they're in opposite directions.
@seealso(GetCrossProduct) @seealso(GetPlaneNormal) @seealso(GetNormalizedVector)
#GetVectorLerp
This is most commonly used to find a point some fraction of the way along a line between two endpoints (e.g. to move an object gradually between those points).
@param(V1 Start value, returned when @code(T) is @code(0).)
@param(V2 End value, returned when @code(T) is @code(1).)
@param(T Value used to interpolate between @code(V1) and @code(V2).)
@return(Interpolated value, equals to @code(((V2 - V1) * T) + V1).)
#GetPlaneNormal
The vectors passed as parameters are points in the plane. Such points should be passed in clockwise order.
@param(v1 A vector representing a point in a plane.)
@param(v2 A vector representing a point in a plane.)
@param(v3 A vector representing a point in a plane.)
@return(A vector that is perpendicular to the plane defined by the parameters.)
@seealso(GetCrossProduct)
#GetDistance
@seealso(GetDistance2) @seealso(GetDistance2Segment)
#GetDistance2
This function is faster than @link(GetDistance), so compare square of distance is faster than compare distance.
This function can be used to check sphere collisions:
@longcode(!
type
TSphere = record
Center: TVector3D;
Radius: Single
end;
function CheckSphereCollision (aSphere1, aSphere2: TSphere): Boolean;
begin
Result := GetDistance2 (aSphere1.Center, aSphere2.Center) <= Sqr (aSphere1.Radius + aSphere2.Radius)
end;
!)
@seealso(GetDistance)
#GetDistance2Segment
@seealso(GetDistance2Segment2) @seealso(GetDistance)
#GetDistance2Segment2
This function is faster than @link(GetDistance2Segment), so compare square of distance is faster than compare distance.
It can be used to check for collisions but it is slower than sphere or bounding-box collision algorithms.
@seealso(GetDistance2Segment) @seealso(GetDistance2)
#TMatrix3D
You can multiply two matrices together to produce a third matrix, and this will have the same effect on points as applying the original two matrices one after the other. For example, if you have one matrix that rotates a point and another that shifts it sideways, you can combine them to produce a matrix that will do the rotation and the shift in a single step. You can build up extremely complex transformations in this way, while only ever having to multiply each point by a single matrix.
This array is zero based and the order it is stored is the one OpenGL expects:
@preformatted(
| 0 4 8 12 |
| 1 5 9 13 |
| 2 6 10 14 |
| 3 7 11 15 | <- Note A3DGE doesn't use this row!
^----- Translation column.
)
So to acces to element @code(M@(m,n@)) use @code(M[@(@(n - 1@) * 4@) + @(m - 1@)]).
A3DGE assumes row 4 values are @code({ 0 0 0 1 }) in any case so you can ignore such row.
@seealso(IdentityMatrix) @seealso(GetTransformationMatrix)
@seealso(TVector3D) @seealso(MultiplyVectorMatrix)
#IdentityMatrix
@seealso(GetTransformationMatrix)
#GetTranslationMatrix
@seealso(GetScalingMatrix) @seealso(GetRotationMatrix)
@seealso(GetTransformationMatrix)
@seealso(MultiplyVectorMatrix)
#GetScalingMatrix
@seealso(GetTranslationMatrix) @seealso(GetRotationMatrix)
@seealso(GetTransformationMatrix)
@seealso(MultiplyVectorMatrix)
#GetXRotateMatrix
@seealso(GetYRotateMatrix) @seealso(GetZRotateMatrix)
@seealso(GetRotationMatrix) @seealso(GetTransformationMatrix)
@seealso(MultiplyVectorMatrix)
#GetYRotateMatrix
@seealso(GetXRotateMatrix) @seealso(GetZRotateMatrix)
@seealso(GetRotationMatrix) @seealso(GetTransformationMatrix)
@seealso(MultiplyVectorMatrix)
#GetZRotateMatrix
@seealso(GetXRotateMatrix) @seealso(GetYRotateMatrix)
@seealso(GetRotationMatrix) @seealso(GetTransformationMatrix)
@seealso(MultiplyVectorMatrix)
#GetRotationMatrix
@seealso(GetXRotateMatrix) @seealso(GetYRotateMatrix) @seealso(GetZRotateMatrix)
@seealso(GetScalingMatrix) @seealso(GetTranslationMatrix)
@seealso(GetTransformationMatrix)
@seealso(RotateVector) @seealso(MultiplyVectorMatrix)
#GetTransformationMatrix
@seealso(IdentityMatrix)
@seealso(GetTranslationMatrix) @seealso(GetScalingMatrix) @seealso(GetRotationMatrix)
@seealso(MultiplyVectorMatrix)
#MultiplyMatrix
@seealso(TMatrix3D)
#MultiplyVectorMatrix
@param(aM Matrix. Assumes row @code(4) of @code([0 0 0 1]).)
@param(aV Vector.)
@return(The transformed vector.)
@seealso(SetGLMatrix) @seealso(GetTransformationMatrix) @seealso(RotateVector)
#SetGLMatrix
Note this will replace the current OpenGL matrix stack.
#GetRelativeDirection
Note this function works on the @code(x/z) plane only.
@param(Chaser Position of the @italic(chaser) object.)
@param(Target Position of the @italic(target) object.)
@param(Direction The @code(x/z) angle the @code(Chaser) is facing.)
@return(A value in the interval @code(0..7) where @code(0) is in front of, @code(1) is in the front/right, @code(2) is on the right and so one.)
#TPolygon
The way this description is used depends the specific implementation of the model.
#TPolygon.Vertices
This list contains the index of each vertex of the polygon.
#TPolygon.VertexNormals
This list contains the index of each vertex normal.
@seealso(TPolygon.PlaneNormal) @seealso(TPolygon.UsePlaneNormal)
#TPolygon.TexCoords
This list contains the index of each texture UV pair.
#TPolygon.PlaneNormal
this vector is the plane normal.
@seealso(TPolygon.VertexNormals) @seealso(TPolygon.UsePlaneNormal)
#TPolygon.UsePlaneNormal
If this is @true, then model should use @link(PlaneNormal), otherwise it should use @link(VertexNormals).
If neither @code(UsePlaneNormal) is true nor @link(VertexNormals) contains any indes, the model shold render the polygon as if light desn't affect it (i.e. disable lighting and fog).
@seealso(TPolygon.PlaneNormal) @seealso(TPolygon.VertexNormals)
#TPolyhedron
@code(TPolyhedron) introduces fields, properties and methods that helps to define and manage the 3D model.
This class doesn't use textures, thus it uses less memory and it's a bit faster than @link(TTexturedPolyhedron).
#TPolyhedron.GetVertexList
This is useful as access using the @link(Vertices) property might be slightly slower, specially when accessing to a lot of vertices.
@seealso(TPolyhedron.SetVertexList) @seealso(TPolyhedron.NumVertices) @seealso(TPolyhedron.Vertices)
#TPolyhedron.GetNormalList
This is useful as access using the @link(Normals) property might be slightly slower, specially when accessing to a lot of normals.
@seealso(TPolyhedron.SetNormalList) @seealso(TPolyhedron.NumNormals) @seealso(TPolyhedron.Normals)
#TPolyhedron.GetPolygonList
This is useful as access using the @link(Polygons) property might be slightly slower, specially when accessing to a lot of polygons.
@seealso(TPolyhedron.SetPolygonList) @seealso(TPolyhedron.NumPolygons) @seealso(TPolyhedron.Polygons)
#TPolyhedron.SetNumVertices
@seealso(TPolyhedron.SetVertexList) @seealso(TPolyhedron.GetVertexList) @seealso(TPolyhedron.NumVertices) @seealso(TPolyhedron.Vertices)
#TPolyhedron.SetVertexList
This will replace all vertices with the given list. It also change the number of vertices.
@seealso(TPolyhedron.GetVertexList) @seealso(TPolyhedron.NumVertices) @seealso(TPolyhedron.Vertices)
#TPolyhedron.SetNumNormals
@seealso(TPolyhedron.SetNormalList) @seealso(TPolyhedron.GetNormalList) @seealso(TPolyhedron.NumNormals) @seealso(TPolyhedron.Normals)
#TPolyhedron.SetNormalList
This will replace all normals with the given list. It also change the number of normals.
@seealso(TPolyhedron.GetNormalList) @seealso(TPolyhedron.NumNormals) @seealso(TPolyhedron.Normals)
#TPolyhedron.SetNumPolygons
@seealso(TPolyhedron.SetPolygonList) @seealso(TPolyhedron.GetPolygonList) @seealso(TPolyhedron.NumPolygons) @seealso(TPolyhedron.Polygons)
#TPolyhedron.SetPolygonList
This will replace all polygons with the given list. It also change the number of polygons.
@seealso(TPolyhedron.GetPolygonList) @seealso(TPolyhedron.NumPolygons) @seealso(TPolyhedron.Polygons)
#TPolyhedron.BoundingSphereRadius
@seealso(TPolyhedron.Vertices)
#TPolyhedron.NumVertices
@seealso(TPolyhedron.Vertices) @seealso(TPolyhedron.SetNumVertices)
#TPolyhedron.Vertices
@seealso(TPolyhedron.NumVertices) @seealso(TPolyhedron.SetNumVertices) @seealso(TPolyhedron.SetVertexList)
#TPolyhedron.NumNormals
@seealso(TPolyhedron.Normals) @seealso(TPolyhedron.SetNumNormals)
#TPolyhedron.Normals
@seealso(TPolyhedron.NumVertices) @seealso(TPolyhedron.SetNumNormals) @seealso(TPolyhedron.SetNormalList)
#TPolyhedron.NumPolygons
@seealso(TPolyhedron.Polygons) @seealso(TPolyhedron.SetNumPolygons)
#TPolyhedron.Normals
@seealso(TPolyhedron.NumPolygons) @seealso(TPolyhedron.SetNumPolygons) @seealso(TPolyhedron.SetPolygonList)
#TTexturedPolyhedron
If the model doesn't use textures, @link(TPolyhedron) may be a tad faster and use less memory.
Remember that it needs texture coordinates for all vertices even if it doesn't use textures.
#TTexturedPolyhedron.GetTexCoordList
This is useful as access using the @link(TexCoords) property might be slightly slower, specially when accessing to a lot of coordinates.
@seealso(TTexturedPolyhedron.SetTexCoordList) @seealso(TTexturedPolyhedron.NumTexCoords) @seealso(TTexturedPolyhedron.TexCoords)
#TTexturedPolyhedron.SetNumTexCoords
@seealso(TTexturedPolyhedron.SetTexCoordList) @seealso(TTexturedPolyhedron.GetTexCoordList) @seealso(TTexturedPolyhedron.NumTexCoords) @seealso(TTexturedPolyhedron.TexCoords)
#TTexturedPolyhedron.SetTexCoordList
This will replace all texture coordinates with the given list.
@seealso(TTexturedPolyhedron.GetTexCoordList) @seealso(TTexturedPolyhedron.NumTexCoords) @seealso(TTexturedPolyhedron.TexCoords)
#TTexturedPolyhedron.NumTexCoords
@seealso(TTexturedPolyhedron.TexCoords) @seealso(TTexturedPolyhedron.SetNumTexCoords)
#TTexturedPolyhedron.TexCoords
@seealso(TTexturedPolyhedron.NumTexCoords) @seealso(TTexturedPolyhedron.SetNumTexCoords) @seealso(TTexturedPolyhedron.SetTexCoordList)
#TBillboard
This kind of objects are also called @bold(3D Sprites) as they resemble @italic(sprites) but in a 3D space.
The @code(Position) of the object refers to the central point of the bitmap.
#TBillboard.Destroy
If @link(OwnsTexture) is @true, it will destroy the texture.
#TBillboard.Render
On current version, z-sorting doesn't work for these models. This will be fixed in version 1.1.
@seealso(TBillboard.Texture)
#TBillboard.Width
Default value is @code(1).
@seealso(TBillboard.Height)
#TBillboard.Height
Default value is @code(1).
@seealso(TBillboard.Width)
#TBillboard.OwnsTexture
@code(OwnsTexture) determines whether the @link(Texture) used should be freed when a new one is assigned or when the object is destroyed. If the property is @true then it is freed. If the property is @false the texture isn't freed.
It defaults to @true.
@seealso(TBillboard.Texture) @seealso(TBillboard.Destroy)
#TBillboard.Texture
On animated billboards the texture should contain all frames in a strip.
@seealso(TBillboard.Destroy) @seealso(TBillboard.OwnsTexture) @seealso(TBillboard.NumFrames)
#TBillboard.NumFrames
If it's greater than 1, the @link(Render) method will get the @link(TObject3D.Frame) value to render a single frame.
Default value is @code(1).
@seealso(TBillboard.Texture)
#CreateBox
All facets will use material 0 and will map the whole texture.
Note you must assign the material to the returned model.
@param(aWidth Box size in the @code(X) axis.)
@param(aHeight Box size in the @code(Y) axis.)
@param(aDepth Box size in the @code(Z) axis.)
@return(A box model.)
@seealso(CreateCube)
#CreateCube
All facets will use material 0 and will map the whole texture.
Note you must assign the material to the returned model.
@param(aSize The cube size.)
@return(A cube model.)
@seealso(CreateBox)
#LoadWavefrontObj
If the .obj file includes references to .mtl files, it will load the material library and the textures.
@param(aFilename File to load.)
@return(The reference to the new model or @nil if it cannot load it.)
@seealso(LoadWavefrontMtl) @seealso(LoadModel)
#LoadWavefrontMtl
If the material references to a texture bitmap it will try to load it. If it cannot, it won't fail and add the filename of the bitmap (without extension) to the @link(TMaterial.TextureName) property.
@seealso(LoadWavefrontObj)
#RegisterModelLoader
You can register your custom loaders using this function so they're available to be used by @link(LoadModel).
You can replace or remove a loader by registering the same extension.
Some units, as @html(<a href="a3dge.Wavefront.html">a3dge.Wavefront</a>) and @html(<a href="a3dge.Pol3D.html">a3dge.Pol3D</a>), will register their own loaders just by including them in the @code(uses) clause and no furgher functionality is needed.
@param(aExtension The file extension with dot. You can register the same loader for different extensions.)
@param(aLoader The function that loads the model.)
@seealso(LoadModel)
#LoadModel
This function uses the file extension ot find a loader registered by @link(RegisterModelLoader) and load the model.
This function will catch any exception raised by the loader, log it and then will return a @nil pointer.
@param(aFilename File to load.)
@return(A reference to the model or @nil if it cannot load it.)
@seealso(RegisterModelLoader)
#TEntity3D
@code(TEntity3D) is a base class for elements that are inside a scene with position and rotation.
It introduces methods and properties that allows entities to move in a scene.
An instance of @code(TEntity3D) is never created directly, instead a descendant should be created.
#TEntity3D.SetTag
Override it if you need some kind of notification.
@seealso(TEntity3D.Tag)
#TEntity3D.Translate
This method doesn't check any collision.
@param(aVector A vector describing the distance to translate in each axis.)
@seealso(TEntity3D.TranslateDir)
#TEntity3D.TranslateDir
This method doesn't check any collision.
@param(aDirection A vector describing the direction to be translated. It's not rotation. Should be normalized.)
@param(aDistance The distance to move in the given direction.)
@seealso(TEntity3D.Translate)
#TEntity3D.Tag
This is an arbitrary value not used by the engine itself. You can use it for whatever you want. For esample, you can use to identify individuals, or breeds, or states.
#TOctreeNode
This class is for internal use and you shouldn't need to deal with it.
@seealso(TOctree)
#TOctreeNode.FirstObject
@seealso(TObject3D.NextObject)
#TOctree
You can read about octrees on the @html(<a href="https://en.wikipedia.org/wiki/Octree">Wikipedia</a>).
@seealso(TWorld3D.Octree)
#TOctree.Create
@seealso(Initialize)
@seealso(DefaultWorldSize) @seealso(DefaultOctreeDepth)
#TOctree.Initialize
This method will clear the octree and rebuild it.
The root node will be centered at <0, 0, 0>, so it will span @code(<-aSize, -aSize, -aSize>) to @code(<aSize, aSize, aSize>). It is not a physical limit and objects would be outside the boudings; in such case the object will be in the @italic(root node).
Note that octree will grow exponentially. For example, a level 4 octree will use 585 nodes while a level 5 one will use 5681. So don't create octrees too deep.
@param(aSize Root node size.)
@param(aDepth Otree depth.)
@seealso(TOctree.Clear)
#TLight.SetPosition
@seealso(TEntity3D.Position) @seealso(TLight.Position4D)
#TLight.Create
@param(aName a @code(GL_LIGHT*) constant.)
@seealso(TLight.Name)
#TLight.Apply
@seealso(TLight.Name) @seealso(TEntity3D.Enabled)
@seealso(TLight.Position4D) @seealso(TLight.Ambient) @seealso(TLight.Diffuse) @seealso(TLight.Specular)
#TLight.Name
Should be a @code(GL_LIGHT*) constant.
Note that it doesn't check if a light with same name exists. That means the last light applied is the one that's used.
#TLight.Position4D
This allows to define directional lights when @code(V_W) component is @code(0) but positional when it's @code(1).
Note that @link(TEntity3D.Position) will return @code(Position4D) without the @code(V_W) component. Also assign @code(Position) will change @code(Position4D) too. So you can use either one or the other if you don't change the @code(V_W) component.
#TCamera
It defines the fustrum by setting the viewport (@link(SetViewport)), and the @link(FarPlane) and the @link(NearPlane) properties, so the height is 2 units and width is proportial to the viewport height/width relation.
@seealso(TWorld3D.Camera) @seealso(TWorld3D.Render)
#TCamera.Destroy
It also destroys the @link(Light).
#TCamera.SetViewport
The viewport definition may affect the frustrum angle.
@param(x Horizontal position of the viewport on the screen in pixels.)
@param(y Vertical position of the viewport on the screen in pixels.)
@param(w Width position of the viewport in pixels.)
@param(h Height of the viewport in pixels.)
@seealso(ApplyViewport)
#TCamera.SetPerspectiveProjection
Note this affects the viewport only.
This method also call @code(glLoadIdentity) so it cleans the transformation matrix stack.
@seealso(TCamera.SetOrthographicProjection)
#TCamera.SetOrthographicProjection
Note this affects the viewport only.
For OpenGL, screen coordinates are -1 to 1 in both height and width. For Allegro, it is pixel coordinates.
This method also call @code(glLoadIdentity) so it cleans the transformation matrix stack.
@seealso(TCamera.SetPerspectiveProjection) @seealso(TDisplay.SetOrthographicProjection)
#TCamera.ApplyMatrix
@code(ApplyMatrix) builds the camera matrix using current @code(Position) and @code(Rotation) then adds it to the matrix stack.
Note it doesn't loads the Identity matrix so previous applied matrices will affect the scene transformations.
@seealso(TCamera.ApplyRotationMatrix) @seealso(ApplyInverseRotationMatrix)
#TCamera.ApplyRotationMatrix
This can be used to implement skyboxes and other special effects.
@seealso(MultiplyVectorMatrix) @seealso(ApplyInverseRotationMatrix)
#TCamera.ApplyInverseRotationMatrix
This can be used to implement billboards, 3D sprites and other special effects.
@seealso(MultiplyVectorMatrix) @seealso(ApplyRotationMatrix)
#TCamera.Light
You don't have to create this light because the camera creates one automatically.
The camera owns this light so if you assing a new one, the previous will be destroyed. If you need to change this light it's better to change the properties of the light than assign one.
If you don't want to use a camera light just assign @nil.
#TModel3D.Name
Names are converted to lower-case.
#TObject3D.SetPosition
@seealso(TEntity3D.Position)
#TObject3D.SetScale
@seealso(TObject3D.Scale)
#TObject3D.SetBoundingBox
This box is always paralel to the @code(x, y, z) coordinates and they don't change when object rotates.
The parameters are the limits of the bounding box relative to the object's @code(Position).
@seealso(TObject3D.UseBoundingBox) @seealso(TObject3D.GetBoundingBox) @seealso(TObject3D.CheckCollision)
#TObject3D.GetBoundingBox
The values returned are the actual limits in the world. They're @bold(not) relative to the object's position, but absolute to the scene.
This box is always paralel to the @code(x, y, z) coordinates and they don't change when object rotates.
@seealso(TObject3D.UseBoundingBox) @seealso(TObject3D.SetBoundingBox) @seealso(TObject3D.CheckCollision)
#TObject3D.CheckCollision
To check the collision, this method uses both @italic(bounding sphere) and @italic(bounding boxes) where available. It follows the next sequence:@orderedlist(
@item(It checks sphere collision using both object @code(Radius).)
@item(If spheres collide, then checks box collision if they're available.)
)
Note that if any of the @code(Radius) is negative, it will skip any checking and return @false.
@param(aObject The object to check the collision with.)
@return(@true if objects are in contact or overlap, @false otherwise.)
@seealso(TObject3D.Radius) @seealso(TObject3D.UseBoundingBox) @seealso(TObject3D.SetBoundingBox)
@seealso(TObject3D.RenderBoundingVolume)
#TObject3D.CollidedWith
This method is used to tell to the object that it has collided with another object.
@param(aObject The other object implied in the collision or @nil if collision is with scenary.)
#TObject3D.Render
@link(Model) @bold(must) be assigned for this method to work.
Note this method will render the object despite the @link(Visible) property value.
@seealso(TObject3D.Visible) @seealso(TObject3D.RenderBoundingVolume)
@seealso(TObject3D.Model) @seealso(TEntity3D.Position) @seealso(TEntity3D.Rotation) @seealso(TObject3D.Scale)
#TObject3D.RenderBoundingVolume
@seealso(Radius) @seealso(SetBoundingBox) @seealso(UseBoundingBox)
#TObject3D.Visible
The value is informative. That means method @link(TObject3D.Render) will ignore it but @link(TWorld3D.Render) will use it to know if it should render it.
Default is @true
@seealso(TObject3D.Render)
#TObject3D.Frame
This property is only informative. It can be used by the @link(Model) to render different versions of itself.
Default is 0.
#TObject3D.Model
The same model can be used in more than one object. The object doesn't owns the model.
@seealso(TObject3D.Render) @seealso(TModel3D.Render) @seealso(TObject3D.Frame)
#TObject3D.Scale
You can assign a different scale factor for each axis.
@seealso(TObject3D.Render)
#TObject3D.Radius
@seealso(TObject3D.CheckCollision)
#TObject3D.UseBoundingBox
@seealso(TObject3D.CheckCollision)
#TObject3D.NextObject
This property is for internal use so you shouldn't mess with it.
#TWorld3D
@code(TWorld3D) contains all objects, lights and the camera used to render a scene.
@seealso(TWorld3D.OwnsObjects)
#TWorld3D.Create
It creates an empty world with an octree of default size and depth.
@seealso(DefaultWorldSize) @seealso(DefaultOctreeDepth)
@seealso(TWorld3D.Octree)
#TWorld3D.Destroy
If @link(OwnsObjects) is @true it will destroy the @link(Objects).
#TWorld3D.SetFog
@param(aColor Fog color.)
@param(aDensity Fog density.)
@param(aStart Where fog starts.) @param(aFinish Where fog ends.)
@param(aHint OpenGL Hint. Can be @code(GL_NICEST), @code(GL_FASTEST) or @code(GL_DONT_CARE). Default is @code(GL_DONT_CARE).)
@seealso(TWorld3D.UseFog)
#TWorld3D.SetOpenGLContext
@seealso(TWorld3D.DisableOpenGLContext) @seealso(TWorld3D.UseFog)
#TWorld3D.DisableOpenGLContext
@seealso(TWorld3D.SetOpenGLContext) @seealso(TWorld3D.UseFog)
#TWorld3D.ClearObjects
It also frees all objects in the list if @link(OwnsObjects) is @true.
#TWorld3D.AddObject
You should not add the same object twice to the list. Note that when @link(OwnsObjects) is @true this will result in memory corruption when the object is freed (as it will be freed twice). The @code(Add) method does not check this, however
@param(aObject Reference to the object.)
@returns(The object index.)
@seealso(TWorld3D.DeleteObject) @seealso(TWorld3D.ExtractObject)
#TWorld3D.DeleteObject
@code(DeleteObject) removes the object from the list. When @link(OwnsObjects) is @true, the object is also freed.
@seealso(TWorld3D.ExtractObject) @seealso(TWorld3D.OwnsObjects) @seealso(TWorld3D.AddObject) @seealso(TWorld3D.ClearObjects)
#TWorld3D.ExtractObject
Note that the object is not freed, and that only the first found object is removed from the list.
@returns(the object if it is found, @nil if object is not present in the list.)
@seealso(AddObject) @seealso(DeleteObject) @seealso(ClearObjects)
#TWorld3D.Render
It also cleans the frame buffers.
@seealso(TWorld3D.Skybox) @seealso(TWorld3D.Camera)
@seealso(TWorld3D.Heightmap) @seealso(TWorld3D.RenderBounding)
#TWorld3D.Size
@code(Size) is the size of the @link(Octree)'s root node.
This is just informative and it doesn't have any effect in behavior of the game.
#TWorld3D.OwnsCamera
If you're using various cameras, this should be @false.
Default is @true.
#TWorld3D.Camera
@seealso(TWorld3D.OwnsCamera)
#TWorld3D.OwnsSkybox
Default is @true.
#TWorld3D.Skybox
If you don't use skybox just assign @nil.
@seealso(TWorld3D.OwnsSkybox)
#TWorld3D.Lights
By default, all lights are disabled.
#TWorld3D.Objects
The index @code(Ndx) is zero based, i.e., runs from 0 (zero) to @code(@link(NumObjects) - 1).
@seealso(AddObject) @seealso(TWorld3D.OwnsObjects)
#TWorld3D.Octree
You can use this method to change the octree properties such as size and Depth.