00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef PHYSXCLOTHNODE_H
00016 #define PHYSXCLOTHNODE_H
00017
00018 #include "pandabase.h"
00019 #include "pointerTo.h"
00020 #include "geomNode.h"
00021 #include "transformState.h"
00022 #include "geom.h"
00023 #include "geomVertexData.h"
00024 #include "geomTriangles.h"
00025 #include "filename.h"
00026
00027 #include "physx_includes.h"
00028
00029 class PhysxCloth;
00030
00031
00032
00033
00034
00035 class EXPCL_PANDAPHYSX PhysxClothNode : public GeomNode {
00036
00037 PUBLISHED:
00038 INLINE PhysxClothNode(const char *name);
00039 INLINE ~PhysxClothNode();
00040
00041 bool set_texcoords(const Filename &filename);
00042
00043 public:
00044 void allocate(PhysxCloth *cloth);
00045 void update();
00046
00047 private:
00048 void create_geom();
00049 void update_geom();
00050 void update_texcoords();
00051
00052 unsigned int _numVertices;
00053
00054 NxMeshData _mesh;
00055
00056 PT(GeomVertexData) _vdata;
00057 PT(Geom) _geom;
00058 PT(GeomTriangles) _prim;
00059
00060 PT(PhysxCloth) _cloth;
00061
00062 unsigned int _numTexcoords;
00063 float *_texcoords;
00064
00065
00066 public:
00067 static TypeHandle get_class_type() {
00068 return _type_handle;
00069 }
00070 static void init_type() {
00071 GeomNode::init_type();
00072 register_type(_type_handle, "PhysxClothNode",
00073 GeomNode::get_class_type());
00074 }
00075 virtual TypeHandle get_type() const {
00076 return get_class_type();
00077 }
00078 virtual TypeHandle force_init_type() {
00079 init_type();
00080 return get_class_type();
00081 }
00082
00083 private:
00084 static TypeHandle _type_handle;
00085 };
00086
00087 #include "physxClothNode.I"
00088
00089 #endif // PHYSXCLOTHNODE_H