本文整理汇总了C++中PhysicalProperties::getZ方法的典型用法代码示例。如果您正苦于以下问题:C++ PhysicalProperties::getZ方法的具体用法?C++ PhysicalProperties::getZ怎么用?C++ PhysicalProperties::getZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhysicalProperties
的用法示例。
在下文中一共展示了PhysicalProperties::getZ方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addSpriteToRenderList
void SpriteManager::addSpriteToRenderList(AnimatedSprite *sprite,
RenderList *renderList,
Viewport *viewport)
{
// GET THE SPRITE TYPE INFO FOR THIS SPRITE
AnimatedSpriteType *spriteType = sprite->getSpriteType();
PhysicalProperties *pp = sprite->getPhysicalProperties();
if (i >= 3) {
b2Body* bods= sprite->getBody();
b2Vec2 position = bods->GetPosition();
pp->setX(position.x);
pp->setY(position.y);
}
i+=1;
// IS THE SPRITE VIEWABLE?
if (viewport->areWorldCoordinatesInViewport(
pp->getX(),
pp->getY(),
spriteType->getTextureWidth(),
spriteType->getTextureHeight()) )
{
// SINCE IT'S VIEWABLE, ADD IT TO THE RENDER LIST
RenderItem itemToAdd;
itemToAdd.id = sprite->getFrameIndex();
if (spriteType->getTextureWidth()==61) {
renderList->addRenderItem( sprite->getCurrentImageID(),
pp->round(X-viewport->getViewportX()),
pp->round(Y-25-viewport->getViewportY()),
pp->round(pp->getZ()),
sprite->getAlpha(),
spriteType->getTextureWidth(),
spriteType->getTextureHeight());
}
else {
renderList->addRenderItem( sprite->getCurrentImageID(),
pp->round(pp->getX()-viewport->getViewportX()),
pp->round(pp->getY()-viewport->getViewportY()),
pp->round(pp->getZ()),
sprite->getAlpha(),
spriteType->getTextureWidth(),
spriteType->getTextureHeight());
}
}
}
示例2: addSpriteToRenderList
/*
addSpriteToRenderList - This method checks to see if the sprite
parameter is inside the viewport. If it is, a RenderItem is generated
for that sprite and it is added to the render list.
*/
void SpriteManager::addSpriteToRenderList(AnimatedSprite *sprite,
RenderList *renderList,
Viewport *viewport)
{
// GET THE SPRITE TYPE INFO FOR THIS SPRITE
AnimatedSpriteType *spriteType = sprite->getSpriteType();
PhysicalProperties *pp = sprite->getPhysicalProperties();
float rotation = sprite->getRotationInRadians();
// IS THE SPRITE VIEWABLE?
if (viewport->areWorldCoordinatesInViewport(
pp->getX(),
pp->getY(),
spriteType->getTextureWidth(),
spriteType->getTextureHeight()))
{
// SINCE IT'S VIEWABLE, ADD IT TO THE RENDER LIST
RenderItem itemToAdd;
itemToAdd.id = sprite->getFrameIndex();
renderList->addRenderItem( sprite->getCurrentImageID(),
pp->round(pp->getX()-viewport->getViewportX()),
pp->round(pp->getY()-viewport->getViewportY()),
pp->round(pp->getZ()),
sprite->getAlpha(),
spriteType->getTextureWidth(),
spriteType->getTextureHeight(),
rotation);
}
}