Panda3D

bulletSoftBodyConfig.h

00001 // Filename: bulletSoftBodyConfig.h
00002 // Created by:  enn0x (12Apr10)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
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 //       Class : BulletSoftBodyConfig
00024 // Description : 
00025 ////////////////////////////////////////////////////////////////////
00026 class EXPCL_PANDABULLET BulletSoftBodyConfig {
00027 
00028 PUBLISHED:
00029   INLINE ~BulletSoftBodyConfig();
00030 
00031   enum CollisionFlag {
00032     CF_rigid__vs_soft_mask   = 0x000f, // RVSmask: Rigid versus soft mask
00033     CF_sdf_rigid_soft        = 0x0001, // SDF_RS:  SDF based rigid vs soft
00034     CF_cluster_rigid_soft    = 0x0002, // CL_RS:   Cluster vs convex rigid vs soft
00035     CF_soft_vs_soft_mask     = 0x0030, // SVSmask: Soft versus soft mask
00036     CF_vertex_face_soft_soft = 0x0010, // VF_SS:   Vertex vs face soft vs soft handling
00037     CF_cluster_soft_soft     = 0x0020, // CL_SS:   Cluster vs cluster soft vs soft handling
00038     CF_cluster_self          = 0x0040, // CL_SELF: Cluster soft body self collision
00039   };
00040 
00041   enum AeroModel {
00042     AM_vertex_point,     // V_Point:    Vertex normals are oriented toward velocity
00043     AM_vertex_two_sided, // V_TwoSided: Vertex normals are fliped to match velocity
00044     AM_vertex_one_sided, // V_OneSided: Vertex normals are taken as it is
00045     AM_face_two_sided,   // F_TwoSided: Face normals are fliped to match velocity
00046     AM_face_one_sided,   // F_OneSided: Face normals are taken as it is
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__
 All Classes Functions Variables Enumerations