Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
l3ds.cpp File Reference
#include "stdafx.h"
#include "l3ds.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

Go to the source code of this file.

Classes

struct  LChunk
struct  LTri

Macros

#define SEEK_START   1900
#define SEEK_CURSOR   1901
#define COLOR_F   0x0010
#define COLOR_24   0x0011
#define LIN_COLOR_24   0x0012
#define LIN_COLOR_F   0x0013
#define INT_PERCENTAGE   0x0030
#define FLOAT_PERCENTAGE   0x0031
#define AMBIENT_LIGHT   0x2100
#define MAIN3DS   0x4D4D
#define EDIT3DS   0x3D3D
#define KFDATA   0xB000
#define KFHDR   0xB00A
#define OBJECT_NODE_TAG   0xB002
#define NODE_HDR   0xB010
#define PIVOT   0xB013
#define POS_TRACK_TAG   0xB020
#define ROT_TRACK_TAG   0xB021
#define SCL_TRACK_TAG   0xB022
#define MAT_ENTRY   0xAFFF
#define MAT_NAME   0xA000
#define MAT_AMBIENT   0xA010
#define MAT_DIFFUSE   0xA020
#define MAT_SPECULAR   0xA030
#define MAT_SHININESS   0xA040
#define MAT_SHIN2PCT   0xA041
#define MAT_TRANSPARENCY   0xA050
#define MAT_SHADING   0xA100
#define MAT_TWO_SIDE   0xA081
#define MAT_ADDITIVE   0xA083
#define MAT_WIRE   0xA085
#define MAT_FACEMAP   0xA088
#define MAT_WIRESIZE   0xA087
#define MAT_DECAL   0xA082
#define MAT_TEXMAP   0xA200
#define MAT_MAPNAME   0xA300
#define MAT_MAP_TILING   0xA351
#define MAT_MAP_USCALE   0xA354
#define MAT_MAP_VSCALE   0xA356
#define MAT_MAP_UOFFSET   0xA358
#define MAT_MAP_VOFFSET   0xA35A
#define MAT_MAP_ANG   0xA35C
#define MAT_TEX2MAP   0xA33A
#define MAT_OPACMAP   0xA210
#define MAT_BUMPMAP   0xA230
#define MAT_SPECMAP   0xA204
#define MAT_SHINMAP   0xA33C
#define MAT_REFLMAP   0xA220
#define MAT_ACUBIC   0xA310
#define EDIT_OBJECT   0x4000
#define OBJ_TRIMESH   0x4100
#define OBJ_LIGHT   0x4600
#define OBJ_CAMERA   0x4700
#define LIT_OFF   0x4620
#define LIT_SPOT   0x4610
#define TRI_VERTEXLIST   0x4110
#define TRI_VERTEXOPTIONS   0x4111
#define TRI_FACELIST   0x4120
#define TRI_MAT_GROUP   0x4130
#define TRI_SMOOTH_GROUP   0x4150
#define TRI_FACEMAPPING   0x4140
#define TRI_MATRIX   0x4160
#define SPOTLIGHT   0x4610
#define MAX_SHARED_TRIS   100

Typedefs

typedef unsigned long ulong

Functions

void ErrorMsg (const char *msg)
LVector3 _4to3 (const LVector4 &vec)
LVector3 AddVectors (const LVector3 &a, const LVector3 &b)
LVector3 SubtractVectors (const LVector3 &a, const LVector3 &b)
float VectorLength (const LVector3 &vec)
LVector3 NormalizeVector (const LVector3 &vec)
LVector3 CrossProduct (const LVector3 &a, const LVector3 &b)
void LoadIdentityMatrix (LMatrix4 &m)
LVector4 VectorByMatrix (const LMatrix4 &m, const LVector4 &vec)
void QuatToMatrix (const LVector4 &quat, LMatrix4 &m)

Variables

LColor3 black = {0, 0, 0}
LVector3 zero3 = {0, 0, 0}
LVector4 zero4 = {0, 0, 0, 0}
LMap emptyMap = {0, "", 1, 1, 0, 0, 0}

