BRender Technical Reference Manual:4 Data Structures (Alphabetical Reference):br_vertex
Next|Prev|Up
Overview
Members
Copy/Assign
Access & Maintenance
Referencing & Lifetime
Initialisation
Construction & Destruction
Supplementary
Import & Export

br_vertex


Overview

The vertex data structure, describing a single vertex in a model.

The typedef

(See model.h for precise declaration and ordering)

Position

br_vector3 p Co-ordinates of a point in model space

Texture and Lighting

br_vector2 map Texture co-ordinates of this vertex

br_uint_8 index Colour index for pre-lit models

br_uint_8 red, grn, blu True colour values for pre-lit model

Related Functions

See BrModelApplyMap()
231 and BrModelFitMap()233 to set texture co-ordinates. See BrSceneModelLight()234 to set pre-lit values.

Related Structures

See br_model228 for the structure in which vertices are used.

See br_material151 for details of how pre-lighting information is used.

Members

Position

br_vector3 p

The co-ordinates of a point (in the model's co-ordinate space) representing the vertex of a group of faces (typically triangular).

For example, a cube has eight vertices. If it had unit side and was centred about (0,0,0), it would have vertices (0.5,0.5,0.5), (0.5,0.5,-0.5), etc. Faces are polygons (typically triangles) described in terms of a number of vertex indices.

Texture and Lighting

br_vector2 map

The 2D co-ordinates at which this vertex appears in an infinitely*1 tiled texture map.

br_uint_8 index

Pre-computed lighting index at this vertex. See br_material151 for how this relates to pre-lit materials.

br_uint_8 red, grn, blu

Pre-computed light level at this vertex (in terms of colour intensities*2). See br_material151 for how this relates to pre-lit materials.

Copy/Assign

Do not use structure assign. Use member-wise copy only.

Access & Maintenance

Members may be freely accessed. Models referencing vertices that are changed should be updated using BrModelUpdate()237 before rendering. There are private members of vertices that are modified during BrModelUpdate()237.

Referencing & Lifetime

Be careful of referencing vertices especially ones allocated by BrModelAllocate()239, they are liable to be moved around during BrModelUpdate()237, say. Vertices are generally only allocated as arrays completely describing a model. Always access using indexing from the model's vertices member.

Initialisation

Use memset(,0,sizeof(br_vertex)) and set members as appropriate. Updating of models referencing initialised vertices will be needed before there are involved in rendering.

Construction & Destruction

Vertices may be constructed conventionally, but BR_MODF_KEEP_ORIGINAL must be specified in any model that refers to them. Otherwise use BrModelAllocate()239.

Supplementary

When constructed by BrModelAllocate()239 vertices are allocated from the "VERTICES" memory class. It is probably better to organise any enumeration around models (see br_model228).

Import & Export

Vertices are included with model definitions. See br_model228 for details of import/export functions.


Generated with CERN WebMaker