本文整理汇总了C++中USRect::Clip方法的典型用法代码示例。如果您正苦于以下问题:C++ USRect::Clip方法的具体用法?C++ USRect::Clip怎么用?C++ USRect::Clip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类USRect
的用法示例。
在下文中一共展示了USRect::Clip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetScissorRect
//----------------------------------------------------------------//
USRect MOAIScissorRect::GetScissorRect ( const USMatrix4x4& worldToWndMtx ) const {
USVec3D 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;
USMatrix4x4 mtx;
mtx.Init ( this->GetLocalToWorldMtx ());
mtx.Append ( worldToWndMtx );
mtx.Project ( vtx3D [ 0 ]);
mtx.Project ( vtx3D [ 1 ]);
mtx.Project ( vtx3D [ 2 ]);
mtx.Project ( vtx3D [ 3 ]);
USRect scissorRect;
scissorRect.Init ( vtx3D [ 0 ]);
scissorRect.Grow ( vtx3D [ 1 ]);
scissorRect.Grow ( vtx3D [ 2 ]);
scissorRect.Grow ( vtx3D [ 3 ]);
if ( this->mScissorRect ) {
USRect parentRect = this->mScissorRect->GetScissorRect ( worldToWndMtx );
parentRect.Clip ( scissorRect );
}
return scissorRect;
}