Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

item Class Reference

Inheritance diagram for item:

model cylinder cylindercaps empty flat coneseg pseudocylinder fbo_switch house List of all members.

Public Methods

 item (int vertexes, int tris, int texi, int normals=0)
void move (float x, float y, float z)
void setdistance (float x, float y, float z)
void rotate (float _angle, float x, float y, float z)
virtual void draw ()
void setcolor (ub4 _color)
void setcolor (int _color)
void settexture (texture *tex)
void setshader (char type, shader sh)
float distance2 (float3 eyep, float3 d) const
void recalc_distance2 ()

Public Attributes

float dist2
int transparent
int cull
int zwrite
int d_test

Protected Attributes

shader vsh
shader fsh
texturet
ub4 color
f3 translation
f3 distance
f3 rot
float angle

Detailed Description

model extended with color, texture, pixel and framgent shaders information


Constructor & Destructor Documentation

item int    vertexes,
int    tris,
int    texi,
int    normals = 0
 

pass-thru constructor (see model)


Member Function Documentation

float distance2 float3    eyep,
float3    d
const
 

return squared distance of object (between "translation" and "eye") based on eye coordinates and direction of view

virtual void draw   [virtual]
 

draw this model unsing OpenGL commands

Reimplemented from model.

Reimplemented in house, and fbo_switch.

void move float    x,
float    y,
float    z
 

set translation of object to (x,y,z)

void recalc_distance2  
 

recalculate squared distance from eye and put it in member variable dist2

void rotate float    _angle,
float    x,
float    y,
float    z
 

set rotation of object to angle around axis (x,y,z). Rotation is applied after translation

void setcolor int    _color
 

set color for this model

Parameters:
_color color to set (in 0xRRGGBBAA format)

void setcolor ub4    _color
 

set color for this model

Parameters:
_color color to set (in (R,G,B,A) format)

void setdistance float    x,
float    y,
float    z
 

set "translation" used to calculate distance of object to (x,y,z)

void setshader char    type,
shader    sh
 

set fragment/vertex shader for this model

Parameters:
type type of shader ('f'=fragment, 'v'=vertex)
sh shader with parameters

void settexture texture   tex
 

set texture used for this model

Parameters:
tex texture to set


Member Data Documentation

float angle [protected]
 

ub4 color [protected]
 

int cull
 

if true (default), back faces will be culled for this model

int d_test
 

if true, z-buffer will be tested (default). If false, z-buffer will be ignored.

float dist2
 

cached distance set by recalc_distance2()

f3 distance [protected]
 

shader fsh [protected]
 

f3 rot [protected]
 

texture* t [protected]
 

f3 translation [protected]
 

int transparent
 

if true, items is transparent and order of drawing matters

shader vsh [protected]
 

int zwrite
 

if true (default), z-buffer will be updated. If false, z-buffer values will not be updated while drawing this model.