当前位置: 首页>>代码示例>>C++>>正文


C++ mat3::getAxisZ方法代码示例

本文整理汇总了C++中mat3::getAxisZ方法的典型用法代码示例。如果您正苦于以下问题:C++ mat3::getAxisZ方法的具体用法?C++ mat3::getAxisZ怎么用?C++ mat3::getAxisZ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mat3的用法示例。


在下文中一共展示了mat3::getAxisZ方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
开发者ID:foxostro,项目名称:heroman,代码行数:35,代码来源:ComponentPhysicsGeom.cpp

示例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()));
}
开发者ID:foxostro,项目名称:heroman,代码行数:16,代码来源:ComponentPhysicsGeom.cpp


注:本文中的mat3::getAxisZ方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。