Panda3D
 All Classes Functions Variables Enumerations
physxClothNode.I
1 // Filename: physxClothNode.I
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 
16 
17 ////////////////////////////////////////////////////////////////////
18 // Function: PhysxClothNode::Constructor
19 // Access: Published
20 // Description:
21 ////////////////////////////////////////////////////////////////////
22 INLINE PhysxClothNode::
23 PhysxClothNode(const char *name) : GeomNode(name) {
24 
25  _numVertices = 0;
26 
27  _vdata = new GeomVertexData("", GeomVertexFormat::get_v3n3t2(), Geom::UH_stream);
28 
29  _prim = new GeomTriangles(Geom::UH_stream);
30  _prim->set_shade_model(Geom::SM_uniform);
31 
32  _geom = new Geom(_vdata);
33  _geom->add_primitive(_prim);
34 
35  this->add_geom(_geom);
36 
37  _numTexcoords = 0;
38  _texcoords = NULL;
39 }
40 
41 ////////////////////////////////////////////////////////////////////
42 // Function: PhysxClothNode::Destructor
43 // Access: Published
44 // Description:
45 ////////////////////////////////////////////////////////////////////
46 INLINE PhysxClothNode::
47 ~PhysxClothNode() {
48 
49  if (_texcoords) {
50  delete [] _texcoords;
51  }
52 }
53 
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
A node that holds Geom objects, renderable pieces of geometry.
Definition: geomNode.h:37
void add_geom(Geom *geom, const RenderState *state=RenderState::make_empty())
Adds a new Geom to the node.
Definition: geomNode.cxx:642