Panda3D
physxClothNode.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file physxClothNode.I
10  * @author enn0x
11  * @date 2010-04-05
12  */
13 
14 /**
15  *
16  */
17 INLINE PhysxClothNode::
18 PhysxClothNode(const char *name) : GeomNode(name) {
19 
20  _numVertices = 0;
21 
22  _vdata = new GeomVertexData("", GeomVertexFormat::get_v3n3t2(), Geom::UH_stream);
23 
24  _prim = new GeomTriangles(Geom::UH_stream);
25  _prim->set_shade_model(Geom::SM_uniform);
26 
27  _geom = new Geom(_vdata);
28  _geom->add_primitive(_prim);
29 
30  this->add_geom(_geom);
31 
32  _numTexcoords = 0;
33  _texcoords = nullptr;
34 }
35 
36 /**
37  *
38  */
39 INLINE PhysxClothNode::
40 ~PhysxClothNode() {
41 
42  if (_texcoords) {
43  delete [] _texcoords;
44  }
45 }
static const GeomVertexFormat * get_v3n3t2()
Returns a standard vertex format with a 2-component texture coordinate pair, a 3-component normal,...
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:54
Defines a series of disconnected triangles.
Definition: geomTriangles.h:23
A node that holds Geom objects, renderable pieces of geometry.
Definition: geomNode.h:34
void add_geom(Geom *geom, const RenderState *state=RenderState::make_empty())
Adds a new Geom to the node.
Definition: geomNode.cxx:584