D3DXVec3Dot 示例代码

2022-03-03

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

示例1:
NVMeshMender.cpp开发语言: C++项目名称: coc-1.4-xray-64代码行数: 1158
105
106		if(D3DXVec3Dot( &tmp1, &tmp2 ) >= minCreaseAngle )
107		{
133
134		if(D3DXVec3Dot( &tmp1, &tmp2 ) >= minCreaseAngle )
135			return true;
875
876		D3DXVECTOR3 newT = tmpTan -  (D3DXVec3Dot(&tmpNorm , &tmpTan)  * tmpNorm );
877		D3DXVECTOR3 newB = tmpBin - (D3DXVec3Dot(&tmpNorm , &tmpBin) * tmpNorm)
878							- (D3DXVec3Dot(&newT,&tmpBin)*newT);
879
917
918				if( D3DXVec3Dot(&xAxis, &(theVerts[i].normal) )  <  D3DXVec3Dot(&yAxis, &(theVerts[i].normal) ) )
919				{
示例2:
CollisionManager.cpp开发语言: C++项目名称: noxious代码行数: 1135
63	D3DXVECTOR3 vec	  = sphere->center - centerPoint ;
64	float		dist  = D3DXVec3Dot( &vec, &vec );
65	float		radSq = (sphere->radius * sphere->radius);
159	float dd		= D3DXVec3Dot( &d, &d );
160	float nd		= D3DXVec3Dot( &n, &d );
161	float mn		= D3DXVec3Dot( &m, &n );
162	float md		= D3DXVec3Dot( &m, &d );
163	float mm		= D3DXVec3Dot( &m, &m );
216{
217	if(D3DXVec3Dot(&vert0, &norm) - D3DXVec3Dot(&start, &norm) > 0)
218		return false;
247		float planeOffset	= D3DXVec3Dot(&vert0, &norm);
248		t					= (planeOffset - D3DXVec3Dot(&start, &norm))/(D3DXVec3Dot(&norm, &dir));
249		return true;
示例3:
Camera.cpp开发语言: C++项目名称: gfxframework代码行数: 1326
627
628	float f = D3DXVec3Dot(&OP, &Frustum.GetForward());
629	if (f < Frustum.GetZNear() || f > Frustum.GetZFar())
631
632	float r = D3DXVec3Dot(&OP, &Frustum.GetRight());
633	float RLimit = Frustum.GetRFactor() * f;
636
637	float u = D3DXVec3Dot(&OP, &Frustum.GetUp());
638	float ULimit = Frustum.GetUFactor() * f;
728
729		float r = D3DXVec3Dot(&P, &Frustum.GetRight());
730		float u = D3DXVec3Dot(&P, &Frustum.GetUp());
731		float f = D3DXVec3Dot(&P, &Frustum.GetForward());
732
示例4:
KWCamera.cpp开发语言: C++项目名称: beadle代码行数: 209
53
54	m._41 = -D3DXVec3Dot(&m_pos, &m_right);
55	m._42 = -D3DXVec3Dot(&m_pos, &m_up);
56	m._43 = -D3DXVec3Dot(&m_pos, &m_look);
57	m._44 = 1.0f;
163
164	m._41 = -D3DXVec3Dot(&m_pos, &right);
165	m._42 = -D3DXVec3Dot(&m_pos, &up);
166	m._43 = -D3DXVec3Dot(&m_pos, &look);
167	m._44 = 1.0f;
示例5:
NVMeshMender.cpp开发语言: C++项目名称: plex代码行数: 1147
94
95		if(D3DXVec3Dot( &tmp1, &tmp2 ) >= minCreaseAngle )
96		{
122
123		if(D3DXVec3Dot( &tmp1, &tmp2 ) >= minCreaseAngle )
124			return true;
864
865		D3DXVECTOR3 newT = tmpTan -  (D3DXVec3Dot(&tmpNorm , &tmpTan)  * tmpNorm );
866		D3DXVECTOR3 newB = tmpBin - (D3DXVec3Dot(&tmpNorm , &tmpBin) * tmpNorm)
867							- (D3DXVec3Dot(&newT,&tmpBin)*newT);
868
906
907				if( D3DXVec3Dot(&xAxis, &(theVerts[i].normal) )  <  D3DXVec3Dot(&yAxis, &(theVerts[i].normal) ) )
908				{
示例6:
DecalManager.cpp开发语言: C++项目名称: diamondcore-engine代码行数: 483
56
57	x = -D3DXVec3Dot(&DecalCamPos, &R);
58	y = -D3DXVec3Dot(&DecalCamPos, &U);
59	z = -D3DXVec3Dot(&DecalCamPos, &L);
60
181
182	x = -D3DXVec3Dot(&DecalCamPos, &R);
183	y = -D3DXVec3Dot(&DecalCamPos, &U);
184	z = -D3DXVec3Dot(&DecalCamPos, &L);
185
示例7:
dxCamera.cpp开发语言: C++项目名称: directx代码行数: 914
164	
165	viewMatrix->_41 = - D3DXVec3Dot( &m_position,&m_right); 
166	viewMatrix->_42 = - D3DXVec3Dot( &m_position,&m_up);
167	viewMatrix->_43 = - D3DXVec3Dot( &m_position,&m_look);
168}
300	    m_mtxView._31 = m_vecRight.z; m_mtxView._32 = m_vecUp.z; m_mtxView._33 = m_vecLook.z;
301	    m_mtxView._41 =- D3DXVec3Dot( &m_vecPos, &m_vecRight );
302	    m_mtxView._42 =- D3DXVec3Dot( &m_vecPos, &m_vecUp    );
303	    m_mtxView._43 =- D3DXVec3Dot( &m_vecPos, &m_vecLook  );
304
432        // AABB is totally outside the frustum ?
433        if ( D3DXVec3Dot( &Normal, &NearPoint ) + m_Frustum[i].d > 0.0f ) return false;
434
示例8:
geometry_shadow.cpp开发语言: C++项目名称: brettonw代码行数: 328
144                    D3DXVECTOR3 baseEdge = iterEdge.ptB - iterEdge.ptA;
145                    if (D3DXVec3Dot (&xProduct, &baseEdge) > 0)
146                        m_edgeVec.push_back (Edge (iterEdge.ptA, iterEdge.ptB, iterEdge.normal, checkEdge.normal));
257        // that make for a silhouette edge, and both are accounted for here.
258        if ((D3DXVec3Dot (&edge.normalA, &lightDirection) >= 0) and (D3DXVec3Dot (&edge.normalB, &lightDirection) < 0))
259        {
264        }
265        else if ((D3DXVec3Dot (&edge.normalA, &lightDirection) < 0) and (D3DXVec3Dot (&edge.normalB, &lightDirection) >= 0))
266        {
示例9:
shadow.cpp开发语言: C++项目名称: brettonw代码行数: 306
203                    D3DXVECTOR3 baseEdge = iterEdge.ptB - iterEdge.ptA;
204                    if (D3DXVec3Dot (&xProduct, &baseEdge) > 0)
205                        m_edgeVec.push_back (Edge (iterEdge.ptA, iterEdge.ptB, iterEdge.normal, checkEdge.normal));
249        Edge&   edge = *iter++;
250        if ((D3DXVec3Dot (&edge.normalA, &lightDirection) >= 0) and (D3DXVec3Dot (&edge.normalB, &lightDirection) < 0))
251        {
258        }
259        else if ((D3DXVec3Dot (&edge.normalA, &lightDirection) < 0) and (D3DXVec3Dot (&edge.normalB, &lightDirection) >= 0))
260        {
示例10:
collision.cpp开发语言: C++项目名称: Onslaught代码行数: 272
53  D3DXVECTOR3    v(center - quad.point[0]);
54  float t = D3DXVec3Dot(&v, &quad.normal);
55
100        v = center - p;
101        t = D3DXVec3Dot(&v, &v);
102        if (t < min)   // Keep track of closest point
187{
188  float denom = D3DXVec3Dot(&dir, &quad.normal);
189  if (denom == 0.0f)   // The line and quadrangle are parallel
193  D3DXVECTOR3    diff(start - quad.point[0]);
194  float t = -D3DXVec3Dot(&diff, &quad.normal);
195  t = t / denom;
229  D3DXVECTOR3      v(c - start);
230  float   t = D3DXVec3Dot(&v, &dir);
231  p = (t * dir) + start;

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