Marked some CGizmo functions as const + added a comment

This commit is contained in:
parax0 2015-09-29 04:48:28 -06:00
parent d8ac185656
commit 421e718d07
2 changed files with 28 additions and 27 deletions

View File

@ -69,7 +69,7 @@ void CGizmo::AddToRenderer(CRenderer *pRenderer, const CFrustumPlanes&)
} }
} }
void CGizmo::DrawAsset(ERenderOptions options, u32 asset) void CGizmo::DrawAsset(ERenderOptions /*options*/, u32 asset)
{ {
// Determine which SModelPart array to use // Determine which SModelPart array to use
if (asset >= mNumCurrentParts) return; if (asset >= mNumCurrentParts) return;
@ -464,6 +464,7 @@ bool CGizmo::TransformFromInput(const CRay& ray, CCamera& camera)
// Apply scale // Apply scale
scaleAmount = scaleAmount + mScaleOffset + 1.f; scaleAmount = scaleAmount + mScaleOffset + 1.f;
// A multiplier is applied to the scale amount of it's less than 1 to prevent it from going negative
if (scaleAmount < 1.f) if (scaleAmount < 1.f)
scaleAmount = 1.f / (-(scaleAmount - 1.f) + 1.f); scaleAmount = 1.f / (-(scaleAmount - 1.f) + 1.f);
@ -491,67 +492,67 @@ void CGizmo::EndTransform()
mIsTransforming = false; mIsTransforming = false;
} }
bool CGizmo::IsTransforming() bool CGizmo::IsTransforming() const
{ {
return mIsTransforming; return mIsTransforming;
} }
bool CGizmo::HasTransformed() bool CGizmo::HasTransformed() const
{ {
return mHasTransformed; return mHasTransformed;
} }
CGizmo::EGizmoMode CGizmo::Mode() CGizmo::EGizmoMode CGizmo::Mode() const
{ {
return mMode; return mMode;
} }
ETransformSpace CGizmo::TransformSpace() ETransformSpace CGizmo::TransformSpace() const
{ {
return mTransformSpace; return mTransformSpace;
} }
CVector3f CGizmo::Position() CVector3f CGizmo::Position() const
{ {
return mPosition; return mPosition;
} }
CVector3f CGizmo::DeltaTranslation() CVector3f CGizmo::DeltaTranslation() const
{ {
return mDeltaTranslation; return mDeltaTranslation;
} }
CVector3f CGizmo::TotalTranslation() CVector3f CGizmo::TotalTranslation() const
{ {
return mTotalTranslation; return mTotalTranslation;
} }
CQuaternion CGizmo::Rotation() CQuaternion CGizmo::Rotation() const
{ {
return mRotation; return mRotation;
} }
CQuaternion CGizmo::DeltaRotation() CQuaternion CGizmo::DeltaRotation() const
{ {
return mDeltaRotation; return mDeltaRotation;
} }
CVector3f CGizmo::TotalRotation() CVector3f CGizmo::TotalRotation() const
{ {
return mTotalRotation; return mTotalRotation;
} }
CVector3f CGizmo::Scale() CVector3f CGizmo::Scale() const
{ {
return mScale; return mScale;
} }
CVector3f CGizmo::DeltaScale() CVector3f CGizmo::DeltaScale() const
{ {
return mDeltaScale; return mDeltaScale;
} }
CVector3f CGizmo::TotalScale() CVector3f CGizmo::TotalScale() const
{ {
return mTotalScale; return mTotalScale;
} }

View File

@ -136,20 +136,20 @@ public:
void StartTransform(); void StartTransform();
bool TransformFromInput(const CRay& ray, CCamera& camera); bool TransformFromInput(const CRay& ray, CCamera& camera);
void EndTransform(); void EndTransform();
bool IsTransforming(); bool IsTransforming() const;
bool HasTransformed(); bool HasTransformed() const;
EGizmoMode Mode(); EGizmoMode Mode() const;
ETransformSpace TransformSpace(); ETransformSpace TransformSpace() const;
CVector3f Position(); CVector3f Position() const;
CVector3f DeltaTranslation(); CVector3f DeltaTranslation() const;
CVector3f TotalTranslation(); CVector3f TotalTranslation() const;
CQuaternion Rotation(); CQuaternion Rotation() const;
CQuaternion DeltaRotation(); CQuaternion DeltaRotation() const;
CVector3f TotalRotation(); CVector3f TotalRotation() const;
CVector3f Scale(); CVector3f Scale() const;
CVector3f DeltaScale(); CVector3f DeltaScale() const;
CVector3f TotalScale(); CVector3f TotalScale() const;
void SetMode(EGizmoMode mode); void SetMode(EGizmoMode mode);
void SetTransformSpace(ETransformSpace space); void SetTransformSpace(ETransformSpace space);
void SetPosition(const CVector3f& position); void SetPosition(const CVector3f& position);