D3DXVec3Length 示例代码

2022-03-03

以下示例是关于cpp中包含D3DXVec3Length用法的示例代码,想了解D3DXVec3Length的具体用法?D3DXVec3Length怎么用?D3DXVec3Length使用的例子?那么可以参考以下10个相关示例代码来学习它的具体使用方法。

示例1:
SystemCollision.cpp开发语言: C++项目名称: intern_games代码行数: 369
158	//	2�_�����a�̘a���菬�������Γ������Ă���
159	return ( D3DXVec3Length(&dist) < (radius1 + radius2) );
160}
177	//	2�_�����a�̘a���菬�������Γ������Ă���
178	if( D3DXVec3Length(&dist) < (radius1 + radius2) ) {
179		return TRUE;
184	//	2�_�����a�̘a���菬�������Γ������Ă���
185	if( D3DXVec3Length(&dist) < (radius1 + radius2) ) {
186		return TRUE;
194	vec1 = pos  - pos1;
195	length1 = D3DXVec3Length(&vec1);
196
198	vec2 = pos2 - pos1;
199	length2 = D3DXVec3Length(&vec2);
200
示例2:
LEEffectCtrl.cpp开发语言: C++项目名称: top-recode代码行数: 565
418	_vDir = _vOldTarget - _vOldPos;
419	_fDist = D3DXVec3LengthSq(&_vDir);
420
425	//计算弧形算法中起点和目标点之间最高能到的高度
426	_fHalfHei = D3DXVec3Length(&(_vOldTarget - _vOldPos));
427	_vArcOrg = _vOldPos + _vDir * (_fHalfHei / 2);
430	//计算起点到圆心的距离(半径)
431	_fHalfHei = D3DXVec3Length(&(_vOldPos - _vArcOrg));
432	D3DXVec3Normalize(&_vArcAxis, &(_vOldPos - _vArcOrg));
449	if (_fStartDist <= 0)
450		_fStartDist = D3DXVec3Length(&_vDir);
451
453
454	float fDist = D3DXVec3Length(&_vDir);
455	if (_vDir.z == 0)
示例3:
MPEffectCtrl.cpp开发语言: C++项目名称: top-recode代码行数: 564
418	_vDir = _vOldTarget - _vOldPos;
419	_fDist = D3DXVec3LengthSq(&_vDir);
420
425	//计算弧形算法中起点和目标点之间最高能到的高度
426	_fHalfHei = D3DXVec3Length(&(_vOldTarget - _vOldPos));
427	_vArcOrg = _vOldPos + _vDir * (_fHalfHei / 2);
430	//计算起点到圆心的距离(半径)
431	_fHalfHei = D3DXVec3Length(&(_vOldPos - _vArcOrg));
432	D3DXVec3Normalize(&_vArcAxis, &(_vOldPos - _vArcOrg));
449	if (_fStartDist <= 0)
450		_fStartDist = D3DXVec3Length(&_vDir);
451
453
454	float fDist = D3DXVec3Length(&_vDir);
455	if (_vDir.z == 0)
示例4:
MPEffectCtrl.cpp开发语言: C++项目名称: top-recode代码行数: 565
418	_vDir = _vOldTarget - _vOldPos;
419	_fDist = D3DXVec3LengthSq(&_vDir);
420
425	//计算弧形算法中起点和目标点之间最高能到的高度
426	_fHalfHei = D3DXVec3Length(&(_vOldTarget - _vOldPos));
427	_vArcOrg = _vOldPos + _vDir * (_fHalfHei / 2);
430	//计算起点到圆心的距离(半径)
431	_fHalfHei = D3DXVec3Length(&(_vOldPos - _vArcOrg));
432	D3DXVec3Normalize(&_vArcAxis, &(_vOldPos - _vArcOrg));
449	if (_fStartDist <= 0)
450		_fStartDist = D3DXVec3Length(&_vDir);
451
453
454	float fDist = D3DXVec3Length(&_vDir);
455	if (_vDir.z == 0)
示例5:
RenderRibbonSelection.cpp开发语言: C++项目名称: ProteinInsight代码行数: 1999
313
314					FLOAT len = D3DXVec3Length( &(m_arrayCarbonAtom[beginCarbonAtom]-m_arrayCarbonAtom[endCarbonAtom] ) );
315
351					//    
352					FLOAT lenOneSegment = D3DXVec3Length(&(arrayCylinderNewPos[0]-arrayCylinderNewPos[1]));	//	하나 간격의 길이.//    
353					D3DXVECTOR3 beginVertexPos = arrayCylinderNewPos[0];
386					//
387					len = D3DXVec3Length( &(m_arrayCarbonAtom[beginCarbonAtom]-m_arrayCarbonAtom[endCarbonAtom] ) );
388
419					//    
420					lenOneSegment = D3DXVec3Length(&(arrayCylinderNewPos[0]-arrayCylinderNewPos[1]));	//	하나 간격의 길이.//    
421					beginVertexPos = arrayCylinderNewPos[0];
816			D3DXVECTOR3 vecLen = pickRayOrig-pos;
817			pickResidue.m_len = D3DXVec3Length(&vecLen);
818
示例6:
Light.cpp开发语言: C++项目名称: ProteinInsight代码行数: 489
187
188						FLOAT len = D3DXVec3Length(&m_posLight);
189						len -= delta;
384{
385	return D3DXVec3Length(&m_posLight);
386}
406{
407	DOUBLE len = D3DXVec3Length(&m_posLight);
408
409	D3DXVec3Normalize(&m_posLight, &direction);
410	if ( D3DXVec3Length(&m_posLight) == 0.0f )
411	{
473	m_posLight = *pos;
474	if (D3DXVec3Length(&m_posLight) == 0.0f)
475		m_posLight = D3DXVECTOR3(0,0,-10);
示例7:
TankStates.cpp开发语言: C++项目名称: noxious代码行数: 345
148
149		if(D3DXVec3Length( &TANK->GetDistToPlayer()) < TANK_MELEE_RANGE * 2 )
150		{
184
185	if( TANK->IsChargeReady() && ( D3DXVec3Length( &TANK->GetDistToPlayer()) < TANK_CHARGE_RANGE )  &&  ( D3DXVec3Length( &TANK->GetDistToPlayer()) > TANK_CHARGE_MIN  ) )
186	{
188	}
189	else if( TANK->IsAttackReady() &&  (D3DXVec3Length( &TANK->GetDistToPlayer())   < TANK_MELEE_RANGE) )
190	{
193	}
194	else if( D3DXVec3Length( &TANK->GetDistToPlayer())   < TANK_MELEE_RANGE)
195	{
示例8:
CameraCtrl.cpp开发语言: C++项目名称: top-recode代码行数: 973
896	if (D3DXVec3Dot(&point2seg1, &(-segment)) < 0.f) {
897		return D3DXVec3Length(&point2seg1);
898	} else if (D3DXVec3Dot(&point2seg2, &(segment)) < 0.f) {
899		return D3DXVec3Length(&point2seg2);
900	} else {
902		D3DXVec3Cross(&crossProduct, &point2seg1, &point2seg2);
903		return D3DXVec3Length(&crossProduct) * 2.f / D3DXVec3Length(&segment);
904	}
929
930	if (D3DXVec3Length(&(_myTarget - v)) < 50.f)
931		_myTarget = _my_targetController->GetValue(_myTarget, v, 0.15f);
示例9:
CameraCtrl.cpp开发语言: C++项目名称: top-recode代码行数: 999
922	if (D3DXVec3Dot(&point2seg1, &(-segment)) < 0.f) {
923		return D3DXVec3Length(&point2seg1);
924	} else if (D3DXVec3Dot(&point2seg2, &(segment)) < 0.f) {
925		return D3DXVec3Length(&point2seg2);
926	} else {
928		D3DXVec3Cross(&crossProduct, &point2seg1, &point2seg2);
929		return D3DXVec3Length(&crossProduct) * 2.f / D3DXVec3Length(&segment);
930	}
955
956	if (D3DXVec3Length(&(_myTarget - v)) < 50.f)
957		_myTarget = _my_targetController->GetValue(_myTarget, v, 0.15f);
示例10:
SystemPrimitive.cpp开发语言: C++项目名称: intern_games代码行数: 823
323
324	f32 angle = (vec1.x*vec2.x + vec1.y*vec2.y + vec1.z*vec2.z) / (D3DXVec3Length(&vec1) * D3DXVec3Length(&vec2));
325
472
473	f32 angle = (vec1.x*vec2.x + vec1.y*vec2.y + vec1.z*vec2.z) / (D3DXVec3Length(&vec1) * D3DXVec3Length(&vec2));
474

本文地址:https://www.itbaoku.cn/snippets/415925.html