[964] | 1 | /*
|
---|
| 2 | Copyright (C) 2005-2006 Feeling Software Inc.
|
---|
| 3 | MIT License: http://www.opensource.org/licenses/mit-license.php
|
---|
| 4 | */
|
---|
| 5 | /*
|
---|
| 6 | Based on the FS Import classes:
|
---|
| 7 | Copyright (C) 2005-2006 Feeling Software Inc
|
---|
| 8 | Copyright (C) 2005-2006 Autodesk Media Entertainment
|
---|
| 9 | MIT License: http://www.opensource.org/licenses/mit-license.php
|
---|
| 10 | */
|
---|
| 11 |
|
---|
| 12 | #ifndef _FCD_PHYSICS_SCENE_NODE_
|
---|
| 13 | #define _FCD_PHYSICS_SCENE_NODE_
|
---|
| 14 |
|
---|
| 15 | #include "FCDocument/FCDEntity.h"
|
---|
| 16 |
|
---|
| 17 | class FCDocument;
|
---|
| 18 | class FCDEntityInstance;
|
---|
| 19 | class FCDExtra;
|
---|
| 20 |
|
---|
| 21 | class FCDPhysicsModelInstance;
|
---|
| 22 |
|
---|
| 23 | typedef vector<FCDPhysicsModelInstance*> FCDPhysicsModelInstanceList;
|
---|
| 24 |
|
---|
| 25 | class FCOLLADA_EXPORT FCDPhysicsSceneNode : public FCDEntity
|
---|
| 26 | {
|
---|
| 27 | private:
|
---|
| 28 | DeclareObjectType;
|
---|
| 29 | FCDExtra* extra;
|
---|
| 30 | FMVector3 gravity;
|
---|
| 31 | float timestep;
|
---|
| 32 | FCDPhysicsModelInstanceList instances;
|
---|
| 33 |
|
---|
| 34 | public:
|
---|
| 35 | FCDPhysicsSceneNode(FCDocument* document);
|
---|
| 36 | virtual ~FCDPhysicsSceneNode();
|
---|
| 37 |
|
---|
| 38 | // Returns the entity type
|
---|
| 39 | virtual Type GetType() const { return PHYSICS_SCENE_NODE; }
|
---|
| 40 |
|
---|
| 41 | FCDPhysicsModelInstanceList& GetInstances() { return instances; }
|
---|
| 42 | const FCDPhysicsModelInstanceList& GetInstances() const { return instances; }
|
---|
| 43 | size_t GetNumInstances() const { return instances.size(); };
|
---|
| 44 |
|
---|
| 45 | // Visibility parameter
|
---|
| 46 | const FMVector3& GetGravity() const { return gravity; }
|
---|
| 47 | const float& GetTimestep() const { return timestep; }
|
---|
| 48 |
|
---|
| 49 | // Parse a <physics_scene> node from a COLLADA document
|
---|
| 50 | virtual FUStatus LoadFromXML(xmlNode* sceneNode);
|
---|
| 51 |
|
---|
| 52 | // Write out a <physics_scene> element to a COLLADA xml document
|
---|
| 53 | void WriteToNodeXML(xmlNode* node) const;
|
---|
| 54 | virtual xmlNode* WriteToXML(xmlNode* parentNode) const;
|
---|
| 55 |
|
---|
| 56 | // Instantiating a scene node means ensuring that there is no cycles in the scene graph
|
---|
| 57 | void Instantiate(FCDPhysicsSceneNode* sceneNode);
|
---|
| 58 | };
|
---|
| 59 |
|
---|
| 60 | #endif // _FCD_SCENE_NODE_
|
---|