14 #ifndef __BULLET_TRIANGLE_MESH_H__ 15 #define __BULLET_TRIANGLE_MESH_H__ 37 void add_triangle(
const LPoint3 &p0,
40 bool remove_duplicate_vertices=
false);
41 void add_array(
const PTA_LVecBase3 &points,
42 const PTA_int &indices,
43 bool remove_duplicate_vertices=
false);
44 void add_geom(
const Geom *geom,
45 bool remove_duplicate_vertices=
false,
48 void set_welding_distance(PN_stdfloat distance);
49 void preallocate(
int num_verts,
int num_indices);
51 size_t get_num_triangles()
const;
52 PN_stdfloat get_welding_distance()
const;
54 virtual void output(std::ostream &out)
const;
55 virtual void write(std::ostream &out,
int indent_level)
const;
58 size_t get_num_vertices()
const;
59 LPoint3 get_vertex(
size_t index)
const;
61 LVecBase3i get_triangle(
size_t index)
const;
63 size_t do_get_num_triangles()
const;
64 void do_add_triangle(
const LPoint3 &p0,
67 bool remove_duplicate_vertices=
false);
70 MAKE_PROPERTY(welding_distance, get_welding_distance, set_welding_distance);
72 MAKE_SEQ_PROPERTY(vertices, get_num_vertices, get_vertex);
73 MAKE_SEQ_PROPERTY(triangles, get_num_triangles, get_triangle);
76 INLINE btStridingMeshInterface *ptr()
const;
79 unsigned int find_or_add_vertex(
const LVecBase3 &p);
81 btTriangleIndexVertexArray _mesh;
82 btAlignedObjectArray<btVector3> _vertices;
83 btAlignedObjectArray<unsigned int> _indices;
84 PN_stdfloat _welding_distance;
87 static void register_with_read_factory();
98 static void init_type() {
99 TypedWritableReferenceCount::init_type();
101 TypedWritableReferenceCount::get_class_type());
104 return get_class_type();
108 return get_class_type();
119 #endif // __BULLET_TRIANGLE_MESH_H__ PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Base class for objects that can be written to and read from Bam files.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is intended to be called by each class's make_from_bam() method to read in all...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A container for geometry primitives.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
A base class for things which need to inherit from both TypedWritable and from ReferenceCount.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...