[964] | 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_PHYSICSMODEL_H_
|
---|
| 7 | #define _FCD_PHYSICSMODEL_H_
|
---|
| 8 |
|
---|
| 9 | #include "FCDocument/FCDEntity.h"
|
---|
| 10 | #include "FCDocument/FCDEntityInstance.h"
|
---|
| 11 | #include "FUtils/FUDaeEnum.h"
|
---|
| 12 |
|
---|
| 13 | class FCDocument;
|
---|
| 14 | class FCDPhysicsRigidBody;
|
---|
| 15 | class FCDPhysicsRigidConstraint;
|
---|
| 16 |
|
---|
| 17 | typedef vector<FCDEntityInstance*> FCDEntityInstanceList;
|
---|
| 18 | typedef vector<FCDPhysicsRigidBody*> FCDPhysicsRigidBodyList;
|
---|
| 19 | typedef vector<FCDPhysicsRigidConstraint*> FCDPhysicsRigidConstraintList;
|
---|
| 20 |
|
---|
| 21 | class FCOLLADA_EXPORT FCDPhysicsModel : public FCDEntity
|
---|
| 22 | {
|
---|
| 23 | private:
|
---|
| 24 | DeclareObjectType;
|
---|
| 25 | FCDEntityInstanceList instances;
|
---|
| 26 | FCDPhysicsRigidBodyList rigidBodies;
|
---|
| 27 | FCDPhysicsRigidConstraintList rigidConstraints;
|
---|
| 28 |
|
---|
| 29 | public:
|
---|
| 30 | FCDPhysicsModel(FCDocument* document);
|
---|
| 31 | virtual ~FCDPhysicsModel();
|
---|
| 32 |
|
---|
| 33 | // Returns the entity type
|
---|
| 34 | virtual Type GetType() const { return PHYSICS_MODEL; }
|
---|
| 35 |
|
---|
| 36 | // Direct Accessors
|
---|
| 37 | FCDEntityInstanceList& GetInstances() { return instances; }
|
---|
| 38 | const FCDEntityInstanceList& GetInstances() const { return instances; }
|
---|
| 39 |
|
---|
| 40 | FCDPhysicsRigidBody* FindRigidBodyFromSid(const string& sid);
|
---|
| 41 | FCDPhysicsRigidConstraint* FindRigidConstraintFromSid(const string& sid);
|
---|
| 42 |
|
---|
| 43 | // Create a copy of this physicsmodel, with the vertices overwritten
|
---|
| 44 | FCDPhysicsModel* Clone(/*FloatList& newPositions, uint32 newPositionsStride, FloatList& newNormals, uint32 newNormalsStride*/);
|
---|
| 45 |
|
---|
| 46 | // Read in the <physics_model> node of the COLLADA document
|
---|
| 47 | virtual FUStatus LoadFromXML(xmlNode* node);
|
---|
| 48 |
|
---|
| 49 | // Write out the <physics_model> node to the COLLADA xml tree
|
---|
| 50 | virtual xmlNode* WriteToXML(xmlNode* parentNode) const;
|
---|
| 51 | };
|
---|
| 52 |
|
---|
| 53 | #endif // _FCD_PHYSICSMODEL_H_
|
---|