Guidance
指路人
g.yi.org
Guidance Forums / Rapid-Q Basic / New BUG, QD3DVector is wrong

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. New BUG, QD3DVector is wrong
#3594
Posted by: JohnK 2004-03-26 05:55:44
I found out that QD3DVector is declared incorrectly. The current declaration is

QD3DVector
  DVX SINGLE
  DVY SINGLE
  DVZ SINGLE
  X SINGLE
  Y SINGLE
  Z SINGLE

Should be:
QD3DVector
  X SINGLE
  Y SINGLE
  Z SINGLE

Why? The actual Microsoft declaration is A UNION !!!
typedef struct _D3DVECTOR {
    union {
        D3DVALUE x;
        D3DVALUE dvX;
    };
    union {
        D3DVALUE y;
        D3DVALUE dvY;
    };
    union {
        D3DVALUE z;
        D3DVALUE dvZ;
    };
} D3DVECTOR, *LPD3DVECTOR;

That is you can use this code:

DIM Camera AS QD3DVector
Camera.x = 1
Camera.y = 0
Camera.z = 0.5

But don't use:

Camera.dvx = XXX
Camera.dvy = XXX
Camera.dvz = XXX

Or maybe you should just declare your own

TYPE QVector3D
  DVX SINGLE
  DVY SINGLE
  DVZ SINGLE
  X SINGLE
  Y SINGLE
  Z SINGLE
END TYPE

DIM Camera AS QVector3D


-JohnK
-
I'm basic too
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥860.00 ·
 
 
¥900.00 ·
 
 
¥810.00 ·
 
 
¥317.00 ·
 
 
¥1,370.00 ·
 
 
¥660.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0