本文整理汇总了C++中FTPoint::Zf方法的典型用法代码示例。如果您正苦于以下问题:C++ FTPoint::Zf方法的具体用法?C++ FTPoint::Zf怎么用?C++ FTPoint::Zf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FTPoint
的用法示例。
在下文中一共展示了FTPoint::Zf方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ftglGetFontBBox
void ftglGetFontBBox(FTGLfont *f, const char* s, int len, float c[6])
{
FTBBox ret = _ftglGetFontBBox(f, s, len);
FTPoint lower = ret.Lower(), upper = ret.Upper();
c[0] = lower.Xf(); c[1] = lower.Yf(); c[2] = lower.Zf();
c[3] = upper.Xf(); c[4] = upper.Yf(); c[5] = upper.Zf();
}
示例2: ftglGetGlyphBBox
void ftglGetGlyphBBox(FTGLglyph *g, float bounds[6])
{
FTBBox ret = _ftglGetGlyphBBox(g);
FTPoint lower = ret.Lower(), upper = ret.Upper();
bounds[0] = lower.Xf(); bounds[1] = lower.Yf(); bounds[2] = lower.Zf();
bounds[3] = upper.Xf(); bounds[4] = upper.Yf(); bounds[5] = upper.Zf();
}
示例3: ftgGetlLayoutBBox
void ftgGetlLayoutBBox(FTGLlayout *l, const char * s, float c[6])
{
FTBBox ret = _ftgGetlLayoutBBox(l, s);
FTPoint lower = ret.Lower(), upper = ret.Upper();
c[0] = lower.Xf(); c[1] = lower.Yf(); c[2] = lower.Zf();
c[3] = upper.Xf(); c[4] = upper.Yf(); c[5] = upper.Zf();
}
示例4: getBounds
Bounds Font::getBounds(const vec3& pos, const std::string& text) const {
if (!font_)
return Bounds();
FTPoint point(static_cast<double>(pos.x),
static_cast<double>(pos.y),
static_cast<double>(pos.z));
float delta = 0;
std::string line;
std::stringstream ss(text);
std::getline(ss, line);
FTBBox box_tmp = font_->BBox(line.c_str(), -1, point);
delta -= box_tmp.Upper().Yf() - box_tmp.Lower().Yf(); // height of first line
FTBBox box = simpleLayout_->BBox(text.c_str(), -1, point);
FTPoint upper = box.Upper();
FTPoint lower = box.Lower();
float height = upper.Yf() - lower.Yf();
switch(vAlign_) {
case Font::Top:
delta += height;
break;
case Font::Middle:
delta += height * 0.5f;
break;
case Font::Bottom:
break;
}
vec3 upperTGT = vec3(upper.Xf(), upper.Yf() + delta, upper.Zf());
vec3 lowerTGT = vec3(lower.Xf(), lower.Yf() + delta, lower.Zf());
return Bounds(lowerTGT, upperTGT);
}