Gorilla.Billboard
Unit Gorilla.Billboard.pasClasses
- TGorillaBillboardFillingAlgorithm = class ( TObject )
- TGorillaBillboardFlatFilling = class ( TGorillaBillboardFillingAlgorithm )
- TGorillaBillboardTerrainFilling = class ( TGorillaBillboardFillingAlgorithm )
- TGorillaBillboard = class ( TGorillaMesh )
Records
- record TGorillaBillboardSourceObject
- record TGorillaBillboardProxy
Enumerations
- enum TGorillaBillboardProxyPropertyFlag = ( UsePosition, UseRotation, UseScale, UseDirection, UseTexturePool ) ;
Constants
- const GORILLA_BILLBOARD_FLAGS_ALL : TGorillaBillboardProxyPropertyFlags = ;
Mics. types
- type PGorillaBillboardProxy = pointer to TGorillaBillboardProxy;
TGorillaBillboardProxy
TGorillaBillboardFillingAlgorithm
Custom algorithm component for filling the TGorillaBillboard.Billboards list with TGorillaBillboardProxy structures.
Ancestors
Members
Fields
- protected FBillboard :
TGorillaBillboard
- protected FCount :
Integer
- protected FFlags :
TGorillaBillboardProxyPropertyFlags
- protected FOnCreateProxy :
TOnBillboardProxyCreate
Methods
- public constructor Create ( const ABillboard : TGorillaBillboard ) ;
- public destructor Destroy ( ) ;
- public procedure Execute
(
)
;
abstract virtual;
On extending the filling algorithm class you need to overwrite this routine.
Properties
TGorillaBillboardFlatFilling
Default flat filling algorithm for billboard.
Ancestors
Members
TGorillaBillboardTerrainFilling
Defines a billboard filling algorithm adjusting proxies on a terrain surface. Use this filling f.e. for grass meshes on a terrain.
Ancestors
Members
Fields
Methods
- public constructor Create ( const ABillboard : TGorillaBillboard; const ATerrain : TGorillaMesh ) ;
- public procedure Execute ( ) ; override;
Properties
- public RandomPosition : Boolean
By this property you can switch between column-row filling and random position generation.
read FRandomPosition
write FRandomPosition
TGorillaBillboard
A billboard controls proxy objects of a basis mesh instance (source object).
Remarks
The billboard component is a mesh itself, into which proxies are merged. Much faster rendering is possible if proxy meshes are merge into one mesh instead of rendering each mesh.Ancestors
Members
Fields
- protected FSourceObjects :
TList<FMX.Controls3D.TControl3D>
- protected FProxies :
TCacheList<Gorilla.Billboard.TGorillaBillboardProxy>
- protected FBoxSize :
TPoint3D
- protected FAddSourceObjectHierarchy :
Boolean
- protected FLastRadialMergePos :
TPoint3D
- protected FRadialMergeTolerance :
Single
- protected FTempSrcObjList :
TGorillaBillboardSourceObjectList
- protected FSrcObjChanged :
Boolean
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected procedure DoOnSourceObjectNotify ( ASender : TObject; const AItem : TGorillaBillboardSourceObject; AAction : TCollectionNotification ) ;
- protected procedure DoGetSourceObjectsList ( ) ;
- protected procedure DoSetOutputBuffer ( ASrcList : TGorillaBillboardSourceObjectList; AVB : TVertexBuffer; AIB : TIndexBuffer; const AProxies : TArray<Gorilla.Billboard.TGorillaBillboardProxy> ) ;
- protected function DoMerge ( ASrcList : TGorillaBillboardSourceObjectList; ACenter : TPoint3D; ARadius : Single ) : Integer ;
- protected procedure DoRadialMerge ( ACenter : TPoint3D; ARadius : Single ) ;
- protected procedure CreateStaticBuffer ( ) ; virtual;
- protected procedure Render ( ) ; override;
- protected procedure RenderChildren ( ) ; override;
- protected procedure Notification ( AComponent : TComponent; Operation : TOperation ) ; override;
- public function GetAbsoluteBoundingBox ( ) : TBoundingBox ; override;
- public function ContainsVertices
(
)
: Boolean
;
Checks if any of the linked source objects contains vertices. Sometimes we need empty billboards for preserving object hierarchy.
- public procedure Fill
(
const
AAlgorithm :
TGorillaBillboardFillingAlgorithm; const
ADoClear :
Boolean
)
;
virtual;
Create a number of proxies by an individual algorithm.
- public procedure Merge
(
)
;
virtual;
The routine will build instances from the registered proxies. Those instances are merged to one single mesh represented by the billboard component itself.
- public procedure RadialMerge
(
ACenter :
TPoint3D; ARadius :
Single
)
;
virtual;
The routine will build instances from the registered proxies. Those instances are merged to one single mesh represented by the billboard component itself. Only proxies inside of a given radius are merged.
- public function AddSourceObject
(
const
ACtrl :
TControl3D; const
AUnique :
Boolean
=
False
)
: Integer
;
Add a new source object to list of source objects. If AUnique is TRUE the method will take care that only single instances of this control are contained.
- public procedure AddSourceObjects ( const ACtrls : TArray<FMX.Controls3D.TControl3D>; const AUnique : Boolean = False ) ;
- public procedure RemoveSourceObject
(
const
ACtrl :
TControl3D; const
AAllCopies :
Boolean
=
False
)
;
Remove source object from list.
- public procedure DeleteSourceObject
(
const
AIndex :
Integer
)
;
Delete a source object at a certain position in source object list.
- public function GetSourceObject
(
const
AIndex :
Integer
)
: TControl3D
;
Returns a source object at a certain position in source object list.
- public function CountSourceObjects
(
)
: Integer
;
Counts added source objects.
- public procedure ClearSourceObjects
(
)
;
Deletes all source objects from source object list.
Properties
- public SourceObjects : TList<FMX.Controls3D.TControl3D>
Returns a list of TControl3D components to be multiplied in billboard. Add controls at runtime and setup a list before starting filling mechanism.
read FSourceObjects - public Proxies : TCacheList<Gorilla.Billboard.TGorillaBillboardProxy>
- public BoxSize : TPoint3Dread FBoxSize
- public AddSourceObjectHierarchy : Boolean