Macro Definition Documentation

#define AMBIENT_LIGHT   0x2100

Definition at line 34 of file l3ds.cpp.

#define COLOR_24   0x0011

Definition at line 27 of file l3ds.cpp.

#define COLOR_F   0x0010

Definition at line 26 of file l3ds.cpp.

#define EDIT3DS   0x3D3D

Definition at line 38 of file l3ds.cpp.

#define EDIT_OBJECT   0x4000

Definition at line 82 of file l3ds.cpp.

#define FLOAT_PERCENTAGE   0x0031

Definition at line 32 of file l3ds.cpp.

#define INT_PERCENTAGE   0x0030

Definition at line 31 of file l3ds.cpp.

#define KFDATA   0xB000

Definition at line 41 of file l3ds.cpp.

#define KFHDR   0xB00A

Definition at line 42 of file l3ds.cpp.

#define LIN_COLOR_24   0x0012

Definition at line 28 of file l3ds.cpp.

#define LIN_COLOR_F   0x0013

Definition at line 29 of file l3ds.cpp.

#define LIT_OFF   0x4620

Definition at line 86 of file l3ds.cpp.

#define LIT_SPOT   0x4610

Definition at line 87 of file l3ds.cpp.

#define MAIN3DS   0x4D4D

Definition at line 37 of file l3ds.cpp.

#define MAT_ACUBIC   0xA310

Definition at line 80 of file l3ds.cpp.

#define MAT_ADDITIVE   0xA083

Definition at line 61 of file l3ds.cpp.

#define MAT_AMBIENT   0xA010

Definition at line 53 of file l3ds.cpp.

#define MAT_BUMPMAP   0xA230

Definition at line 76 of file l3ds.cpp.

#define MAT_DECAL   0xA082

Definition at line 65 of file l3ds.cpp.

#define MAT_DIFFUSE   0xA020

Definition at line 54 of file l3ds.cpp.

#define MAT_ENTRY   0xAFFF

Definition at line 51 of file l3ds.cpp.

#define MAT_FACEMAP   0xA088

Definition at line 63 of file l3ds.cpp.

#define MAT_MAP_ANG   0xA35C

Definition at line 73 of file l3ds.cpp.

#define MAT_MAP_TILING   0xA351

Definition at line 68 of file l3ds.cpp.

#define MAT_MAP_UOFFSET   0xA358

Definition at line 71 of file l3ds.cpp.

#define MAT_MAP_USCALE   0xA354

Definition at line 69 of file l3ds.cpp.

#define MAT_MAP_VOFFSET   0xA35A

Definition at line 72 of file l3ds.cpp.

#define MAT_MAP_VSCALE   0xA356

Definition at line 70 of file l3ds.cpp.

#define MAT_MAPNAME   0xA300

Definition at line 67 of file l3ds.cpp.

#define MAT_NAME   0xA000

Definition at line 52 of file l3ds.cpp.

#define MAT_OPACMAP   0xA210

Definition at line 75 of file l3ds.cpp.

#define MAT_REFLMAP   0xA220

Definition at line 79 of file l3ds.cpp.

#define MAT_SHADING   0xA100

Definition at line 59 of file l3ds.cpp.

#define MAT_SHIN2PCT   0xA041

Definition at line 57 of file l3ds.cpp.

#define MAT_SHININESS   0xA040

Definition at line 56 of file l3ds.cpp.

#define MAT_SHINMAP   0xA33C

Definition at line 78 of file l3ds.cpp.

#define MAT_SPECMAP   0xA204

Definition at line 77 of file l3ds.cpp.

#define MAT_SPECULAR   0xA030

Definition at line 55 of file l3ds.cpp.

#define MAT_TEX2MAP   0xA33A

Definition at line 74 of file l3ds.cpp.

#define MAT_TEXMAP   0xA200

Definition at line 66 of file l3ds.cpp.

#define MAT_TRANSPARENCY   0xA050

Definition at line 58 of file l3ds.cpp.

