• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ idMat3类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: vec

void idSimpleWindow::SetupTransforms( float x, float y )
{
	static idMat3 trans;
	static idVec3 org;
	
	trans.Identity();
	org.Set( origin.x + x, origin.y + y, 0 );
	if( rotate )
	{
		static idRotation rot;
		static idVec3 vec( 0, 0, 1 );
		rot.Set( org, vec, rotate );
		trans = rot.ToMat3();
	}
	
	static idMat3 smat;
	smat.Identity();
	if( shear.x() || shear.y() )
	{
		smat[0][1] = shear.x();
		smat[1][0] = shear.y();
		trans *= smat;
	}
	
	if( !trans.IsIdentity() )
	{
		dc->SetTransformInfo( org, trans );
	}
}
开发者ID:Yetta1,项目名称:OpenTechBFG,代码行数:29,代码来源:SimpleWindow.cpp


示例2: ClipPush

/*
============
idPush::ClipPush

  Try to push other entities by moving the given entity.
============
*/
float idPush::ClipPush( trace_t &results, idEntity *pusher, const int flags,
								const idVec3 &oldOrigin, const idMat3 &oldAxis,
									idVec3 &newOrigin, idMat3 &newAxis ) {
	idVec3 translation;
	idRotation rotation;
	float mass;

    mass = 0.0f;

	results.fraction = 1.0f;
	results.endpos = newOrigin;
	results.endAxis = newAxis;
	memset( &results.c, 0, sizeof( results.c ) );

	// translational push
	translation = newOrigin - oldOrigin;

	// if the pusher translates
	if ( translation != vec3_origin ) {

		mass += ClipTranslationalPush( results, pusher, flags, newOrigin, translation );
		if ( results.fraction < 1.0f ) {
			newOrigin = oldOrigin;
			newAxis = oldAxis;
			return mass;
		}
	} else {
		newOrigin = oldOrigin;
	}

	// rotational push
	rotation = ( oldAxis.Transpose() * newAxis ).ToRotation();
	rotation.SetOrigin( newOrigin );
	rotation.Normalize180();
	rotation.ReCalculateMatrix();		// recalculate the rotation matrix to avoid accumulating rounding errors

	// if the pusher rotates
	if ( rotation.GetAngle() != 0.0f ) {

		// recalculate new axis to avoid floating point rounding problems
		newAxis = oldAxis * rotation.ToMat3();
		newAxis.OrthoNormalizeSelf();
		newAxis.FixDenormals();
		newAxis.FixDegeneracies();

		pusher->GetPhysics()->GetClipModel()->SetPosition( newOrigin, oldAxis );

		mass += ClipRotationalPush( results, pusher, flags, newAxis, rotation );
		if ( results.fraction < 1.0f ) {
			newOrigin = oldOrigin;
			newAxis = oldAxis;
			return mass;
		}
	} else {
		newAxis = oldAxis;
	}

	return mass;
}
开发者ID:albertz,项目名称:iodoom3,代码行数:66,代码来源:Push.cpp


示例3: Transform

/*
============
idBrush::Transform
============
*/
void idBrush::Transform( const idVec3& origin, const idMat3& axis )
{
	int i;
	bool transformed = false;
	
	if( axis.IsRotated() )
	{
		for( i = 0; i < sides.Num(); i++ )
		{
			sides[i]->plane.RotateSelf( vec3_origin, axis );
		}
		transformed = true;
	}
	if( origin != vec3_origin )
	{
		for( i = 0; i < sides.Num(); i++ )
		{
			sides[i]->plane.TranslateSelf( origin );
		}
		transformed = true;
	}
	if( transformed )
	{
		CreateWindings();
	}
}
开发者ID:Yetta1,项目名称:OpenTechBFG,代码行数:31,代码来源:Brush.cpp


示例4: GetMatrixForKey

/*
 =======================================================================================================================
 =======================================================================================================================
 */
