CSceneNode: Make use of in-class initializers

Same behavior, less code.
This commit is contained in:
Lioncash 2020-06-09 22:55:23 -04:00
parent 0096b28294
commit d3315bf84f
2 changed files with 14 additions and 26 deletions

View File

@ -13,21 +13,9 @@ uint32 CSceneNode::smNumNodes = 0;
CColor CSceneNode::skSelectionTint = CColor::Integral(39, 154, 167);
CSceneNode::CSceneNode(CScene *pScene, uint32 NodeID, CSceneNode *pParent)
: mpScene(pScene)
: _mID(NodeID)
, mpParent(pParent)
, _mID(NodeID)
, mPosition(CVector3f::skZero)
, mRotation(CQuaternion::skIdentity)
, mScale(CVector3f::skOne)
, _mTransformDirty(true)
, _mInheritsPosition(true)
, _mInheritsRotation(true)
, _mInheritsScale(true)
, mLightLayerIndex(0)
, mLightCount(0)
, mMouseHovering(false)
, mSelected(false)
, mVisible(true)
, mpScene(pScene)
{
smNumNodes++;

View File

@ -71,11 +71,11 @@ class CSceneNode : public IRenderable
private:
mutable CTransform4f _mCachedTransform;
mutable CAABox _mCachedAABox;
mutable bool _mTransformDirty;
mutable bool _mTransformDirty = true;
bool _mInheritsPosition;
bool _mInheritsRotation;
bool _mInheritsScale;
bool _mInheritsPosition = true;
bool _mInheritsRotation = true;
bool _mInheritsScale = true;
uint32 _mID;
@ -85,18 +85,18 @@ protected:
CSceneNode *mpParent;
CScene *mpScene;
CVector3f mPosition;
CQuaternion mRotation;
CVector3f mScale;
CVector3f mPosition{CVector3f::skZero};
CQuaternion mRotation{CQuaternion::skIdentity};
CVector3f mScale{CVector3f::skOne};
CAABox mLocalAABox;
bool mMouseHovering;
bool mSelected;
bool mVisible;
bool mMouseHovering = false;
bool mSelected = false;
bool mVisible = true;
std::list<CSceneNode*> mChildren;
uint32 mLightLayerIndex;
uint32 mLightCount;
uint32 mLightLayerIndex = 0;
uint32 mLightCount = 0;
CLight* mLights[8];
CColor mAmbientColor;