00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef PHYSXMATERIAL_H
00016 #define PHYSXMATERIAL_H
00017
00018 #include "pandabase.h"
00019 #include "luse.h"
00020
00021 #include "physxObject.h"
00022 #include "physxEnums.h"
00023 #include "physx_includes.h"
00024
00025 class PhysxScene;
00026 class PhysxMaterialDesc;
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 class EXPCL_PANDAPHYSX PhysxMaterial : public PhysxObject, public PhysxEnums {
00052
00053 PUBLISHED:
00054 INLINE PhysxMaterial();
00055 INLINE ~PhysxMaterial();
00056
00057 PhysxScene *get_scene() const;
00058 unsigned short get_material_index() const;
00059
00060 void load_from_desc(const PhysxMaterialDesc &materialDesc);
00061 void save_to_desc(PhysxMaterialDesc &materialDesc) const;
00062
00063 void set_dynamic_friction(float coef);
00064 void set_static_friction(float coef);
00065 void set_restitution(float rest);
00066 void set_dynamic_friction_v(float coef);
00067 void set_static_friction_v(float coef);
00068 void set_dir_of_anisotropy(const LVector3f dir);
00069 void set_flag(PhysxMaterialFlag flag, bool value);
00070 void set_friction_combine_mode(PhysxCombineMode mode);
00071 void set_restitution_combine_mode(PhysxCombineMode mode);
00072
00073 float get_dynamic_friction() const;
00074 float get_static_friction() const;
00075 float get_restitution() const;
00076 float get_dynamic_friction_v() const;
00077 float get_static_friction_v() const;
00078 LVector3f get_dir_of_anisotropy() const;
00079 bool get_flag(PhysxMaterialFlag flag) const;
00080 PhysxCombineMode get_friction_combine_mode() const;
00081 PhysxCombineMode get_restitution_combine_mode() const;
00082
00083 INLINE void ls() const;
00084 INLINE void ls(ostream &out, int indent_level=0) const;
00085
00086
00087 PUBLISHED:
00088 void release();
00089
00090 public:
00091 INLINE NxMaterial *ptr() const { return _ptr; };
00092
00093 void link(NxMaterial *ptr);
00094 void unlink();
00095
00096 private:
00097 NxMaterial *_ptr;
00098
00099
00100 public:
00101 static TypeHandle get_class_type() {
00102 return _type_handle;
00103 }
00104 static void init_type() {
00105 PhysxObject::init_type();
00106 register_type(_type_handle, "PhysxMaterial",
00107 PhysxObject::get_class_type());
00108 }
00109 virtual TypeHandle get_type() const {
00110 return get_class_type();
00111 }
00112 virtual TypeHandle force_init_type() {
00113 init_type();
00114 return get_class_type();
00115 }
00116
00117 private:
00118 static TypeHandle _type_handle;
00119 };
00120
00121 #include "physxMaterial.I"
00122
00123 #endif // PHYSXMATERIAL_H