Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Anonymous
unregistriert
C-/C++-Quelltext |
|
1 2 |
matrix mView;
D3DXMatrixLookAtLH(&mView, vector3(...), ..., ...);
|
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
class API vector3 { public: vector3(); vector3(float fxyz); vector3(float fx, float fy, float fz); vector3(const vector3& v); vector3(const D3DVECTOR& v); vector3(const float* pfv); virtual ~vector3(); operator D3DVECTOR&(); vector3 operator = (const vector3& v); vector3 operator + (const vector3& v) const; vector3 operator - (const vector3& v) const; vector3 operator * (const vector3& v) const; vector3 operator / (const vector3& v) const; vector3 operator += (const vector3& v); vector3 operator -= (const vector3& v); vector3 operator *= (const vector3& v); vector3 operator /= (const vector3& v); vector3 operator * (float fs) const; vector3 operator / (float fs) const; vector3 operator *= (float fs); vector3 operator /= (float fs); vector3 operator - () const; BOOL operator == (const vector3& v) const; BOOL operator != (const vector3& v) const; union { struct { float x; float y; float z; }; /*struct { float u; float v; float w; };*/ float v[3]; D3DVECTOR vD3D; }; }; |
Anonymous
unregistriert
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 |
#define FVF D3DFVF_XYZ|D3DFVF_DIFFUSE struct SVertex { vector3 vPosition; DWORD dwColor; }; ... SVertex Vertices[3]; Vertices[0].vPosition = vector3(1.0f, 1.0f, 1.0f); Vertices[0].dwColor = color(1.0f, .0f, .0f); ... |
Alter Hase
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
union { struct { float x; float y; float z; }; /*struct { float u; float v; float w; };*/ float v[3]; D3DVECTOR vD3D; }; |
Zitat
e:\c++\dreidaeengine\vector3.h(56) : error C2040: 'v' : 'float [3]' unterscheidet sich von 'float' in bezug auf die Anzahl vorgenommener Dereferenzierungen
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
union { struct { float x; float y; float z; }; struct { float u; float v; float w; }; float c[3]; D3DVECTOR vD3D; }; |
Werbeanzeige