Class TMesh

DescriptionHierarchyFieldsMethodsProperties

Unit

meshunit

Declaration

type TMesh = class(TObject)

Description

This class represent a Mesh, a collection of vertex and faces that forms a model. It has no drawing implementation, so that it's not bound to any library. Extenders of this class can implement it.

Hierarchy

TMesh > TObject

Fields

 NameDescription
Public Face  
Private fNumFace  
Private fNumVertex  
Private nome  
Private radius

store radius of bounding sphere, so that it's calculated only once

Public userData  
Public Vertex  

Methods

Overview

Public constructor Create; virtual;
Public destructor Destroy; override;
Public procedure CalcolateNormals;
Public procedure Draw; virtual; abstract;
Public function getBoundingSphereRadius:TFloat;
Public function getName():string;
Public procedure LoadFrom(stream:TStream); overload;
Public procedure LoadFrom(filename:String); overload;
Public procedure Scale(factor:TFloat);
Public procedure Translate(x,y,z:TFloat);
Private procedure calculateBoundingSphereRadius;
Private procedure setNumface(value:integer);
Private procedure setNumvertex(value:integer);

Description

Public procedure CalcolateNormals;

used to recalculate normals. No so sure whether it works good :P

Private procedure calculateBoundingSphereRadius;

 

Public constructor Create; virtual;

 

Public destructor Destroy; override;

Destroy the mesh releasing used resources

Public procedure Draw; virtual; abstract;

This will be implemented by gfx-library specific code (opengl/directx/pen&paper/etc etc)

Public function getBoundingSphereRadius:TFloat;

get the radius of the bounding sphere of this mesh

Public function getName():string;

return the name of the mesh

Public procedure LoadFrom(filename:String); overload;

load the mesh from an XML file

Public procedure LoadFrom(stream:TStream); overload;

load the mesh from an XML stream

Public procedure Scale(factor:TFloat);

scale the mesh by a given factor (act on vertex! not on any view matrix)

parameters
X,Y,Z
the value of scaling on the single axes
Private procedure setNumface(value:integer);

 

Private procedure setNumvertex(value:integer);

 

Public procedure Translate(x,y,z:TFloat);

translate the mesh about its center (act on vertex! not on any view matrix)

parameters
X,Y,Z
the value of translation on the three axes

Properties

Overview

Public property NumFace: integer;
Public property NumVertex: integer;

Description

Public property NumFace: integer;

 

Public property NumVertex: integer;

 


Generated by PasDoc 0.8.8 on 2005-03-14 21:03:49