296 lines
6.8 KiB
C
296 lines
6.8 KiB
C
/*=========================================================================
|
|
*
|
|
* Element.h - Element definitions
|
|
*
|
|
* Version 1.0
|
|
* Revision date
|
|
*
|
|
*=======================================================================*/
|
|
#ifndef __MLT_ELEMENT_H
|
|
#define __MLT_ELEMENT_H
|
|
|
|
|
|
//--- Includes --------------------------------------------------------
|
|
|
|
#include "acp_base.h"
|
|
#include "MTH.h"
|
|
|
|
#include "typedef.h"
|
|
|
|
#include "fmd.h"
|
|
#include "geosprit.h"
|
|
|
|
|
|
//--- Altimaps --------------------------------------------------------
|
|
|
|
#define MLT_C_xAltiSquareVoid 0
|
|
#define MLT_C_xAltiSquareTopRight 1
|
|
#define MLT_C_xAltiSquareBottomLeft 2
|
|
#define MLT_C_xAltiSquareBothTRBL 3
|
|
#define MLT_C_xAltiSquareTopLeft 4
|
|
#define MLT_C_xAltiSquareBottomRight 8
|
|
#define MLT_C_xAltiSquareBothTLBR 12
|
|
#define MLT_C_xAltiSquareBothBRTL MLT_C_xAltiSquareBothTLBR
|
|
#define MLT_C_xAltiSquareBothBLTR MLT_C_xAltiSquareBothTRBL
|
|
|
|
|
|
//--- Meshes --------------------------------------------------------
|
|
|
|
#define MeshFunctionSwap 0xFFFF
|
|
#define MeshFunctionEnd 0xFFFE
|
|
|
|
|
|
|
|
//--- Structures --------------------------------------------------------
|
|
|
|
// tripled index
|
|
typedef struct MLT_tdstTripledIndex_
|
|
{
|
|
long a3_xIndex[3];
|
|
}
|
|
MLT_tdstTripledIndex;
|
|
|
|
// double index
|
|
typedef struct MLT_tdstDoubledIndex_
|
|
{
|
|
long a2_xIndex[2];
|
|
}
|
|
MLT_tdstDoubledIndex;
|
|
|
|
// indexed sprite
|
|
typedef struct MLT_tdstIndexedSprite_
|
|
{
|
|
long xCenterPoint;
|
|
MLT_tdstSprite *hSprite;
|
|
MTH2D_tdstVector stSize;
|
|
}
|
|
MLT_tdstIndexedSprite;
|
|
|
|
// element sprite
|
|
typedef struct MLT_tdstElementSprite_
|
|
{
|
|
xString sName;
|
|
ACP_tdxIndex xIndexOfParallelBox; // must be just after name.
|
|
long xNbSprites;
|
|
MLT_tdstIndexedSprite *d_stListOfSprites;
|
|
}
|
|
MLT_tdstElementSprite;
|
|
|
|
// element indexed triangle
|
|
typedef struct MLT_tdstElementIndexedTriangles_
|
|
{
|
|
xString sName;
|
|
ACP_tdxIndex xIndexOfParallelBox; // must be just after name.
|
|
xString sMaterial;
|
|
MLT_tdstMaterial *hMaterial;
|
|
xString sSectorName;
|
|
long xNbFaces;
|
|
long xNbElementUV;
|
|
xString sFacesOf;
|
|
xString sUVsOf;
|
|
MLT_tdstTripledIndex *d_stListOfFacesTripled;
|
|
MLT_tdstTripledIndex *d_stListOfFacesTripledIndexUV;
|
|
MTH3D_tdstVector *d_stListOfFacesNormals;
|
|
MLT_tdstColor *d_stListOfFacesReceivedLightIntensity;
|
|
ACP_tdst2DUVValues *d_stListOfElementUV;
|
|
}
|
|
MLT_tdstElementIndexedTriangles;
|
|
|
|
|
|
// square
|
|
typedef struct MLT_tdstSquare_
|
|
{
|
|
short Vertex[4];
|
|
}
|
|
MLT_tdstSquare;
|
|
|
|
// altimap square
|
|
typedef struct MLT_tdstAltimapSquare_
|
|
{
|
|
unsigned char ucType;
|
|
ACP_tdxIndex xFaceIndex;
|
|
short sNbFacesForSquare;
|
|
}
|
|
MLT_tdstAltimapSquare;
|
|
|
|
// handle of FMD
|
|
typedef struct MLT_tdstHandleOfFMD_
|
|
{
|
|
MLT_tdstTripledIndex stTrianglesIndexUVValues;
|
|
xString sMaterial;
|
|
}
|
|
MLT_tdstHandleOfFMD;
|
|
|
|
typedef struct MLT_tdstHandleOfFMD_ *MLT_tdxHandleOfFMD;
|
|
|
|
|
|
// element altimap
|
|
typedef struct MLT_tdstElementAltimap_
|
|
{
|
|
char sName[100];
|
|
ACP_tdxIndex xIndexOfParallelBox; // must be just after name.
|
|
long xNbVertexes;
|
|
long xNbSquares;
|
|
long xNbFaces;
|
|
long xNbElementUV;
|
|
|
|
MTH3D_tdstVector stOrigin;
|
|
MTH_tdxReal xDeltaX;
|
|
MTH_tdxReal xDeltaY;
|
|
ACP_tdxIndex xWidth;
|
|
ACP_tdxIndex xDepth;
|
|
MTH_tdxReal *d_xHeight;
|
|
MTH3D_tdstVector *d_stPointNormals;
|
|
MLT_tdstAltimapSquare *d_stSquare;
|
|
ACP_tdst2DUVValues *d_stUVValues;
|
|
MLT_tdxHandleOfFMD *d_hFMD;
|
|
MTH3D_tdstVector *d_stFaceNormals;
|
|
}
|
|
MLT_tdstElementAltimap;
|
|
|
|
|
|
// face map triangle
|
|
typedef struct MLT_tdstFaceMapTriangle_
|
|
{
|
|
MLT_tdstTripledIndex stFaceTripled;
|
|
MLT_tdstFaceMapDescriptor *hFaceMapDescriptor;
|
|
}
|
|
MLT_tdstFaceMapTriangle;
|
|
|
|
// face map descriptor
|
|
typedef struct MLT_tdstElementFaceMapDescriptors_
|
|
{
|
|
xString sName;
|
|
ACP_tdxIndex xIndexOfParallelBox; // must be just after name.
|
|
long xNbFaces;
|
|
MLT_tdstFaceMapTriangle *d_stListOfFacesQuadrupled;
|
|
MTH3D_tdstVector *d_stListOfFacesNormals;
|
|
MLT_tdstColor *d_stListOfFacesReceivedLightIntensity;
|
|
}
|
|
MLT_tdstElementFaceMapDescriptors;
|
|
|
|
// element mesh
|
|
typedef struct MLT_tdstElementTMeshes_
|
|
{
|
|
xString sName;
|
|
ACP_tdxIndex xIndexOfParallelBox; // must be just after name.
|
|
xString sMaterial;
|
|
MLT_tdstMaterial *hMaterial;
|
|
long xNbMeshAtoms;
|
|
long xNbFaces;
|
|
long xNbUV;
|
|
long *d_stListOfMeshAtoms;
|
|
MTH3D_tdstVector *d_stListOfFacesNormals;
|
|
MLT_tdstColor *d_stListOfFacesReceivedLightIntensity;
|
|
ACP_tdst2DUVValues *d_stListOfElementUV;
|
|
}
|
|
MLT_tdstElementTMeshes;
|
|
|
|
// element point
|
|
typedef struct MLT_tdstElementPoints_
|
|
{
|
|
xString sName;
|
|
ACP_tdxIndex xIndexOfParallelBox; // must be just after name.
|
|
MTH_tdxReal xFatness;
|
|
long xNbPoints;
|
|
long *d_xListOfPointIndex;
|
|
xString sMaterial;
|
|
MLT_tdstMaterial *hMaterial;
|
|
}
|
|
MLT_tdstElementPoints;
|
|
|
|
// element lines
|
|
typedef struct MLT_tdstElementLines_
|
|
{
|
|
xString sName;
|
|
ACP_tdxIndex xIndexOfParallelBox; // must be just after name.
|
|
MTH_tdxReal xThickness;
|
|
long xNbLines;
|
|
MLT_tdstDoubledIndex *d_stListOfLineIndex;
|
|
xString *d_hListOfLinesMaterial;
|
|
MLT_tdstColor *d_stListOfLinesReceivedLightIntensity;
|
|
}
|
|
MLT_tdstElementLines;
|
|
|
|
// indexed sphere
|
|
typedef struct MLT_tdstIndexedSphere_
|
|
{
|
|
long xCenterPoint;
|
|
MTH_tdxReal xRadius;
|
|
xString sMaterial;
|
|
MLT_tdstMaterial *hMaterial;
|
|
}
|
|
MLT_tdstIndexedSphere;
|
|
|
|
// element sphere
|
|
typedef struct MLT_tdstElementSpheres_
|
|
{
|
|
xString sName;
|
|
ACP_tdxIndex xIndexOfParallelBox; // must be just after name.
|
|
long xNbSpheres;
|
|
MLT_tdstIndexedSphere *d_stListOfSpheres;
|
|
}
|
|
MLT_tdstElementSpheres;
|
|
|
|
// indexed alighed box
|
|
typedef struct MLT_tdstIndexedAlignedBox_
|
|
{
|
|
long xMinPoint;
|
|
long xMaxPoint;
|
|
xString sMaterial;
|
|
MLT_tdstMaterial *hMaterial;
|
|
}
|
|
MLT_tdstIndexedAlignedBox;
|
|
|
|
// element aligned box
|
|
typedef struct MLT_tdstElementAlignedBoxes_
|
|
{
|
|
xString sName;
|
|
ACP_tdxIndex xIndexOfParallelBox; // must be just after name.
|
|
long xNbAlignedBoxes;
|
|
MLT_tdstIndexedAlignedBox *d_stListOfAlignedBoxes;
|
|
}
|
|
MLT_tdstElementAlignedBoxes;
|
|
|
|
// indexed cone
|
|
typedef struct MLT_tdstIndexedCone_
|
|
{
|
|
long xTopPoint;
|
|
long xBasePoint;
|
|
MTH_tdxReal xBaseRadius;
|
|
xString sMaterial;
|
|
MLT_tdstMaterial *hMaterial;
|
|
}
|
|
MLT_tdstIndexedCone;
|
|
|
|
// element cone
|
|
typedef struct MLT_tdstElementCones_
|
|
{
|
|
xString sName;
|
|
ACP_tdxIndex xIndexOfParallelBox; // must be just after name.
|
|
long xNbCones;
|
|
MLT_tdstIndexedCone *d_stListOfCones;
|
|
}
|
|
MLT_tdstElementCones;
|
|
|
|
// mega face
|
|
typedef struct MLT_tdstMegaFace_
|
|
{
|
|
long lIndex;
|
|
long lNbFaces;
|
|
long *d_stListOfFaces;
|
|
}
|
|
MLT_tdstMegaFace;
|
|
|
|
// element mega face
|
|
typedef struct MLT_tdstElementMegaFace_
|
|
{
|
|
xString sName;
|
|
long lNbMegaFaces;
|
|
MLT_tdstMegaFace *d_stListOfMegaFaces;
|
|
}
|
|
MLT_tdstElementMegaFace;
|
|
|
|
#endif /* __MLT_ELEMENT_H */
|
|
|