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_RIGID_CONSTRAINT_H_
|
---|
7 | #define _FCD_PHYSICS_RIGID_CONSTRAINT_H_
|
---|
8 |
|
---|
9 | #include "FCDocument/FCDEntity.h"
|
---|
10 | #include "FCDocument/FCDEntityInstance.h"
|
---|
11 | #include "FUtils/FUDaeEnum.h"
|
---|
12 |
|
---|
13 | class FCDocument;
|
---|
14 | class FCDTransform;
|
---|
15 | class FCDPhysicsModel;
|
---|
16 | class FCDPhysicsRigidBody;
|
---|
17 | typedef vector<FCDTransform*> FCDTransformList;
|
---|
18 |
|
---|
19 | class FCOLLADA_EXPORT FCDPhysicsRigidConstraint : public FCDEntity
|
---|
20 | {
|
---|
21 | private:
|
---|
22 | DeclareObjectType;
|
---|
23 |
|
---|
24 | string sid;
|
---|
25 | bool enabled;
|
---|
26 | bool interpenetrate;
|
---|
27 | FCDPhysicsRigidBody* referenceRigidBody;
|
---|
28 | FCDPhysicsRigidBody* targetRigidBody;
|
---|
29 | FMVector3 limitsLinearMin;
|
---|
30 | FMVector3 limitsLinearMax;
|
---|
31 | FMVector3 limitsSCTMin;
|
---|
32 | FMVector3 limitsSCTMax;
|
---|
33 |
|
---|
34 | FCDPhysicsModel* parent;
|
---|
35 |
|
---|
36 | float springLinearStiffness;
|
---|
37 | float springLinearDamping;
|
---|
38 | float springLinearTargetValue;
|
---|
39 |
|
---|
40 | float springAngularStiffness;
|
---|
41 | float springAngularDamping;
|
---|
42 | float springAngularTargetValue;
|
---|
43 |
|
---|
44 | FCDTransformList transformsRef;
|
---|
45 | FCDTransformList transformsTar;
|
---|
46 |
|
---|
47 | public:
|
---|
48 | FCDPhysicsRigidConstraint(FCDocument* document, FCDPhysicsModel* _parent);
|
---|
49 | virtual ~FCDPhysicsRigidConstraint();
|
---|
50 |
|
---|
51 | string GetSid() const { return sid; }
|
---|
52 | // Returns the entity type
|
---|
53 | virtual Type GetType() const { return PHYSICS_RIGID_CONSTRAINT; }
|
---|
54 |
|
---|
55 | const bool& GetEnabled() const { return enabled;}
|
---|
56 | const bool& GetInterpenetrate() const { return interpenetrate;}
|
---|
57 |
|
---|
58 | FCDPhysicsRigidBody* GetReferenceRigidBody() const { return referenceRigidBody;}
|
---|
59 | FCDPhysicsRigidBody* GetTargetRigidBody() const { return targetRigidBody;}
|
---|
60 |
|
---|
61 | const FCDTransformList& GetTransformsRef() const { return transformsRef; }
|
---|
62 | const FCDTransformList& GetTransformsTar() const { return transformsTar; }
|
---|
63 |
|
---|
64 | FMVector3 GetLimitsLinearMin() const { return limitsLinearMin;}
|
---|
65 | FMVector3 GetLimitsLinearMax() const { return limitsLinearMax;}
|
---|
66 | FMVector3 GetLimitsSCTMin() const { return limitsSCTMin;}
|
---|
67 | FMVector3 GetLimitsSCTMax() const { return limitsSCTMax;}
|
---|
68 |
|
---|
69 | float GetSpringLinearStiffness() const { return springLinearStiffness;}
|
---|
70 | float GetSpringLinearDamping() const { return springLinearDamping;}
|
---|
71 | float GetSpringLinearTargetValue() const { return springLinearTargetValue;}
|
---|
72 | float GetSpringAngularStiffness() const { return springAngularStiffness;}
|
---|
73 | float GetSpringAngularDamping() const { return springAngularDamping;}
|
---|
74 | float GetSpringAngularTargetValue() const { return springAngularTargetValue;}
|
---|
75 |
|
---|
76 | // Create a copy of this physicsmodel, with the vertices overwritten
|
---|
77 | FCDPhysicsRigidConstraint* Clone();
|
---|
78 |
|
---|
79 | // Read in the <physics_model> node of the COLLADA document
|
---|
80 | virtual FUStatus LoadFromXML(xmlNode* node);
|
---|
81 |
|
---|
82 | // Write out the <physics_model> node to the COLLADA xml tree
|
---|
83 | virtual xmlNode* WriteToXML(xmlNode* parentNode) const;
|
---|
84 | };
|
---|
85 |
|
---|
86 | #endif // _FCD_PHYSICS_RIGID_CONSTRAINT_H_
|
---|