The RViewPoint Class

Superclasses:

TViewPoint

RViewPoint



  public:
 RViewPoint() { objectLists = NULL; nObjectLists = 0; weather = NULL; };
 ~RViewPoint() { ShiAssert( !IsReady() ); };

 void Setup( float gndRange, int maxDetail, int minDetail, float wxRange );
 void Cleanup( void );

 void SetGroundRange( float gndRange, int maxDetail, int minDetail );
 void SetWeatherRange( float wxRange );

 BOOL IsReady( void ) { return (objectLists != NULL) && (TViewPoint::IsReady()); };

 // Add/remove drawable objects from this viewpoint's display list
 void InsertObject( DrawableObject *object );
 void RemoveObject( DrawableObject *object );

 // Query terrain and weather properties for the area arround this viewpoint
 float GetTerrainFloor( void )  { return terrainFloor; };
 float GetTerrainCeiling( void ) { return terrainCeiling; };
 float GetCloudBase( void )  { return cloudBase; };
 float GetCloudTops( void )  { return cloudTops; };
 float GetWeatherRange( void )  { return weather ? weather->GetMaxRange() : 0.0f; };

 // Cloud properties at this viewpoint's exact position in space
 float CloudOpacity( void )  { return cloudOpacity; };
 Tcolor CloudColor( void )   { return cloudColor; };

 // Ask if a line of sight exists between two points with respect to both clouds and terrain
 float CompositLineOfSight( Tpoint *p1, Tpoint *p2 );
 int  CloudLineOfSight( Tpoint *p1, Tpoint *p2 );

 void Update( Tpoint *pos );
 void UpdateMoon();

 void ResetObjectTraversal( void );
 int  GetContainingList( float zValue );

 ObjectDisplayList* ObjectsInTerrain( void ) { return &objectLists[0].displayList; };
 ObjectDisplayList* ObjectsBelowClouds( void ) { return &objectLists[1].displayList; };
 ObjectDisplayList* Clouds( void )    { return &cloudList; };
 ObjectDisplayList* ObjectsInClouds( void )  { return &objectLists[2].displayList; };
 ObjectDisplayList* ObjectsAboveClouds( void ) { return &objectLists[3].displayList; };
 ObjectDisplayList* ObjectsAboveRoof( void ) { return &objectLists[4].displayList; };

 Texture  SunTexture,  GreenSunTexture;
 Texture  MoonTexture, GreenMoonTexture, OriginalMoonTexture;

  protected:
 int   lastDay;    // Used to decide when the moon needs updating

 class LocalWeather *weather;

 int     nObjectLists;
 ObjectListRecord *objectLists;
 ObjectDisplayList cloudList;
 float    cloudOpacity; // 0.0 for no effect, 1.0 when inCloud is TRUE
 Tcolor    cloudColor;

 float terrainFloor;
 float terrainCeiling;
 float cloudBase;
 float cloudTops;
 float roofHeight;
 

  protected:
 void  SetupTextures(void);
 void  ReleaseTextures(void);
 static void TimeUpdateCallback( void *self );
};