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


C++ Matrix44F::setTranslation方法代码示例

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


在下文中一共展示了Matrix44F::setTranslation方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: space

Matrix44F BaseTransform::space() const
{
	Matrix44F s;
	s.setTranslation(m_translation);
	s.setRotation(rotation());
	return s;
}
开发者ID:ahmidou,项目名称:aphid,代码行数:7,代码来源:BaseTransform.cpp

示例2: space

Matrix44F BaseTransform::space() const
{
    Matrix44F s;
	s.setTranslation(m_translation);
	Matrix33F r = orientation();
	
	s.translate(m_rotatePivotTranslate);
	s.translate(m_rotatePivot);
	s.translate(r.transform(m_rotatePivot.reversed()));
	
	s.translate(r.transform(m_scalePivotTranslate));
	s.translate(r.transform(m_scalePivot));
	
	Vector3F displaceByScaling = m_scalePivot.reversed();
	displaceByScaling = displaceByScaling * m_scale;
	s.translate(r.transform(displaceByScaling));
	
	Matrix33F scaleMatrix;
	*scaleMatrix.m(0, 0) = m_scale.x;
	*scaleMatrix.m(1, 1) = m_scale.y;
	*scaleMatrix.m(2, 2) = m_scale.z;
	
	r = scaleMatrix * r;
	s.setRotation(r);

	return s;
}
开发者ID:spinos,项目名称:aphid,代码行数:27,代码来源:BaseTransform.cpp

示例3: sin

const Matrix44F Chassis::computeBogieArmOrigin(const float & chassisWidth, const Vector3F & wheelP, const float & l, const float & s, const float & ang) const
{
    Matrix44F tm;
    tm.rotateX(-ang);
    Vector3F p;
    p.x = chassisWidth * .5f + s * .5f;
    p.y = wheelP.y + l * .5f * sin(ang);
    p.z = wheelP.z + l * .5f * cos(ang);
    tm.setTranslation(p);
    return tm;
}
开发者ID:ahmidou,项目名称:aphid,代码行数:11,代码来源:Chassis.cpp

示例4: drawControlVectors

void MlUVView::drawControlVectors(MlFeather * f)
{
	Vector3F baseP(f->baseUV());
	GeoDrawer * dr = getDrawer();
	
	glPushMatrix();
    Matrix44F s;
	s.setTranslation(baseP);
	
	float * quill = f->getQuilly();
	Vector3F b, a;
	Vector2F *d;
	for(short i=0; i <= f->numSegment(); i++) {
	    dr->useSpace(s);
		
		a.setZero();
		d = f->uvDisplaceAt(i, 0);
		for(short j = 0; j < 3; j++) {
			b = d[j];
			dr->arrow(a, a + b);
			a += b;
		}
		
		a.setZero();
		d = f->uvDisplaceAt(i, 1);
		for(short j = 0; j < 3; j++) {
			b = d[j];
			dr->arrow(a, a + b);
			a += b;
		}
		
		a.setZero();
		b.set(0.f, quill[i], 0.f);
		
		if(i<f->numSegment()) dr->arrow(a, b);
		
		s.setTranslation(b);
	}
	glPopMatrix();
}
开发者ID:ahmidou,项目名称:aphid,代码行数:40,代码来源:MlUVView.cpp

示例5: roadWheelOrigin

const Matrix44F  Chassis::bogieArmOrigin(const int & i, bool isLeft) const
{
    Matrix44F res;
    res.rotateX(-m_torsionBarRestAngle);
    Vector3F cen = roadWheelOrigin(i, isLeft);
    float d = 1.f;
	if(!isLeft) d = -d;
	cen.x += -m_trackWidth * .5f * d + m_bogieArmWidth * .7f * d;
    cen.z += 0.5f * m_bogieArmLength * cos(m_torsionBarRestAngle);
    cen.y += 0.5f * m_bogieArmLength * sin(m_torsionBarRestAngle);
    res.setTranslation(cen);
    return res;
}
开发者ID:ahmidou,项目名称:aphid,代码行数:13,代码来源:Chassis.cpp

示例6: frameAll

void BaseView::frameAll(const BoundingBox & b)
{
	Vector3F eye = b.center();
	eye.z = b.getMax(2) + b.distance(0) / hfov() * .55f + 120.f;
	setEyePosition(eye);
	
	Matrix44F m;
	m.setTranslation(eye);
	*cameraSpaceR() = m;
	m.inverse();
	*cameraInvSpaceR() = m;
	setFrustum(1.33f, 1.f, 26.2f, -1.f, -1000.f);
}
开发者ID:spinos,项目名称:aphid,代码行数:13,代码来源:ViewCull.cpp

示例7: drawBindVectors

void MlUVView::drawBindVectors(MlFeather * f)
{
	GeoDrawer * dr = getDrawer();
	const Vector3F baseP(f->baseUV());
	
	glPushMatrix();
    Matrix44F s;
	s.setTranslation(baseP);
	
	float * quill = f->getQuilly();
	Vector3F b;
	for(short i=0; i < f->numSegment(); i++) {
	    dr->useSpace(s);
		
		for(short j=0; j < f->numBind(i); j++) {
			DeformableFeather::BindCoord *bind = f->getBind(i, j);
			dr->arrow(Vector3F(0.f, 0.f, 0.f), bind->_objP * 32.f);
		}
		
		b.set(0.f, quill[i], 0.f);
		s.setTranslation(b);
	}
	glPopMatrix();
}
开发者ID:ahmidou,项目名称:aphid,代码行数:24,代码来源:MlUVView.cpp


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