Fixed control point overlay position.

This commit is contained in:
leo 2016-04-02 23:11:39 +00:00
parent 2842cccf53
commit 3beec440a2

View file

@ -457,12 +457,29 @@ public:
} }
lcVector3 GetRotationCenter() const lcVector3 GetRotationCenter() const
{
lcuint32 Section = GetFocusSection();
if (Section == LC_PIECE_SECTION_POSITION || Section == LC_PIECE_SECTION_INVALID)
{ {
if (mState & LC_PIECE_PIVOT_POINT_VALID) if (mState & LC_PIECE_PIVOT_POINT_VALID)
return lcMul31(mPivotMatrix.GetTranslation(), mModelWorld); return lcMul31(mPivotMatrix.GetTranslation(), mModelWorld);
else else
return mModelWorld.GetTranslation(); return mModelWorld.GetTranslation();
} }
else
{
int ControlPointIndex = Section - LC_PIECE_SECTION_CONTROL_POINT_1;
if (ControlPointIndex >= 0 && ControlPointIndex < mControlPoints.GetSize())
{
lcMatrix44& Transform = mControlPoints[ControlPointIndex].Transform;
return lcMul31(Transform.GetTranslation(), mModelWorld);
}
return mModelWorld.GetTranslation();
}
}
lcMatrix33 GetRelativeRotation() const lcMatrix33 GetRelativeRotation() const
{ {