CAST II Game Engine

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

Unit C2Visual

Description

CAST II Engine visual items unit

(C) 2006 George "Mirage" Bakhtadze. www.casteng.com
The source code may be used under either MPL 1.1 or LGPL 2.1 license. See included license.txt file
Unit contains basic classes of visual items

Classes, Interfaces and Objects

NameDescription
Class THeighTMapEditOp 
Class THeighTMapEditOpAdjust 
Class THeighTMapEditOpSmooth 
Class TLightLight source
Class TLookAtCameraCamera which looks at a specified target point
Class TMappedItem 
Class TMappedTesselator 
Class TSharedTesselator 
Class TSharedTesselators 
Class TTemporaryVisible 
Class TTessBBoxUpdateMsg 
Class TTesselatorPerforms triangulation of visible items
Class TVisible 

Functions and Procedures

Overview

procedure ConvertVertices(SrcFormat, DestFormat: Longword; TotalVertices: Integer; Src: Pointer; Dest: Pointer);
function GetVertexElementOffset(VertexFormat, ElementIndex: Longword): Integer;
function GetVertexFormat(Transformed, Normals, Diffuse, Specular, PointSize: Boolean; VertexWeights: Word; TextureSets: array of Integer): Longword;
function GetVertexIndexedBlending(VertexFormat: Longword): Boolean;
function GetVertexSize(VertexFormat: Longword): Cardinal;
function GetVertexTextureCoordsCount(VertexFormat, TextureSetIndex: Longword): Integer;
function GetVertexTextureSetsCount(VertexFormat: Longword): Integer;
function GetVertexWeightsCount(VertexFormat: Longword): Integer;
function VertexContains(VertexFormat, ElementIndex: Longword): Boolean;

Description

procedure ConvertVertices(SrcFormat, DestFormat: Longword; TotalVertices: Integer; Src: Pointer; Dest: Pointer);

 

function GetVertexElementOffset(VertexFormat, ElementIndex: Longword): Integer;

 

function GetVertexFormat(Transformed, Normals, Diffuse, Specular, PointSize: Boolean; VertexWeights: Word; TextureSets: array of Integer): Longword;

/ Determines a vertex format which can include variuos components. VertexWeight can be OR'ed with vwIndexedBlending to indicate that last weight is actually a dword with indices

function GetVertexIndexedBlending(VertexFormat: Longword): Boolean;

 

function GetVertexSize(VertexFormat: Longword): Cardinal;

 

function GetVertexTextureCoordsCount(VertexFormat, TextureSetIndex: Longword): Integer;

 

function GetVertexTextureSetsCount(VertexFormat: Longword): Integer;

 

function GetVertexWeightsCount(VertexFormat: Longword): Integer;

 

function VertexContains(VertexFormat, ElementIndex: Longword): Boolean;

 

Types

Overview

CTesselator = of TTesselator;
TClassRec = record TessClass: CTesselator; TessMap: BaseCont.TPointerPointerMap; end;
TTesselationParameters = record Camera: TCamera; ModelMatrix: TMatrix4s; end;
TTesselationStatus = record TesselatorType: TTesselatorType; BufferIndex, Offset: Integer; Status: TTesselationState; LastResetCounter, LastBufferResetCounter: Integer; end;
TTextureMatrixDelegate = procedure(TextureStage: Integer; out Matrix: TMatrix4s) of object;
TVisibilityCheckerDelegate = function(const Camera: TCamera): Boolean of object;

Description

CTesselator = of TTesselator;

 

TClassRec = record TessClass: CTesselator; TessMap: BaseCont.TPointerPointerMap; end;

 

TTesselationParameters = record Camera: TCamera; ModelMatrix: TMatrix4s; end;

Data structure passed to tesselator buffer filling methods
Camera - currently applied camera
ModelMatrix - model transform of visible items being rendered

TTesselationStatus = record TesselatorType: TTesselatorType; BufferIndex, Offset: Integer; Status: TTesselationState; LastResetCounter, LastBufferResetCounter: Integer; end;

Current tesselation status data structure BufferIndex - index of buffer in API-independent buffers Offset - offset within the buffer in elements (vertices, indices, etc) Status - current tesselation state LastResetCounter - reset counter should not be modified manually

TTextureMatrixDelegate = procedure(TextureStage: Integer; out Matrix: TMatrix4s) of object;

The delegate used to retrieve a custom texture matrix. See tmCustom. TextureSet is an index of texture set to which the retrieved matrix will applied

TVisibilityCheckerDelegate = function(const Camera: TCamera): Boolean of object;

 

Enumerations

TTesselationState
Tesselation status
 tsMaxSizeChangedTesselator was cardinally changed, including maximum number of vertices and/or indices
 tsChangedTesselator data was changed
 tsTesselatedTesselator data was not changed so no reason to tesselate it again
TTesselatorKind
Kind of tesselator
 tkNoneNull tesselator. Used when the item is tesselated by other shared tesselator (GUI, impostors, etc)
 tkOwnThe item is tesselated by its own tesselator (default)
 tkShareda shared tesselator used for items of several classes (2D primitives, particles, etc)
TTesselatorType
Type of tesselator used to render an item
 ttStaticTriangulated data of the tesselator rarely or never changes
 ttDynamicTriangulated data changes nearly every frame (particle system, etc)

Constants

Overview

DefaultTechToItemMapCapacity = 8;
hmemAdjust = 0;
hmemSmooth = 1;
IndexSize = 2;
LightKindsEnum = 'Directional\&Point\&Spot';
ltDirectional = 0;
ltPoint = 1;
ltSpot = 2;
MapEditModesEnum = 'Adjust' + StringDelimiter + 'Smooth';
MaxCursorSize = 64;
vwIndexedBlending = $8;

Description

DefaultTechToItemMapCapacity = 8;

Default capacity of technique => item hash map

hmemAdjust = 0;

Map edit mode: adjust heights

hmemSmooth = 1;

Map edit mode: smooth heights

IndexSize = 2;

Size of data in index buffers

LightKindsEnum = 'Directional\&Point\&Spot';

Light source types enumeration string

ltDirectional = 0;

Light source types

ltPoint = 1;

 

ltSpot = 2;

 

MapEditModesEnum = 'Adjust' + StringDelimiter + 'Smooth';

Map edit modes string enumeration

MaxCursorSize = 64;

Max size of mapped item edit cursor size

vwIndexedBlending = $8;

Vertex format

Variables

Overview

RGBA: Boolean;

Description

RGBA: Boolean;

 

Last modified: 4 Jul, 2008
Copyright (C) 2006-2008, casteng.com