Panda3D
 All Classes Functions Variables Enumerations
bulletSoftBodyConfig.h
1 // Filename: bulletSoftBodyConfig.h
2 // Created by: enn0x (12Apr10)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef __BULLET_SOFT_BODY_CONFIG_H__
16 #define __BULLET_SOFT_BODY_CONFIG_H__
17 
18 #include "pandabase.h"
19 
20 #include "bullet_includes.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : BulletSoftBodyConfig
24 // Description :
25 ////////////////////////////////////////////////////////////////////
26 class EXPCL_PANDABULLET BulletSoftBodyConfig {
27 
28 PUBLISHED:
29  INLINE ~BulletSoftBodyConfig();
30 
31  enum CollisionFlag {
32  CF_rigid_vs_soft_mask = 0x000f, // RVSmask: Rigid versus soft mask
33  CF_sdf_rigid_soft = 0x0001, // SDF_RS: SDF based rigid vs soft
34  CF_cluster_rigid_soft = 0x0002, // CL_RS: Cluster vs convex rigid vs soft
35  CF_soft_vs_soft_mask = 0x0030, // SVSmask: Soft versus soft mask
36  CF_vertex_face_soft_soft = 0x0010, // VF_SS: Vertex vs face soft vs soft handling
37  CF_cluster_soft_soft = 0x0020, // CL_SS: Cluster vs cluster soft vs soft handling
38  CF_cluster_self = 0x0040, // CL_SELF: Cluster soft body self collision
39  };
40 
41  enum AeroModel {
42  AM_vertex_point, // V_Point: Vertex normals are oriented toward velocity
43  AM_vertex_two_sided, // V_TwoSided: Vertex normals are fliped to match velocity
44  AM_vertex_one_sided, // V_OneSided: Vertex normals are taken as it is
45  AM_face_two_sided, // F_TwoSided: Face normals are fliped to match velocity
46  AM_face_one_sided, // F_OneSided: Face normals are taken as it is
47  };
48 
49  void clear_all_collision_flags();
50  void set_collision_flag(CollisionFlag flag, bool value);
51  bool get_collision_flag(CollisionFlag flag) const;
52 
53  void set_aero_model(AeroModel value);
54  AeroModel get_aero_model() const;
55 
56  INLINE void set_velocities_correction_factor(PN_stdfloat value);
57  INLINE void set_damping_coefficient(PN_stdfloat value);
58  INLINE void set_drag_coefficient(PN_stdfloat value);
59  INLINE void set_lift_coefficient(PN_stdfloat value);
60  INLINE void set_pressure_coefficient(PN_stdfloat value);
61  INLINE void set_volume_conversation_coefficient(PN_stdfloat value);
62  INLINE void set_dynamic_friction_coefficient(PN_stdfloat value);
63  INLINE void set_pose_matching_coefficient(PN_stdfloat value);
64  INLINE void set_rigid_contacts_hardness(PN_stdfloat value);
65  INLINE void set_kinetic_contacts_hardness(PN_stdfloat value);
66  INLINE void set_soft_contacts_hardness(PN_stdfloat value);
67  INLINE void set_anchors_hardness(PN_stdfloat value);
68  INLINE void set_soft_vs_rigid_hardness(PN_stdfloat value);
69  INLINE void set_soft_vs_kinetic_hardness(PN_stdfloat value);
70  INLINE void set_soft_vs_soft_hardness(PN_stdfloat value);
71  INLINE void set_soft_vs_rigid_impulse_split(PN_stdfloat value);
72  INLINE void set_soft_vs_kinetic_impulse_split(PN_stdfloat value);
73  INLINE void set_soft_vs_soft_impulse_split(PN_stdfloat value);
74  INLINE void set_maxvolume(PN_stdfloat value);
75  INLINE void set_timescale(PN_stdfloat value);
76  INLINE void set_positions_solver_iterations(int value);
77  INLINE void set_velocities_solver_iterations(int value);
78  INLINE void set_drift_solver_iterations( int value);
79  INLINE void set_cluster_solver_iterations(int value);
80 
81  INLINE PN_stdfloat get_velocities_correction_factor() const;
82  INLINE PN_stdfloat get_damping_coefficient() const;
83  INLINE PN_stdfloat get_drag_coefficient() const;
84  INLINE PN_stdfloat get_lift_coefficient() const;
85  INLINE PN_stdfloat get_pressure_coefficient() const;
86  INLINE PN_stdfloat get_volume_conversation_coefficient() const;
87  INLINE PN_stdfloat get_dynamic_friction_coefficient() const;
88  INLINE PN_stdfloat get_pose_matching_coefficient() const;
89  INLINE PN_stdfloat get_rigid_contacts_hardness() const;
90  INLINE PN_stdfloat get_kinetic_contacts_hardness() const;
91  INLINE PN_stdfloat get_soft_contacts_hardness() const;
92  INLINE PN_stdfloat get_anchors_hardness() const;
93  INLINE PN_stdfloat get_soft_vs_rigid_hardness() const;
94  INLINE PN_stdfloat get_soft_vs_kinetic_hardness() const;
95  INLINE PN_stdfloat get_soft_vs_soft_hardness() const;
96  INLINE PN_stdfloat get_soft_vs_rigid_impulse_split() const;
97  INLINE PN_stdfloat get_soft_vs_kinetic_impulse_split() const;
98  INLINE PN_stdfloat get_soft_vs_soft_impulse_split() const;
99  INLINE PN_stdfloat get_maxvolume() const;
100  INLINE PN_stdfloat get_timescale() const;
101  INLINE int get_positions_solver_iterations() const;
102  INLINE int get_velocities_solver_iterations() const;
103  INLINE int get_drift_solver_iterations() const;
104  INLINE int get_cluster_solver_iterations() const;
105 
106 public:
107  BulletSoftBodyConfig(btSoftBody::Config &cfg);
108 
109 private:
110  btSoftBody::Config &_cfg;
111 };
112 
113 #include "bulletSoftBodyConfig.I"
114 
115 #endif // __BULLET_SOFT_BODY_CONFIG_H__