LODNode

from panda3d.core import LODNode
class LODNode

Bases: PandaNode

A Level-of-Detail node. This selects only one of its children for rendering, according to the distance from the camera and the table indicated in the associated LOD object.

Inheritance diagram

Inheritance diagram of LODNode

__init__(*args, **kwargs)
addSwitch()

C++ Interface: add_switch(const LODNode self, float in, float out)

/**
  • Adds a switch range to the LODNode. This implies that the corresponding

  • child node has been parented to the node.

  • The sense of in vs. out distances is as if the object were coming towards

  • you from far away: it switches “in” at the far distance, and switches “out”

  • at the close distance. Thus, “in” should be larger than “out”.

*/

add_switch()

C++ Interface: add_switch(const LODNode self, float in, float out)

/**
  • Adds a switch range to the LODNode. This implies that the corresponding

  • child node has been parented to the node.

  • The sense of in vs. out distances is as if the object were coming towards

  • you from far away: it switches “in” at the far distance, and switches “out”

  • at the close distance. Thus, “in” should be larger than “out”.

*/

center
clearForceSwitch()

C++ Interface: clear_force_switch(const LODNode self)

/**
  • Undoes the effect of a previous call to force_switch() and releases the

  • LODNode to once again display the normal level.

*/

clearSwitches()

C++ Interface: clear_switches(const LODNode self)

/**
  • Removes the set of switching ranges for the LODNode, presumably in

  • conjunction with removing all of its children. See add_switch().

*/

clear_force_switch()

C++ Interface: clear_force_switch(const LODNode self)

/**
  • Undoes the effect of a previous call to force_switch() and releases the

  • LODNode to once again display the normal level.

*/

clear_switches()

C++ Interface: clear_switches(const LODNode self)

/**
  • Removes the set of switching ranges for the LODNode, presumably in

  • conjunction with removing all of its children. See add_switch().

*/

forceSwitch()

C++ Interface: force_switch(const LODNode self, int index)

/**
  • Forces the LODNode to show the indicated level instead of the level that

  • would normally be shown based on the distance from the camera.

*/

force_switch()

C++ Interface: force_switch(const LODNode self, int index)

/**
  • Forces the LODNode to show the indicated level instead of the level that

  • would normally be shown based on the distance from the camera.

*/

getCenter()

C++ Interface: get_center(LODNode self)

/**
  • Returns the center of the LOD. This is the point that is compared to the

  • camera (in camera space) to determine the particular LOD that should be

  • chosen.

*/

getClassType()

C++ Interface: get_class_type()

getHighestSwitch()

C++ Interface: get_highest_switch(LODNode self)

/**
  • Returns the index number of the child with the highest level of detail;

  • that is, the one that is designed to be seen from the closest to the

  • camera. This is usually the last child, but it is not necessarily so.

*/

getIn()

C++ Interface: get_in(LODNode self, int index)

/**
  • Returns the “in” distance of the indicated switch range. This should be

  • larger than the “out” distance of the same range.

*/

getIns()
getLodScale()

C++ Interface: get_lod_scale(LODNode self)

/**
  • Returns the multiplier for lod distances

*/

getLowestSwitch()

C++ Interface: get_lowest_switch(LODNode self)

/**
  • Returns the index number of the child with the lowest level of detail; that

  • is, the one that is designed to be seen from the farthest away. This is

  • usually the first child, but it is not necessarily so.

*/

getNumSwitches()

C++ Interface: get_num_switches(LODNode self)

/**
  • Returns the number of switch ranges added to the LODNode. This should

  • correspond to the number of children of the node in order for the LODNode

  • to function correctly.

*/

getOut()

C++ Interface: get_out(LODNode self, int index)

/**
  • Returns the “out” distance of the indicated switch range. This should be

  • smaller than the “in” distance of the same range.

*/

getOuts()
get_center()

C++ Interface: get_center(LODNode self)

/**
  • Returns the center of the LOD. This is the point that is compared to the

  • camera (in camera space) to determine the particular LOD that should be

  • chosen.

*/

get_class_type()

C++ Interface: get_class_type()

get_highest_switch()

C++ Interface: get_highest_switch(LODNode self)

/**
  • Returns the index number of the child with the highest level of detail;

  • that is, the one that is designed to be seen from the closest to the

  • camera. This is usually the last child, but it is not necessarily so.

*/

get_in()

C++ Interface: get_in(LODNode self, int index)

/**
  • Returns the “in” distance of the indicated switch range. This should be

  • larger than the “out” distance of the same range.

*/

get_ins()
get_lod_scale()

C++ Interface: get_lod_scale(LODNode self)

/**
  • Returns the multiplier for lod distances

*/

get_lowest_switch()

C++ Interface: get_lowest_switch(LODNode self)

/**
  • Returns the index number of the child with the lowest level of detail; that

  • is, the one that is designed to be seen from the farthest away. This is

  • usually the first child, but it is not necessarily so.

*/

get_num_switches()

C++ Interface: get_num_switches(LODNode self)

/**
  • Returns the number of switch ranges added to the LODNode. This should

  • correspond to the number of children of the node in order for the LODNode

  • to function correctly.

*/

get_out()

C++ Interface: get_out(LODNode self, int index)

/**
  • Returns the “out” distance of the indicated switch range. This should be

  • smaller than the “in” distance of the same range.

*/

get_outs()
hideAllSwitches()

C++ Interface: hide_all_switches(const LODNode self)

/**
  • Hides all levels, restoring the LODNode to normal operation.

*/

hideSwitch()

C++ Interface: hide_switch(const LODNode self, int index)

/**
  • Disables a previous call to show_switch().

*/

hide_all_switches()

