本文整理汇总了C++中vec3f::z方法的典型用法代码示例。如果您正苦于以下问题:C++ vec3f::z方法的具体用法?C++ vec3f::z怎么用?C++ vec3f::z使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vec3f
的用法示例。
在下文中一共展示了vec3f::z方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Overlap
bool BBox::Overlap( const vec3f& p ) const
{
bool x = (pMax.x() >= p.x()) && (pMin.x() <= p.x());
bool y = (pMax.y() >= p.y()) && (pMin.y() <= p.y());
bool z = (pMax.z() >= p.z()) && (pMin.z() <= p.z());
return (x && y && z);
}
示例2: DrawQuad
void GLVBO::DrawQuad( int type, const vec3f &p1, const vec3f &p2, const vec3f &p3, const vec3f &p4)
{
GLfloat verts[] = {
p1.x(), p1.y(), p1.z(),
p2.x(), p2.y(), p2.z(),
p3.x(), p3.y(), p3.z(),
p4.x(), p4.y(), p4.z()
};
glVertexPointer(3, GL_FLOAT, 0, verts);
glEnableClientState(GL_VERTEX_ARRAY);
glDrawArrays(type, 0, 4);
glDisableClientState(GL_VERTEX_ARRAY);
}
示例3: clamp
void clamp(vec3f & v, float min, float max)
{
if(v.peekx() > max) v.x() = max;
if(v.peekx() < min) v.x() = min;
if(v.peeky() > max) v.y() = max;
if(v.peeky() < min) v.y() = min;
if(v.peekz() > max) v.z() = max;
if(v.peekz() < min) v.z() = min;
}
示例4: clamp
void clamp(vec3f & v, float vmin, float vmax)
{
if(v.peekx() > vmax) v.x() = vmax;
if(v.peekx() < vmin) v.x() = vmin;
if(v.peeky() > vmax) v.y() = vmax;
if(v.peeky() < vmin) v.y() = vmin;
if(v.peekz() > vmax) v.z() = vmax;
if(v.peekz() < vmin) v.z() = vmin;
}
示例5: coordsToMapPos
vec2f Grid::coordsToMapPos(vec3f coords) {
GLfloat width = d_cellWidth * d_rows;
GLfloat height = d_cellHeight * d_cols;
GLfloat x = floor(coords.x() / width);
GLfloat y = floor(coords.z() / height);
// Clamp the values into the bounds
if (x > d_rows) {
x = d_rows;
} else if (x < 0) {
x = 0;
}
if (y > d_cols) {
y = d_cols;
} else if (y < 0) {
y = 0;
}
return vec2f(x, y);
}
示例6: setUniform
void Shader::setUniform(const std::string &name, const vec3f v, bool warn) {
glUniform3f(uniform(name, warn), v.x(), v.y(), v.z());
}
示例7:
vec3i::vec3i( const vec3f &v )
{
m_x = (int)v.x();
m_y = (int)v.y();
m_z = (int)v.z();
}
示例8: Inside
bool BBox::Inside( const vec3f& pt) const
{
return (pt.x() >= pMin.x() && pt.x() <= pMax.x() &&
pt.y() >= pMin.y() && pt.y() <= pMax.y() &&
pt.z() >= pMin.z() && pt.z() <= pMax.z());
}