diff --git a/Engine/source/math/mAngAxis.h b/Engine/source/math/mAngAxis.h index a61b8e4f6..fd02ad8ec 100644 --- a/Engine/source/math/mAngAxis.h +++ b/Engine/source/math/mAngAxis.h @@ -67,6 +67,8 @@ class AngAxisF inline AngAxisF::AngAxisF() { + axis = Point3F(0.0f,0.0f,1.0f); + angle = 0.0f; } inline AngAxisF::AngAxisF( const Point3F & _axis, F32 _angle ) diff --git a/Engine/source/math/mMatrix.h b/Engine/source/math/mMatrix.h index 71a95946b..5c2f3e8ae 100644 --- a/Engine/source/math/mMatrix.h +++ b/Engine/source/math/mMatrix.h @@ -22,7 +22,7 @@ #ifndef _MMATRIX_H_ #define _MMATRIX_H_ - +#include #ifndef _MPLANE_H_ #include "math/mPlane.h" #endif @@ -232,6 +232,8 @@ inline MatrixF::MatrixF(bool _identity) { if (_identity) identity(); + else + std::fill_n(m, 16, 0); } inline MatrixF::MatrixF( const EulerF &e ) diff --git a/Engine/source/math/mPlane.h b/Engine/source/math/mPlane.h index a67d5c60b..6191251ff 100644 --- a/Engine/source/math/mPlane.h +++ b/Engine/source/math/mPlane.h @@ -66,7 +66,7 @@ class PlaneF : public Point3F /// @name Initialization /// @{ - PlaneF() {} + PlaneF() :d(0.0f) {} PlaneF( const Point3F& p, const Point3F& n ); /// NOTE: d is the NEGATIVE distance along the xyz normal. PlaneF( F32 _x, F32 _y, F32 _z, F32 _d); @@ -571,6 +571,7 @@ public: inline PlaneD::PlaneD() { + d = 0.0; } inline PlaneD:: diff --git a/Engine/source/math/mPlaneSet.h b/Engine/source/math/mPlaneSet.h index 511c7bd92..8c83b01d6 100644 --- a/Engine/source/math/mPlaneSet.h +++ b/Engine/source/math/mPlaneSet.h @@ -76,7 +76,7 @@ class PlaneSet /// Create an uninitialized set. /// @warn None of the members will be initialized. - PlaneSet() {} + PlaneSet() :mNumPlanes(0), mPlanes(NULL) {} /// Use the given set of planes to initialize the set. /// diff --git a/Engine/source/math/mPoint2.h b/Engine/source/math/mPoint2.h index c141400b9..d48fea3c9 100644 --- a/Engine/source/math/mPoint2.h +++ b/Engine/source/math/mPoint2.h @@ -266,8 +266,8 @@ class Point2D //-------------------------------------- Point2I // inline Point2I::Point2I() + :x(0),y(0) { - // } @@ -448,8 +448,8 @@ inline Point2I& Point2I::operator/=(const Point2I &_vec) //-------------------------------------- Point2F // inline Point2F::Point2F() + :x(0.0f), y(0.0f) { - // } @@ -692,8 +692,8 @@ inline void Point2F::normalizeSafe() //-------------------------------------- Point2D // inline Point2D::Point2D() + :x(0.0), y(0.0) { - // } diff --git a/Engine/source/math/mPoint3.h b/Engine/source/math/mPoint3.h index 12af91c4b..c1bb72923 100644 --- a/Engine/source/math/mPoint3.h +++ b/Engine/source/math/mPoint3.h @@ -276,8 +276,8 @@ public: //-------------------------------------- Point3I // inline Point3I::Point3I() + : x(0), y(0), z(0) { - // } inline Point3I::Point3I(const Point3I& _copy) @@ -431,9 +431,7 @@ inline Point3I& Point3I::operator/=(S32 div) //-------------------------------------- Point3F // inline Point3F::Point3F() -#if defined(TORQUE_OS_LINUX) - : x(0.f), y(0.f), z(0.f) -#endif + : x(0.0f), y(0.0f), z(0.0f) { // Uninitialized points are definitely a problem. // Enable the following code to see how often they crop up. @@ -761,6 +759,7 @@ inline Point3F& Point3F::operator=(const Point3D &_vec) //-------------------------------------- Point3D // inline Point3D::Point3D() + : x(0.0), y(0.0), z(0.0) { // } diff --git a/Engine/source/math/mPoint4.h b/Engine/source/math/mPoint4.h index 793ff06fc..6fd371af3 100644 --- a/Engine/source/math/mPoint4.h +++ b/Engine/source/math/mPoint4.h @@ -39,7 +39,7 @@ class Point4I { public: - Point4I() {} + Point4I() :x(0), y(0), z(0), w(0) {} Point4I(S32 _x, S32 _y, S32 _z, S32 _w); void zero(); ///< Zero all values @@ -127,6 +127,7 @@ inline void Point4I::zero() //-------------------------------------- Point4F // inline Point4F::Point4F() + :x(0.0f), y(0.0f), z(0.0f), w(0.0f) { } diff --git a/Engine/source/math/mPolyhedron.h b/Engine/source/math/mPolyhedron.h index 3da780e0c..c52d40b8a 100644 --- a/Engine/source/math/mPolyhedron.h +++ b/Engine/source/math/mPolyhedron.h @@ -98,7 +98,7 @@ struct PolyhedronData /// it defines a *clockwise* orientation for face[ 0 ]. This is important! U32 vertex[ 2 ]; - Edge() {} + Edge() { std::fill_n(face, 2, 0), std::fill_n(vertex, 0, 0); } Edge( U32 face1, U32 face2, U32 vertex1, U32 vertex2 ) { face[ 0 ] = face1; diff --git a/Engine/source/math/mQuat.h b/Engine/source/math/mQuat.h index 261b66a88..d713b405d 100644 --- a/Engine/source/math/mQuat.h +++ b/Engine/source/math/mQuat.h @@ -42,7 +42,7 @@ public: public: F32 x,y,z,w; - QuatF() {} // no init constructor + QuatF() :x(0.0f), y(0.0f), z(0.0f), w(1.0f) {} //identity constructor QuatF( F32 _x, F32 _y, F32 _z, F32 w ); QuatF( const Point3F &axis, F32 angle ); QuatF( const MatrixF & m ); diff --git a/Engine/source/math/mRandom.h b/Engine/source/math/mRandom.h index 632925228..c69c06477 100644 --- a/Engine/source/math/mRandom.h +++ b/Engine/source/math/mRandom.h @@ -33,7 +33,7 @@ class MRandomGenerator { protected: - MRandomGenerator() {} + MRandomGenerator() :mSeed(-1) {} S32 mSeed; public: diff --git a/Engine/source/math/mSphere.h b/Engine/source/math/mSphere.h index 7990f8f21..8f76dce86 100644 --- a/Engine/source/math/mSphere.h +++ b/Engine/source/math/mSphere.h @@ -35,7 +35,7 @@ public: F32 radius; public: - SphereF() { } + SphereF() :radius(1.0f) {} SphereF( const Point3F& in_rPosition, const F32 in_rRadius ) : center(in_rPosition), radius(in_rRadius) diff --git a/Engine/source/math/util/frustum.h b/Engine/source/math/util/frustum.h index 9de0c4c6a..2129abd7d 100644 --- a/Engine/source/math/util/frustum.h +++ b/Engine/source/math/util/frustum.h @@ -186,8 +186,16 @@ struct FrustumData : public PolyhedronData void _update() const; FrustumData() - : mDirty( false ), - mIsInverted( false ) {} + : mIsOrtho(false), + mNearLeft(-1.0f), + mNearRight(1.0f), + mNearTop(1.0f), + mNearBottom(-1.0f), + mNearDist(0.1f), + mFarDist(1.0f), + mTransform(MatrixF(true)), + mDirty( false ), + mIsInverted( false ) {} public: @@ -478,4 +486,4 @@ class Frustum : public PolyhedronImpl< FrustumData > /// @} }; -#endif // _MATHUTIL_FRUSTUM_H_ \ No newline at end of file +#endif // _MATHUTIL_FRUSTUM_H_ diff --git a/Engine/source/math/util/tResponseCurve.h b/Engine/source/math/util/tResponseCurve.h index ad5329bda..cf282acc5 100644 --- a/Engine/source/math/util/tResponseCurve.h +++ b/Engine/source/math/util/tResponseCurve.h @@ -73,7 +73,7 @@ public: struct Sample { - Sample() {} + Sample() :mF(0) { dMemset(&mVal, 0, sizeof(mVal)); } Sample( F32 f, const T &val ) : mF(f), mVal(val) {} F32 mF;