BulletTriangleMesh

from panda3d.bullet import BulletTriangleMesh
class BulletTriangleMesh

Bases:

Bases: TypedWritableReferenceCount

Inheritance diagram

Inheritance diagram of BulletTriangleMesh

__init__()
add_array(points: panda3d.core.PTA_LVecBase3, indices: panda3d.core.PTA_int, remove_duplicate_vertices: bool)

Adds triangle information from an array of points and indices referring to these points. This is more efficient than adding triangles one at a time.

If remove_duplicate_vertices is true, it will make sure that it does not add duplicate vertices if they already exist in the triangle mesh, within the tolerance specified by set_welding_distance(). This comes at a significant performance cost, especially for large meshes.

add_geom(geom: panda3d.core.Geom, remove_duplicate_vertices: bool, ts: panda3d.core.TransformState)

Adds the geometry from the indicated Geom from the triangle mesh. This is a one-time copy operation, and future updates to the Geom will not be reflected.

If remove_duplicate_vertices is true, it will make sure that it does not add duplicate vertices if they already exist in the triangle mesh, within the tolerance specified by set_welding_distance(). This comes at a significant performance cost, especially for large meshes.

add_triangle(p0: panda3d.core.LPoint3, p1: panda3d.core.LPoint3, p2: panda3d.core.LPoint3, remove_duplicate_vertices: bool)

Adds a triangle with the indicated coordinates.

If remove_duplicate_vertices is true, it will make sure that it does not add duplicate vertices if they already exist in the triangle mesh, within the tolerance specified by set_welding_distance(). This comes at a significant performance cost, especially for large meshes.

static get_class_type() panda3d.core.TypeHandle
get_num_triangles() int

Returns the number of triangles in this triangle mesh.

get_welding_distance() float

Returns the value previously set with set_welding_distance(), or the value of 0 if none was set.

output(out: panda3d.core.ostream)
preallocate(num_verts: int, num_indices: int)

Used to reserve memory in anticipation of the given amount of vertices and indices being added to the triangle mesh. This is useful if you are about to call add_triangle() many times, to prevent unnecessary reallocations.

set_welding_distance(distance: float)

Sets the square of the distance at which vertices will be merged together when adding geometry with remove_duplicate_vertices set to true.

The default is 0, meaning vertices will only be merged if they have the exact same position.

property triangles Sequence[LVecBase3i]

Returns the vertex indices making up the given triangle index.

property vertices Sequence[LPoint3]

Returns the vertex at the given vertex index.

property welding_distance float
Getter

Returns the value previously set with set_welding_distance(), or the value of 0 if none was set.

Setter

Sets the square of the distance at which vertices will be merged together when adding geometry with remove_duplicate_vertices set to true.

The default is 0, meaning vertices will only be merged if they have the exact same position.

write(out: panda3d.core.ostream, indent_level: int)