//----------------------------------------------------------------// ZLRect MOAILayoutFrame::GetScissorRect () { ZLRect scissorRect = this->GetFrame (); ZLMatrix4x4 mtx; // TODO: mtx.Init ( this->mLocalToWorldMtx ); //mtx.Append ( MOAIGfxDevice::Get ().GetWorldToWndMtx ( 1.0f, 1.0f )); mtx.Transform ( scissorRect ); return scissorRect; }
//----------------------------------------------------------------// ZLRect MOAIScissorRect::GetScissorRect ( const ZLMatrix4x4& worldToWndMtx ) const { ZLVec3D vtx3D [ 4 ]; vtx3D [ 0 ].mX = this->mRect.mXMin; vtx3D [ 0 ].mY = this->mRect.mYMin; vtx3D [ 0 ].mZ = 0.0f; vtx3D [ 1 ].mX = this->mRect.mXMin; vtx3D [ 1 ].mY = this->mRect.mYMax; vtx3D [ 1 ].mZ = 0.0f; vtx3D [ 2 ].mX = this->mRect.mXMax; vtx3D [ 2 ].mY = this->mRect.mYMax; vtx3D [ 2 ].mZ = 0.0f; vtx3D [ 3 ].mX = this->mRect.mXMax; vtx3D [ 3 ].mY = this->mRect.mYMin; vtx3D [ 3 ].mZ = 0.0f; ZLMatrix4x4 mtx; mtx.Init ( this->GetLocalToWorldMtx ()); mtx.Append ( worldToWndMtx ); mtx.Project ( vtx3D [ 0 ]); mtx.Project ( vtx3D [ 1 ]); mtx.Project ( vtx3D [ 2 ]); mtx.Project ( vtx3D [ 3 ]); ZLRect scissorRect; scissorRect.Init ( vtx3D [ 0 ]); scissorRect.Grow ( vtx3D [ 1 ]); scissorRect.Grow ( vtx3D [ 2 ]); scissorRect.Grow ( vtx3D [ 3 ]); if ( this->mScissorRect ) { ZLRect parentRect = this->mScissorRect->GetScissorRect ( worldToWndMtx ); parentRect.Clip ( scissorRect ); } return scissorRect; }
//----------------------------------------------------------------// void ZLQuaternion::Get ( ZLMatrix4x4& m ) const { ZLAffine3D affine; this->Get ( affine ); m.Init ( affine ); }