#define MAT_TWO_SIDE   0xA081

Definition at line 60 of file l3ds.cpp.

#define MAT_WIRE   0xA085

Definition at line 62 of file l3ds.cpp.

#define MAT_WIRESIZE   0xA087

Definition at line 64 of file l3ds.cpp.

#define MAX_SHARED_TRIS   100

Definition at line 102 of file l3ds.cpp.

#define NODE_HDR   0xB010

Definition at line 44 of file l3ds.cpp.

#define OBJ_CAMERA   0x4700

Definition at line 85 of file l3ds.cpp.

#define OBJ_LIGHT   0x4600

Definition at line 84 of file l3ds.cpp.

#define OBJ_TRIMESH   0x4100

Definition at line 83 of file l3ds.cpp.

#define OBJECT_NODE_TAG   0xB002

Definition at line 43 of file l3ds.cpp.

#define PIVOT   0xB013

Definition at line 45 of file l3ds.cpp.

#define POS_TRACK_TAG   0xB020

Definition at line 46 of file l3ds.cpp.

#define ROT_TRACK_TAG   0xB021

Definition at line 47 of file l3ds.cpp.

#define SCL_TRACK_TAG   0xB022

Definition at line 48 of file l3ds.cpp.

#define SEEK_CURSOR   1901

Definition at line 22 of file l3ds.cpp.

#define SEEK_START   1900

Definition at line 21 of file l3ds.cpp.

#define SPOTLIGHT   0x4610

Definition at line 98 of file l3ds.cpp.

#define TRI_FACELIST   0x4120

Definition at line 91 of file l3ds.cpp.

#define TRI_FACEMAPPING   0x4140

Definition at line 95 of file l3ds.cpp.

#define TRI_MAT_GROUP   0x4130

Definition at line 92 of file l3ds.cpp.

#define TRI_MATRIX   0x4160

Definition at line 96 of file l3ds.cpp.

#define TRI_SMOOTH_GROUP   0x4150

Definition at line 93 of file l3ds.cpp.

#define TRI_VERTEXLIST   0x4110

Definition at line 88 of file l3ds.cpp.

#define TRI_VERTEXOPTIONS   0x4111

Definition at line 89 of file l3ds.cpp.


Typedef Documentation

typedef unsigned long ulong

Definition at line 19 of file l3ds.cpp.


Function Documentation

LVector3 _4to3 ( const LVector4 vec)

Definition at line 140 of file l3ds.cpp.

LVector3 AddVectors ( const LVector3 a,
const LVector3 b 
)

Definition at line 149 of file l3ds.cpp.

LVector3 CrossProduct ( const LVector3 a,
const LVector3 b 
)

Definition at line 185 of file l3ds.cpp.

void ErrorMsg ( const char *  msg)

Definition at line 106 of file l3ds.cpp.

void LoadIdentityMatrix ( LMatrix4 m)

Definition at line 194 of file l3ds.cpp.

LVector3 NormalizeVector ( const LVector3 vec)

Definition at line 172 of file l3ds.cpp.

void QuatToMatrix ( const LVector4 quat,
LMatrix4 m 
)

Definition at line 224 of file l3ds.cpp.

LVector3 SubtractVectors ( const LVector3 a,
const LVector3 b 
)

Definition at line 158 of file l3ds.cpp.

LVector4 VectorByMatrix ( const LMatrix4 m,
const LVector4 vec 
)

Definition at line 201 of file l3ds.cpp.

float VectorLength ( const LVector3 vec)

Definition at line 167 of file l3ds.cpp.


Variable Documentation

LColor3 black = {0, 0, 0}

Definition at line 132 of file l3ds.cpp.

LMap emptyMap = {0, "", 1, 1, 0, 0, 0}

Definition at line 138 of file l3ds.cpp.

LVector3 zero3 = {0, 0, 0}

Definition at line 134 of file l3ds.cpp.

LVector4 zero4 = {0, 0, 0, 0}

Definition at line 136 of file l3ds.cpp.