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
Remarks
D3DXVECTOR3 Extensions
D3DXVECTOR3 has the following C++ extensions.
- #ifdef __cplusplus
- typedef struct D3DXVECTOR3 : public D3DVECTOR
- {
- public:
- D3DXVECTOR3() {};
- D3DXVECTOR3( CONST FLOAT * );
- D3DXVECTOR3( CONST D3DVECTOR& );
- D3DXVECTOR3( CONST D3DXFLOAT16 * );
- D3DXVECTOR3( FLOAT x, FLOAT y, FLOAT z );
- // casting
- operator FLOAT* ();
- operator CONST FLOAT* () const;
- // assignment operators
- D3DXVECTOR3& operator += ( CONST D3DXVECTOR3& );
- D3DXVECTOR3& operator -= ( CONST D3DXVECTOR3& );
- D3DXVECTOR3& operator *= ( FLOAT );
- D3DXVECTOR3& operator /= ( FLOAT );
- // unary operators
- D3DXVECTOR3 operator + () const;
- D3DXVECTOR3 operator - () const;
- // binary operators
- D3DXVECTOR3 operator + ( CONST D3DXVECTOR3& ) const;
- D3DXVECTOR3 operator - ( CONST D3DXVECTOR3& ) const;
- D3DXVECTOR3 operator * ( FLOAT ) const;
- D3DXVECTOR3 operator / ( FLOAT ) const;
- friend D3DXVECTOR3 operator * ( FLOAT, CONST struct D3DXVECTOR3& );
- BOOL operator == ( CONST D3DXVECTOR3& ) const;
- BOOL operator != ( CONST D3DXVECTOR3& ) const;
- } D3DXVECTOR3, *LPD3DXVECTOR3;
- #else //!__cplusplus
- typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3;
- #endif //!__cplusplus
- typedef struct D3DXVECTOR3_16F
- {
- #ifdef __cplusplus
- public:
- D3DXVECTOR3_16F() {};
- D3DXVECTOR3_16F( CONST FLOAT * );
- D3DXVECTOR3_16F( CONST D3DVECTOR& );
- D3DXVECTOR3_16F( CONST D3DXFLOAT16 * );
- D3DXVECTOR3_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y, CONST D3DXFLOAT16 &z );
- // casting
- operator D3DXFLOAT16* ();
- operator CONST D3DXFLOAT16* () const;
- // binary operators
- BOOL operator == ( CONST D3DXVECTOR3_16F& ) const;
- BOOL operator != ( CONST D3DXVECTOR3_16F& ) const;
- public:
- #endif //__cplusplus
- D3DXFLOAT16 x, y, z;
- } D3DXVECTOR3_16F, *LPD3DXVECTOR3_16F;
原文链接: https://www.cnblogs.com/dragon2012/archive/2013/03/02/2940202.html
欢迎关注
微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍
原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/79403
非原创文章文中已经注明原地址,如有侵权,联系删除
关注公众号【高性能架构探索】,第一时间获取最新文章
转载文章受原作者版权保护。转载请注明原作者出处!