Class TFBU_Effect

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TFBU_Effect = class(TObject)

Description

This class is meant to be the ancestor class of an effect implementation to use with the manager. Therefore, the Update, Render and SetRenderMode methods are abstract and must be overwritten in your effect implementation.

Hierarchy

Overview

Fields

Protected FPosition: TFB_Vectorf3;
Protected FMinExtremePoint: TFB_Vectorf3;
Protected FMaxExtremePoint: TFB_Vectorf3;
Protected FWind: TFB_Vectorf3;
Protected FRotationMatrix: TFB_Matrixf3;
Protected FFinishedCallback: TFBU_NotifyEvent;
Protected FPreUpdateCallback: TFBU_NotifyEvent;
Protected FPostUpdateCallback: TFBU_NotifyEvent;
Protected FPreRenderCallback: TFBU_NotifyEvent;
Protected FPostRenderCallback: TFBU_NotifyEvent;
Protected FTerminateEffect: Boolean;
Protected FUseFrustum: Boolean;

Methods

Public constructor Create; virtual;
Public procedure SetMatrix(ARef: Pointer);
Public procedure SetPosition(x, y, z: Single); overload;
Public procedure SetPosition(ARef: Pointer); overload;
Public procedure SetWind(x, y, z: Single); overload; virtual;
Public procedure SetWind(ARef: Pointer); overload; virtual;
Public procedure Update(ADeltaTime: Single); virtual; abstract;
Public procedure Render(APrepareGL: Boolean); virtual; abstract;
Public procedure SetVertexStorage(AVertexStorage: Cardinal); virtual; abstract;
Public procedure Terminate;

Properties

Public property FinishedCallback: TFBU_NotifyEvent read FFinishedCallback write FFinishedCallback;
Public property PreUpdateCallback: TFBU_NotifyEvent read FPreUpdateCallback write FPreUpdateCallback;
Public property PostUpdateCallback: TFBU_NotifyEvent read FPostUpdateCallback write FPostUpdateCallback;
Public property PreRenderCallback: TFBU_NotifyEvent read FPreRenderCallback write FPreRenderCallback;
Public property PostRenderCallback: TFBU_NotifyEvent read FPostRenderCallback write FPostRenderCallback;
Public property Wind: TFB_Vectorf3 read FWind;
Public property Position: TFB_Vectorf3 read FPosition;

Description

Fields

Protected FPosition: TFB_Vectorf3;

The position of the effect. Note that the effect isn't translated to this point. This value is just for internal calculations of the manager, so you have to do this on your own.

Protected FMinExtremePoint: TFB_Vectorf3;

The extreme points of the effect (only necessary if Frustum Culling is used)

Protected FMaxExtremePoint: TFB_Vectorf3;

The extreme points of the effect (only necessary if Frustum Culling is used)

Protected FWind: TFB_Vectorf3;

Wind vector for the containers

Protected FRotationMatrix: TFB_Matrixf3;

Rotation Matrix

Protected FFinishedCallback: TFBU_NotifyEvent;

Callback to remove the effect from the manager and free the instance in the next update cycle. It is automatically defined by the manager

Protected FPreUpdateCallback: TFBU_NotifyEvent;

Called before update

Protected FPostUpdateCallback: TFBU_NotifyEvent;

Called after update

Protected FPreRenderCallback: TFBU_NotifyEvent;

Callback which is called directly before the render-method of the effect is called. You may want to set up some shaders here or so.

Protected FPostRenderCallback: TFBU_NotifyEvent;

Same as above, but called after the render-method has been called.

Protected FTerminateEffect: Boolean;

When true, the effect got the terminate signal and should call FFinishedCallback. This doesn't need to be directly after the value turned to true, so you have the possibility to wait until effect containers run empty or so.

Protected FUseFrustum: Boolean;

When true, the effect is neither calculated nor rendered if outside field of view

Methods

Public constructor Create; virtual;

Class constructor

Public procedure SetMatrix(ARef: Pointer);

Sets the whole translation matrix of the effect, OpenGL-Compatible.

Parameters
ARef
Pointer to a sequence of 16 single precision values, which represent a 4x4 Matrix.
Public procedure SetPosition(x, y, z: Single); overload;

Convenience method to set the effects position.

Public procedure SetPosition(ARef: Pointer); overload;

Convenience method to set the effects position. position in x,y,z format.

Parameters
ARef
Pointer to a sequence of 3 single precision values, which define the
Public procedure SetWind(x, y, z: Single); overload; virtual;

Sets the FWind field. You may override it to directly setup your contexts.

Public procedure SetWind(ARef: Pointer); overload; virtual;

Sets the FWind field. You may override it to directly setup your contexts. wind speeds in x,y,z direction.

Parameters
ARef
Pointer to a sequence of 3 single precision values, which define the
Public procedure Update(ADeltaTime: Single); virtual; abstract;

Update method for calculations. You shouldn't do any rendering here because, depending on how the manager is set up, it's possible that this method isn't called every frame.

Parameters
ADeltaTime
The time since the last procedure call
Public procedure Render(APrepareGL: Boolean); virtual; abstract;

Render method, which is called at least every frame

Public procedure SetVertexStorage(AVertexStorage: Cardinal); virtual; abstract;

This method is called by the manager when its method TFBU_EffectManager.SetVertexStorage is called.

Parameters
AVertexStorage
The vertex storage mode.
See also
FB_VERTEXSTORAGE_VA
FB_VERTEXSTORAGE_VBO
FB_VERTEXSTORAGE_USER
Public procedure Terminate;

Simply sets FTerminateEffect to True

Properties

Public property FinishedCallback: TFBU_NotifyEvent read FFinishedCallback write FFinishedCallback;

Sets FFinishedCallback. You actually should not set the callback if you don't know what you are doing

Public property PreUpdateCallback: TFBU_NotifyEvent read FPreUpdateCallback write FPreUpdateCallback;

Callback which is called directly before the update-method of the effect is called. You may want to set up some shaders here or so.

Public property PostUpdateCallback: TFBU_NotifyEvent read FPostUpdateCallback write FPostUpdateCallback;

Same as above, but called after the update-method has been called.

Public property PreRenderCallback: TFBU_NotifyEvent read FPreRenderCallback write FPreRenderCallback;

Callback which is called directly before the render-method of the effect is called. You may want to set up some shaders here or so.

Public property PostRenderCallback: TFBU_NotifyEvent read FPostRenderCallback write FPostRenderCallback;

Same as above, but called after the render-method has been called.

Public property Wind: TFB_Vectorf3 read FWind;

Wind speeds

Public property Position: TFB_Vectorf3 read FPosition;

Effect Position


Generated by PasDoc 0.11.0 on 2009-06-29 23:12:34