本文整理汇总了C++中Billboard::setTexcoordRect方法的典型用法代码示例。如果您正苦于以下问题:C++ Billboard::setTexcoordRect方法的具体用法?C++ Billboard::setTexcoordRect怎么用?C++ Billboard::setTexcoordRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Billboard
的用法示例。
在下文中一共展示了Billboard::setTexcoordRect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mNode
BillboardSprite::BillboardSprite(SceneNode* node, BillboardSet* bs, int row, int col, int unitWidth, int unitHeight)
: mNode(node), mBillboards(bs), mRow(row), mCol(col), mUnitWidth(unitWidth), mUnitHeight(unitHeight),
mIsFinished(false)
{
mWidth = row * unitWidth;
mHeight = col * unitHeight;
Billboard* b = mBillboards->getBillboard(0);
if (b)
b->setTexcoordRect(0, 0, 1 / (float)mRow, 1 / (float)mCol);
}
示例2: createBillboard
void BillboardSetComponent::createBillboard(const PonykartParsers::BillboardBlock* const block)
{
Billboard* bb = billboardSet->createBillboard(block->getVectorProperty("Position")); // make our billboard
// set its color if it has one, and a rotation
auto quatIt=block->getQuatTokens().find("colour");
if (quatIt != block->getQuatTokens().end())
bb->setColour(toColourValue(quatIt->second));
bb->setRotation(Degree(block->getFloatProperty("Rotation", 0)));
auto rectQIt = block->getQuatTokens().find("texturecoords");
if (rectQIt != block->getQuatTokens().end())
bb->setTexcoordRect(rectQIt->second.x, rectQIt->second.y, rectQIt->second.z, rectQIt->second.w);
// It's best to not do this unless we really need to since it makes it less efficient
auto fTokens = block->getFloatTokens();
auto heightIt=fTokens.find("height"), widthIt=fTokens.find("width");
if (heightIt!=fTokens.end() && widthIt!=fTokens.end())
bb->setDimensions(widthIt->second, heightIt->second);
}