CAST II Game Engine

   MAIN       FEATURES       SCREENSHOTS       FORUMS       MANUAL       DOWNLOADS       CONTACTS   
Units
Class Hierarchy
Classes, Interfaces and Objects
Types
Enumerations
Variables
Constants
Functions and Procedures
Identifiers

Class TCASTRootItem

Unit

Cast2

Declaration

type TCASTRootItem = class(TRootItem)

Description

An item of this class should be the root of items hierarchy

Hierarchy

TRootItem > TItem > TBaseItem

Fields

 NameDescription
PublicStageSettingsClear settings for all render stages

Methods

Overview

Publicconstructor Create(AManager: TItemsManager); override;
Publicdestructor Destroy; override;
Publicfunction AddCollection(Mask: TTraverseMask): Integer;
Protectedprocedure AddColliding(AItem: TProcessing);
Publicprocedure AddProperties(const Result: Props.TProperties); override;
Publicprocedure Collide;
Publicprocedure DeleteCollection(Index: Integer);
Publicfunction ExtractByMaskClassInCamera(Mask: TItemFlags; AClass: CProcessing; out Items: TItems; ACamera: TCamera): Integer;
Publicfunction ExtractByMaskClassInRadius(Mask: TItemFlags; AClass: CProcessing; out Items: TItems; Origin: TLocation; Range: Single): Integer;
Publicprocedure FreeChilds; override;
Publicfunction GetItemSize(CountChilds: Boolean): Integer; override;
Publicprocedure HandleMessage(const Msg: TMessage); override;
Protectedprocedure RemoveColliding(AItem: TProcessing);
Publicprocedure SetProperties(Properties: Props.TProperties); override;
Publicprocedure TraverseTree(Callback: TTraverseCallback);

Description

Publicconstructor Create(AManager: TItemsManager); override;

 

Publicdestructor Destroy; override;

 

Publicfunction AddCollection(Mask: TTraverseMask): Integer;

Adds a collection of items with the specified state

Protectedprocedure AddColliding(AItem: TProcessing);

Adds item's collision info to a collision manager

Publicprocedure AddProperties(const Result: Props.TProperties); override;

This procedure is called (by editor for example) to retrieve a list of item's properties and their values. Any TItem descendant class should override this method in order to add its own properties.

Publicprocedure Collide;

Performs a collision test. ToDo: move to core

Publicprocedure DeleteCollection(Index: Integer);

Removes collection specified by the index

Publicfunction ExtractByMaskClassInCamera(Mask: TItemFlags; AClass: CProcessing; out Items: TItems; ACamera: TCamera): Integer;

Traverses through the items hierarchy and adds to Items all items matching the following:
the item is an instance of the given class or a descendant, its State field has matches Mask and the item is within visibility frustum of the given camera. Childs of items with non-matching State are not considered. Returns number of items in Items.

Publicfunction ExtractByMaskClassInRadius(Mask: TItemFlags; AClass: CProcessing; out Items: TItems; Origin: TLocation; Range: Single): Integer;

Traverses through the items hierarchy and adds to Items all items matching the following:
the item is an instance of the given class or a descendant, its State field has matches Mask and the item is within the given range from the given origin. Childs of items with non-matching State are not considered. Returns number of items in Items.

Publicprocedure FreeChilds; override;

Frees all childs

Publicfunction GetItemSize(CountChilds: Boolean): Integer; override;

 

Publicprocedure HandleMessage(const Msg: TMessage); override;

 

Protectedprocedure RemoveColliding(AItem: TProcessing);

Removes item's collision info from a collision manager

Publicprocedure SetProperties(Properties: Props.TProperties); override;

This procedure is called (by editor for example) to set values of item's properties. Any TItem descendant class should override this method to allow its own properties to be set.

Publicprocedure TraverseTree(Callback: TTraverseCallback);

Traverses through the items hierarchy and calls Callback for all items

Last modified: Jan 6, 2010
Copyright (C) 2006-2010, casteng.com