📄 trpage_geom.h
字号:
void SetPerformerTpPixelSize( float64 ); // Set the transparent Falloff exponent for Performer Lights void SetPerformerTpFalloffExp( float64 ); // Set the transparent scale for Performer Lights void SetPerformerTpScale( float64 ); // Set the transparent clamp for Performer Lights void SetPerformerTpClamp( float64 ); // Set the fog scale for Performer Lights void SetPerformerFogScale( float64 ); // Set the attributes for animated lights void SetAnimationAttr( trpgLightAttr::AnimationAttr& ); // Set the animation period for animated lights void SetAnimationPeriod( float64 ); // Set the animation phase delay for animated lights void SetAnimationPhaseDelay( float64 ); // Set the time on for animated lights void SetAnimationTimeOn( float64 ); // Set the animation vector for animated lights void SetAnimationVector( trpg3dPoint ); // Set the flags for animated lights void SetAnimationFlags( int32 ); // Set the comment for this light point type void SetComment(const char *); // Getters // See the comments for the Setters void GetType( trpgLightAttr::LightType& ); void GetDirectionality( trpgLightAttr::LightDirectionality& ); void GetFrontColor( trpgColor& ); void GetFrontIntensity( float64& ); void GetBackColor( trpgColor& ); void GetBackIntensity( float64& ); void GetNormal( trpg3dPoint& ); void GetSMC( int32& ); void GetFID( int32& ); void GetFlags( int32& ); void GetHLobeAngle( float64& ); void GetVLobeAngle( float64& ); void GetLobeRollAngle( float64& ); void GetLobeFalloff( float64& ); void GetAmbient( float64& ); void GetQuality( trpgLightAttr::LightQuality& ); void GetRascalSignificance( float64& ); void GetRandomIntensity( trpgLightAttr::LightQuality& ); void GetCalligraphicAttr( trpgLightAttr::CalligraphicAttr& ); void GetCalligraphicDrawOrder( int32& ); void GetCalligraphicMinDefocus( float64& ); void GetCalligraphicMaxDefocus( float64& ); void GetPerformerAttr( trpgLightAttr::PerformerAttr& ); void GetPerformerFlags( int32& ); void GetPerformerMinPixelSize( float64& ); void GetPerformerMaxPixelSize( float64& ); void GetPerformerActualSize( float64& ); void GetPerformerTpPixelSize( float64& ); void GetPerformerTpFalloffExp( float64& ); void GetPerformerTpScale( float64& ); void GetPerformerTpClamp( float64& ); void GetPerformerFogScale( float64& ); void GetAnimationAttr( trpgLightAttr::AnimationAttr& ); void GetAnimationPeriod( float64& ); void GetAnimationPhaseDelay( float64& ); void GetAnimationTimeOn( float64& ); void GetAnimationVector( trpg3dPoint& ); void GetAnimationFlags( int32& ); const char *GetComment(); // operators trpgLightAttr& operator = (const trpgLightAttr&); bool operator == (const trpgLightAttr&); bool operator != (const trpgLightAttr&); // Writes this class to a write buffer bool Write(trpgWriteBuffer &); // Reads this class from a read buffer bool Read(trpgReadBuffer &); // Prints this class to a print buffer bool Print(trpgPrintBuffer &) const; // Validity check bool isValid(void) const; // Resets the contents back to empty void Reset(void); protected: struct DataSet { LightType type; LightDirectionality directionality; trpgColor frontColor; float64 frontIntensity; trpgColor backColor; float64 backIntensity; trpg3dPoint normal; int32 smc; int32 fid; int32 flags; float64 horizontalLobeAngle; float64 verticalLobeAngle; float64 lobeRollAngle; float64 lobeFalloff; float64 ambientIntensity; LightQuality quality; LightQuality randomIntensity; float64 rascalSignificance; CalligraphicAttr calligraphicAttr; PerformerAttr performerAttr; AnimationAttr animationAttr; char *commentStr; } data;};/* Lights in TerraPage are called out as separate objects. The trpgLight object will appear in the scenegraph as an individual light structure. These may consist of single lights or light strings. The trpgLight points into the trpgLightTable for its attributes.*/TX_EXDECL class TX_CLDECL trpgLight : public trpgReadWriteable{ public: // Default constructor trpgLight(void); // Copy constructor trpgLight(const trpgLight &); // Destructor ~trpgLight(void); // Set the index pointing into the Light Table void SetAttrIndex(int); // Add a new location this light is located at void AddVertex(trpg3dPoint); // Returns the number of locations, this light is located at void GetNumVertices(uint32 &) const; // Returns the location at a given index bool GetVertex(uint32, trpg3dPoint &) const; // Returns the whole list of vertices bool GetVertices(trpg3dPoint *) const; bool GetVertices(float64 *) const; bool GetVertices(float32 *) const; // Returns the index of the Light Attributes in the Light Table void GetAttrIndex(int &) const; // Validity check bool isValid(void) const; // Resets the contents back to empty void Reset(void); // Writes this class to a write buffer bool Write(trpgWriteBuffer &); // Reads this class from a read buffer bool Read(trpgReadBuffer &); // Prints this class to a print buffer bool Print(trpgPrintBuffer &) const; // operator trpgLight& operator = (const trpgLight &); protected: // Here we store the light locations std::vector<trpg3dPoint> lightPoints; int index;};/* The Light Table is stored in the TerraPage header and consolidates the attributes for all light points. trpgLight structures will index into this table to define their appearance.*/TX_EXDECL class TX_CLDECL trpgLightTable : public trpgReadWriteable{ public: // Default constructor trpgLightTable(void); // Copy constructor trpgLightTable(const trpgLightTable &); // Destructor ~trpgLightTable(void); // Adds the given light attrib to the table and increments the total light attrib count. int AddLightAttr(const trpgLightAttr&); /* This is the same as AddLightAttr except that it searches for a matching light attrib first. This is convenient for writers who aren't keeping track of their own light attrib internally. */ int FindAddLightAttr(const trpgLightAttr&); // Returns the number of light attrib in this table bool GetNumLightAttrs(int &) const; // Returns a pointer to a light attrib from a given index const trpgLightAttr* GetLightAttrRef(int) const; // Validity check bool isValid(void) const; // Resets the contents back to empty void Reset(void); // Writes this class to a write buffer bool Write(trpgWriteBuffer &); // Reads this class from a read buffer bool Read(trpgReadBuffer &); // Prints this class to a print buffer bool Print(trpgPrintBuffer &) const; // operator trpgLightTable & operator = (const trpgLightTable &); typedef std::map<int,trpgLightAttr> LightMapType; LightMapType *getLightMap() { return &lightMap; } protected: // Here we store the light attributes //std::vector<trpgLightAttr> lightList; LightMapType lightMap;};/* Range Info These classes live within the trpgRangeTable. They encapsulate range information that ties trpgLod nodes together. Their purpose is to provide data to the run-time system about the relative priorities of classes of features. See the trpgRangeTable for a complete explanation.*/TX_EXDECL class TX_CLDECL trpgRange : public trpgReadWriteable{ public: trpgRange(void); ~trpgRange(void); // Copy constructor trpgRange(const trpgRange &); // Set the name and subName (can be NULL) void SetCategory(const char *cat,const char *subCat); /* Get the name and subName Name should be the major category (e.g. "trees") SubName should be the minor category (e.g. "big trees") */ void GetCategory(char *cat,int maxCatLen,char *subCat,int maxSubCatLen) const; // Set the lod info void SetLodInfo(double in,double out); // Get the lod info (this will be duplicated in the trpgLod node) // However, you may want to change these values yourself during a run void GetLodInfo(double &in,double &out) const; // Set the priority void SetPriority(int); /* Get the priority. Priority is a hint to the run-time system as to the relative importance of range limited features. Features with lower priorities should be sacrified before those with higher priorities. */ void GetPriority(int &) const; // Writes this class to a write buffer bool Write(trpgWriteBuffer &); // Reads this class from a read buffer bool Read(trpgReadBuffer &); // Prints this class to a print buffer bool Print(trpgPrintBuffer &) const; // Reset back to a clean state void Reset(void); // Equality operator bool operator == (const trpgRange &) const; // Assignment operator trpgRange & operator = (const trpgRange &); protected: double inLod,outLod; char *category; char *subCategory; int priority;};/* The Range Table is new to 2.0. The goal is to provide information about certain classes of features within a TerraPage database. It's intended to solve the following problem. Let's say that you have an Image Generator that must draw a given TerraPage database at 60Hz. However, it's only hitting 30Hz reliably. Often, some feature set (e.g. bushes) must be sacrified in order to reach the target frame rate. Determining which features can be throttled back can often be very difficult. Scaling all of the LODs will often work, but it's not very elegant. It's not selective (you may lose important features as well as unimportant ones) and it doesn't easily let turn whole feature sets off. If you do want to selectively turn features on and off or throttle them back, you can do so based on node names within the LODs. This can work, however you've got the additional overhead of traversing the tree looking for LODs and trying to figure out what the names mean. The range table is intended to make this task easier. Each trpgLod can (but isn't required to) have an index into the Range Table. That index will point to a trpgRange that contains global information about that class of LODs. This includes the in/out information already contained within the LOD as well as global info. The global information includes a category and sub-category as well as an integer priority. The category data is there to allow run-time systems to tell users what they're dropping (or allow them to pick). The priority is there to tell systems what to get rid of first (according to the user who build the TerraPage archive). Priorities are relative to each other within the Range Table. There can be duplicates and there may be holes in the numbering. {group:Read/Write Classes}*/TX_EXDECL class TX_CLDECL trpgRangeTable : public trpgReadWriteable{ public: trpgRangeTable(void); ~trpgRangeTable(void); // Get the given range info bool GetRange(int id,trpgRange &) const; // Get the number of entries in the table int GetNumRanges() {return int(rangeMap.size());} // Set the range info for the given ID bool SetRange(int id,trpgRange &);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -