本文整理汇总了C++中Dimensions::getWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ Dimensions::getWidth方法的具体用法?C++ Dimensions::getWidth怎么用?C++ Dimensions::getWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dimensions
的用法示例。
在下文中一共展示了Dimensions::getWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: new
END_TEST
START_TEST (test_Dimensions_createWithSize)
{
Dimensions* d = new(std::nothrow) Dimensions( 1.2 , 0.4 , 3.1415 );
fail_unless( d->getTypeCode () == SBML_LAYOUT_DIMENSIONS );
fail_unless( d->getMetaId () == "" );
// fail_unless( d->getNotes () == "" );
// fail_unless( d->getAnnotation () == "" );
fail_unless( d->getWidth () == 1.2 );
fail_unless( d->getHeight() == 0.4 );
fail_unless( d->getDepth () == 3.1415 );
delete d;
}
示例2: GenerateVertices
void PlayerData::GenerateVertices(Dimensions &dimensions)
{
float widthX = dimensions.getWidth()/2.0f;
float heightY = dimensions.getHeight()/2.0f;
float x= dimensions.getPosition().getX();
float y=dimensions.getPosition().getY();
vertices.clear();
vertices.push_back({glm::vec2(-widthX+x,-heightY+y)});
vertices.push_back({glm::vec2(widthX+x,-heightY+y)});
vertices.push_back({glm::vec2(widthX+x,heightY+y)});
vertices.push_back({glm::vec2(-widthX+x,heightY+y)});
vertices.push_back({glm::vec2(-widthX+x,-heightY+y)});
vertices.push_back({glm::vec2(widthX+x,heightY+y)});
}
示例3: mWidth
CLDimensions::CLDimensions(const Dimensions& d)
: mWidth(d.getWidth()),
mHeight(d.getHeight())
{}