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

Revision 964, 2.0 KB checked in by igarcia, 19 years ago (diff)
RevLine 
[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_PHYSICSRIGIDBODY_H_
7#define _FCD_PHYSICSRIGIDBODY_H_
8
9#include "FCDocument/FCDEntity.h"
10#include "FCDocument/FCDEntityInstance.h"
11#include "FCDocument/FCDPhysicsParameter.h"
12#include "FCDocument/FCDTransform.h"
13#include "FCDocument/FCDPhysicsShape.h"
14#include "FUtils/FUDaeEnum.h"
15
16class FCDocument;
17
18typedef vector<FCDPhysicsParameterGeneric*> FCDPhysicsParameterList;
19typedef vector<FCDPhysicsShape*> FCDPhysicsShapeList;
20
21class FCOLLADA_EXPORT FCDPhysicsRigidBody : public FCDEntity
22{
23private:
24        DeclareObjectType;
25
26        string sid;
27        bool ownsPhysicsMaterial;
28        FCDPhysicsMaterial* physicsMaterial;
29       
30        FCDPhysicsParameterList parameters;
31        FCDPhysicsShapeList physicsShape;
32
33public:
34        FCDPhysicsRigidBody(FCDocument* document);
35        virtual ~FCDPhysicsRigidBody();
36
37        string GetSid() const { return sid; }
38        // Returns the entity type
39        virtual Type GetType() const { return PHYSICS_RIGID_BODY; }
40       
41        void AddParameter(FCDPhysicsParameterGeneric* parameter);
42        void CopyParameter(FCDPhysicsParameterGeneric* parameter);
43
44        void SetParameters(FCDPhysicsParameterList& params);
45        FCDPhysicsParameterGeneric* FindParameterByReference(const string& reference);
46
47        // Direct Accessors
48        FCDPhysicsMaterial* GetPhysicsMaterial() const {return physicsMaterial;}
49        void SetPhysicsMaterial(FCDPhysicsMaterial* _physicsMaterial);
50        FCDPhysicsShapeList& GetPhysicsShapeList() {return physicsShape;}
51        void SetPhysicsShapes(FCDPhysicsShapeList& _physicsShape);
52        void SetMaterialOwnership(bool val) {ownsPhysicsMaterial = val;}
53
54        void Flatten();
55
56        // Create a copy of this physicsmodel, with the vertices overwritten
57        FCDPhysicsRigidBody* Clone();
58
59        // Read in the <physics_model> node of the COLLADA document
60        virtual FUStatus LoadFromXML(xmlNode* node);
61
62        // Write out the <physics_model> node to the COLLADA xml tree
63        virtual xmlNode* WriteToXML(xmlNode* parentNode) const;
64};
65
66#endif // _FCD_PHYSICSRIGIDBODY_H_
Note: See TracBrowser for help on using the repository browser.