source: NonGTP/FCollada/FCDocument/FCDPhysicsAnalyticalGeometry.h @ 964

Revision 964, 4.4 KB checked in by igarcia, 18 years ago (diff)
Line 
1/*
2        Copyright (C) 2005-2006 Feeling Software Inc.
3        MIT License: http://www.opensource.org/licenses/mit-license.php
4*/
5
6#ifndef _FCD_PHYSICS_ANALYTICAL_GEOM_H_
7#define _FCD_PHYSICS_ANALYTICAL_GEOM_H_
8
9#include "FCDocument/FCDEntity.h"
10#include "FCDocument/FCDEntityInstance.h"
11#include "FUtils/FUDaeEnum.h"
12
13class FCDocument;
14class FCDPhysicsParameterGeneric;
15
16typedef vector<FCDPhysicsParameterGeneric*> FCDPhysicsParameterList;
17
18class FCOLLADA_EXPORT FCDPhysicsAnalyticalGeometry : public FCDEntity
19{
20private:
21        DeclareObjectType;
22
23public:
24        enum GeomType { BOX, PLANE, SPHERE, CYLINDER, CAPSULE, TAPERED_CYLINDER, TAPERED_CAPSULE };
25
26        FCDPhysicsAnalyticalGeometry(FCDocument* document);
27        virtual ~FCDPhysicsAnalyticalGeometry();
28
29        virtual Type GetType() const {return PHYSICS_ANALYTICAL_GEOMETRY;}
30
31        // Returns the entity type
32        virtual GeomType GetGeomType() const = 0;
33
34        // Create a copy of this analyticalGeometry
35        virtual FCDPhysicsAnalyticalGeometry* Clone() = 0;
36
37        // Read in the <physics_analyticalGeometry> node of the COLLADA document
38        virtual FUStatus LoadFromXML(xmlNode* node);
39
40        // Write out the <physics_analyticalGeometry> node to the COLLADA xml tree
41        virtual xmlNode* WriteToXML(xmlNode* parentNode) const = 0;
42};
43
44class FCOLLADA_EXPORT FCDPASBox : public FCDPhysicsAnalyticalGeometry
45{
46private:
47        DeclareObjectType;
48
49public:
50        FCDPASBox(FCDocument* document);
51        virtual ~FCDPASBox() {}
52
53        virtual FUStatus LoadFromXML(xmlNode* node);
54        virtual xmlNode* WriteToXML(xmlNode* parentNode) const;
55        virtual GeomType GetGeomType() const {return BOX;}
56        virtual FCDPhysicsAnalyticalGeometry* Clone();
57
58public:
59        FMVector3 halfExtents;
60};
61
62class FCOLLADA_EXPORT FCDPASPlane : public FCDPhysicsAnalyticalGeometry
63{
64private:
65        DeclareObjectType;
66
67public:
68        FCDPASPlane(FCDocument* document);
69        virtual ~FCDPASPlane() {}
70
71        virtual FUStatus LoadFromXML(xmlNode* node);
72        virtual xmlNode* WriteToXML(xmlNode* parentNode) const;
73        virtual GeomType GetGeomType() const {return PLANE;}
74        virtual FCDPhysicsAnalyticalGeometry* Clone();
75
76public:
77        FMVector3 normal;
78        float d;
79};
80
81class FCOLLADA_EXPORT FCDPASSphere : public FCDPhysicsAnalyticalGeometry
82{
83private:
84        DeclareObjectType;
85
86public:
87        FCDPASSphere(FCDocument* document);
88        virtual ~FCDPASSphere() {}
89
90        virtual FUStatus LoadFromXML(xmlNode* node);
91        virtual xmlNode* WriteToXML(xmlNode* parentNode) const;
92        virtual GeomType GetGeomType() const {return SPHERE;}
93        virtual FCDPhysicsAnalyticalGeometry* Clone();
94
95public:
96        float radius;
97};
98
99class FCOLLADA_EXPORT FCDPASCylinder : public FCDPhysicsAnalyticalGeometry
100{
101private:
102        DeclareObjectType;
103
104public:
105        FCDPASCylinder(FCDocument* document);
106        virtual ~FCDPASCylinder() {}
107
108        virtual FUStatus LoadFromXML(xmlNode* node);
109        virtual xmlNode* WriteToXML(xmlNode* parentNode) const;
110        virtual GeomType GetGeomType() const {return CYLINDER;}
111        virtual FCDPhysicsAnalyticalGeometry* Clone();
112
113public:
114        float height;
115        float radius;
116};
117
118class FCOLLADA_EXPORT FCDPASCapsule : public FCDPhysicsAnalyticalGeometry
119{
120private:
121        DeclareObjectType;
122
123public:
124        FCDPASCapsule(FCDocument* document);
125        virtual ~FCDPASCapsule() {}
126
127        virtual FUStatus LoadFromXML(xmlNode* node);
128        virtual xmlNode* WriteToXML(xmlNode* parentNode) const;
129        virtual GeomType GetGeomType() const {return CAPSULE;}
130        virtual FCDPhysicsAnalyticalGeometry* Clone();
131
132public:
133        float height;
134        float radius;
135};
136
137class FCOLLADA_EXPORT FCDPASTaperedCapsule : public FCDPASCapsule
138{
139private:
140        DeclareObjectType;
141
142public:
143        FCDPASTaperedCapsule(FCDocument* document);
144        virtual ~FCDPASTaperedCapsule() {}
145
146        virtual FUStatus LoadFromXML(xmlNode* node);
147        virtual xmlNode* WriteToXML(xmlNode* parentNode) const;
148        virtual GeomType GetGeomType() const {return TAPERED_CAPSULE;}
149        virtual FCDPhysicsAnalyticalGeometry* Clone();
150
151public:
152        //inherits all other attributes from Capsule
153        float radius2;
154};
155
156class FCOLLADA_EXPORT FCDPASTaperedCylinder : public FCDPASCylinder
157{
158private:
159        DeclareObjectType;
160
161public:
162        FCDPASTaperedCylinder(FCDocument* document);
163        virtual ~FCDPASTaperedCylinder() {}
164
165        virtual FUStatus LoadFromXML(xmlNode* node);
166        virtual xmlNode* WriteToXML(xmlNode* parentNode) const;
167        virtual GeomType GetGeomType() const {return TAPERED_CYLINDER;}
168        virtual FCDPhysicsAnalyticalGeometry* Clone();
169
170public:
171        //inherits all other attributes from Cylinder
172        float radius2;
173};
174
175
176#endif // _FCD_PHYSICS_ANALYTICAL_GEOMETRY_H_
Note: See TracBrowser for help on using the repository browser.