D3DXVECTOR3

http://technet.microsoft.com/zh-cn/bb205546

Describes a three-component vector including operator overloads and type casts.

Syntax

typedef struct D3DXVECTOR3 {
  FLOAT x;
  FLOAT y;
  FLOAT z;
} D3DXVECTOR3, *LPD3DXVECTOR3;

Members

x

Type: FLOAT

The x-component.

y

Type: FLOAT

The y-component.

z

Type: FLOAT

The z-component.

Remarks

D3DXVECTOR3 Extensions

D3DXVECTOR3 has the following C++ extensions.

  1. #ifdef __cplusplus
  2. typedef struct D3DXVECTOR3 : public D3DVECTOR
  3. {
  4. public:
  5.     D3DXVECTOR3() {};
  6.     D3DXVECTOR3( CONST FLOAT * );
  7.     D3DXVECTOR3( CONST D3DVECTOR& );
  8.     D3DXVECTOR3( CONST D3DXFLOAT16 * );
  9.     D3DXVECTOR3( FLOAT x, FLOAT y, FLOAT z );
  10.  
  11.     // casting
  12.     operator FLOAT* ();
  13.     operator CONST FLOAT* () const;
  14.  
  15.     // assignment operators
  16.     D3DXVECTOR3& operator += ( CONST D3DXVECTOR3& );
  17.     D3DXVECTOR3& operator -= ( CONST D3DXVECTOR3& );
  18.     D3DXVECTOR3& operator *= ( FLOAT );
  19.     D3DXVECTOR3& operator /= ( FLOAT );
  20.  
  21.     // unary operators
  22.     D3DXVECTOR3 operator + () const;
  23.     D3DXVECTOR3 operator - () const;
  24.  
  25.     // binary operators
  26.     D3DXVECTOR3 operator + ( CONST D3DXVECTOR3& ) const;
  27.     D3DXVECTOR3 operator - ( CONST D3DXVECTOR3& ) const;
  28.     D3DXVECTOR3 operator * ( FLOAT ) const;
  29.     D3DXVECTOR3 operator / ( FLOAT ) const;
  30.  
  31.     friend D3DXVECTOR3 operator * ( FLOAT, CONST struct D3DXVECTOR3& );
  32.  
  33.     BOOL operator == ( CONST D3DXVECTOR3& ) const;
  34.     BOOL operator != ( CONST D3DXVECTOR3& ) const;
  35.  
  36. } D3DXVECTOR3, *LPD3DXVECTOR3;
  37.  
  38. #else //!__cplusplus
  39. typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3;
  40. #endif //!__cplusplus
  41.  
  42. typedef struct D3DXVECTOR3_16F
  43. {
  44. #ifdef __cplusplus
  45. public:
  46.     D3DXVECTOR3_16F() {};
  47.     D3DXVECTOR3_16F( CONST FLOAT * );
  48.     D3DXVECTOR3_16F( CONST D3DVECTOR& );
  49.     D3DXVECTOR3_16F( CONST D3DXFLOAT16 * );
  50.     D3DXVECTOR3_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y, CONST D3DXFLOAT16 &z );
  51.  
  52.     // casting
  53.     operator D3DXFLOAT16* ();
  54.     operator CONST D3DXFLOAT16* () const;
  55.  
  56.     // binary operators
  57.     BOOL operator == ( CONST D3DXVECTOR3_16F& ) const;
  58.     BOOL operator != ( CONST D3DXVECTOR3_16F& ) const;
  59.  
  60. public:
  61. #endif //__cplusplus
  62.     D3DXFLOAT16 x, y, z;
  63.  
  64. } D3DXVECTOR3_16F, *LPD3DXVECTOR3_16F;

原文链接: https://www.cnblogs.com/dragon2012/archive/2013/03/02/2940202.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍

    D3DXVECTOR3

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/79403

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年2月9日 下午7:01
下一篇 2023年2月9日 下午7:01

相关推荐