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); CColor CSceneNode::skSelectionTint = CColor::Integral(39, 154, 167);
CSceneNode::CSceneNode(CScene *pScene, uint32 NodeID, CSceneNode *pParent) CSceneNode::CSceneNode(CScene *pScene, uint32 NodeID, CSceneNode *pParent)
: mpScene(pScene) : _mID(NodeID)
, mpParent(pParent) , mpParent(pParent)
, _mID(NodeID) , mpScene(pScene)
, 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)
{ {
smNumNodes++; smNumNodes++;

View File

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