C++ Interface: hide_all_switches(const LODNode self)

/**
  • Hides all levels, restoring the LODNode to normal operation.

*/

hide_switch()

C++ Interface: hide_switch(const LODNode self, int index)

/**
  • Disables a previous call to show_switch().

*/

highest_switch
ins
isAnyShown()

C++ Interface: is_any_shown(LODNode self)

/**
  • Returns true if any switch has been shown with show_switch(), indicating

  • the LODNode is in debug show mode; or false if it is in the normal mode.

*/

is_any_shown()

C++ Interface: is_any_shown(LODNode self)

/**
  • Returns true if any switch has been shown with show_switch(), indicating

  • the LODNode is in debug show mode; or false if it is in the normal mode.

*/

lod_scale
lowest_switch
makeDefaultLod()

C++ Interface: make_default_lod(str name)

/**
  • Creates a new LODNode of the type specified by the default-lod-type config

  • variable.

*/

make_default_lod()

C++ Interface: make_default_lod(str name)

/**
  • Creates a new LODNode of the type specified by the default-lod-type config

  • variable.

*/

outs
setCenter()

C++ Interface: set_center(const LODNode self, const LPoint3f center)

/**
  • Specifies the center of the LOD. This is the point that is compared to the

  • camera (in camera space) to determine the particular LOD that should be

  • chosen.

*/

setLodScale()

C++ Interface: set_lod_scale(const LODNode self, float value)

// for performance tuning, increasing this value should improve performance // at the cost of model quality

// for performance tuning, increasing this value should improve performance // at the cost of model quality

/**
  • Sets the multiplier for lod distances. A higher value means you’ll see

  • farther switchs than normal

*/

setSwitch()

C++ Interface: set_switch(const LODNode self, int index, float in, float out)

/**
  • Changes the switching range of a particular child of the LODNode. See

  • add_switch().

*/

set_center()

C++ Interface: set_center(const LODNode self, const LPoint3f center)

/**
  • Specifies the center of the LOD. This is the point that is compared to the

  • camera (in camera space) to determine the particular LOD that should be

  • chosen.

*/

set_lod_scale()

C++ Interface: set_lod_scale(const LODNode self, float value)

// for performance tuning, increasing this value should improve performance // at the cost of model quality

// for performance tuning, increasing this value should improve performance // at the cost of model quality

/**
  • Sets the multiplier for lod distances. A higher value means you’ll see

  • farther switchs than normal

*/

set_switch()

C++ Interface: set_switch(const LODNode self, int index, float in, float out)

/**
  • Changes the switching range of a particular child of the LODNode. See

  • add_switch().

*/

showAllSwitches()

C++ Interface: show_all_switches(const LODNode self)

/**
  • Shows all levels in their default colors.

*/

showSwitch()

C++ Interface: show_switch(const LODNode self, int index) show_switch(const LODNode self, int index, const LVecBase4f color)

/**
  • This is provided as a debugging aid. show_switch() will put the LODNode

  • into a special mode where rather than computing and drawing the appropriate

  • level of the LOD, a ring is drawn around the LODNode center indicating the

  • switch distances from the camera for the indicated level, and the geometry

  • of the indicated level is drawn in wireframe.

  • Multiple different levels can be visualized this way at once. Call

  • hide_switch() or hide_all_switches() to undo this mode and restore the

  • LODNode to its normal behavior.

*/

/**
  • This is provided as a debugging aid. show_switch() will put the LODNode

  • into a special mode where rather than computing and drawing the appropriate

  • level of the LOD, a ring is drawn around the LODNode center indicating the

  • switch distances from the camera for the indicated level, and the geometry

  • of the indicated level is drawn in wireframe.

  • Multiple different levels can be visualized this way at once. Call

  • hide_switch() or hide_all_switches() to undo this mode and restore the

  • LODNode to its normal behavior.

*/

show_all_switches()

C++ Interface: show_all_switches(const LODNode self)

/**
  • Shows all levels in their default colors.

*/

show_switch()

C++ Interface: show_switch(const LODNode self, int index) show_switch(const LODNode self, int index, const LVecBase4f color)

/**
  • This is provided as a debugging aid. show_switch() will put the LODNode

  • into a special mode where rather than computing and drawing the appropriate

  • level of the LOD, a ring is drawn around the LODNode center indicating the

  • switch distances from the camera for the indicated level, and the geometry

  • of the indicated level is drawn in wireframe.

  • Multiple different levels can be visualized this way at once. Call

  • hide_switch() or hide_all_switches() to undo this mode and restore the

  • LODNode to its normal behavior.

*/

/**
  • This is provided as a debugging aid. show_switch() will put the LODNode

  • into a special mode where rather than computing and drawing the appropriate

  • level of the LOD, a ring is drawn around the LODNode center indicating the

  • switch distances from the camera for the indicated level, and the geometry

  • of the indicated level is drawn in wireframe.

  • Multiple different levels can be visualized this way at once. Call

  • hide_switch() or hide_all_switches() to undo this mode and restore the

  • LODNode to its normal behavior.

*/

verifyChildBounds()

C++ Interface: verify_child_bounds(LODNode self)

/**
  • Returns true if the bounding volumes for the geometry of each fhild node

  • entirely fits within the switch_in radius for that child, or false

  • otherwise. It is almost always a mistake for the geometry of an LOD level

  • to be larger than its switch_in radius.

*/

verify_child_bounds()

C++ Interface: verify_child_bounds(LODNode self)

/**
  • Returns true if the bounding volumes for the geometry of each fhild node

  • entirely fits within the switch_in radius for that child, or false

  • otherwise. It is almost always a mistake for the geometry of an LOD level

  • to be larger than its switch_in radius.

*/