本文整理汇总了C++中mat3::getAxisX方法的典型用法代码示例。如果您正苦于以下问题:C++ mat3::getAxisX方法的具体用法?C++ mat3::getAxisX怎么用?C++ mat3::getAxisX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mat3
的用法示例。
在下文中一共展示了mat3::getAxisX方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawAxes
void ComponentPhysicsGeom::drawAxes() const
{
CHECK_GL_ERROR();
glPushAttrib(GL_ALL_ATTRIB_BITS);
{
glLineWidth(2.0f);
const mat3 orientation = getOrientation();
mat4 transformation(getPosition(),
orientation.getAxisX(),
orientation.getAxisY(),
orientation.getAxisZ());
glPushMatrix();
glMultMatrixf(transformation);
glBegin(GL_LINES);
glColor4fv(red);
glVertex3fv(vec3(0,0,0));
glVertex3fv(orientation.getAxisX());
glColor4fv(green);
glVertex3fv(vec3(0,0,0));
glVertex3fv(orientation.getAxisY());
glColor4fv(blue);
glVertex3fv(vec3(0,0,0));
glVertex3fv(orientation.getAxisZ());
glEnd();
glPopMatrix();
}
glPopAttrib();
CHECK_GL_ERROR();
}
示例2: setOrientation
void ComponentPhysicsGeom::setOrientation(const mat3 &m)
{
dMatrix3 r;
const vec3 x = m.getAxisX().getNormal();
const vec3 y = m.getAxisY().getNormal();
const vec3 z = m.getAxisZ().getNormal();
r[0] = x.x; r[1] = x.y; r[2] = x.z; r[3] = 0.0f;
r[4] = y.x; r[5] = y.y; r[6] = y.z; r[7] = 0.0f;
r[8] = z.x; r[9] = z.y; r[10]= z.z; r[11]= 0.0f;
dGeomSetRotation(geom, r);
getParentBlackBoard().relayMessage(MessageOrientationHasBeenSet(getOrientation()));
}
示例3: putBillboardChar
void Font::putBillboardChar(vec3 start,
vec3 *offset,
char character,
const color *color,
FontSize size,
mat3 cameraOrientation) const
{
const float _size = fontSize.find(size)->second;
float w = _size / 100.0f;
float h = _size / 100.0f;
const vec3 right = cameraOrientation.getAxisX();
const vec3 up = cameraOrientation.getAxisY();
vec3 nextOffset;
if(character == '\n')
{
nextOffset = (*offset) + -up*(h*lineHeight);
}
else
{
/* center the quad place it shift left by an offset */
const vec3 a = -right*(w*0.5f) + (*offset) - right*w*getCharacter(character).left;
const vec3 b = right*(w*0.5f) + (*offset) - right*w*getCharacter(character).left;
const vec3 c = right*(w*0.5f) + up*h + (*offset) - right*w*getCharacter(character).left;
const vec3 d = -right*(w*0.5f) + up*h + (*offset) - right*w*getCharacter(character).left;
drawChar(a, b, c, d, character, *color);
float offsetRight = w * (getCharacter(character).width + spacing);
nextOffset = (*offset) + right*offsetRight;
}
(*offset) = nextOffset;
}