CollisionHeightfield

from panda3d.core import CollisionHeightfield
class CollisionHeightfield

Bases:

Bases: CollisionSolid

/*
  • CollisionHeightfield efficiently deals with collisions on uneven

  • terrain given a heightfield image. A quad tree is implemented to

  • significantly reduce the amount of triangles tested. Each quad

  • tree node represents a sub-rectangle of the heightfield image

  • and thus a box in 3D space.

  • */

Inheritance diagram

Inheritance diagram of CollisionHeightfield

__init__(heightfield: PNMImage, max_height: float, num_subdivisions: int)
static get_class_type() TypeHandle
get_height(x: int, y: int) float
get_heightfield() PNMImage
get_max_height() float
get_num_subdivisions() int
set_heightfield(heightfield: PNMImage)
set_max_height(max_height: float)
set_num_subdivisions(num_subdivisions: int)

Sets the number of quadtree subdivisions and modifies the quadtree accordingly. This should be called when a user wants to modify the number of quadtree subdivisions or from a constructor to initialize the quadtree.

If the number of subdivisions is too high, it will automatically be decremented.