Skip to content
Snippets Groups Projects
Commit 4c7646cb authored by Shon Ferguson's avatar Shon Ferguson
Browse files

Fixed Matrix44 so IDENTITY is private, and made other necessary changes due to this.

Made Header and Footer functions NIFLIB_HIDDEN.
Fixed comment on NIF version 3.1
A manual change by Amorilia to the generated Header.cpp and Footer.cpp files was overwritten.  This needs to be fixed in the Python script.
parent 596afdf0
No related branches found
No related tags found
No related merge requests found
......@@ -37,9 +37,9 @@ struct Footer {
* Bip Head node).
*/
vector<Ref<NiObject > > roots;
void Read( istream& in, list<unsigned int> & link_stack, unsigned int version, unsigned int user_version );
void Write( ostream& out, const map<NiObjectRef,unsigned int> & link_map, unsigned int version, unsigned int user_version ) const;
string asString( bool verbose = false ) const;
NIFLIB_HIDDEN void Read( istream& in, list<unsigned int> & link_stack, unsigned int version, unsigned int user_version );
NIFLIB_HIDDEN void Write( ostream& out, const map<NiObjectRef,unsigned int> & link_map, unsigned int version, unsigned int user_version ) const;
NIFLIB_HIDDEN string asString( bool verbose = false ) const;
};
}
......
......@@ -31,7 +31,7 @@ struct Header {
/*!
* Unknown.
*/
vector<LineString > copyright;
array<3,LineString > copyright;
/*!
* The NIF version, in hexadecimal notation: 0x04000002, 0x0401000C,
* 0x04020002, 0x04020100, 0x04020200, 0x0A000100, 0x0A010000,
......@@ -88,9 +88,9 @@ struct Header {
* Unknown.
*/
unsigned int unknownInt2;
void Read( istream& in );
void Write( ostream& out ) const;
string asString( bool verbose = false ) const;
NIFLIB_HIDDEN void Read( istream& in );
NIFLIB_HIDDEN void Write( ostream& out ) const;
NIFLIB_HIDDEN string asString( bool verbose = false ) const;
};
}
......
......@@ -816,6 +816,7 @@ struct Matrix44 {
return rows[n];
}
private:
/*! The 4x4 identity matrix constant */
static const Matrix44 IDENTITY;
};
......
......@@ -8,7 +8,7 @@ All rights reserved. Please see niflib.h for licence. */
namespace Niflib {
const unsigned VER_3_1 = 0x03010000; /*!< NIF Version 3.3.0.13 */
const unsigned VER_3_1 = 0x03010000; /*!< NIF Version 3.1 */
const unsigned VER_3_3_0_13 = 0x0303000D; /*!< NIF Version 3.3.0.13 */
const unsigned VER_4_0_0_0 = 0x04000000; /*!< NIF Version 4.0.0.0 */
const unsigned VER_4_0_0_2 = 0x04000002; /*!< NIF Version 4.0.0.2 */
......
......@@ -5,7 +5,7 @@ All rights reserved. Please see niflib.h for licence. */
using namespace Niflib;
//Constructor
Header::Header() : version((unsigned int)0x04000002), endianType((byte)1), userVersion((unsigned int)0), numBlocks((unsigned int)0), userVersion2((unsigned int)0), numBlockTypes((unsigned short)0), unknownInt2((unsigned int)0), copyright(3) {};
Header::Header() : version((unsigned int)0x04000002), endianType((byte)1), userVersion((unsigned int)0), numBlocks((unsigned int)0), userVersion2((unsigned int)0), numBlockTypes((unsigned short)0), unknownInt2((unsigned int)0) {};
//Copy Constructor
Header::Header( const Header & src ) {
......
......@@ -162,7 +162,7 @@ Vector3 Vector3::CrossProduct( const Vector3 & rh) const {
*/
Matrix22::Matrix22() {
*this = Matrix22::IDENTITY;
*this = Matrix22::Identity();
}
/*
......@@ -170,7 +170,7 @@ Matrix22::Matrix22() {
*/
Matrix33::Matrix33() {
*this = Matrix33::IDENTITY;
*this = Matrix33::Identity();
}
Quaternion Matrix33::AsQuaternion() {
......@@ -241,7 +241,7 @@ Matrix33 Matrix33::operator*( const Matrix33 & m ) const
*/
Matrix44::Matrix44() {
*this = Matrix44::IDENTITY;
*this = Matrix44::Identity();
}
Matrix44::Matrix44( const Matrix33 & r ) {
......
......@@ -210,7 +210,7 @@ void NiGeometry::ApplySkinOffset() {
this->ApplyTransforms();
//Set the skin overall transform to the identity
skinInstance->GetSkinData()->SetOverallTransform( Matrix44::IDENTITY );
skinInstance->GetSkinData()->SetOverallTransform( Matrix44::Identity() );
//Reset skin offsets
skinInstance->GetSkinData()->ResetOffsets( this );
......@@ -352,7 +352,7 @@ void NiGeometry::ApplyTransforms() {
geom_data->Transform( this->GetLocalTransform() );
//Now that the transforms have been applied, clear them to the identity
this->SetLocalTransform( Matrix44::IDENTITY );
this->SetLocalTransform( Matrix44::Identity() );
}
// Calculate bounding sphere using minimum-volume axis-align bounding box. Its fast but not a very good fit.
......
......@@ -221,7 +221,7 @@ void NiNode::PropagateTransform() {
}
//Nowthat the transforms have been propogated, clear them out
this->SetLocalTransform( Matrix44::IDENTITY );
this->SetLocalTransform( Matrix44::Identity() );
}
bool NiNode::IsSplitMeshProxy() const {
......@@ -245,7 +245,7 @@ bool NiNode::IsSplitMeshProxy() const {
if ( children[i]->IsDerivedType( NiTriBasedGeom::TypeConst() ) == false ) {
return false;
}
if ( children[i]->GetLocalTransform() != Matrix44::IDENTITY ) {
if ( children[i]->GetLocalTransform() != Matrix44::Identity() ) {
return false;
}
if ( children[i]->GetVisibility() == false ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment