Quake-III-Arena

Quake III Arena GPL Source Release
Log | Files | Refs

terrain.h (4134B)


      1 /*
      2 ===========================================================================
      3 Copyright (C) 1999-2005 Id Software, Inc.
      4 
      5 This file is part of Quake III Arena source code.
      6 
      7 Quake III Arena source code is free software; you can redistribute it
      8 and/or modify it under the terms of the GNU General Public License as
      9 published by the Free Software Foundation; either version 2 of the License,
     10 or (at your option) any later version.
     11 
     12 Quake III Arena source code is distributed in the hope that it will be
     13 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 GNU General Public License for more details.
     16 
     17 You should have received a copy of the GNU General Public License
     18 along with Foobar; if not, write to the Free Software
     19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     20 ===========================================================================
     21 */
     22 #ifndef __TERRAIN_H__
     23 #define __TERRAIN_H__
     24 
     25 void			Terrain_SetEpair( terrainMesh_t *p, const char *pKey, const char *pValue );
     26 const char*		Terrain_GetKeyValue( terrainMesh_t *p, const char *pKey );
     27 int				Terrain_MemorySize( terrainMesh_t *p );
     28 void			Terrain_Delete( terrainMesh_t *p );
     29 terrainMesh_t	*MakeNewTerrain( int width, int height, qtexture_t *texture = NULL );
     30 brush_t			*AddBrushForTerrain( terrainMesh_t *pm, bool bLinkToWorld = true );
     31 terrainMesh_t	*Terrain_Duplicate( terrainMesh_t *pFrom );
     32 void			Terrain_BrushToMesh( void );
     33 brush_t			*Terrain_Parse( void );
     34 void			Terrain_Write( terrainMesh_t *p, CMemFile *file );
     35 void			Terrain_Write( terrainMesh_t *p, FILE *file );
     36 void			Terrain_Select( terrainMesh_t *p );
     37 void			Terrain_Deselect( terrainMesh_t *p );
     38 void			Terrain_Move( terrainMesh_t *pm, const vec3_t vMove, bool bRebuild = false );
     39 void			UpdateTerrainInspector( void );
     40 void			Terrain_CalcBounds( terrainMesh_t *p, vec3_t &vMin, vec3_t &vMax );
     41 void			CalcTriNormal( const vec3_t a, const vec3_t b, const vec3_t c, vec3_t o );
     42 void			Terrain_CalcVertPos( terrainMesh_t *p, int x, int y, vec3_t vert );
     43 void			Terrain_CalcNormals( terrainMesh_t *p );
     44 void			Terrain_FindReplaceTexture( terrainMesh_t *p, const char *pFind, const char *pReplace, bool bForce );
     45 bool			Terrain_HasTexture( terrainMesh_t *p, const char *name );
     46 void			Terrain_ReplaceQTexture( terrainMesh_t *p, qtexture_t *pOld, qtexture_t *pNew );
     47 void			Terrain_SetTexture( terrainMesh_t *p, texdef_t *tex_def );
     48 void			Terrain_Scale( terrainMesh_t *p, const vec3_t vOrigin, const vec3_t vAmt, bool bRebuild = true );
     49 bool			Terrain_DragScale( terrainMesh_t *p, vec3_t vAmt, vec3_t vMove );
     50 void			Terrain_ApplyMatrix( terrainMesh_t *p, const vec3_t vOrigin, const vec3_t vMatrix[ 3 ], bool bSnap );
     51 void			Terrain_DrawFace( brush_t *brush, terrainFace_t *terraface );
     52 void			DrawTerrain( terrainMesh_t *pm, bool bPoints, bool bShade = false );
     53 void			Terrain_DrawCam( terrainMesh_t *pm );
     54 void			Terrain_DrawXY( terrainMesh_t *pm, entity_t *owner );
     55 bool			OnlyTerrainSelected( void );
     56 bool			AnyTerrainSelected( void );
     57 terrainMesh_t	*SingleTerrainSelected( void );
     58 void			Terrain_Edit( void );
     59 void			Terrain_SelectPointByRay ( vec3_t org, vec3_t dir, int buttons );
     60 void			Terrain_AddMovePoint( vec3_t v, bool bMulti, bool bFull, int buttons );
     61 void			Terrain_UpdateSelected( vec3_t vMove );
     62 int				Terrain_PointInMoveList( terrainVert_t *pf );
     63 void			Terrain_AddPoint( terrainMesh_t *p, terrainVert_t *v );
     64 void			Terrain_RemovePointFromMoveList( terrainVert_t *v );
     65 void			Terrain_SelectAreaPoints( void );
     66 bool			RayTriangleIntersect( vec3_t orig, vec3_t dir, vec3_t vert1, vec3_t vert2, vec3_t vert3, float *t );
     67 terrainFace_t	*Terrain_Ray( vec3_t origin, vec3_t dir, brush_t *b, float *dist );
     68 void			Select_TerrainFacesFromBrush( brush_t *brush );
     69 void			SetTerrainTexdef( brush_t *brush, terrainFace_t *vert, texdef_t *texdef );
     70 void			RotateTerrainFaceTexture( terrainFace_t *vert, int nAxis, float fDeg );
     71 void			TerrainFace_FitTexture( terrainFace_t *vert );
     72 void			Select_TerrainFace( brush_t * brush, terrainFace_t *terraface );
     73 void			Terrain_Init( void );
     74 
     75 #endif