927 lines (824 with data), 47.3 kB
#a3dVersionString
@seealso(a3dCopyrightString)
#a3dCopyrightString
@seealso(a3dVersionString)
#etDbg
@seealso(Ta3dLog.Trace) @seealso(Ta3dLog.Level)
#etAll
@seealso(Ta3dLog.Trace) @seealso(Ta3dLog.Level)
#etNone
@seealso(Ta3dLog.Trace) @seealso(Ta3dLog.Level)
#etDefault
@seealso(Ta3dLog.Trace) @seealso(Ta3dLog.Level)
#Ta3dLog
This class introduces methods to create a log system.
An instance of @code(Ta3dLog) is never created directly, instead a descendent class such as @link(Ta3dLogFile) should be used. This is because @code(Ta3dLog) is an abstract class which does not implement all methods.
#Ta3dLog.WriteLog
Descendent classes must implement this abstract method.
@param(aText The text to log.)
@seealso(Ta3dLog.Trace)
#Ta3dLog.Trace
Note that using a log file is time consuming, even if it's disabled, so use it sparingly and never in code that is executed too often. For example, use it when initialising, loading data or releasing resources, but avoid it in game execution or rendering.
@param(aEventType Type of the event to log. If it isn't set in @link(Level) it will not be logged.)
@param(aMessage The message to log.)
@seealso(Ta3dLog.Level)
#Ta3dLog.Level
@seealso(Ta3dLog.Trace) @seealso(etDbg) @seealso(etAll)
#Ta3dConfiguration
It gets values from a configuration file, which uses the INI file format, and also from command line options.
It parses the following command line options:
@html(<table>
<tr><th>Command</th><th>INI file equivalence, variable or effect</th>
<tr><td><tt>--log=none</tt></td><td><tt>[system] log = none</tt></td></tr>
<tr><td><tt>--log=all</tt></td><td><tt>[system] log = all</tt></td></tr>
<tr><td><tt>--log=dbg</tt></td><td><tt>[system] log = dbg</tt></td></tr>
<tr><td><tt>--data-directory=<path></tt></td><td><a href="a3dge.Ta3dApplication.html#DataPath">Ta3dApplication.DataPath</a></td></tr>
<tr><td><tt>--help, -h</tt></td><td>Shows help on screen.</td></tr>
</table>)
To add more command line options, override @link(ParseCommandLineOption) and @link(PrintCommandLineOptions).
@seealso(Ta3dConfiguration.ParseCommandLineOption) @seealso(Ta3dConfiguration.GetConfigurationValues) @seealso(Ta3dConfiguration.PrintCommandLineOptions)
#Ta3dConfiguration.BoolToString
@seealso(Ta3dConfiguration.StringToBool)
#Ta3dConfiguration.StringToBool
@seealso(Ta3dConfiguration.BoolToString)
#Ta3dConfiguration.PrintCommandLineOptions
This method is called when user requests help through the command line option @code(--help).
@seealso(ParseCommandLineOption)
#Ta3dConfiguration.ParseCommandLineOption
This method is called by @link(LoadConfiguration) method.
@param(aCommand The command to parse.)
@return(@true if command was parsed, @false if not.)
@seealso(Ta3dConfiguration.LoadConfiguration)
@seealso(Ta3dConfiguration.PrintCommandLineOptions) @seealso(Ta3dConfiguration.GetConfigurationValues)
#Ta3dConfiguration.GetConfigurationValues
This method is called by @link(LoadConfiguration) method.
@seealso(Ta3dConfiguration.LoadConfiguration)
#Ta3dConfiguration.Destroy
Note that changes in the configuration file won't be saved. You must call @link(Save) to do it.
@seealso(Ta3dConfiguration.Save)
#Ta3dConfiguration.LoadConfiguration
It calls @link(ParseCommandLineOption), @link(GetConfigurationValues) and @link(PrintCommandLineOptions) when needed.
@seealso(Ta3dConfiguration.ParseCommandLineOption) @seealso(Ta3dConfiguration.GetConfigurationValues) @seealso(Ta3dConfiguration.PrintCommandLineOptions)
#Ta3dConfiguration.GetValue
@param(Section Section name. It can be an empty string for the global section.)
@param(Key Key name.)
@param(Default Default value.)
@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(Ta3dConfiguration.SetValue) @seealso(Ta3dConfiguration.GetBoolValue) @seealso(Ta3dConfiguration.GetIntValue)
#Ta3dConfiguration.GetIntValue
@seealso(Ta3dConfiguration.SetIntValue) @seealso(Ta3dConfiguration.GetValue)
#Ta3dConfiguration.GetBoolValue
@seealso(Ta3dConfiguration.SetBoolValue) @seealso(Ta3dConfiguration.GetValue)
#Ta3dConfiguration.SetValue
It is not saved to the file. You must call @link(Save) for this.
@param(Section Section name. It can be an empty string for the global section.)
@param(Key Key name.)
@param(Value The new value.)
@seealso(Ta3dConfiguration.Save) @seealso(Ta3dConfiguration.GetValue) @seealso(Ta3dConfiguration.SetBoolValue) @seealso(Ta3dConfiguration.SetIntValue)
#Ta3dConfiguration.SetIntValue
@seealso(Ta3dConfiguration.GetIntValue) @seealso(Ta3dConfiguration.SetValue)
#Ta3dConfiguration.SetBoolValue
@seealso(Ta3dConfiguration.GetBoolValue) @seealso(Ta3dConfiguration.SetValue)
#Ta3dConfiguration.Save
@seealso(Ta3dConfiguration.SetValue) @seealso(Ta3dConfiguration.FileName)
#Ta3dConfiguration.FileName
Note that modify this property will not load the new file: you must call @link(LoadConfiguration) again.
Default is @code(GetAppConfigFile @(False, False@)).
@seealso(Ta3dConfiguration.LoadConfiguration) @seealso(Ta3dConfiguration.Save)
#Ta3dEventManager
Mostly for internal use, I think you don't need to deal with this stuff directly, but you'll use indirectly quite often (i.e. user input).
It is a wrap around Allegro's event system. You should read Allegro's documentation to know more. The idea is to provide a more @italic(object oriented) approximation to the event handling connecting events with objects.
#Ta3dEventManager.AddEventSource
If source was yet added this wile replace it with the new handler.
@seealso(Ta3dEventManager.RemoveEventSource) @seealso(Ta3dEventManager.IsInList)
#Ta3dEventManager.RemoveEventSource
@seealso(Ta3dEventManager.AddEventSource)
#Ta3dEventManager.IsInList
@seealso(Ta3dEventManager.AddEventSource) @seealso(Ta3dEventManager.RemoveEventSource)
#Ta3dEventManager.Clear
@seealso(Ta3dEventManager.DispatchEvents) @seealso(Ta3dEventManager.IsQueueEmpty)
#Ta3dEventManager.IsQueueEmpty
@seealso(Ta3dEventManager.DispatchEvents)
#Ta3dEventManager.DispatchEvents
It dispatchs all events in the queue. If event queue is empty it waits for the next event.
@seealso(Ta3dEventManager.IsQueueEmpty)
@seealso(Ta3dEventManager.Clear) @seealso(Ta3dEventManager.Pause) @seealso(Ta3dEventManager.Resume)
#Ta3dEventManager.Pause
That mean that @code(al_wait_for_event), @code(al_get_next_event) and such will not receibe any valid events, so use this only if you really need it, and you know what are you doing.
@seealso(Ta3dEventManager.Paused) @seealso(Ta3dEventManager.Resume)
#Ta3dEventManager.Resume
@seealso(Ta3dEventManager.Paused) @seealso(Ta3dEventManager.Pause)
#Ta3dEventManager.Paused
@seealso(Ta3dEventManager.Pause) @seealso(Ta3dEventManager.Pause)
#Ta3dDisplay
This is the one used by default by the @link(a3dApplication) object if noone is assigned before calling @link(Ta3dApplication.Initialize).
@seealso(Ta3dApplication.Display)
#Ta3dDisplay.GetDisplayFlags
Note that @link(Open) will use only flags that are compatible with the display configuration.
@seealso(Ta3dDisplay.Open) @seealso(Ta3dDisplay.GetWindowSize)
#Ta3dDisplay.GetWindowSize
Right now it returns a window that fits in the current desktop with 16:9 proportion.
@seealso(Ta3dDisplay.Open) @seealso(Ta3dDisplay.GetDisplayFlags)
#Ta3dDisplay.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(Ta3dDisplay.OnClose)
#Ta3dDisplay.AllegroDisplay
@bold(For internal use only. Do not destroy.)
#Ta3dDisplay.Open
It will close the previous display if exists.
@seealso(Ta3dDisplay.Title) @seealso(Ta3dDisplay.FlipDisplay)
@seealso(Ta3dDisplay.GetDisplayFlags) @seealso(Ta3dDisplay.GetWindowSize)
@seealso(Ta3dDisplay.SetOrthoProjection)
@seealso(Ta3dDisplay.OnOpen)
#Ta3dDisplay.SetOrthoProjection
It disables z-buffer, fog and lighting.
Screen coordinates are -1 to 1 in both height and width.
@seealso(Ta3dDisplay.Open)
#Ta3dDisplay.SetAsTarget
@seealso(Ta3dDisplay.FlipDisplay) @seealso(Ta3dDisplay.Open)
#Ta3dDisplay.FlipDisplay
@seealso(Ta3dDisplay.Open) @seealso(Ta3dDisplay.SetAsTarget)
#Ta3dDisplay.Title
You can set it before or after opening the display.
#Ta3dKeyboard
You don't need to create it, use it through @link(Ta3dApplication.Keyboard).
#Ta3dKeyboard.Clear
@seealso(Ta3dKeyboard.Readkey) @seealso(Ta3dKeyboard.KeyState)
#Ta3dKeyboard.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
val: LongInt;
...
val := a3dApplication.Keyboard.Readkey;
if (val and $FF) = ord ('d') then
WriteLn ('You pressed "d"');
if (val shr 8) = ALLEGRO_KEY_SPACE then
WriteLn ('You pressed Space');
if (val and $FF) = 3 then
WriteLn ('You pressed Control+C');
if val = (ALLEGRO_KEY_X shl 8) then
WriteLn ('You pressed Alt+X');
#)
This function cannot return character values greater than 255.
@seealso(Ta3dKeyboard.UReadkey) @seealso(Ta3dKeyboard.KeyModifiers) @seealso(Ta3dKeyboard.Clear) @seealso(Ta3dKeyboard.KeyState)
#Ta3dKeyboard.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
val, scancode: LongInt;
...
val := a3dApplication.keyboard.UReadkey (scancode);
if val = $00F1 then
WriteLn ('You pressed n with tilde');
if val = $00DF then
WriteLn ('You pressed sharp s');
#)
You should be able to find Unicode character maps at http://www.unicode.org/.
@seealso(Ta3dKeyboard.Readkey) @seealso(Ta3dKeyboard.KeyModifiers) @seealso(Ta3dKeyboard.Clear)
#Ta3dKeyboard.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
val, mod: LongInt;
...
mod := Game.Keyboard.KeyModifiers;
val := Game.Keyboard.Readkey;
if (val shr 8) = ALLEGRO_KEY_LEFT then
begin
if (mod and ALLEGRO_KEY_MOD_SHIFT) <> 0 then
X := X - 10
else
X := X - 1
end;
if (val shr 8) = ALLEGRO_KEY_RIGHT then
begin
if (mod 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(Ta3dKeyboard.Readkey) @seealso(Ta3dKeyboard.UReadkey) @seealso(Ta3dKeyboard.KeyModifiers)
#Ta3dKeyboard.KeyState
@seealso(Ta3dKeyboard.Clear) @seealso(Ta3dKeyboard.Keypressed)
#Ta3dGameState
@code(Ta3dGameState) implements an abstract class to define a game state. It introduces methods to define the behaviour of this state.
An instance of @code(Ta3dGameState) is never created directly, instead a descendant should be created. This is because @code(Ta3dGameState) is an abstract class which does not implement all methods.
@seealso(Ta3dState.Update) @seealso(Ta3dGameState.Render) @seealso(Ta3dGameState.Enter) @seealso(Ta3dState.Leave)
@seealso(Ta3dApplication.GameStates)
#Ta3dGameState.Enter
You can use this method to load data and prepare the game arena.
Remember that loading and preparing data is a time consuming task, and while executing state's @code(Enter) and @code(Leave) the engine won't be dispatching the events. To prevent weird behaviours you should clear the event queue before exiting these methods (see @link(Ta3dEventManager.Clear)).
#Ta3dGameState.Render
#Ta3dGameStatesManager
@seealso(Ta3dApplication.GameStates) @seealso(Ta3dGameState)
@seealso(Ta3dApplication.Run)
#Ta3dGameStatesManager.Render
You don't need to call this as @link(Ta3dApplication.Run) will do it.
@seealso(Ta3dGameState.Render)
#Ta3dApplication
It works much like LCL and VCL @code(TCustomApplication) class, so Lazarus and Delphi users should be used to this kind of stuff. Anyway, @code(Ta3dApplication) doesn't have same functionality than their counterparts, as it will be used in a more specific context (videogames).
Only one application object should exist. If you create more than one an exception will raise.
@seealso(a3dApplication)
#Ta3dApplication.Initialize
You must call this before the game execution.
It will:
@orderedlist(
@item(Check if @link(Log), @link(Configuration) and @link(Display) exist. If not, it creates default objects for each of them.)
@item(Loads configuration file and parses command line options.)
@item(Initializes Allegro and base subsystems.)
@item(Opens the display.)
@item(Initializes components if any.)
@item(Initializes game states.)
)
@seealso(Ta3dApplication.Log) @seealso(Ta3dApplication.Configuration) @seealso(Ta3dApplication.Display) @seealso(Ta3dApplication.Components)
@seealso(Ta3dApplication.GameStates)
#Ta3dApplication.FindFile
It will search following next order:@orderedlist(
@item(Working directory.)
@item(User application data directory.)
@item(Executable directory.)
@item(Game data directory.)
)
This method may be used also to find a list of files and directories, but this behaviour would be different on different platforms.
See @html(<a href="introduction.html#data_loading">Data loading</a>) for a more detailed explanation about the use of this method.
This method is quite verbose so run it with the @code(--log=all) command line option and check the log file to know the actual search directories it checks.
@param(aFileName The name of the file to look for.)
@return(The full path of file or @code(aFileName) if it can't find the file.)
@seealso(Ta3dApplication.GameDirName) @seealso(Ta3dApplication.DataPath)
@seealso(Ta3dApplication.GameDataDirectory) @seealso(Ta3dApplication.UserDataDirectory)
#Ta3dApplication.Run
@code(Run) is the start of the game. When called, it starts a loop and repeatedly calls the @code(Update) and the @code(Render) methods of the @code(Current) game state until @link(Terminated) is set to @true. @code(Update) method will be called @link(TicksPerSecond) times per second.
If an exception is raised during the execution, it is caught and shown by @link(ShowErrorMessage) and execution is aborted.
@seealso(Ta3dApplication.GameStates) @seealso(Ta3dApplication.Terminate) @seealso(Ta3dApplication.Terminated) @seealso(Ta3dApplication.ShowErrorMessage)
@seealso(Ta3dApplication.TicksPerSecond) @seealso(Ta3dApplication.PauseUpdates) @seealso(Ta3dApplication.ResumeUpdates)
#Ta3dApplication.PauseUpdates
Note that calling this methos will stop calls to game state's @code(Update) method so use with caution and be sure you call @link(ResumeUpdates) to resume normal execution.
@seealso(Ta3dApplication.Run) @seealso(Ta3dApplication.ResumeUpdates)
#Ta3dApplication.ResumeUpdates
@seealso(Ta3dApplication.Run) @seealso(Ta3dApplication.PauseUpdates) @seealso(Ta3dApplication.TicksPerSecond)
#Ta3dApplication.Terminate
It sets the @link(Terminated) property to @True.
@seealso(Ta3dApplication.Run) @seealso(Ta3dApplication.Terminated)
#Ta3dApplication.Log
If not assigned, @link(Ta3dApplication.Initialize) will create a @link(Ta3dLogFile) one.
@seealso(Ta3dApplication.Initialize)
#Ta3dApplication.Configuration
If not assigned, @link(Ta3dApplication.Initialize) will create a @link(Ta3dConfiguration) one.
@seealso(Ta3dApplication.Initialize)
#Ta3dApplication.Display
If not assigned, @link(Ta3dApplication.Initialize) will create a @link(Ta3dDisplay) one.
@seealso(Ta3dApplication.Initialize)
#Ta3dApplication.TicksPerSecond
@seealso(Ta3dApplication.Run)
#Ta3dApplication.GameDirName
Default value is @code(ApplicationName).
Modifying this will affect to @link(FindFile) and so to all loading functions.
@seealso(Ta3dApplication.DataPath) @seealso(Ta3dApplication.FindFile)
@seealso(Ta3dApplication.GameDataDirectory) @seealso(Ta3dApplication.UserDataDirectory)
#Ta3dApplication.DataPath
This property allows some control to the searching method @link(FindFile):@unorderedlist(
@item(If empty it doesn't alter the default searching.)
@item(If it is an absolute path, search will start in this path.)
@item(If it is a relative path, it will be added to the search paths.)
)
See @html(<a href="introduction.html#data_loading">Data loading</a>) for more detailed information about how this works.
Default is empty string or a value given by the @code(--data-directory) command line.
@seealso(Ta3dApplication.GameDirName) @seealso(Ta3dApplication.FindFile) @seealso(Ta3dConfiguration)
#Ta3dApplication.GameDataDirectory
Value is different on different operating systems. See @html(<a href="introduction.html#data_loading">Data loading</a>) for details.
@seealso(Ta3dApplication.FindFile) @seealso(Ta3dApplication.GameDirName)
#Ta3dApplication.UserDataDirectory
Value is different on different operating systems. See @html(<a href="introduction.html#data_loading">Data loading</a>) for details.
@seealso(Ta3dApplication.FindFile) @seealso(Ta3dApplication.GameDirName) *)
#Ta3dApplication.Components
@seealso(Ta3dApplication.Initialize)
#Ta3dApplication.GameStates
@seealso(Ta3dApplication.Initialize)
#Ta3dApplication.Terminated
@seealso(Ta3dApplication.Terminate) @seealso(Ta3dApplication.Run)
#a3dApplication
Read @link(Ta3dApplication) for more information.
#a3dException
It logs all exceptions as @code(edError) using @code(a3dApplication.Log).
@seealso(Ta3dApplication.Log)
#Ta3dObserver
@seealso(Ta3dSubject)
#Ta3dComponentName
@seealso(Ta3dComponent.Name) @seealso(Ta3dComponentList.Find)
#Ta3dSubject
This class just introduces the methods that allows @italic(observers) interact with it. Subjects should create a @link(Ta3dSubjectImplementation) instead. For example:
@longcode(!
type
(* A class with subject. *)
TMyClass = class (TObject)
private
fSubject: Ta3dSubject;
{ Other stuff... }
public
(* Constructor. *)
constructor Create;
(* Access to subject. *)
property Subject: Ta3dSubject read fSubject;
{ Other stuff... }
end;
constructor TMyClass.Create;
begin
inherited Create;
fSubject := Ta3dSubjectImplementation.Create (Self);
{ Other stuff... }
end;
!)
This way subject is exposed hiding the internals to the exterior.
@seealso(Ta3dObserver)
#Ta3dSubject.Create
@param(aOwner Object that owns the subject. It will be passed to the observer through the @code(aSender) parameter.)
#Ta3dSubject.Add
@param(aObserver The method that will handle the notification. If it's @nil it will ignore and log it as a @italic(Warning).)
@seealso(Ta3dSubject.Remove)
#Ta3dSubject.Remove
If the observer was added more than once, this will remove all them.
@param(aObserver The notification handler to remove.)
@seealso(Ta3dSubject.Add)
#Ta3dSubjectImplementation
@seealso(Ta3dSubject)
#Ta3dComponent
@seealso(Ta3dComponentList)
#Ta3dComponent.Initialize
@seealso(Ta3dComponentList.InitializeAll)
#Ta3dComponent.Owner
The owner cannot be set except by explicitly inserting the component in a component list using that list @link(Ta3dComponentList.Add) method, or by removing the component from it's owner's owned component list using the @link(Ta3dComponentList.Remove) method.
#Ta3dComponentList
@seealso(Ta3dComponent)
#Ta3dComponentList.RemoveFromList
It doesn't destroy the component.
@seealso(Ta3dComponentList.Extract) @seealso(Ta3dComponentList.Remove)
#Ta3dComponentList.Create
It instantiates a new componentt list.
@param(aOwner List owner. It will be assigned as owner of the components.)
@param(aOwnsComponents Determines whether components that are removed from the list should also be freed from memory. By default this is @true. This behaviour can be changed after the list was instantiated.)
@seealso(Ta3dComponentList.Owner) @seealso(Ta3dComponentList.OwnsComponents)
@seealso(Ta3dComponentList.Items) @seealso(Ta3dComponentList.Add)
#Ta3dComponentList.Destroy
If @link(OwnsComponents) is @true then it will also free all components.
@seealso(Ta3dComponentList.Clear) @seealso(Ta3dComponentList.OwnsComponents)
#Ta3dComponentList.Clear
If @link(OwnsComponents) is @true then it will also free all components.
@seealso(Ta3dComponentList.OwnsComponents)
#Ta3dComponentList.Add
Note that when @link(OwnsComponents) is @true, a component should not be added twice to the list: this will result in memory corruption when the component is freed (as it will be freed twice). The @code(Add) method does not check this, however.
The index of the added element can be obtained though the @link(LastItemAdded) property.
@param(aComponent Reference to the component to add.)
@param(aName Component name. If not set then name should be assigned to the component's @code(Name).)
@seealso(Ta3dComponentList.Items) @seealso(Ta3dComponentList.Count) @seealso(Ta3dComponentList.LastItemAdded) @seealso(Ta3dComponentList.IndexOf) @seealso(Ta3dComponentList.Find)
@seealso(Ta3dComponentList.OwnsComponents)
@seealso(Ta3dComponentList.Clear) @seealso(Ta3dComponentList.Remove)
#Ta3dComponentList.IndexOf
@param(aName Name of the component to find. It is case insensitive.)
@return(The index of the component, if found. If no component with the name was found, @code(-1) is returned.)
@seealso(Ta3dComponentList.Find) @seealso(Ta3dComponentList.LastItemAdded) @seealso(Ta3dComponentList.Items)
#Ta3dComponentList.Find
@param(aName Name of the component to find. It is case insensitive.)
@return(The reference of the component, if found. If no component with the name was found, @nil is returned.)
@seealso(Ta3dComponentList.IndexOf) @seealso(Ta3dComponentList.Items)
#Ta3dComponentList.InitializeAll
@seealso(Ta3dComponent.Initialize)
#Ta3dComponentList.Extract
It removes the component from the list, if it is present in the list. Note that the object is not freed, and that only the first found object is removed from the list.
@param(aName The component name. It is case insensitive.)
@param(aComponent The component to extract.)
@return(@true if the component was found, @false if component was not present in the list.)
@seealso(Ta3dComponentList.Remove) @seealso(Ta3dComponentList.Pack)
#Ta3dComponentList.Remove
It removes the component from the list, if it is present in the list. It frees it if @link(OwnsComponents) is @true. Note that only the first found object is removed from the list.
@param(aName The component name. It is case insensitive.)
@param(aComponent The component to extract.)
@return(@true if the component was found, @false if component was not present in the list.)
@seealso(Ta3dComponentList.Extract) @seealso(Ta3dComponentList.OwnsComponents)
@seealso(Ta3dComponentList.Clear) @seealso(Ta3dComponentList.Pack)
#Ta3dComponentList.Pack
Calling this method will not change component references but may change component indexes.
@seealso(Ta3dComponentList.Extract) @seealso(Ta3dComponentList.Remove) @seealso(Ta3dComponentList.Clear)
@seealso(Ta3dComponentList.LastItemAdded)
#Ta3dComponentList.OwnsComponents
It determines whether the components 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(Ta3dComponentList.Remove) @seealso(Ta3dComponentList.Clear) @seealso(Ta3dComponentList.Destroy)
#Ta3dComponentList.Count
Count is the current number of (possibly @nil) components in the list
Since the list is zero-based, the index of the largest pointer is @code(Count - 1).
@seealso(Ta3dComponentList.Items) @seealso(Ta3dComponentList.Add) @seealso(Ta3dComponentList.Clear)
#Ta3dComponentList.LastItemAdded
@seealso(Ta3dComponentList.Add) @seealso(Ta3dComponentList.Pack)
#Ta3dComponentList.Items
The index @code(Index) is zero based, i.e., runs from @code(0) (zero) to @code(@link(Count) - 1). Note that some of the items may be @nil.
It is the default property.
@seealso(Ta3dComponentList.Count) @seealso(Ta3dComponentList.Clear)
@seealso(Ta3dComponentList.Add) @seealso(Ta3dComponentList.IndexOf) @seealso(Ta3dComponentList.LastItemAdded)
@seealso(Ta3dComponentList.Find)
#Ta3dState
@code(Ta3dState) implements an abstract class to define a state. It introduces methods to define the behaviour of this state.
States are managed by @link(Ta3dFiniteStateMachine). 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(Ta3dState) is never created directly, instead a descendant should be created. This is because @code(Ta3dState) is an abstract class which does not implement all methods.
@seealso(Ta3dFiniteStateMachine)
#Ta3dState.Enter
@param(aEntity Object entity asociated with the state.)
@seealso(Ta3dState.Leave)
#Ta3dState.Update
@param(aEntity Object entity asociated with the state.)
@seealso(Ta3dState.Enter) @seealso(Ta3dState.Leave)
#Ta3dState.Leave
@param(aEntity Object entity asociated with the state.)
@seealso(Ta3dState.Enter)
#Ta3dFiniteStateMachine
To use this object create a @link(Ta3dFiniteStateMachine) object assigning the apropriate owner. Then assign the @link(Current) and call the @link(Update) method to execute the state.
@seealso(Ta3dState) @seealso(Ta3dFiniteStateMachine.Current) @seealso(Ta3dFiniteStateMachine.Update)
#Ta3dFiniteStateMachine.Destroy
It calls the @code(Leave) method of the @link(Current) and @link(Global) states.
@seealso(Ta3dState.Leave)
#Ta3dFiniteStateMachine.Add
Each state should have a different name. This method will raise an exception if a state with same name exists.
The index of the added state can be obtained though the @link(Ta3dComponentList.LastItemAdded) property.
The first state added will became the @italic(@link(Current) state).
@param(aState The state)
@param(aName Name of state. If not set, it will use the one assigned to its @code(Name) property.)
@seealso(Ta3dFiniteStateMachine.Current) @seealso(Ta3dFiniteStateMachine.States)
@seealso(Ta3dFiniteStateMachine.Update)
#Ta3dFiniteStateMachine.Update
@seealso(Ta3dFiniteStateMachine.SwapPreviousState)
@seealso(Ta3dFiniteStateMachine.Current) @seealso(Ta3dFiniteStateMachine.Global)
@seealso(Ta3dFiniteStateMachine.Add)
#Ta3dFiniteStateMachine.SwapPreviousState
@seealso(Ta3dFiniteStateMachine.Current) @seealso(Ta3dFiniteStateMachine.Global)
#Ta3dFiniteStateMachine.Current
The assigned state doesn't need to be in the state list (i.e. don't need to @link(Add) it).
Note that assign this property doesn't ensure the immediate use of the state. It may need some time until the new state is used.
@seealso(Ta3dFiniteStateMachine.Add) @seealso(Ta3dFiniteStateMachine.Update)
@seealso(Ta3dFiniteStateMachine.Global) @seealso(Ta3dFiniteStateMachine.SwapPreviousState)
@seealso(Ta3dFiniteStateMachine.States)
#Ta3dFiniteStateMachine.Global
The assigned state doesn't need to be in the state list (i.e. don't need to @link(Add) it).
This state won't affect @link(SwapPreviousState).
@seealso(Ta3dFiniteStateMachine.Current) @seealso(Ta3dFiniteStateMachine.SwapPreviousState)
@seealso(Ta3dFiniteStateMachine.States)
#Ta3dFiniteStateMachine.States
@seealso(Ta3dFiniteStateMachine.Add) @seealso(Ta3dFiniteStateMachine.Current)
#a3dLoadBitmap
It uses @link(Ta3dApplication.FindFile) to localize the disk file.
@param(aFileName The file name. May include path.)
@return(Pointer to the image or @nil if it cannot load the file.)
@seealso(a3dDestroyBitmap)
#a3dDestroyBitmap
@param(aBitmap Pointer to the image to destroy. It will be set to @nil)
@seealso(a3dLoadBitmap)
#a3dLoadBitmapFont
It uses @link(Ta3dApplication.FindFile) to localize the disk file.
@param(aFileName The file name. May include path.)
@return(Pointer to the font or @nil if it cannot load the file or create the font.)
@seealso(a3dDestroyFont)
#a3dDestroyFont
@param(aFont Pointer to the font to destroy. It will be set to @nil)
@seealso(a3dLoadBitmapFont)
#a3dHex2Rad
Usage:
@longcode(?
Radians := Grades * a3dHex2Rad;
?)
@seealso(a3dRad2Hex)
#a3dRad2Hex
Usage:
@longcode(?
Grades := Radians * a3dHex2Rad;
?)
@seealso(a3dHex2Rad)
#Ta3dVector3D
@seealso(a3dVector3D)
@seealso(Ta3dMatrix3D) @seealso(a3dApplyMatrix)
#Ta3dVector3D.GetLength
If you only need to compare lengths of vectors, you can use @link(GetLength2) as it is faster.
@seealso(Ta3dVector3D.GetLength2) @seealso(Ta3dVector3D.Normalize)
#Ta3dVector3D.GetLength2
To calculate vector length a @italic(square root) is used, wich is complicated and slow. Calculating the squared length is quite faster. Since squares are proportional to the base, compare squared lengths have the same result than compare lengths but faster.
@seealso(Ta3dVector3D.GetLength)
#Ta3dVector3D.Scale
@seealso(Ta3dVector3D.Normalize)
@seealso(Ta3dVector3D.Add) @seealso(Ta3dVector3D.Sub)
#Ta3dVector3D.Normalize
If vector is too small then vector will became a zero vector (i.e. a vector with all components equal zero).
@seealso(a3dNormalizedVector3D)
@seealso(Ta3dVector3D.GetLength) @seealso(Ta3dVector3D.Scale) @seealso(a3dDotProduct)
#Ta3dVector3D.Opposite
This returns a vector with same direction and magnitude but opposite direction.
#Ta3dVector3D.Add
@seealso(Ta3dVector3D.Sub) @seealso(Scale)
#Ta3dVector3D.Sub
@seealso(Ta3dVector3D.Add) @seealso(Scale)
#Ta3dVector3D.AsString
Useful for logging and debugging.
#a3dVector3D
@seealso(Ta3dVector3D)
#a3dNormalizedVector3D
If vector is too small then a zero vector will be returned (i.e. a vector with all components equal zero).
@param(aVector A vector.)
@return(A vector in the same direction than @code(aVector) but length @code(1) @(one@).)
@seealso(Ta3dVector3D.Normalize) @seealso(a3dDotProduct)
#a3dCrossProduct
@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(a3dDotProduct) @seealso(a3dNormalizedVector3D) @seealso(a3dGetPlaneNormal)
#a3dDotProduct
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(a3dCrossProduct) @seealso(a3dGetPlaneNormal) @seealso(a3dNormalizedVector3D) @seealso(Ta3dVector3D.Normalize)
#a3dVectorLerp
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).)
#a3dGetPlaneNormal
The vectors passed as parameters are points in the plane. Such points should be passed in clockwise order.
@param(aP1 A vector representing a point in a plane.)
@param(aP2 A vector representing a point in a plane.)
@param(aP3 A vector representing a point in a plane.)
@return(A vector that is perpendicular to the plane defined by the parameters.)
#a3dGetDistance
@seealso(a3dGetDistance2) @seealso(a3dDistance2Segment)
#a3dGetDistance2
This function is faster than @link(a3dGetDistance), so compare square of distance is faster than compare distance.
This function can be used to check sphere collisions:
@longcode(!
type
TSphere = record
Center: Ta3dVector3D;
Radius: Single
end;
function CheckSphereCollision (aSphere1, aSphere2: TSphere): Boolean;
begin
Result := a3dGetDistance2 (aSphere1.Center, aSphere2.Center) <= Sqr (aSphere1.Radius + aSphere2.Radius)
end;
!)
@seealso(a3dGetDistance)
#a3dDistance2Segment
@seealso(a3dDistance2Segment2) @seealso(a3dGetDistance)
#a3dDistance2Segment2
This function is faster than @link(a3dDistance2Segment), 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(a3dDistance2Segment) @seealso(a3dGetDistance2)
#Ta3dMatrix3D
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.
@seealso(a3dIdentityMatrix) @seealso(a3dGetTransformationMatrix)
@seealso(Ta3dVector3D) @seealso(a3dApplyMatrix)
#Ta3dMatrix3D.M
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 no function 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(Ta3dMatrix3D.Elements)
#Ta3dMatrix3D.Elements
@code(m) is row and and @code(n) is column, and both go from @code(1) to @code(4).
Note that A3DGE assumes row 4 is @code([0 0 0 1]) so all operations will ignore those values.
@seealso(Ta3dMatrix3D.M)
#a3dIdentityMatrix
@seealso(a3dGetTransformationMatrix)
#a3dGetTranslationMatrix
@seealso(a3dGetScalingMatrix) @seealso(a3dGetRotationMatrix)
@seealso(a3dGetTransformationMatrix)
@seealso(a3dApplyMatrix)
#a3dGetScalingMatrix
@seealso(a3dGetTranslationMatrix) @seealso(a3dGetRotationMatrix)
@seealso(a3dGetTransformationMatrix)
@seealso(a3dApplyMatrix)
#a3dGetXRotateMatrix
@seealso(a3dGetYRotateMatrix) @seealso(a3dGetZRotateMatrix)
@seealso(a3dGetRotationMatrix) @seealso(a3dGetTransformationMatrix)
@seealso(a3dApplyMatrix)
#a3dGetYRotateMatrix
@seealso(a3dGetXRotateMatrix) @seealso(a3dGetZRotateMatrix)
@seealso(a3dGetRotationMatrix) @seealso(a3dGetTransformationMatrix)
@seealso(a3dApplyMatrix)
#a3dGetZRotateMatrix
@seealso(a3dGetXRotateMatrix) @seealso(a3dGetYRotateMatrix)
@seealso(a3dGetRotationMatrix) @seealso(a3dGetTransformationMatrix)
@seealso(a3dApplyMatrix)
#a3dGetRotationMatrix
@seealso(a3dGetXRotateMatrix) @seealso(a3dGetYRotateMatrix) @seealso(a3dGetZRotateMatrix)
@seealso(a3dGetScalingMatrix) @seealso(a3dGetTranslationMatrix)
@seealso(a3dGetTransformationMatrix)
@seealso(a3dRotateVector) @seealso(a3dApplyMatrix)
#a3dGetTransformationMatrix
@seealso(a3dIdentityMatrix)
@seealso(a3dGetTranslationMatrix) @seealso(a3dGetScalingMatrix) @seealso(a3dGetRotationMatrix)
@seealso(a3dApplyMatrix)
#a3dApplyMatrix
@param(aM Matrix. Assumes row @code(4) of @code([0 0 0 1]).)
@param(aV Vector. Assumes @code(w) of @code(1).)
@return(The transformed vector.)
@seealso(a3dSetMatrix) @seealso(a3dGetTransformationMatrix) @seealso(a3dRotateVector)
#a3dRotateVector
This is the same than @link(a3dApplyMatrix) but assumes that matrix column @code(4) is @code([0 0 0 1]) so only rotation is computed.
@param(aM Matrix. Assumes row @code(4) of @code([0 0 0 1]).)
@param(aV Vector. Assumes @code(w) of @code(1).)
@return(The totated vector.)
@seealso(a3dApplyMatrix) @seealso(a3dGetRotationMatrix)
#a3dSetMatrix
@seealso(a3dApplyMatrix)
#Ta3dGnomon
A gnomon contains three perpendicular vectors that represents @link(Front) (or @italic(forward)), @link(Up) and @link(Right) directions. It can be used to get object orientation.
To get the @code(Back), @code(Down) and @code(Left) directions use the @link(Ta3dVector3D.Opposite) method of the given vectors.
@seealso(a3dIdentityGnomon)
#Ta3dGnomon.Build
@seealso(Ta3dGnomon.Rotate)
#Ta3dGnomon.Rotate
@seealso(Ta3dGnomon.Build)
#a3dDefaultNearPlane
@seealso(a3dDefaultFarPlane)
#a3dDefaultFarPlane
@seealso(a3dDefaultNearPlane)
#a3dMaxLODLevel
@seealso(Ta3dWorld3D.LOD)
#Ta3dEntity3D
An entity is anything that is in the 3D space, visible or invisible. That includes cameras, lights, sensors and objects.
This class introduces methods and properties common for all entities.
An instance of @code(Ta3dEntity3D) is never created directly, instead a descendent class should be used.
#Ta3dEntity3D.ApplyTransformationMatrix
@seealso(Ta3dEntity3D.ApplyTransformationMatrix)
@seealso(Ta3dEntity3D.ApplyRotationMatrix)
@seealso(Ta3dEntity3D.Position) @seealso(Ta3dEntity3D.Rotation)
@seealso(Ta3dEntity3D.LocalPosition) @seealso(Ta3dEntity3D.LocalRotation)
#Ta3dEntity3D.ApplyTranslationMatrix
@seealso(Ta3dEntity3D.ApplyTransformationMatrix)
@seealso(Ta3dEntity3D.ApplyRotationMatrix)
@seealso(Ta3dEntity3D.Position)
@seealso(Ta3dEntity3D.LocalPosition)
#Ta3dEntity3D.ApplyRotationMatrix
@seealso(Ta3dEntity3D.ApplyTransformationMatrix)
@seealso(Ta3dEntity3D.ApplyTranslationMatrix)
@seealso(Ta3dEntity3D.Position) @seealso(Ta3dEntity3D.Rotation)
@seealso(Ta3dEntity3D.LocalPosition) @seealso(Ta3dEntity3D.LocalRotation)
#Ta3dEntity3D.SpatialNode
This is a pointer to the tree node or sector or room that contains the entity.
It is mostly for interal use so don't mess with it unless you really know what are you doing.
#Ta3dEntity3D.Parent
Changing the @code(Parent) will modify the parent-relative position and rotation but keep the world space position and rotation the same.
@seealso(Ta3dEntity3D.Position) @seealso(Ta3dEntity3D.Rotation)
@seealso(Ta3dEntity3D.LocalPosition) @seealso(Ta3dEntity3D.LocalRotation)
#Ta3dEntity3D.Position
For example, next code will move an object:
@longcode(!
procedure MoveObject (aObject: Ta3dObject3D; aDir: Ta3dVector3D; aSpeed: GLfloat);
begin
aObject.Position := aObject.Position + (aDir * aSpeed)
end;
!)
@seealso(Ta3dEntity3D.Rotation)
@seealso(Ta3dEntity3D.LocalPosition) @seealso(Ta3dEntity3D.LocalRotation)
@seealso(Ta3dEntity3D.ApplyTransformationMatrix) @seealso(Ta3dEntity3D.ApplyTranslationMatrix)
#Ta3dEntity3D.Rotation
For example, next code will rotate an object:
@longcode(!
procedure RotateObject (aObject: Ta3dObject3D; aSpeed: GLfloat);
var
Tmp: Ta3dVector3D;
begin
Tmp := aObject.Rotation;
Tmp.y := Tmp.y + (aSpeed / a3dFPS);
aObject.Rotation := Tmp
end;
!)
@seealso(Ta3dEntity3D.Position)
@seealso(Ta3dEntity3D.LocalPosition) @seealso(Ta3dEntity3D.LocalRotation)
@seealso(Ta3dEntity3D.ApplyRotationMatrix) @seealso(Ta3dEntity3D.ApplyTranslationMatrix)
#Ta3dEntity3D.LocalPosition
If the entity has not @code(Parent), it is the same than @link(Position)
@seealso(Ta3dEntity3D.Parent) @seealso(Ta3dEntity3D.Position)
@seealso(Ta3dEntity3D.LocalRotation)
@seealso(Ta3dEntity3D.ApplyTransformationMatrix) @seealso(Ta3dEntity3D.ApplyTranslationMatrix)
#Ta3dEntity3D.LocalRotation
If the entity has not @code(Parent), it is the same than @link(Rotation)
@seealso(Ta3dEntity3D.Parent) @seealso(Ta3dEntity3D.Rotation)
@seealso(Ta3dEntity3D.LocalPosition)
@seealso(Ta3dEntity3D.ApplyRotationMatrix) @seealso(Ta3dEntity3D.ApplyTranslationMatrix)
#Ta3dEntity3DList.Create
@param(aOwnsObject Should objects be freed when removing them from the list. By default this is @true. This behaviour can be changed after the list was instantiated.)
@seealso(Ta3dEntity3DList.Destroy) @seealso(Ta3dEntity3DList.OwnsObjects)
#Ta3dEntity3DList.Destroy
Frees all objects in the list if @link(OwnsObjects) is @true.
@seealso(Ta3dEntity3DList.Create) @seealso(Ta3dEntity3DList.Clear) @seealso(Ta3dEntity3DList.OwnsObjects)
#Ta3dEntity3DList.Clear
Frees all objects in the list if @link(OwnsObjects) is @true.
@seealso(Ta3dEntity3DList.Destroy) @seealso(Ta3dEntity3DList.OwnsObjects)
#Ta3dEntity3DList.Add
Note that when @link(OwnsObjects) is @True, an entity should not be added twice to the list: this will result in memory corruption when the entity is freed (as it will be freed twice). The @code(Add) method does not check this, however.
@param(aEntity The entity to add.)
@seealso(Ta3dEntity3DList.Extract) @seealso(Ta3dEntity3DList.Remove) @seealso(Ta3dEntity3DList.Items)
@seealso(Ta3dEntity3DList.IndexOf) @seealso(Ta3dEntity3DList.Count)
#Ta3dEntity3DList.Extract
It removes @code(aEntity) from the list, if it is present in the list.
Note that the object is not freed, and that only the first found object is removed from the list.
@param(aEntity The entity to extract.)
@seealso(Ta3dEntity3DList.Remove) @seealso(Ta3dEntity3DList.Clear) @seealso(Ta3dEntity3DList.Pack) @seealso(Ta3dEntity3DList.Count)
#Ta3dEntity3DList.Remove
It removes @code(aEntity) from the list, if it is present in the list. It frees the item if @link(OwnsObjects) is @true.
Note that the object is not freed, and that only the first found object is removed from the list.
@param(aEntity The entity to remove.)
@seealso(Ta3dEntity3DList.OwnsObjects) @seealso(Ta3dEntity3DList.Remove) @seealso(Ta3dEntity3DList.Clear) @seealso(Ta3dEntity3DList.Pack) @seealso(Ta3dEntity3DList.Count)
#Ta3dEntity3DList.IndexOf
It searches for the presence of @code(aItem) in the list, and returns the location (index) in the list. The index is 0-based, and -1 is returned if @code(aItem) was not found in the list.
@return(Index of the object in the list, -1 if not present.)
@seealso(Ta3dEntity3DList.Items) @seealso(Ta3dEntity3DList.Count)
#Ta3dEntity3DList.Pack
@seealso(Ta3dEntity3DList.Extract) @seealso(Ta3dEntity3DList.Remove) @seealso(Ta3dEntity3DList.Count) @seealso(Ta3dEntity3DList.Items)
#Ta3dEntity3DList.OwnsObjects
It determines whether the objects 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(Ta3dEntity3DList.Create) @seealso(Ta3dEntity3DList.Clear) @seealso(Ta3dEntity3DList.Remove) @seealso(Ta3dEntity3DList.Destroy)
#Ta3dEntity3DList.Count
Note that this includes @Nil elements.
@seealso(Ta3dEntity3DList.Add) @seealso(Ta3dEntity3DList.Items)
#Ta3dEntity3DList.Items
It is the default property of the list. It provides indexed access to the elements in the list. The index @code(aIndex) is zero based, i.e., runs from 0 (zero) to @code(@link(Count) - 1).
@seealso(Ta3dEntity3DList.Add) @seealso(Ta3dEntity3DList.Remove) @seealso(Ta3dEntity3DList.Pack)
#Ta3dCamera
Its @code(World) property references to the current world (when rendering) or the last world rendered (when not rendering).
#Ta3dCamera.Initialize
It sets default values for @link(NearPlane) and @link(FarPlane) and sets @link(Viewport) to fill the display. It also set position to the local origin and looking front.
@seealso(a3dDefaultNearPlane) @seealso(a3dDefaultFarPlane)
@seealso(Ta3dDisplay)
#Ta3dCamera.ApplyViewport
You should call this before to render the scene. You don't need to call it every frame but you should call it everytime the @link(Viewport) or FOV definition changes.
@seealso(Ta3dCamera.Viewport) @seealso(a3dDefaultNearPlane) @seealso(a3dDefaultFarPlane)
@seealso(Ta3dCamera.SetOrthoProjection)
#Ta3dCamera.SetOrthoProjection
It disables z-buffer, fog and lighting.
Viewport coordinates are -1 to 1 in both height and width.
@seealso(Ta3dCamera.ApplyViewport)
#Ta3dCamera.ApplyMatrix
@seealso(Ta3dCamera.ApplyRotationMatrix) @seealso(Ta3dCamera.ApplyInverseRotationMatrix)
#Ta3dCamera.ApplyRotationMatrix
This is used by skyboxes.
@seealso(Ta3dCamera.ApplyMatrix) @seealso(Ta3dCamera.ApplyInverseRotationMatrix)
#Ta3dCamera.ApplyInverseRotationMatrix
This is used by 3D sprites.
It doesn't load the identity matrix.
@seealso(Ta3dCamera.ApplyMatrix) @seealso(Ta3dCamera.ApplyRotationMatrix)
#Ta3dCamera.Viewport
@seealso(Ta3dCamera.NearPlane) @seealso(Ta3dCamera.FarPlane)
@seealso(Ta3dCamera.ApplyViewport)
#Ta3dCamera.NearPlane
It modifies @italic(field of view) (FOV).
@seealso(a3dDefaultNearPlane)
@seealso(Ta3dCamera.FarPlane) @seealso(Ta3dCamera.ApplyViewport)
#Ta3dCamera.FarPlane
It doesn't modify @italic(field of view) (FOV).
@seealso(a3dDefaultFarPlane)
@seealso(Ta3dCamera.NearPlane) @seealso(Ta3dCamera.ApplyViewport)
#Ta3dObject3D.CurrentFrame
This property is used by @code(Ta3dObject3D) descendents to apply animations. It may be ignored if animations are not implemented.
#Ta3dObject3DList.Add
@seealso(Ta3dEntity3DList.Add) @seealso(Ta3dWorld3D.ObjectAdded)
#Ta3dWorld3D.ObjectAdded
Overriden methods @bold(must) call this inherited method.
@seealso(Ta3dObject3DList.Add)
#Ta3dWorld3D.Render
@seealso(Ta3dWorld3D.Background)
#Ta3dWorld3D.LOD
Read section @html(<a href="introduction.html#lod">Level of Detail</a>) for details of the LOD system.
@seealso(a3dDefaultLOD1) @seealso(a3dDefaultLOD2) @seealso(a3dDefaultLOD3).
@seealso(Ta3dModelObject3D.LODMesh)
#Ta3dWorld3D.Background
If no background is assigned, nothing will be rendered.
@code(Ta3dWorld3D) will not destroy the object.
@seealso(Ta3dWorld3D.Render)
#Ta3dModel
A model contains the data and the instructions that allows to render an object.
An instance of @code(Ta3dModel) is never created directly, instead a descendent class should be used. This is because @code(Ta3dModel) is an abstract class which does not implement all methods.
@seealso(Ta3dModelObject3D)
#Ta3dModel.Render
Object translation and rotation is established before calling this method.
@param(aCamera Camera passed to the object's @code(Render) method.)
@param(aFrame Frame to be rendered. Fractional part is for animation interpolation.)
@seealso(Ta3dModelObject3D.Render) @seealso(Ta3dObject3D.CurrentFrame)
#Ta3dModelObject3D
The object doesn't own the model.
#Ta3dModelObject3D.Render
This method builds and applies the OpenGL matrix with rotation and translation, then calls @code(@link(Model).Render) method.
@param(aCamera Camera used.)
@seealso(Ta3dModelObject3D.Model) @seealso(Ta3dModel.Render)
@seealso(Ta3dObject3D.CurrentFrame)
#Ta3dModelObject3D.Model
Note that @code(Model) overrides @link(LODMesh). Read section @html(<a href="introduction.html#lod">Level of Detail</a>) for details.
@seealso(Ta3dModelObject3D.Render) @seealso(Ta3dModelObject3D.LODMesh)
#Ta3dModelObject3D.LODMesh
@link(Model) overrides @code(LODMesh). That is, if @code(Model) is assigned to a valid model then LOD will be ignored an will render the @code(Model).
Read section @html(<a href="introduction.html#lod">Level of Detail</a>) for details of the LOD system.
@seealso(Ta3dModelObject3D.Render) @seealso(Ta3dModelObject3D.Model)