bool GetMatrixForKey(entity_t *ent, const char *key, idMat3 &mat)
{
    const char	*k;
    k = ValueForKey(ent, key);
    if (k && strlen(k) > 0)
    {
        sscanf
        (
            k,
            "%f %f %f %f %f %f %f %f %f ",
            &mat[0][0],
            &mat[0][1],
            &mat[0][2],
            &mat[1][0],
            &mat[1][1],
            &mat[1][2],
            &mat[2][0],
            &mat[2][1],
            &mat[2][2]
        );
        return true;
    }
    else
    {
        mat.Identity();
    }

    return false;
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:33,代码来源:EditorEntity.cpp


示例5: SetAxis

/*
================
idPhysics_Parametric::SetAxis
================
*/
void idPhysics_Parametric::SetAxis( const idMat3 &newAxis, int id ) {
	idVec3 masterOrigin;
	idMat3 masterAxis;

	current.localAngles = newAxis.ToAngles();

	current.angularExtrapolation.SetStartValue( current.localAngles );
	current.angularInterpolation.SetStartValue( current.localAngles );

	current.localAngles = current.angularExtrapolation.GetCurrentValue( current.time );
	if ( hasMaster && isOrientated ) {
		self->GetMasterPosition( masterOrigin, masterAxis );
		current.axis = current.localAngles.ToMat3() * masterAxis;
		current.angles = current.axis.ToAngles();
	}
	else {
		current.axis = current.localAngles.ToMat3();
		current.angles = current.localAngles;
	}
	if ( clipModel ) {
// RAVEN BEGIN
// ddynerman: multiple clip worlds
		clipModel->Link( self, 0, current.origin, current.axis );
// RAVEN END
	}
	Activate();
}
开发者ID:ET-NiK,项目名称:amxxgroup,代码行数:32,代码来源:Physics_Parametric.cpp


示例6: Contents

/*
============
idClip::Contents
============
*/
int idClip::Contents( const idVec3 &start, const idClipModel *mdl, const idMat3 &trmAxis, int contentMask, const idEntity *passEntity ) {
	int i, num, contents;
	idClipModel *touch, *clipModelList[MAX_GENTITIES];
	idBounds traceBounds;
	const idTraceModel *trm;

	trm = TraceModelForClipModel( mdl );

	if ( !passEntity || passEntity->entityNumber != ENTITYNUM_WORLD ) {
		// test world
		idClip::numContents++;
		contents = collisionModelManager->Contents( start, trm, trmAxis, contentMask, 0, vec3_origin, mat3_default );
	} else {
		contents = 0;
	}

	if ( !trm ) {
		traceBounds[0] = start;
		traceBounds[1] = start;
	} else if ( trmAxis.IsRotated() ) {
		traceBounds.FromTransformedBounds( trm->bounds, start, trmAxis );
	} else {
		traceBounds[0] = trm->bounds[0] + start;
		traceBounds[1] = trm->bounds[1] + start;
	}

	num = GetTraceClipModels( traceBounds, -1, passEntity, clipModelList );

	for ( i = 0; i < num; i++ ) {
		touch = clipModelList[i];

		if ( !touch ) {
			continue;
		}

		// no contents test with render models
		if ( touch->renderModelHandle != -1 ) {
			continue;
		}

		// if the entity does not have any contents we are looking for
		if ( ( touch->contents & contentMask ) == 0 ) {
			continue;
		}

		// if the entity has no new contents flags
		if ( ( touch->contents & contents ) == touch->contents ) {
			continue;
		}

		idClip::numContents++;
		if ( collisionModelManager->Contents( start, trm, trmAxis, contentMask, touch->Handle(), touch->origin, touch->axis ) ) {
			contents |= ( touch->contents & contentMask );
		}
	}

	return contents;
}
开发者ID:AndreiBarsan,项目名称:doom3.gpl,代码行数:63,代码来源:Clip.cpp


示例7: DrawEdge

/*
================
idCollisionModelManagerLocal::DrawEdge
================
*/
void idCollisionModelManagerLocal::DrawEdge( cm_model_t* model, int edgeNum, const idVec3& origin, const idMat3& axis )
{
	int side;
	cm_edge_t* edge;
	idVec3 start, end, mid;
	bool isRotated;
	
	isRotated = axis.IsRotated();
	
	edge = model->edges + abs( edgeNum );
	side = edgeNum < 0;
	
	start = model->vertices[edge->vertexNum[side]].p;
	end = model->vertices[edge->vertexNum[!side]].p;
	if( isRotated )
	{
		start *= axis;
		end *= axis;
	}
	start += origin;
	end += origin;
	
	if( edge->internal )
	{
		if( cm_drawInternal.GetBool() )
		{
			common->RW()->DebugArrow( colorGreen, start, end, 1 );
		}
	}
	else
	{
		if( edge->numUsers > 2 )
		{
			common->RW()->DebugArrow( colorBlue, start, end, 1 );
		}
		else
		{
			common->RW()->DebugArrow( cm_color, start, end, 1 );
		}
	}
	
	if( cm_drawNormals.GetBool() )
	{
		mid = ( start + end ) * 0.5f;
		if( isRotated )
		{
			end = mid + 5 * ( axis * edge->normal );
		}
		else
		{
			end = mid + 5 * edge->normal;
		}
		common->RW()->DebugArrow( colorCyan, mid, end, 1 );
	}
}
开发者ID:dcahrakos,项目名称:RBDOOM-3-BFG,代码行数:60,代码来源:CollisionModel_debug.cpp


示例8: GetMatrix

/*
================
idDict::GetMatrix
================
*/
bool idDict::GetMatrix( const char *key, const char *defaultString, idMat3 &out ) const {
	const char	*s;
	bool		found;
	if( !defaultString ) {
		defaultString = "1 0 0 0 1 0 0 0 1";
	}
	found = GetString( key, defaultString, &s );
	out.Identity();		// sccanf has a bug in it on Mac OS 9.  Sigh.
	sscanf( s, "%f %f %f %f %f %f %f %f %f", &out[0].x, &out[0].y, &out[0].z, &out[1].x, &out[1].y, &out[1].z, &out[2].x, &out[2].y, &out[2].z );
	return found;
}
开发者ID:revelator,项目名称:Revelation,代码行数:16,代码来源:Dict.cpp


示例9: DrawPolygon

/*
================
idCollisionModelManagerLocal::DrawPolygon
================
*/
void idCollisionModelManagerLocal::DrawPolygon( cm_model_t *model, cm_polygon_t *p, const idVec3 &origin, const idMat3 &axis, const idVec3 &viewOrigin ) {
	int i, edgeNum;
	cm_edge_t *edge;
	idVec3 center, end, dir;

	if ( cm_backFaceCull.GetBool() ) {
		edgeNum = p->edges[0];
		edge = model->edges + abs(edgeNum);
		dir = model->vertices[edge->vertexNum[0]].p - viewOrigin;
		if ( dir * p->plane.Normal() > 0.0f ) {
			return;
		}
	}

	if ( cm_drawNormals.GetBool() ) {
		center = vec3_origin;
		for ( i = 0; i < p->numEdges; i++ ) {
			edgeNum = p->edges[i];
			edge = model->edges + abs(edgeNum);
			center += model->vertices[edge->vertexNum[edgeNum < 0]].p;
		}
		center *= (1.0f / p->numEdges);
		if ( axis.IsRotated() ) {
			center = center * axis + origin;
			end = center + 5 * (axis * p->plane.Normal());
		} else {
			center += origin;
			end = center + 5 * p->plane.Normal();
		}
		session->rw->DebugArrow( colorMagenta, center, end, 1 );
	}

	if ( cm_drawFilled.GetBool() ) {
		idFixedWinding winding;
		for ( i = p->numEdges - 1; i >= 0; i-- ) {
			edgeNum = p->edges[i];
			edge = model->edges + abs(edgeNum);
			winding += origin + model->vertices[edge->vertexNum[INTSIGNBITSET(edgeNum)]].p * axis;
		}
		session->rw->DebugPolygon( cm_color, winding );
	} else {
		for ( i = 0; i < p->numEdges; i++ ) {
			edgeNum = p->edges[i];
			edge = model->edges + abs(edgeNum);
			if ( edge->checkcount == checkCount ) {
				continue;
			}
			edge->checkcount = checkCount;
			DrawEdge( model, edgeNum, origin, axis );
		}
	}
}
开发者ID:DerSaidin,项目名称:OpenWolf,代码行数:57,代码来源:CollisionModel_debug.cpp


示例10: DetermineIdealRotation

/*
================
hhCameraInterpolator::DetermineIdealRotation
================
*/
idQuat hhCameraInterpolator::DetermineIdealRotation( const idVec3& idealUpVector, const idVec3& viewDir, const idMat3& untransformedViewAxis ) {
	idMat3 mat;
	idVec3 newViewVector( viewDir );

	newViewVector.ProjectOntoPlane( idealUpVector );
	if( newViewVector.LengthSqr() < VECTOR_EPSILON ) {
		newViewVector = -Sign( newViewVector * idealUpVector );
	}

	newViewVector.Normalize();
	mat[0] = newViewVector;
	mat[1] = idealUpVector.Cross( newViewVector );
	mat[2] = idealUpVector;

	mat = untransformedViewAxis.Transpose() * mat;
	return mat.ToQuat();
}
开发者ID:mrwonko,项目名称:preymotionmod,代码行数:22,代码来源:prey_camerainterpolator.cpp


示例11: FromBoundsTranslation

/*
============
idBounds::FromBoundsTranslation

  Most tight bounds for the translational movement of the given bounds.
============
*/
void idBounds::FromBoundsTranslation( const idBounds &bounds, const idVec3 &origin, const idMat3 &axis, const idVec3 &translation ) {
	int i;

	if ( axis.IsRotated() ) {
		FromTransformedBounds( bounds, origin, axis );
	}
	else {
		b[0] = bounds[0] + origin;
		b[1] = bounds[1] + origin;
	}
	for ( i = 0; i < 3; i++ ) {
		if ( translation[i] < 0.0f ) {
			b[0][i] += translation[i];
		}
		else {
			b[1][i] += translation[i];
		}
	}
}
开发者ID:mrwonko,项目名称:preymotionmod,代码行数:26,代码来源:Bounds.cpp


示例12: DrawModel

/*
================
idCollisionModelManagerLocal::DrawModel
================
*/
void idCollisionModelManagerLocal::DrawModel( cmHandle_t handle, const idVec3 &modelOrigin, const idMat3 &modelAxis,
					const idVec3 &viewOrigin, const float radius ) {

	cm_model_t *model;
	idVec3 viewPos;

	if ( handle < 0 && handle >= numModels ) {
		return;
	}

	if ( cm_drawColor.IsModified() ) {
		sscanf( cm_drawColor.GetString(), "%f %f %f %f", &cm_color.x, &cm_color.y, &cm_color.z, &cm_color.w );
		cm_drawColor.ClearModified();
	}

	model = models[ handle ];
	viewPos = (viewOrigin - modelOrigin) * modelAxis.Transpose();
	checkCount++;
	DrawNodePolygons( model, model->node, modelOrigin, modelAxis, viewPos, radius );
}
开发者ID:DerSaidin,项目名称:OpenWolf,代码行数:25,代码来源:CollisionModel_debug.cpp


示例13: GlobalProjectionInfoToLocal

/*
=================
idRenderModelDecal::CreateProjectionInfo
=================
*/
void idRenderModelDecal::GlobalProjectionInfoToLocal( decalProjectionInfo_t &localInfo, const decalProjectionInfo_t &info, const idVec3 &origin, const idMat3 &axis ) {
	float modelMatrix[16];
	R_AxisToModelMatrix( axis, origin, modelMatrix );
	for( int j = 0; j < NUM_DECAL_BOUNDING_PLANES; j++ ) {
		R_GlobalPlaneToLocal( modelMatrix, info.boundingPlanes[j], localInfo.boundingPlanes[j] );
	}
	R_GlobalPlaneToLocal( modelMatrix, info.fadePlanes[0], localInfo.fadePlanes[0] );
	R_GlobalPlaneToLocal( modelMatrix, info.fadePlanes[1], localInfo.fadePlanes[1] );
	R_GlobalPlaneToLocal( modelMatrix, info.textureAxis[0], localInfo.textureAxis[0] );
	R_GlobalPlaneToLocal( modelMatrix, info.textureAxis[1], localInfo.textureAxis[1] );
	R_GlobalPointToLocal( modelMatrix, info.projectionOrigin, localInfo.projectionOrigin );
	localInfo.projectionBounds = info.projectionBounds;
	localInfo.projectionBounds.TranslateSelf( -origin );
	localInfo.projectionBounds.RotateSelf( axis.Transpose() );
	localInfo.material = info.material;
	localInfo.parallel = info.parallel;
	localInfo.fadeDepth = info.fadeDepth;
	localInfo.startTime = info.startTime;
	localInfo.force = info.force;
}
开发者ID:SL987654,项目名称:The-Darkmod-Experimental,代码行数:25,代码来源:ModelDecal.cpp


示例14: GetMassProperties

/*
============
idTraceModel::GetMassProperties
============
*/
void idTraceModel::GetMassProperties( const float density, float &mass, idVec3 &centerOfMass, idMat3 &inertiaTensor ) const {
	volumeIntegrals_t integrals;

	// if polygon trace model
	if ( type == TRM_POLYGON ) {
		idTraceModel trm;

		VolumeFromPolygon( trm, 1.0f );
		trm.GetMassProperties( density, mass, centerOfMass, inertiaTensor );
		return;
	}

	VolumeIntegrals( integrals );

	// if no volume
	if ( integrals.T0 == 0.0f ) {
		mass = 1.0f;
		centerOfMass.Zero();
		inertiaTensor.Identity();
		return;
	}

	// mass of model
	mass = density * integrals.T0;
	// center of mass
	centerOfMass = integrals.T1 / integrals.T0;
	// compute inertia tensor
	inertiaTensor[0][0] = density * (integrals.T2[1] + integrals.T2[2]);
	inertiaTensor[1][1] = density * (integrals.T2[2] + integrals.T2[0]);
	inertiaTensor[2][2] = density * (integrals.T2[0] + integrals.T2[1]);
	inertiaTensor[0][1] = inertiaTensor[1][0] = - density * integrals.TP[0];
	inertiaTensor[1][2] = inertiaTensor[2][1] = - density * integrals.TP[1];
	inertiaTensor[2][0] = inertiaTensor[0][2] = - density * integrals.TP[2];
	// translate inertia tensor to center of mass
	inertiaTensor[0][0] -= mass * (centerOfMass[1]*centerOfMass[1] + centerOfMass[2]*centerOfMass[2]);
	inertiaTensor[1][1] -= mass * (centerOfMass[2]*centerOfMass[2] + centerOfMass[0]*centerOfMass[0]);
	inertiaTensor[2][2] -= mass * (centerOfMass[0]*centerOfMass[0] + centerOfMass[1]*centerOfMass[1]);
	inertiaTensor[0][1] = inertiaTensor[1][0] += mass * centerOfMass[0] * centerOfMass[1];
	inertiaTensor[1][2] = inertiaTensor[2][1] += mass * centerOfMass[1] * centerOfMass[2];
	inertiaTensor[2][0] = inertiaTensor[0][2] += mass * centerOfMass[2] * centerOfMass[0];
}
开发者ID:pdoughty,项目名称:Q4--Hardqore,代码行数:46,代码来源:TraceModel.cpp


示例15: GetPhysicsToSoundTransform

bool CFrobHandle::GetPhysicsToSoundTransform(idVec3 &origin, idMat3 &axis)
{
	idVec3 eyePos = gameLocal.GetLocalPlayer()->GetEyePosition();
	const idBounds& bounds = GetPhysics()->GetAbsBounds();

	//gameRenderWorld->DebugBounds(colorLtGrey, bounds, vec3_origin, 5000);
	
	// greebo: Choose the corner which is nearest to the player's eyeposition
	origin.x = (idMath::Fabs(bounds[0].x - eyePos.x) < idMath::Fabs(bounds[1].x - eyePos.x)) ? bounds[0].x : bounds[1].x;
	origin.y = (idMath::Fabs(bounds[0].y - eyePos.y) < idMath::Fabs(bounds[1].y - eyePos.y)) ? bounds[0].y : bounds[1].y;
	origin.z = (idMath::Fabs(bounds[0].z - eyePos.z) < idMath::Fabs(bounds[1].z - eyePos.z)) ? bounds[0].z : bounds[1].z;

	// The called expects the origin in local space
	origin -= GetPhysics()->GetOrigin();

	axis.Identity();

	//gameRenderWorld->DebugArrow(colorWhite, GetPhysics()->GetOrigin() + origin, eyePos, 0, 5000);

	return true;
}
开发者ID:ProfessorKaos64,项目名称:tdm,代码行数:21,代码来源:FrobHandle.cpp


示例16: UpdateAxis

void hhShuttleTransport::UpdateAxis( const idMat3 &newAxis ) {
	// Yaw transport to match yaw of shuttle
	idAngles ang = newAxis.ToAngles();
	ang.pitch = ang.roll = 0.0f;
	SetAxis(ang.ToMat3());
}
开发者ID:mrwonko,项目名称:preymotionmod,代码行数:6,代码来源:game_shuttletransport.cpp


示例17: tan

/*
================
idCollisionModelManagerLocal::Rotation180
================
*/
void idCollisionModelManagerLocal::Rotation180( trace_t *results, const idVec3 &rorg, const idVec3 &axis,
										const float startAngle, const float endAngle, const idVec3 &start,
										const idTraceModel *trm, const idMat3 &trmAxis, int contentMask,
										cmHandle_t model, const idVec3 &modelOrigin, const idMat3 &modelAxis ) {
	int i, j, edgeNum;
	float d, maxErr, initialTan;
	bool model_rotated, trm_rotated;
	idVec3 dir, dir1, dir2, tmp, vr, vup, org, at, bt;
	idMat3 invModelAxis, endAxis, tmpAxis;
	idRotation startRotation, endRotation;
	idPluecker plaxis;
	cm_trmPolygon_t *poly;
	cm_trmEdge_t *edge;
	cm_trmVertex_t *vert;
	ALIGN16( static cm_traceWork_t tw );

	if ( model < 0 || model > MAX_SUBMODELS || model > idCollisionModelManagerLocal::maxModels ) {
		common->Printf("idCollisionModelManagerLocal::Rotation180: invalid model handle\n");
		return;
	}
	if ( !idCollisionModelManagerLocal::models[model] ) {
		common->Printf("idCollisionModelManagerLocal::Rotation180: invalid model\n");
		return;
	}

	idCollisionModelManagerLocal::checkCount++;

	tw.trace.fraction = 1.0f;
	tw.trace.c.contents = 0;
	tw.trace.c.type = CONTACT_NONE;
	tw.contents = contentMask;
	tw.isConvex = true;
	tw.rotation = true;
	tw.positionTest = false;
	tw.axisIntersectsTrm = false;
	tw.quickExit = false;
	tw.angle = endAngle - startAngle;
	assert( tw.angle > -180.0f && tw.angle < 180.0f );
	tw.maxTan = initialTan = idMath::Fabs( tan( ( idMath::PI / 360.0f ) * tw.angle ) );
	tw.model = idCollisionModelManagerLocal::models[model];
	tw.start = start - modelOrigin;
	// rotation axis, axis is assumed to be normalized
	tw.axis = axis;
//	assert( tw.axis[0] * tw.axis[0] + tw.axis[1] * tw.axis[1] + tw.axis[2] * tw.axis[2] > 0.99f );
	// rotation origin projected into rotation plane through tw.start
	tw.origin = rorg - modelOrigin;
	d = (tw.axis * tw.origin) - ( tw.axis * tw.start );
	tw.origin = tw.origin - d * tw.axis;
	// radius of rotation
	tw.radius = ( tw.start - tw.origin ).Length();
	// maximum error of the circle approximation traced through the axial BSP tree
	d = tw.radius * tw.radius - (CIRCLE_APPROXIMATION_LENGTH*CIRCLE_APPROXIMATION_LENGTH*0.25f);
	if ( d > 0.0f ) {
		maxErr = tw.radius - idMath::Sqrt( d );
	} else {
		maxErr = tw.radius;
	}

	model_rotated = modelAxis.IsRotated();
	if ( model_rotated ) {
		invModelAxis = modelAxis.Transpose();
		tw.axis *= invModelAxis;
		tw.origin *= invModelAxis;
	}

	startRotation.Set( tw.origin, tw.axis, startAngle );
	endRotation.Set( tw.origin, tw.axis, endAngle );

	// create matrix which rotates the rotation axis to the z-axis
	tw.axis.NormalVectors( vr, vup );
	tw.matrix[0][0] = vr[0];
	tw.matrix[1][0] = vr[1];
	tw.matrix[2][0] = vr[2];
	tw.matrix[0][1] = -vup[0];
	tw.matrix[1][1] = -vup[1];
	tw.matrix[2][1] = -vup[2];
	tw.matrix[0][2] = tw.axis[0];
	tw.matrix[1][2] = tw.axis[1];
	tw.matrix[2][2] = tw.axis[2];

	// if optimized point trace
	if ( !trm || ( trm->bounds[1][0] - trm->bounds[0][0] <= 0.0f &&
					trm->bounds[1][1] - trm->bounds[0][1] <= 0.0f &&
					trm->bounds[1][2] - trm->bounds[0][2] <= 0.0f ) ) {

		if ( model_rotated ) {
			// rotate trace instead of model
			tw.start *= invModelAxis;
		}
		tw.end = tw.start;
		// if we start at a specific angle
		if ( startAngle != 0.0f ) {
			startRotation.RotatePoint( tw.start );
		}
		// calculate end position of rotation
//.........这里部分代码省略.........
开发者ID:469486139,项目名称:DOOM-3-BFG,代码行数:101,代码来源:CollisionModel_rotate.cpp


示例18: GetPhysicsToSoundTransform

/*
================
hhSound::GetPhysicsToSoundTransform
================
*/
bool hhSound::GetPhysicsToSoundTransform( idVec3 &origin, idMat3 &axis ) {
	origin = positionOffset;
	axis.Identity();
	return true;
}
开发者ID:mrwonko,项目名称:preymotionmod,代码行数:10,代码来源:prey_sound.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ idParser类代码示例发布时间:2022-05-31
下一篇:
C++ idList类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap