Panda3D
Loading...
Searching...
No Matches
physxTriangleMeshDesc.h
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 physxTriangleMeshDesc.h
10 * @author enn0x
11 * @date 2009-10-11
12 */
13
14#ifndef PHYSXTRIANGLEMESHDESC_H
15#define PHYSXTRIANGLEMESHDESC_H
16
17#include "pandabase.h"
18#include "nodePath.h"
19#include "luse.h"
20
21#include "physx_includes.h"
22
23/**
24 *
25 */
26class EXPCL_PANDAPHYSX PhysxTriangleMeshDesc {
27
28PUBLISHED:
29 INLINE PhysxTriangleMeshDesc();
30 INLINE ~PhysxTriangleMeshDesc();
31
32 INLINE bool is_valid() const;
33
34 void set_num_vertices(unsigned int n);
35 void set_vertex(unsigned int idx, const LPoint3f &vert);
36
37 void set_num_triangles(unsigned int n, bool use_material_indices=false);
38 void set_triangle(unsigned int idx,
39 unsigned int i1, unsigned int i2, unsigned int i3,
40 unsigned int material_index=1);
41
42 void set_from_node_path(const NodePath &np);
43
44public:
45 const NxTriangleMeshDesc &get_desc() const;
46
47private:
48 NxVec3 *_vertices;
49 NxU32 *_triangles;
50 NxMaterialIndex *_materials;
51 NxTriangleMeshDesc _desc;
52};
53
55
56#endif // PHYSXTRIANGLEMESHDESC_H
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition nodePath.h:159
void set_vertex(unsigned int idx, const LPoint3f &vert)
Sets a single vertex.
bool is_valid() const
Returns true if the descriptor is valid.
void set_from_node_path(const NodePath &np)
A convenience method to set the mesh data from a NodePath in a single call.
void set_num_vertices(unsigned int n)
Sets the number of vertices to be stored within this triangle mesh.
void set_triangle(unsigned int idx, unsigned int i1, unsigned int i2, unsigned int i3, unsigned int material_index=1)
Sets a single triangle, by providing the three indices i1, i2, i3.
void set_num_triangles(unsigned int n, bool use_material_indices=false)
Sets the number of triangles to be stored in this triangle mesh.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.