FCDocument/FCDPhysicsRigidBody.h

00001 /*
00002     Copyright (C) 2005-2006 Feeling Software Inc.
00003     MIT License: http://www.opensource.org/licenses/mit-license.php
00004 */
00005 
00006 #ifndef _FCD_PHYSICSRIGIDBODY_H_
00007 #define _FCD_PHYSICSRIGIDBODY_H_
00008 
00009 #include "FCDocument/FCDEntity.h"
00010 #include "FCDocument/FCDEntityInstance.h"
00011 #include "FCDocument/FCDPhysicsParameter.h"
00012 #include "FCDocument/FCDTransform.h"
00013 #include "FCDocument/FCDPhysicsShape.h"
00014 #include "FUtils/FUDaeEnum.h"
00015 
00016 class FCDocument;
00017 
00018 typedef vector<FCDPhysicsParameterGeneric*> FCDPhysicsParameterList;
00019 typedef vector<FCDPhysicsShape*> FCDPhysicsShapeList;
00020 
00021 class FCOLLADA_EXPORT FCDPhysicsRigidBody : public FCDEntity
00022 {
00023 private:
00024     DeclareObjectType;
00025 
00026     string sid;
00027     bool ownsPhysicsMaterial;
00028     FCDPhysicsMaterial* physicsMaterial;
00029     
00030     FCDPhysicsParameterList parameters;
00031     FCDPhysicsShapeList physicsShape;
00032 
00033 public:
00034     FCDPhysicsRigidBody(FCDocument* document);
00035     virtual ~FCDPhysicsRigidBody();
00036 
00037     string GetSid() const { return sid; }
00038     // Returns the entity type
00039     virtual Type GetType() const { return PHYSICS_RIGID_BODY; }
00040     
00041     void AddParameter(FCDPhysicsParameterGeneric* parameter);
00042     void CopyParameter(FCDPhysicsParameterGeneric* parameter);
00043 
00044     void SetParameters(FCDPhysicsParameterList& params);
00045     FCDPhysicsParameterGeneric* FindParameterByReference(const string& reference);
00046 
00047     // Direct Accessors
00048     FCDPhysicsMaterial* GetPhysicsMaterial() const {return physicsMaterial;}
00049     void SetPhysicsMaterial(FCDPhysicsMaterial* _physicsMaterial);
00050     FCDPhysicsShapeList& GetPhysicsShapeList() {return physicsShape;}
00051     void SetPhysicsShapes(FCDPhysicsShapeList& _physicsShape);
00052     void SetMaterialOwnership(bool val) {ownsPhysicsMaterial = val;}
00053 
00054     void Flatten();
00055 
00056     // Create a copy of this physicsmodel, with the vertices overwritten
00057     FCDPhysicsRigidBody* Clone();
00058 
00059     // Read in the <physics_model> node of the COLLADA document
00060     virtual FUStatus LoadFromXML(xmlNode* node);
00061 
00062     // Write out the <physics_model> node to the COLLADA xml tree
00063     virtual xmlNode* WriteToXML(xmlNode* parentNode) const;
00064 };
00065 
00066 #endif // _FCD_PHYSICSRIGIDBODY_H_

Generated on Fri May 12 16:44:39 2006 for FCollada by  doxygen 1.4.6-NO