本文整理汇总了C++中AffineTransform::identity方法的典型用法代码示例。如果您正苦于以下问题:C++ AffineTransform::identity方法的具体用法?C++ AffineTransform::identity怎么用?C++ AffineTransform::identity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AffineTransform
的用法示例。
在下文中一共展示了AffineTransform::identity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void PostProcess::update(Actor* actor)
{
_screen = getScreenRect(*actor);
OX_ASSERT(actor->_getStage());
_rt = getRTManager().get(_rt, _screen.getWidth(), _screen.getHeight(), _format);
_transform = actor->computeGlobalTransform().inverted();
IVideoDriver* driver = IVideoDriver::instance;
driver->setRenderTarget(_rt);
Rect vp = _screen;
vp.pos = Point(0, 0);
driver->setViewport(vp);
driver->clear(0);
RenderState rs;
STDMaterial* mat = STDMaterial::instance;
STDRenderer* renderer = mat->getRenderer();
rs.material = mat;
RectF clip = vp.cast<RectF>();
rs.clip = &clip;
renderer->initCoordinateSystem(vp.getWidth(), vp.getHeight(), true);
rs.transform = actor->getParent()->computeGlobalTransform();
if (!(_options._flags & PostProcessOptions::flag_fullscreen))
{
AffineTransform offset;
offset.identity();
offset.translate(-_screen.pos);
rs.transform = rs.transform * offset;
}
mat->Material::render(actor, rs);
mat->finish();
}
示例2: convertPosUp
Vector2 convertPosUp(Actor* src, Actor* dest, const Vector2& pos, bool direction)
{
Vector2 locPos = pos;
AffineTransform t;
t.identity();
//t = src->getTransform();
while (src != dest && src)
{
t = src->getTransform() * t;
src = src->getParent();
}
if (direction)
{
t.x = 0;
t.y = 0;
}
locPos = t.transform(locPos);
return locPos;
}