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; }
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)}); }
CLDimensions::CLDimensions(const Dimensions& d) : mWidth(d.getWidth()), mHeight(d.getHeight()) {}