From b057204933c76ab98a19405331861e12660de42c Mon Sep 17 00:00:00 2001 From: wz <wz_@users.sourceforge.net> Date: Fri, 15 Sep 2006 10:48:19 +0000 Subject: [PATCH] Created accessors for LOD type nodes. Updated NiScreenLODNode in Nif.xml to use 'ProportionLevels'. --- include/obj/NiLODNode.h | 18 ++++++++++++++++ include/obj/NiRangeLODData.h | 15 ++++++++++++- include/obj/NiScreenLODData.h | 33 ++++++++++++++++++++++++++++- src/obj/NiLODNode.cpp | 24 +++++++++++++++++++++ src/obj/NiRangeLODData.cpp | 16 ++++++++++++++ src/obj/NiScreenLODData.cpp | 40 +++++++++++++++++++++++++++++++++++ 6 files changed, 144 insertions(+), 2 deletions(-) diff --git a/include/obj/NiLODNode.h b/include/obj/NiLODNode.h index 6beb4031..778b219c 100644 --- a/include/obj/NiLODNode.h +++ b/include/obj/NiLODNode.h @@ -41,6 +41,24 @@ public: virtual list<NiObjectRef> GetRefs() const; virtual const Type & GetType() const; + /*! + * Point to calculate distance from for switching? + */ + Vector3 GetLodCenter() const; + void SetLodCenter( const Vector3 & value ); + + /*! + * The ranges of distance that each level of detail applies in. + */ + vector<LODRange > GetLodLevels() const; + void SetLodLevels( const vector<LODRange >& value ); + + /*! + * Refers to LOD level information, either distance or screen size based. + */ + Ref<NiLODData > GetRangeData() const; + void SetRangeData( Ref<NiLODData > value ); + protected: NI_L_O_D_NODE_MEMBERS STANDARD_INTERNAL_METHODS diff --git a/include/obj/NiRangeLODData.h b/include/obj/NiRangeLODData.h index 4136f1c3..a6377a9d 100644 --- a/include/obj/NiRangeLODData.h +++ b/include/obj/NiRangeLODData.h @@ -17,7 +17,8 @@ class NiRangeLODData; typedef Ref<NiRangeLODData> NiRangeLODDataRef; /*! - * NiRangeLODData - Describes levels of detail. + * NiRangeLODData - Describes levels of detail based on distance of + * object from camera. */ class NIFLIB_API NiRangeLODData : public NI_RANGE_L_O_D_DATA_PARENT { @@ -36,6 +37,18 @@ public: virtual list<NiObjectRef> GetRefs() const; virtual const Type & GetType() const; + /*! + * ? + */ + Vector3 GetLodCenter() const; + void SetLodCenter( const Vector3 & value ); + + /*! + * The ranges of distance that each level of detail applies in. + */ + vector<LODRange > GetLodLevels() const; + void SetLodLevels( const vector<LODRange >& value ); + protected: NI_RANGE_L_O_D_DATA_MEMBERS STANDARD_INTERNAL_METHODS diff --git a/include/obj/NiScreenLODData.h b/include/obj/NiScreenLODData.h index 34b0c831..5b867338 100644 --- a/include/obj/NiScreenLODData.h +++ b/include/obj/NiScreenLODData.h @@ -13,7 +13,8 @@ class NiScreenLODData; typedef Ref<NiScreenLODData> NiScreenLODDataRef; /*! - * NiScreenLODData - Unknown. + * NiScreenLODData - Describes levels of detail based on size of object + * on screen? */ class NIFLIB_API NiScreenLODData : public NI_SCREEN_L_O_D_DATA_PARENT { @@ -32,6 +33,36 @@ public: virtual list<NiObjectRef> GetRefs() const; virtual const Type & GetType() const; + /*! + * The center of the bounding sphere? + */ + Vector3 GetBoundCenter() const; + void SetBoundCenter( const Vector3 & value ); + + /*! + * The radius of the bounding sphere? + */ + float GetBoundRadius() const; + void SetBoundRadius( float value ); + + /*! + * The center of the bounding sphere in world space? + */ + Vector3 GetWorldCenter() const; + void SetWorldCenter( const Vector3 & value ); + + /*! + * The radius of the bounding sphere in world space? + */ + float GetWorldRadius() const; + void SetWorldRadius( float value ); + + /*! + * The LOD levels based on proportion of screen size? + */ + vector<float > GetProportionLevels() const; + void SetProportionLevels( const vector<float >& value ); + protected: NI_SCREEN_L_O_D_DATA_MEMBERS STANDARD_INTERNAL_METHODS diff --git a/src/obj/NiLODNode.cpp b/src/obj/NiLODNode.cpp index f8b0d5c8..455d2498 100644 --- a/src/obj/NiLODNode.cpp +++ b/src/obj/NiLODNode.cpp @@ -37,3 +37,27 @@ const Type & NiLODNode::GetType() const { return TYPE; }; +Vector3 NiLODNode::GetLodCenter() const { + return lodCenter; +} + +void NiLODNode::SetLodCenter( const Vector3 & value ) { + lodCenter = value; +} + +vector<LODRange > NiLODNode::GetLodLevels() const { + return lodLevels; +} + +void NiLODNode::SetLodLevels( const vector<LODRange >& value ) { + lodLevels = value; +} + +Ref<NiLODData > NiLODNode::GetRangeData() const { + return rangeData; +} + +void NiLODNode::SetRangeData( Ref<NiLODData > value ) { + rangeData = value; +} + diff --git a/src/obj/NiRangeLODData.cpp b/src/obj/NiRangeLODData.cpp index ef33e227..fa169a50 100644 --- a/src/obj/NiRangeLODData.cpp +++ b/src/obj/NiRangeLODData.cpp @@ -36,3 +36,19 @@ const Type & NiRangeLODData::GetType() const { return TYPE; }; +Vector3 NiRangeLODData::GetLodCenter() const { + return lodCenter; +} + +void NiRangeLODData::SetLodCenter( const Vector3 & value ) { + lodCenter = value; +} + +vector<LODRange > NiRangeLODData::GetLodLevels() const { + return lodLevels; +} + +void NiRangeLODData::SetLodLevels( const vector<LODRange >& value ) { + lodLevels = value; +} + diff --git a/src/obj/NiScreenLODData.cpp b/src/obj/NiScreenLODData.cpp index f42cacae..9bcadfc6 100644 --- a/src/obj/NiScreenLODData.cpp +++ b/src/obj/NiScreenLODData.cpp @@ -35,3 +35,43 @@ const Type & NiScreenLODData::GetType() const { return TYPE; }; +Vector3 NiScreenLODData::GetBoundCenter() const { + return boundCenter; +} + +void NiScreenLODData::SetBoundCenter( const Vector3 & value ) { + boundCenter = value; +} + +float NiScreenLODData::GetBoundRadius() const { + return boundRadius; +} + +void NiScreenLODData::SetBoundRadius( float value ) { + boundRadius = value; +} + +Vector3 NiScreenLODData::GetWorldCenter() const { + return worldCenter; +} + +void NiScreenLODData::SetWorldCenter( const Vector3 & value ) { + worldCenter = value; +} + +float NiScreenLODData::GetWorldRadius() const { + return worldRadius; +} + +void NiScreenLODData::SetWorldRadius( float value ) { + worldRadius = value; +} + +vector<float > NiScreenLODData::GetProportionLevels() const { + return proportion; +} + +void NiScreenLODData::SetProportionLevels( const vector<float >& value ) { + proportion = value; +} + -- GitLab