123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- #pragma once
- #include "Vec2.h"
- #include "Array.h"
- #include "Mat4.h"
- #include "Zeichnung3D.h"
- struct ID3D11Buffer;
- namespace Framework
- {
- struct Polygon2D;
- class Textur;
- class Model2DData;
- class DXIndexBuffer;
- class DXVertexBuffer;
- class Render3D;
- class Model3DTextur;
- class Model3DList;
- class Animation3D;
-
- class Knochen
- {
- private:
- Vec3< float > pos;
- Vec3< float > winkel;
- Knochen *geschwister;
- Knochen *kinder;
- int id;
-
-
- void addGeschwisterKnochen( Knochen *k );
- public:
-
- __declspec( dllexport ) Knochen( int id );
-
- __declspec( dllexport ) ~Knochen();
-
-
- __declspec( dllexport ) void setPosition( Vec3< float > &pos );
-
-
- __declspec( dllexport ) void setDrehung( Vec3< float > &winkel );
-
-
-
- __declspec( dllexport ) void addKind( int id, Knochen *k );
-
-
-
-
- __declspec( dllexport ) void kalkulateMatrix( Mat4< float > &elternMat, Mat4< float > *matBuffer, Mat4< float > &kamMat );
-
- __declspec( dllexport ) Knochen *kopiereKnochen() const;
-
- __declspec( dllexport ) int getId() const;
-
- __declspec( dllexport ) Vec3< float > getDrehung() const;
-
- __declspec( dllexport ) Vec3< float > getPosition() const;
-
- float getRadius() const;
- friend Animation3D;
- };
-
- class Skelett
- {
- private:
- Knochen *k;
- int nextId;
- int ref;
- public:
-
- __declspec( dllexport ) Skelett();
-
- __declspec( dllexport ) ~Skelett();
-
-
- __declspec( dllexport ) int getNextKnochenId();
-
-
-
- __declspec( dllexport ) void addKnochen( Knochen *k, int elternId = -1 );
-
-
-
-
-
- __declspec( dllexport ) int kalkulateMatrix( Mat4< float > &modelMatrix, Mat4< float > *matBuffer, Mat4< float > &kamMatrix );
-
- __declspec( dllexport ) float getRadius() const;
-
- __declspec( dllexport ) Skelett *kopiereSkelett() const;
-
-
- __declspec( dllexport ) Skelett *getThis();
-
-
- __declspec( dllexport ) Skelett *release();
- friend Animation3D;
- };
-
- struct Vertex3D
- {
- Vec3< float > pos;
- Vec2< float > tPos;
- int knochenId;
- };
-
- struct Polygon3D
- {
- int *indexList;
- int indexAnz;
- DXIndexBuffer *indexBuffer;
-
- __declspec( dllexport ) Polygon3D();
-
- __declspec( dllexport ) ~Polygon3D();
- };
-
-
- class Model3DData
- {
- private:
- Skelett *skelett;
- Vertex3D *vertexList;
- DXVertexBuffer *vertexBuffer;
- Array< Polygon3D* > *polygons;
- float radius;
- int id;
- int ref;
- public:
-
- __declspec( dllexport ) Model3DData();
-
- __declspec( dllexport ) ~Model3DData();
-
- __declspec( dllexport ) void clearModel();
-
-
- __declspec( dllexport ) void setSkelettZ( Skelett *s );
-
-
-
- __declspec( dllexport ) void setVertecies( Vertex3D *vertexList, int anz );
-
-
- __declspec( dllexport ) void addPolygon( Polygon3D *polygon );
-
-
-
- __declspec( dllexport ) void copyModel2D( Model2DData *model, float z );
-
-
- __declspec( dllexport ) void removePolygon( int index );
-
- __declspec( dllexport ) void aktualisiereVertecies( Render3D *zRObj );
-
-
-
-
-
- int kalkulateMatrix( Mat4< float > &modelMatrix, Mat4< float > *matBuffer, Mat4< float > &kamMatrix ) const;
-
-
-
-
- __declspec( dllexport ) void render( Mat4< float > &welt, const Model3DTextur *zTxt, Render3D *zRObj );
-
- __declspec( dllexport ) int getPolygonAnzahl() const;
-
-
- __declspec( dllexport ) Polygon3D *getPolygon( int index ) const;
-
- __declspec( dllexport ) float getRadius() const;
-
- __declspec( dllexport ) int getId() const;
-
- __declspec( dllexport ) const DXVertexBuffer *zVertexBuffer() const;
-
-
- __declspec( dllexport ) Model3DData *getThis();
-
-
- __declspec( dllexport ) Model3DData *release();
- friend Model3DList;
- };
-
- class Model3DTextur
- {
- private:
- RCArray< Textur > *textures;
- int ref;
- public:
-
- __declspec( dllexport ) Model3DTextur();
-
- __declspec( dllexport ) ~Model3DTextur();
-
-
-
- __declspec( dllexport ) void setPolygonTextur( int pI, Textur *txt );
-
-
- __declspec( dllexport ) Textur *zPolygonTextur( int i ) const;
-
-
- __declspec( dllexport ) Model3DTextur *getThis();
-
-
- __declspec( dllexport ) Model3DTextur *release();
- };
-
- class Model3D : public Zeichnung3D
- {
- protected:
- struct AnimationData
- {
- Animation3D *a;
- double speed;
- double offset;
- AnimationData *getThis();
- AnimationData *release();
- };
- Model3DData *model;
- Skelett *skelett;
- Model3DTextur *textur;
- RCArray< AnimationData > *animations;
- public:
-
- __declspec( dllexport ) Model3D();
-
- __declspec( dllexport ) virtual ~Model3D();
-
-
- __declspec( dllexport ) void addAnimation( Animation3D *a, double speed = 1 );
-
-
- __declspec( dllexport ) void removeAnimation( Animation3D *zA );
-
-
- __declspec( dllexport ) void setSkelettZ( Skelett *s );
-
-
- __declspec( dllexport ) void setModelDaten( Model3DData *data );
-
-
- __declspec( dllexport ) void setModelTextur( Model3DTextur *txt );
-
-
-
-
- __declspec( dllexport ) int errechneMatrizen( Mat4< float > &viewProj, Mat4< float > *matBuffer ) override;
-
-
-
- __declspec( dllexport ) virtual bool tick( double tickval ) override;
-
-
- __declspec( dllexport ) void render( Render3D *zRObj ) override;
-
- __declspec( dllexport ) int getDatenId() const;
-
- __declspec( dllexport ) const DXVertexBuffer *zVertexBuffer() const;
- };
- }
|