IMatrix INodeLight::GetProjectionMatrix(int i) { IMatrix invRot; //Spot /*invRot = GetRotationMatrix4x4(); invRot.Inv(invRot);*/ //Omni if (i==0) { invRot.MakeIdentity(); invRot=AngleYToMatrix4x4(0); }else if (i==1) { invRot=AngleYToMatrix4x4(I_PIE); }else if (i==2) { invRot=AngleYToMatrix4x4(I_PIE/2.0); }else if (i==3) { invRot=AngleYToMatrix4x4(-I_PIE/2.0); }else if (i==4) { invRot=AngleXToMatrix4x4(I_PIE/2.0); }else if (i==5) { invRot=AngleXToMatrix4x4(-I_PIE/2.0); } IMatrix mat = GetPerspectiveMatrix(90,1,m_fRadius,0.01)*invRot*TranslationToMatrix(-GetPosition()); return mat; }
// build pivot TRS transformation matrix GMatrix33 GAnimTRSNode2D::PivotMatrix() const { // build translation factor GMatrix33 translation; TranslationToMatrix(translation, -gPivotPosition); // build rotation factor GMatrix33 rotation; RotationToMatrix(rotation, gPivotRotation); // build scale factor GMatrix33 scale; ScaleToMatrix(scale, gPivotScale); // return the resulting matrix (first scale, then rotation and finally translation) return (translation * (rotation * scale)); }
// get pivot inverse matrix only GMatrix33 GAnimTRSNode2D::InversePivotMatrix() const { // build (inverse) translation factor GMatrix33 invTranslation; TranslationToMatrix(invTranslation, gPivotPosition); // build (inverse) rotation factor GMatrix33 invRotation; RotationToMatrix(invRotation, -gPivotRotation); // build (inverse) scale factor GMatrix33 invScale; GVector2 tmpScale(gPivotScale); if (GMath::Abs(tmpScale[G_X]) > G_EPSILON) tmpScale[G_X] = 1 / tmpScale[G_X]; if (GMath::Abs(tmpScale[G_Y]) > G_EPSILON) tmpScale[G_Y] = 1 / tmpScale[G_Y]; ScaleToMatrix(invScale, tmpScale); // return the resulting (inverse) matrix return (invScale * (invRotation * invTranslation)); }
void QGLWidgetTest::TestLinearGradient(const GUInt32 TestIndex, const GReal RotAngle, const GReal Scale) { GUInt32 idx = (TestIndex % 4); GMatrix33 ofsTransf, m; GMatrix33 rot, scl, preTrans, postTrans; TranslationToMatrix(preTrans, GPoint2(-120, -88)); TranslationToMatrix(postTrans, GPoint2(120, 88)); RotationToMatrix(rot, RotAngle); ScaleToMatrix(scl, GVector2(Scale, Scale)); ofsTransf = (postTrans * (rot * (scl * preTrans))); gDrawBoard->SetTargetMode(G_COLOR_MODE); gDrawBoard->SetStrokePaintType(G_COLOR_PAINT_TYPE); gDrawBoard->SetStrokeStyle(G_SOLID_STROKE); gDrawBoard->SetStrokeJoinStyle(G_MITER_JOIN); gDrawBoard->SetStrokeEnabled(G_TRUE); gDrawBoard->SetStrokeWidth(4); gDrawBoard->SetStrokeColor(GVector4(0.0, 0.0, 0.0, 1.000)); gDrawBoard->SetFillEnabled(G_TRUE); gDrawBoard->SetFillPaintType(G_GRADIENT_PAINT_TYPE); // OPAQUE if (idx == 0) { gDrawBoard->SetFillColor(GVector4(0.0, 0.0, 0.0, 1.0)); // -------------------------------------------------------------- gLinGrad1->SetColorInterpolation(G_HERMITE_COLOR_INTERPOLATION); gLinGrad1->SetSpreadMode(G_PAD_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+20,+18,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(20, 18), GPoint2(260, 194)); gLinGrad1->SetSpreadMode(G_REPEAT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+280,+18,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(280, 18), GPoint2(520, 194)); gLinGrad1->SetSpreadMode(G_REFLECT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+540,+18,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(540, 18), GPoint2(780, 194)); // -------------------------------------------------------------- gLinGrad1->SetColorInterpolation(G_LINEAR_COLOR_INTERPOLATION); gLinGrad1->SetSpreadMode(G_PAD_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+20,+212,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(20, 212), GPoint2(260, 388)); gLinGrad1->SetSpreadMode(G_REPEAT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+280,+212,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(280, 212), GPoint2(520, 388)); gLinGrad1->SetSpreadMode(G_REFLECT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+540,+212,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(540, 212), GPoint2(780, 388)); // -------------------------------------------------------------- gLinGrad1->SetColorInterpolation(G_CONSTANT_COLOR_INTERPOLATION); gLinGrad1->SetSpreadMode(G_PAD_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+20,+406,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(20, 406), GPoint2(260, 582)); gLinGrad1->SetSpreadMode(G_REPEAT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+280,+406,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(280, 406), GPoint2(520, 582)); gLinGrad1->SetSpreadMode(G_REFLECT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+540,+406,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(540, 406), GPoint2(780, 582)); // -------------------------------------------------------------- } else if (idx == 1) { // TRANSPARENT gDrawBoard->SetFillColor(GVector4(0.0, 0.0, 0.0, 0.5)); // -------------------------------------------------------------- gLinGrad1->SetColorInterpolation(G_HERMITE_COLOR_INTERPOLATION); gLinGrad1->SetSpreadMode(G_PAD_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+20,+18,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(20, 18), GPoint2(260, 194)); gLinGrad1->SetSpreadMode(G_REPEAT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+280,+18,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(280, 18), GPoint2(520, 194)); gLinGrad1->SetSpreadMode(G_REFLECT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+540,+18,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(540, 18), GPoint2(780, 194)); // -------------------------------------------------------------- gLinGrad1->SetColorInterpolation(G_LINEAR_COLOR_INTERPOLATION); gLinGrad1->SetSpreadMode(G_PAD_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+20,+212,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(20, 212), GPoint2(260, 388)); gLinGrad1->SetSpreadMode(G_REPEAT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+280,+212,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(280, 212), GPoint2(520, 388)); gLinGrad1->SetSpreadMode(G_REFLECT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+540,+212,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(540, 212), GPoint2(780, 388)); // -------------------------------------------------------------- gLinGrad1->SetColorInterpolation(G_CONSTANT_COLOR_INTERPOLATION); gLinGrad1->SetSpreadMode(G_PAD_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+20,+406,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(20, 406), GPoint2(260, 582)); gLinGrad1->SetSpreadMode(G_REPEAT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+280,+406,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(280, 406), GPoint2(520, 582)); gLinGrad1->SetSpreadMode(G_REFLECT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+540,+406,0)); gLinGrad1->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad1); gDrawBoard->DrawRectangle(GPoint2(540, 406), GPoint2(780, 582)); // -------------------------------------------------------------- } else if (idx == 2) { // TRANSPARENT IN KEYS gDrawBoard->SetFillColor(GVector4(0.0, 0.0, 0.0, 1.0)); // -------------------------------------------------------------- gLinGrad2->SetColorInterpolation(G_HERMITE_COLOR_INTERPOLATION); gLinGrad2->SetSpreadMode(G_PAD_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+20,+18,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(20, 18), GPoint2(260, 194)); gLinGrad2->SetSpreadMode(G_REPEAT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+280,+18,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(280, 18), GPoint2(520, 194)); gLinGrad2->SetSpreadMode(G_REFLECT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+540,+18,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(540, 18), GPoint2(780, 194)); // -------------------------------------------------------------- gLinGrad2->SetColorInterpolation(G_LINEAR_COLOR_INTERPOLATION); gLinGrad2->SetSpreadMode(G_PAD_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+20,+212,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(20, 212), GPoint2(260, 388)); gLinGrad2->SetSpreadMode(G_REPEAT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+280,+212,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(280, 212), GPoint2(520, 388)); gLinGrad2->SetSpreadMode(G_REFLECT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+540,+212,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(540, 212), GPoint2(780, 388)); // -------------------------------------------------------------- gLinGrad2->SetColorInterpolation(G_CONSTANT_COLOR_INTERPOLATION); gLinGrad2->SetSpreadMode(G_PAD_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+20,+406,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(20, 406), GPoint2(260, 582)); gLinGrad2->SetSpreadMode(G_REPEAT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+280,+406,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(280, 406), GPoint2(520, 582)); gLinGrad2->SetSpreadMode(G_REFLECT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+540,+406,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(540, 406), GPoint2(780, 582)); // -------------------------------------------------------------- } else { // TRANSPARENT IN KEYS AND COLOR gDrawBoard->SetFillColor(GVector4(0.0, 0.0, 0.0, 0.5)); // -------------------------------------------------------------- gLinGrad2->SetColorInterpolation(G_HERMITE_COLOR_INTERPOLATION); gLinGrad2->SetSpreadMode(G_PAD_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+20,+18,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(20, 18), GPoint2(260, 194)); gLinGrad2->SetSpreadMode(G_REPEAT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+280,+18,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(280, 18), GPoint2(520, 194)); gLinGrad2->SetSpreadMode(G_REFLECT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+540,+18,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(540, 18), GPoint2(780, 194)); // -------------------------------------------------------------- gLinGrad2->SetColorInterpolation(G_LINEAR_COLOR_INTERPOLATION); gLinGrad2->SetSpreadMode(G_PAD_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+20,+212,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(20, 212), GPoint2(260, 388)); gLinGrad2->SetSpreadMode(G_REPEAT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+280,+212,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(280, 212), GPoint2(520, 388)); gLinGrad2->SetSpreadMode(G_REFLECT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+540,+212,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(540, 212), GPoint2(780, 388)); // -------------------------------------------------------------- gLinGrad2->SetColorInterpolation(G_CONSTANT_COLOR_INTERPOLATION); gLinGrad2->SetSpreadMode(G_PAD_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+20,+406,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(20, 406), GPoint2(260, 582)); gLinGrad2->SetSpreadMode(G_REPEAT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+280,+406,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(280, 406), GPoint2(520, 582)); gLinGrad2->SetSpreadMode(G_REFLECT_COLOR_RAMP_SPREAD); TranslationToMatrix(m, GVector3(+540,+406,0)); gLinGrad2->SetMatrix(m * ofsTransf); gDrawBoard->SetFillGradient(gLinGrad2); gDrawBoard->DrawRectangle(GPoint2(540, 406), GPoint2(780, 582)); // -------------------------------------------------------------- } }
void QGLWidgetTest::BuildShape(const GFloat RadAngle1, const GFloat RadAngle2, const GFloat RadAngle3) { GMatrix33 preTrans, postTrans, rot; GMatrix33 finalMatrix; // rotation pivot is at (8, 8) TranslationToMatrix(preTrans, GVector2(-8, -8)); TranslationToMatrix(postTrans, GVector2(8, 8)); gContoursPoints.clear(); gContoursIndexes.clear(); // little cross RotationToMatrix(rot, (GReal)RadAngle1); finalMatrix = (postTrans * rot) * preTrans; gContoursPoints.push_back(finalMatrix * GPoint2(6, 7)); gContoursPoints.push_back(finalMatrix * GPoint2(7, 8)); gContoursPoints.push_back(finalMatrix * GPoint2(6, 9)); gContoursPoints.push_back(finalMatrix * GPoint2(7, 10)); gContoursPoints.push_back(finalMatrix * GPoint2(8, 9)); gContoursPoints.push_back(finalMatrix * GPoint2(9, 10)); gContoursPoints.push_back(finalMatrix * GPoint2(10, 9)); gContoursPoints.push_back(finalMatrix * GPoint2(9, 8)); gContoursPoints.push_back(finalMatrix * GPoint2(10, 7)); gContoursPoints.push_back(finalMatrix * GPoint2(9, 6)); gContoursPoints.push_back(finalMatrix * GPoint2(8, 7)); gContoursPoints.push_back(finalMatrix * GPoint2(7, 6)); gContoursIndexes.push_back(12); // big cross RotationToMatrix(rot, (GReal)RadAngle2); finalMatrix = (postTrans * rot) * preTrans; gContoursPoints.push_back(finalMatrix * GPoint2(2, 6)); gContoursPoints.push_back(finalMatrix * GPoint2(2, 10)); gContoursPoints.push_back(finalMatrix * GPoint2(6, 10)); gContoursPoints.push_back(finalMatrix * GPoint2(6, 14)); gContoursPoints.push_back(finalMatrix * GPoint2(10, 14)); gContoursPoints.push_back(finalMatrix * GPoint2(10, 10)); gContoursPoints.push_back(finalMatrix * GPoint2(14, 10)); gContoursPoints.push_back(finalMatrix * GPoint2(14, 6)); gContoursPoints.push_back(finalMatrix * GPoint2(10, 6)); gContoursPoints.push_back(finalMatrix * GPoint2(10, 2)); gContoursPoints.push_back(finalMatrix * GPoint2(6, 2)); gContoursPoints.push_back(finalMatrix * GPoint2(6, 6)); gContoursIndexes.push_back(12); // star RotationToMatrix(rot, (GReal)RadAngle3); finalMatrix = (postTrans * rot) * preTrans; gContoursPoints.push_back(finalMatrix * GPoint2(2, 2)); gContoursPoints.push_back(finalMatrix * GPoint2(5, 8)); gContoursPoints.push_back(finalMatrix * GPoint2(2, 14)); gContoursPoints.push_back(finalMatrix * GPoint2(8, 11)); gContoursPoints.push_back(finalMatrix * GPoint2(14, 14)); gContoursPoints.push_back(finalMatrix * GPoint2(11, 8)); gContoursPoints.push_back(finalMatrix * GPoint2(14, 2)); gContoursPoints.push_back(finalMatrix * GPoint2(8, 5)); gContoursIndexes.push_back(8); // square gContoursPoints.push_back(GPoint2(1, 1)); gContoursPoints.push_back(GPoint2(1, 15)); gContoursPoints.push_back(GPoint2(15, 15)); gContoursPoints.push_back(GPoint2(15, 1)); gContoursIndexes.push_back(4); }
GMatrix33 GAnimTRSNode2D::InverseMatrix(const GTimeValue TimePos, const GSpaceSystem Space, GTimeInterval& ValidInterval) const { GProperty *tmpProp = Property("transform"); // this can be the case of a curve not created through a kernel if (!tmpProp) { ValidInterval = G_FOREVER_TIMEINTERVAL; return GMatrix33(); } GMatrix33 invTranslation; GMatrix33 invRotation; GMatrix33 invScale; GTimeInterval tmpValid = G_FOREVER_TIMEINTERVAL; GKeyValue xValue, yValue; GError xErr, yErr; GProperty *transProp = tmpProp->Property("position"); GProperty *rotProp = tmpProp->Property("rotation"); GProperty *scaleProp = tmpProp->Property("scale"); G_ASSERT(transProp != NULL); G_ASSERT(rotProp != NULL); G_ASSERT(scaleProp != NULL); // extract translation GProperty *xProp = transProp->Property("x"); GProperty *yProp = transProp->Property("y"); G_ASSERT(xProp != NULL); G_ASSERT(yProp != NULL); // build translation factor xErr = xProp->Value(xValue, tmpValid, TimePos, G_ABSOLUTE_VALUE); yErr = yProp->Value(yValue, tmpValid, TimePos, G_ABSOLUTE_VALUE); if (xErr != G_NO_ERROR || yErr != G_NO_ERROR) return GMatrix33(); TranslationToMatrix(invTranslation, GVector2(-xValue.RealValue(), -yValue.RealValue())); // build rotation factor xErr = rotProp->Value(xValue, tmpValid, TimePos, G_ABSOLUTE_VALUE); if (xErr != G_NO_ERROR) return GMatrix33(); RotationToMatrix(invRotation, -xValue.RealValue()); // extract scale xProp = scaleProp->Property("x"); yProp = scaleProp->Property("y"); G_ASSERT(xProp != NULL); G_ASSERT(yProp != NULL); // build scale factor xErr = xProp->Value(xValue, tmpValid, TimePos, G_ABSOLUTE_VALUE); yErr = yProp->Value(yValue, tmpValid, TimePos, G_ABSOLUTE_VALUE); if (xErr != G_NO_ERROR || yErr != G_NO_ERROR) return GMatrix33(); GPoint2 tmpScale(1, 1); if (GMath::Abs(xValue.RealValue()) > G_EPSILON) tmpScale[G_X] = 1 / xValue.RealValue(); if (GMath::Abs(yValue.RealValue()) > G_EPSILON) tmpScale[G_Y] = 1 / yValue.RealValue(); ScaleToMatrix(invScale, tmpScale); ValidInterval = tmpValid; // take care of father GMatrix33 invLocalMatrix = (invScale * (invRotation * invTranslation)); if (gFather && Space == G_WORLD_SPACE) { GMatrix33 invFatherMatrix = gFather->InverseMatrix(TimePos, G_WORLD_SPACE, tmpValid); ValidInterval &= tmpValid; return (invLocalMatrix * invFatherMatrix); } return invLocalMatrix; }