Panda3D
 All Classes Functions Variables Enumerations
physxClothNode.h
1 // Filename: physxClothNode.h
2 // Created by: enn0x (05Apr10)
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 PHYSXCLOTHNODE_H
16 #define PHYSXCLOTHNODE_H
17 
18 #include "pandabase.h"
19 #include "pointerTo.h"
20 #include "geomNode.h"
21 #include "transformState.h"
22 #include "geom.h"
23 #include "geomVertexData.h"
24 #include "geomTriangles.h"
25 #include "filename.h"
26 
27 #include "physx_includes.h"
28 
29 class PhysxCloth;
30 
31 ////////////////////////////////////////////////////////////////////
32 // Class : PhysxClothNode
33 // Description : Renderable geometry which represents a cloth mesh.
34 ////////////////////////////////////////////////////////////////////
35 class EXPCL_PANDAPHYSX PhysxClothNode : public GeomNode {
36 
37 PUBLISHED:
38  INLINE PhysxClothNode(const char *name);
39  INLINE ~PhysxClothNode();
40 
41  bool set_texcoords(const Filename &filename);
42 
43 public:
44  void allocate(PhysxCloth *cloth);
45  void update();
46 
47 private:
48  void create_geom();
49  void update_geom();
50  void update_texcoords();
51 
52  unsigned int _numVertices;
53 
54  NxMeshData _mesh;
55 
56  PT(GeomVertexData) _vdata;
57  PT(Geom) _geom;
58  PT(GeomTriangles) _prim;
59 
60  PT(PhysxCloth) _cloth;
61 
62  unsigned int _numTexcoords;
63  float *_texcoords;
64 
65 ////////////////////////////////////////////////////////////////////
66 public:
67  static TypeHandle get_class_type() {
68  return _type_handle;
69  }
70  static void init_type() {
71  GeomNode::init_type();
72  register_type(_type_handle, "PhysxClothNode",
73  GeomNode::get_class_type());
74  }
75  virtual TypeHandle get_type() const {
76  return get_class_type();
77  }
78  virtual TypeHandle force_init_type() {
79  init_type();
80  return get_class_type();
81  }
82 
83 private:
84  static TypeHandle _type_handle;
85 };
86 
87 #include "physxClothNode.I"
88 
89 #endif // PHYSXCLOTHNODE_H
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
A container for geometry primitives.
Definition: geom.h:58
Defines a series of disconnected triangles.
Definition: geomTriangles.h:25
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
A node that holds Geom objects, renderable pieces of geometry.
Definition: geomNode.h:37
Renderable geometry which represents a cloth mesh.