Changeset 1310 for GTP/trunk/Lib/Geom


Ignore:
Timestamp:
09/01/06 10:52:45 (18 years ago)
Author:
gumbau
Message:

Lod Manager structure modification

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoLodManager.h

    r1071 r1310  
    1616#include "GeoLodObject.h" 
    1717#include <map> 
     18#include <vector> 
    1819 
    1920namespace Geometry 
     
    2223        { 
    2324        public: 
    24                 lodobj_dist_node_t(LodObject *o):dist2cam(0.0f),lodobj(o){} 
    25                 lodobj_dist_node_t(const lodobj_dist_node_t &c):dist2cam(c.dist2cam),lodobj(c.lodobj){} 
    26                 lodobj_dist_node_t(void):dist2cam(0.0f),lodobj(NULL){} 
     25                lodobj_dist_node_t(float dist, LodObject *o):dist2cam(dist),lodobj(o){ must_recalculate_distance=false; } 
    2726                float dist2cam; 
    2827                LodObject *lodobj; 
     28                bool must_recalculate_distance; 
    2929                bool operator < (const lodobj_dist_node_t &o) const { return (dist2cam < o.dist2cam); } 
    3030        }; 
    31  
    32         class lodobj_idpos_node_t; 
    3331 
    3432        class LodManager 
     
    4139                void UpdateLODObjectPos(LodObject*,const Geometry::Vector3 &); 
    4240        private: 
    43                 std::map<float,Geometry::lodobj_dist_node_t> lodobj_dists; // key: dist2cam for efficient distance finding 
    44                 std::map<Geometry::lodobj_idpos_node_t,Geometry::Vector3> lodobj_pos; // map key: LodObject UniqueID for efficient ID-based finding 
     41                std::vector<lodobj_dist_node_t> lodobj_dists; // key: dist2cam for efficient distance finding 
     42                std::map<uint32,Geometry::Vector3> lodobj_pos; // map key: LodObject UniqueID for efficient ID-based finding 
    4543                unsigned int targetFPS; 
    4644                Vector3 camera_pos; 
     
    4947                float CalculateDistToCamera(const Geometry::Vector3 &) const; 
    5048                float SelectRandomDistance(void) const; 
     49                void RecalculateDist(lodobj_dist_node_t & node); 
    5150        }; 
    5251}; 
Note: See TracChangeset for help on using the changeset viewer.