00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __BULLET_SOFT_BODY_CONFIG_H__
00016 #define __BULLET_SOFT_BODY_CONFIG_H__
00017
00018 #include "pandabase.h"
00019
00020 #include "bullet_includes.h"
00021
00022
00023
00024
00025
00026 class EXPCL_PANDABULLET BulletSoftBodyConfig {
00027
00028 PUBLISHED:
00029 INLINE ~BulletSoftBodyConfig();
00030
00031 enum CollisionFlag {
00032 CF_rigid__vs_soft_mask = 0x000f,
00033 CF_sdf_rigid_soft = 0x0001,
00034 CF_cluster_rigid_soft = 0x0002,
00035 CF_soft_vs_soft_mask = 0x0030,
00036 CF_vertex_face_soft_soft = 0x0010,
00037 CF_cluster_soft_soft = 0x0020,
00038 CF_cluster_self = 0x0040,
00039 };
00040
00041 enum AeroModel {
00042 AM_vertex_point,
00043 AM_vertex_two_sided,
00044 AM_vertex_one_sided,
00045 AM_face_two_sided,
00046 AM_face_one_sided,
00047 };
00048
00049 void clear_all_collision_flags();
00050 void set_collision_flag(CollisionFlag flag, bool value);
00051 bool get_collision_flag(CollisionFlag flag) const;
00052
00053 void set_aero_model(AeroModel value);
00054 AeroModel get_aero_model() const;
00055
00056 INLINE void set_velocities_correction_factor(PN_stdfloat value);
00057 INLINE void set_damping_coefficient(PN_stdfloat value);
00058 INLINE void set_drag_coefficient(PN_stdfloat value);
00059 INLINE void set_lift_coefficient(PN_stdfloat value);
00060 INLINE void set_pressure_coefficient(PN_stdfloat value);
00061 INLINE void set_volume_conversation_coefficient(PN_stdfloat value);
00062 INLINE void set_dynamic_friction_coefficient(PN_stdfloat value);
00063 INLINE void set_pose_matching_coefficient(PN_stdfloat value);
00064 INLINE void set_rigid_contacts_hardness(PN_stdfloat value);
00065 INLINE void set_kinetic_contacts_hardness(PN_stdfloat value);
00066 INLINE void set_soft_contacts_hardness(PN_stdfloat value);
00067 INLINE void set_anchors_hardness(PN_stdfloat value);
00068 INLINE void set_soft_vs_rigid_hardness(PN_stdfloat value);
00069 INLINE void set_soft_vs_kinetic_hardness(PN_stdfloat value);
00070 INLINE void set_soft_vs_soft_hardness(PN_stdfloat value);
00071 INLINE void set_soft_vs_rigid_impulse_split(PN_stdfloat value);
00072 INLINE void set_soft_vs_kinetic_impulse_split(PN_stdfloat value);
00073 INLINE void set_soft_vs_soft_impulse_split(PN_stdfloat value);
00074 INLINE void set_maxvolume(PN_stdfloat value);
00075 INLINE void set_timescale(PN_stdfloat value);
00076 INLINE void set_positions_solver_iterations(int value);
00077 INLINE void set_velocities_solver_iterations(int value);
00078 INLINE void set_drift_solver_iterations( int value);
00079 INLINE void set_cluster_solver_iterations(int value);
00080
00081 INLINE PN_stdfloat get_velocities_correction_factor() const;
00082 INLINE PN_stdfloat get_damping_coefficient() const;
00083 INLINE PN_stdfloat get_drag_coefficient() const;
00084 INLINE PN_stdfloat get_lift_coefficient() const;
00085 INLINE PN_stdfloat get_pressure_coefficient() const;
00086 INLINE PN_stdfloat get_volume_conversation_coefficient() const;
00087 INLINE PN_stdfloat get_dynamic_friction_coefficient() const;
00088 INLINE PN_stdfloat get_pose_matching_coefficient() const;
00089 INLINE PN_stdfloat get_rigid_contacts_hardness() const;
00090 INLINE PN_stdfloat get_kinetic_contacts_hardness() const;
00091 INLINE PN_stdfloat get_soft_contacts_hardness() const;
00092 INLINE PN_stdfloat get_anchors_hardness() const;
00093 INLINE PN_stdfloat get_soft_vs_rigid_hardness() const;
00094 INLINE PN_stdfloat get_soft_vs_kinetic_hardness() const;
00095 INLINE PN_stdfloat get_soft_vs_soft_hardness() const;
00096 INLINE PN_stdfloat get_soft_vs_rigid_impulse_split() const;
00097 INLINE PN_stdfloat get_soft_vs_kinetic_impulse_split() const;
00098 INLINE PN_stdfloat get_soft_vs_soft_impulse_split() const;
00099 INLINE PN_stdfloat get_maxvolume() const;
00100 INLINE PN_stdfloat get_timescale() const;
00101 INLINE int get_positions_solver_iterations() const;
00102 INLINE int get_velocities_solver_iterations() const;
00103 INLINE int get_drift_solver_iterations() const;
00104 INLINE int get_cluster_solver_iterations() const;
00105
00106 public:
00107 BulletSoftBodyConfig(btSoftBody::Config &cfg);
00108
00109 private:
00110 btSoftBody::Config &_cfg;
00111 };
00112
00113 #include "bulletSoftBodyConfig.I"
00114
00115 #endif // __BULLET_SOFT_BODY_CONFIG_H__