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

Re-exposed IDENTITY constants and marked then NIFLIB_API. Now you must use...

Re-exposed IDENTITY constants and marked then NIFLIB_API.  Now you must use MatrixXX::IDENTITY instead of MatrixXX::Identity() again.
parent fcd84977
No related branches found
No related tags found
No related merge requests found
......@@ -316,8 +316,8 @@ struct NIFLIB_API Float2 {
/*! Stores a 2 by 2 matrix used for bump maps. */
struct Matrix22 {
/*! Get the 2x2 identity matrix */
NIFLIB_API static const Matrix22 & Identity();
/*! The 2x2 identity matrix constant */
NIFLIB_API static const Matrix22 IDENTITY;
Float2 rows[2]; /*!< The two rows of Float2 structures which hold two floating point numbers each. */
......@@ -372,9 +372,6 @@ struct Matrix22 {
throw std::out_of_range("Index out of range for MatrixRow3");
return rows[n];
}
private:
/*! The 2x2 identity matrix constant */
static const Matrix22 IDENTITY;
};
/* Stores three floating point numbers. Used as a row of a Matrix33 and to store the data in attr_vector3 and attr_color3 type attributes. */
......@@ -435,8 +432,8 @@ struct NIFLIB_API Float3 {
/*! Stores a 3 by 3 matrix used for rotation. */
struct Matrix33 {
/*! Returns the 3x3 identity matrix */
NIFLIB_API static const Matrix33 & Identity();
/*! The 3x3 identity matrix constant*/
NIFLIB_API static const Matrix33 IDENTITY;
Float3 rows[3]; /*!< The three rows of Float3 structures which hold three floating point numbers each. */
......@@ -524,10 +521,6 @@ struct Matrix33 {
throw std::out_of_range("Index out of range for MatrixRow3");
return rows[n];
}
private:
/*! The 3x3 identity matrix constant*/
static const Matrix33 IDENTITY;
};
......@@ -593,9 +586,9 @@ struct NIFLIB_API Float4 {
/*! Stores a 4 by 4 matrix used for combined transformations. */
struct Matrix44 {
/*! Returns the 4x4 identity matrix */
NIFLIB_API static const Matrix44 & Identity();
/*! The 4x4 identity matrix constant */
NIFLIB_API static const Matrix44 IDENTITY;
Float4 rows[4]; /*!< The three rows of Float3 structures which hold three floating point numbers each. */
//These operators cause SWIG warnings
......@@ -815,10 +808,6 @@ struct Matrix44 {
throw std::out_of_range("Index out of range for Matrix44");
return rows[n];
}
private:
/*! The 4x4 identity matrix constant */
static const Matrix44 IDENTITY;
};
/*! Stores a color along with alpha translucency */
......
......@@ -12,25 +12,13 @@ const Matrix44 Matrix44::IDENTITY( 1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f );
const Matrix44 & Matrix44::Identity() {
return IDENTITY;
};
const Matrix33 Matrix33::IDENTITY( 1.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 1.0f );
const Matrix33 & Matrix33::Identity() {
return IDENTITY;
};
const Matrix22 Matrix22::IDENTITY( 1.0f, 0.0f,
0.0f, 1.0f );
const Matrix22 & Matrix22::Identity() {
return IDENTITY;
};
/* TexCoord Methods
*
*/
......@@ -162,7 +150,7 @@ Vector3 Vector3::CrossProduct( const Vector3 & rh) const {
*/
Matrix22::Matrix22() {
*this = Matrix22::Identity();
*this = Matrix22::IDENTITY;
}
/*
......@@ -170,7 +158,7 @@ Matrix22::Matrix22() {
*/
Matrix33::Matrix33() {
*this = Matrix33::Identity();
*this = Matrix33::IDENTITY;
}
Quaternion Matrix33::AsQuaternion() {
......@@ -241,7 +229,7 @@ Matrix33 Matrix33::operator*( const Matrix33 & m ) const
*/
Matrix44::Matrix44() {
*this = Matrix44::Identity();
*this = Matrix44::IDENTITY;
}
Matrix44::Matrix44( const Matrix33 & r ) {
......
......@@ -144,7 +144,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 );
......@@ -266,7 +266,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.
......
......@@ -239,7 +239,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 {
......@@ -263,7 +263,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