00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __TERRAIN_H__
00023 #define __TERRAIN_H__
00024
00025 void Terrain_SetEpair( terrainMesh_t *p, const char *pKey, const char *pValue );
00026 const char* Terrain_GetKeyValue( terrainMesh_t *p, const char *pKey );
00027 int Terrain_MemorySize( terrainMesh_t *p );
00028 void Terrain_Delete( terrainMesh_t *p );
00029 terrainMesh_t *MakeNewTerrain( int width, int height, qtexture_t *texture = NULL );
00030 brush_t *AddBrushForTerrain( terrainMesh_t *pm, bool bLinkToWorld = true );
00031 terrainMesh_t *Terrain_Duplicate( terrainMesh_t *pFrom );
00032 void Terrain_BrushToMesh( void );
00033 brush_t *Terrain_Parse( void );
00034 void Terrain_Write( terrainMesh_t *p, CMemFile *file );
00035 void Terrain_Write( terrainMesh_t *p, FILE *file );
00036 void Terrain_Select( terrainMesh_t *p );
00037 void Terrain_Deselect( terrainMesh_t *p );
00038 void Terrain_Move( terrainMesh_t *pm, const vec3_t vMove, bool bRebuild = false );
00039 void UpdateTerrainInspector( void );
00040 void Terrain_CalcBounds( terrainMesh_t *p, vec3_t &vMin, vec3_t &vMax );
00041 void CalcTriNormal( const vec3_t a, const vec3_t b, const vec3_t c, vec3_t o );
00042 void Terrain_CalcVertPos( terrainMesh_t *p, int x, int y, vec3_t vert );
00043 void Terrain_CalcNormals( terrainMesh_t *p );
00044 void Terrain_FindReplaceTexture( terrainMesh_t *p, const char *pFind, const char *pReplace, bool bForce );
00045 bool Terrain_HasTexture( terrainMesh_t *p, const char *name );
00046 void Terrain_ReplaceQTexture( terrainMesh_t *p, qtexture_t *pOld, qtexture_t *pNew );
00047 void Terrain_SetTexture( terrainMesh_t *p, texdef_t *tex_def );
00048 void Terrain_Scale( terrainMesh_t *p, const vec3_t vOrigin, const vec3_t vAmt, bool bRebuild = true );
00049 bool Terrain_DragScale( terrainMesh_t *p, vec3_t vAmt, vec3_t vMove );
00050 void Terrain_ApplyMatrix( terrainMesh_t *p, const vec3_t vOrigin, const vec3_t vMatrix[ 3 ], bool bSnap );
00051 void Terrain_DrawFace( brush_t *brush, terrainFace_t *terraface );
00052 void DrawTerrain( terrainMesh_t *pm, bool bPoints, bool bShade = false );
00053 void Terrain_DrawCam( terrainMesh_t *pm );
00054 void Terrain_DrawXY( terrainMesh_t *pm, entity_t *owner );
00055 bool OnlyTerrainSelected( void );
00056 bool AnyTerrainSelected( void );
00057 terrainMesh_t *SingleTerrainSelected( void );
00058 void Terrain_Edit( void );
00059 void Terrain_SelectPointByRay ( vec3_t org, vec3_t dir, int buttons );
00060 void Terrain_AddMovePoint( vec3_t v, bool bMulti, bool bFull, int buttons );
00061 void Terrain_UpdateSelected( vec3_t vMove );
00062 int Terrain_PointInMoveList( terrainVert_t *pf );
00063 void Terrain_AddPoint( terrainMesh_t *p, terrainVert_t *v );
00064 void Terrain_RemovePointFromMoveList( terrainVert_t *v );
00065 void Terrain_SelectAreaPoints( void );
00066 bool RayTriangleIntersect( vec3_t orig, vec3_t dir, vec3_t vert1, vec3_t vert2, vec3_t vert3, float *t );
00067 terrainFace_t *Terrain_Ray( vec3_t origin, vec3_t dir, brush_t *b, float *dist );
00068 void Select_TerrainFacesFromBrush( brush_t *brush );
00069 void SetTerrainTexdef( brush_t *brush, terrainFace_t *vert, texdef_t *texdef );
00070 void RotateTerrainFaceTexture( terrainFace_t *vert, int nAxis, float fDeg );
00071 void TerrainFace_FitTexture( terrainFace_t *vert );
00072 void Select_TerrainFace( brush_t * brush, terrainFace_t *terraface );
00073 void Terrain_Init( void );
00074
00075 #endif