Description | Hierarchy | Fields | Methods | Properties |
type TAdScene = class(TObject)
Simple class that copes with scene management. TAdScene holds its own copy of the current view and projection matrix and applies it to the graphic system when needed. TAdScene is used in TAdRenderingSurface (and so in TAdDraw and TAdTextureSurface, as they are descendants of TAdRenderingSurface) to allow easy access on the scene settings of the surface.
constructor Create(ADraw: TAdDraw); |
|
destructor Destroy; override; |
|
procedure Activate; |
|
procedure Deactivate; |
|
procedure Setup2DScene(AWidth, AHeight: integer); |
|
procedure Setup3DScene(AWidth, AHeight: integer; APos, ADir, AUp: TAdVector3); |
property ViewMatrix: TAdMatrix read FViewMatrix write SetViewMatrix; |
|
property ProjectionMatrix: TAdMatrix read FProjectionMatrix write SetProjectionMatrix; |
|
property Viewport: TAdRect read FViewPort write SetViewPort; |
|
property AmbientColor: TAndorraColor read FAmbientColor write SetAmbientColor; |
|
property Width: integer read FWidth; |
|
property Height: integer read FHeight; |
|
property ClipPlaneNearZ: double read FNearZ write FNearZ; |
|
property ClipPlaneFarZ: double read FFarZ write FFarZ; |
|
property Activated: boolean read FActivated; |
|
property AdDraw: TAdDraw read FDraw; |
|
property OnActivate: TAdNotifyEvent read FOnActivate write FOnActivate; |
constructor Create(ADraw: TAdDraw); |
|
Creates an instance of TAdScene and links itself to the TAdDraw object. |
destructor Destroy; override; |
|
Destroys the instance of TAdScene. |
procedure Activate; |
|
Pushs the current scene settings in the graphic system and indicates this scene object as being "active". |
procedure Deactivate; |
|
Actually does not more than indicating this scene object to be inactive. |
procedure Setup3DScene(AWidth, AHeight: integer; APos, ADir, AUp: TAdVector3); |
|
Creates an perspectivic 3D-Scene. SceneWidth and SceneHeight are set to the values passed here. Parameters
|
property ViewMatrix: TAdMatrix read FViewMatrix write SetViewMatrix; |
|
The ViewMatrix specifies the position of the objects in the scene. It is normally established by the SetupScene functions. You can set this property to transform the objects on the screen in a special way. |
property ProjectionMatrix: TAdMatrix read FProjectionMatrix write SetProjectionMatrix; |
|
The ProjectionMatrix specifies the way the objects are projected on the surface. It is normally established by the SetupScene functions. You can set this property to project the objects on the screen in a special way. |
property Viewport: TAdRect read FViewPort write SetViewPort; |
|
Defines the rectangle where graphic operations take place. Viewport is automatically set when a change in the size of the surface occurs. If you want to use your own viewport, don't forget to reset it after such a change happened. The viewport is always given in absolute coordinates. |
property AmbientColor: TAndorraColor read FAmbientColor write SetAmbientColor; |
|
The ambient color of the scene. The ambient color is the base color all lights are added to. To use an ambient color, lights have to be enabled. See also
|
property Width: integer read FWidth; |
|
Returns the width of the scene, that specifies the width of the relative coordinate system. |
property Height: integer read FHeight; |
|
Returns the height of the scene, that specifies the height of the relative coordinate system. |
property Activated: boolean read FActivated; |
|
Returns whether the scene is currently activated. |
property AdDraw: TAdDraw read FDraw; |
|
Points on the parent AdDraw instance. |
property OnActivate: TAdNotifyEvent read FOnActivate write FOnActivate; |
|
This event is raised when the current scene is activated. OnActivate may already be in use internally, so you have to test if it really is set to nil if you want to assign to it. |