Changeset 9417 in orxonox.OLD for branches/terrain/src/lib/graphics/importer/terrain/terrain_quad.h
- Timestamp:
- Jul 24, 2006, 1:23:47 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/terrain/src/lib/graphics/importer/terrain/terrain_quad.h
r9414 r9417 1 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 4 4 Copyright (C) 2006 orx 5 5 6 6 This program is free software; you can redistribute it and/or modify 7 7 it under the terms of the GNU General Public License as published by 8 8 the Free Software Foundation; either version 2, or (at your option) 9 9 any later version. 10 10 11 11 ### File Specific: 12 12 main programmer: Marco Biasini 13 13 14 14 */ 15 15 #ifndef _TERRAIN_QUAD_TREE_H … … 24 24 25 25 typedef enum { TL_CHILD = 0, TR_CHILD = 1, BL_CHILD = 2, BR_CHILD = 3 } TerrainQuadChild; 26 26 27 27 class TerrainQuad { 28 28 public: 29 29 TerrainQuad( Terrain *_owner, int _xOffset, int _zOffset ); 30 30 TerrainQuad( Terrain *_owner, int _x0, int _z0, int _x1, int _z1 ); 31 32 virtual ~TerrainQuad( ) 31 32 virtual ~TerrainQuad( ) 33 33 { 34 34 for ( int i = 0; i < 4; ++i ) { 35 35 if ( !children[i]->isChildless() ) 36 36 SAVE_DELETE( children[i] ); 37 } 37 } 38 38 } 39 39 int cull( ); 40 40 41 41 /** 42 42 * Returns the array containing the children quad-nodes of this node in the following 43 43 * order: top-left, top-right, bottom-left, bottom-right 44 44 */ 45 inline pTerrainQuad* getChildren( ) 46 { 47 return children; 45 inline pTerrainQuad* getChildren( ) 46 { 47 return children; 48 48 } 49 49 50 50 /** 51 51 * Sets the child-nodes to the specified _children elements. … … 56 56 children[i] = _children[i]; 57 57 } 58 58 59 59 inline bool isChildless() { return ( children[0] == NULL ); } 60 60 61 61 /** 62 62 * Returns the child node given by _child. The returned node may be null. 63 63 */ 64 inline pTerrainQuad getChild( TerrainQuadChild _child ) 65 { 66 return children[_child]; 64 inline pTerrainQuad getChild( TerrainQuadChild _child ) 65 { 66 return children[_child]; 67 67 } 68 68 inline void setScale( Vector _scale ) … … 88 88 inline int getWidth() { return width; } 89 89 inline int getHeight() { return height; } 90 90 91 91 protected: 92 92 TerrainQuad( ) {}
Note: See TracChangeset
for help on using the changeset viewer.