VedaLib3DEngine/lwo2reader.h File Reference


Detailed Description

This file applies the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1 , read file COPYING. independant lightwave object file format reader. by krb (vic ferry), 02/11/2006, based on previous works. features:

Author:
victorien ferry

Definition in file lwo2reader.h.

Go to the source code of this file.

Classes

struct  st_Key
struct  st_Envelope
struct  LwoMatrix
struct  _LwoVertex
struct  _LwoPolyToVertex
struct  _LwoPolygon
struct  LwoTriangle
struct  _LwoSortedTriangleSurface
struct  LwoMorphVertex
struct  MorphSet
struct  _LwoLayer
struct  LwTexture
struct  LwoClip
struct  LwoIndexedEnvelope
struct  _LwoObject

Defines

#define SHAPE_TCB   0
 from LW envelope.h
#define SHAPE_HERM   1
#define SHAPE_BEZI   2
#define SHAPE_LINE   3
#define SHAPE_STEP   4
#define SHAPE_BEZ2   5
#define BEH_RESET   0
#define BEH_CONSTANT   1
#define BEH_REPEAT   2
#define BEH_OSCILLATE   3
#define BEH_OFFSET   4
#define BEH_LINEAR   5

Typedefs

typedef _LwoObject sLwoObject
typedef _LwoLayer sLwoLayer

Enumerations

enum  lwo2_error
 init error enum returned by ReadLwo() More...
enum  ReadLwoFlag { ReadLwoFlag_DiscontinuousUVToNewVertex = 1, ReadLwoFlag_SortTriangleBySurfaces = 2 }
 flag bits for ReadLwo(). Affect the way the objects are read. More...
enum  e_typebits

Functions

void * lw_CleanAlloc (unsigned int _bytesize)
 you must provide this allocator:
void lw_FreeAlloc (void *_pAllocToClose)
 you must provide this desallocator:
lwo2_error ReadLwo (sLwoObject *_pLwoObject, const unsigned char *_pLwoFileChunk, unsigned int _lwoFileByteLength, const unsigned int _flags)
 Read a File, open all layer shapes in tables. CloseLwo() must be called at destruction and will close all allocs. You can specify ReadLwoFlag_... flags if you need a special feature according to your engine, it will not open the same tables in each cases. Then if lwoerr_Ok is returned, you can use LwoGetLayer() to get an object shape. You can then copy all informations before CloseLwo(). consider all informations as const.
void CloseLwo (sLwoObject *_pLwoObject)
 Close all allocs from ReadLwo().
const sLwoLayerLwoGetLayer (const sLwoObject *_pLwoObject, const unsigned int _layerIndex)
 Get a layer shape from a struct inited with ReadLwo(). Each .lwo files can contains one or more layer shapes. _layerIndex corrsponds to the layer index in the interface, and is zero-based. Then you can use.


Define Documentation

#define SHAPE_TCB   0
 

from LW envelope.h

Definition at line 91 of file lwo2reader.h.


Enumeration Type Documentation

enum lwo2_error
 

init error enum returned by ReadLwo()

Definition at line 34 of file lwo2reader.h.

enum ReadLwoFlag
 

flag bits for ReadLwo(). Affect the way the objects are read.

Enumerator:
ReadLwoFlag_DiscontinuousUVToNewVertex  if present, the per-poly discontiuous texture coords are set back on new vertexes. This is needed if your engine only use vertex texture coord,( like usual hardware renderers.)
ReadLwoFlag_SortTriangleBySurfaces  Sort polygons by texture used in the polygon list.

Definition at line 45 of file lwo2reader.h.


Function Documentation

void CloseLwo sLwoObject _pLwoObject  ) 
 

Close all allocs from ReadLwo().

Parameters:
_pLwoObject reference to an object that manage the LWO.

void* lw_CleanAlloc unsigned int  _bytesize  ) 
 

you must provide this allocator:

void lw_FreeAlloc void *  _pAllocToClose  ) 
 

you must provide this desallocator:

const sLwoLayer* LwoGetLayer const sLwoObject _pLwoObject,
const unsigned int  _layerIndex
 

Get a layer shape from a struct inited with ReadLwo(). Each .lwo files can contains one or more layer shapes. _layerIndex corrsponds to the layer index in the interface, and is zero-based. Then you can use.

Parameters:
_pLwoObject pointer to struct computed with ReadLwo().
_layerIndex index of the layer in the file.
Returns:
a sLwoLayer layer shape description.

lwo2_error ReadLwo sLwoObject _pLwoObject,
const unsigned char *  _pLwoFileChunk,
unsigned int  _lwoFileByteLength,
const unsigned int  _flags
 

Read a File, open all layer shapes in tables. CloseLwo() must be called at destruction and will close all allocs. You can specify ReadLwoFlag_... flags if you need a special feature according to your engine, it will not open the same tables in each cases. Then if lwoerr_Ok is returned, you can use LwoGetLayer() to get an object shape. You can then copy all informations before CloseLwo(). consider all informations as const.

Parameters:
_pLwoObject reference to a sLwoObject to init, to handle the file.
_pLwoFileChunk pointer to the whole file chunk.
_lwoFileByteLength the length of _pLwoFileChunk in bytes.
_flags look ReadLwoFlag enum up there.
Returns:
lwoerr_Ok if no problem. else a lwo2_error enum.


      /\/\        4         N         k         !         N         D
                      _______  _ __ ___  _____            ___ _ _  ____
     ___________  __//___   /________  |/    / ___________\_______/    \
    /   _   _   \/   _     /    _   /      _/_/____/    _       __     /
   /    /   /       /     /    /    \      \/     /    /    \   \     /
  \\___/___/___/    ¯    _____/_____/       ______\___/_____/\________\\
               \________/_ ___ __ l____\      /elD!  
                 http://www.m4nkind.com \____/