GeomNode
from panda3d.core import GeomNode
- class GeomNode
Bases:
PandaNode
A node that holds Geom objects, renderable pieces of geometry. This is the primary kind of leaf node in the scene graph; almost all visible objects will be contained in a GeomNode somewhere.
Inheritance diagram
- __init__(*args, **kwargs)
- addGeom()
C++ Interface: add_geom(const GeomNode self, Geom geom, const RenderState state)
- /**
Adds a new Geom to the node. The geom is given the indicated state (which
may be RenderState::make_empty(), to completely inherit its state from the
scene graph).
*/
- addGeomsFrom()
C++ Interface: add_geoms_from(const GeomNode self, const GeomNode other)
- /**
Copies the Geoms (and their associated RenderStates) from the indicated
GeomNode into this one.
*/
- add_geom()
C++ Interface: add_geom(const GeomNode self, Geom geom, const RenderState state)
- /**
Adds a new Geom to the node. The geom is given the indicated state (which
may be RenderState::make_empty(), to completely inherit its state from the
scene graph).
*/
- add_geoms_from()
C++ Interface: add_geoms_from(const GeomNode self, const GeomNode other)
- /**
Copies the Geoms (and their associated RenderStates) from the indicated
GeomNode into this one.
*/
- checkValid()
C++ Interface: check_valid(GeomNode self)
- /**
Verifies that the each Geom within the GeomNode reference vertices that
actually exist within its GeomVertexData. Returns true if the GeomNode
appears to be valid, false otherwise.
*/
- check_valid()
C++ Interface: check_valid(GeomNode self)
- /**
Verifies that the each Geom within the GeomNode reference vertices that
actually exist within its GeomVertexData. Returns true if the GeomNode
appears to be valid, false otherwise.
*/
- decompose()
C++ Interface: decompose(const GeomNode self)
- /**
Calls decompose() on each Geom with the GeomNode. This decomposes higher-
order primitive types, like triangle strips, into lower-order types like
indexed triangles. Normally there is no reason to do this, but it can be
useful as an early preprocessing step, to allow a later call to unify() to
proceed more quickly.
See also SceneGraphReducer::decompose(), which is the normal way this is
called.
*/
- default_collide_mask = 0000 0000 0001 0000 0000 0000 0000 0000
- getClassType()
C++ Interface: get_class_type()
- getDefaultCollideMask()
C++ Interface: get_default_collide_mask()
- /**
Returns the default into_collide_mask assigned to new GeomNodes.
*/
- getGeom()
C++ Interface: get_geom(GeomNode self, int n)
- /**
Returns the nth geom of the node. This object should not be modified,
since the same object might be shared between multiple different GeomNodes,
but see modify_geom().
*/
- getGeomState()
C++ Interface: get_geom_state(GeomNode self, int n)
- /**
Returns the RenderState associated with the nth geom of the node. This is
just the RenderState directly associated with the Geom; the actual state in
which the Geom is rendered will also be affected by RenderStates that
appear on the scene graph in nodes above this GeomNode.
*/
- getGeomStates()
- getGeoms()
- getNumGeoms()
C++ Interface: get_num_geoms(GeomNode self)
- /**
Returns the number of geoms in the node.
*/
- getPreserved()
C++ Interface: get_preserved(GeomNode self)
- /**
Returns the “preserved” flag. When this is true, the GeomNode will be left
untouched by any flatten operations.
*/
- get_class_type()
C++ Interface: get_class_type()
- get_default_collide_mask()
C++ Interface: get_default_collide_mask()
- /**
Returns the default into_collide_mask assigned to new GeomNodes.
*/
- get_geom()
C++ Interface: get_geom(GeomNode self, int n)
- /**
Returns the nth geom of the node. This object should not be modified,
since the same object might be shared between multiple different GeomNodes,
but see modify_geom().
*/
- get_geom_state()
C++ Interface: get_geom_state(GeomNode self, int n)
- /**
Returns the RenderState associated with the nth geom of the node. This is
just the RenderState directly associated with the Geom; the actual state in
which the Geom is rendered will also be affected by RenderStates that
appear on the scene graph in nodes above this GeomNode.
*/
- get_geom_states()
- get_geoms()
- get_num_geoms()
C++ Interface: get_num_geoms(GeomNode self)
- /**
Returns the number of geoms in the node.
*/
- get_preserved()
C++ Interface: get_preserved(GeomNode self)
- /**
Returns the “preserved” flag. When this is true, the GeomNode will be left
untouched by any flatten operations.
*/
- modifyGeom()
C++ Interface: modify_geom(const GeomNode self, int n)
- /**
Returns the nth geom of the node, suitable for modifying it. If the nth
Geom has multiple reference counts to it, reassigns it to an identical copy
first, and returns the new copy–this provides a “copy on write” that
ensures that the Geom that is returned is unique to this GeomNode and is
not shared with any other GeomNodes.
Note that if this method is called in a downstream stage (for instance,
during cull or draw), then it will propagate the new list of Geoms upstream
all the way to pipeline stage 0, which may step on changes that were made
independently in pipeline stage 0. Use with caution.
*/
- modifyGeoms()
- modify_geom()
C++ Interface: modify_geom(const GeomNode self, int n)
- /**
Returns the nth geom of the node, suitable for modifying it. If the nth
Geom has multiple reference counts to it, reassigns it to an identical copy
first, and returns the new copy–this provides a “copy on write” that
ensures that the Geom that is returned is unique to this GeomNode and is
not shared with any other GeomNodes.
Note that if this method is called in a downstream stage (for instance,
during cull or draw), then it will propagate the new list of Geoms upstream
all the way to pipeline stage 0, which may step on changes that were made
independently in pipeline stage 0. Use with caution.
*/
- modify_geoms()
- removeAllGeoms()
C++ Interface: remove_all_geoms(const GeomNode self)
- /**
Removes all the geoms from the node at once.
*/
- removeGeom()
C++ Interface: remove_geom(const GeomNode self, int n)
- /**
Removes the nth geom from the node.
*/
- remove_all_geoms()
C++ Interface: remove_all_geoms(const GeomNode self)
- /**
Removes all the geoms from the node at once.
*/
- remove_geom()
C++ Interface: remove_geom(const GeomNode self, int n)
- /**
Removes the nth geom from the node.
*/
- setGeom()
C++ Interface: set_geom(const GeomNode self, int n, Geom geom)
- /**
Replaces the nth Geom of the node with a new pointer. There must already
be a Geom in this slot.
Note that if this method is called in a downstream stage (for instance,
during cull or draw), then it will propagate the new list of Geoms upstream
all the way to pipeline stage 0, which may step on changes that were made
independently in pipeline stage 0. Use with caution.
*/
- setGeomState()
C++ Interface: set_geom_state(const GeomNode self, int n, const RenderState state)
- /**
Changes the RenderState associated with the nth geom of the node. This is
just the RenderState directly associated with the Geom; the actual state in
which the Geom is rendered will also be affected by RenderStates that
appear on the scene graph in nodes above this GeomNode.
Note that if this method is called in a downstream stage (for instance,
during cull or draw), then it will propagate the new list of Geoms upstream
all the way to pipeline stage 0, which may step on changes that were made
independently in pipeline stage 0. Use with caution.
*/
- setPreserved()
C++ Interface: set_preserved(const GeomNode self, bool value)
- /**
Sets the “preserved” flag. When this is true, the GeomNode will be left
untouched by any flatten operations.
*/
- set_geom()
C++ Interface: set_geom(const GeomNode self, int n, Geom geom)
- /**
Replaces the nth Geom of the node with a new pointer. There must already
be a Geom in this slot.
Note that if this method is called in a downstream stage (for instance,
during cull or draw), then it will propagate the new list of Geoms upstream
all the way to pipeline stage 0, which may step on changes that were made
independently in pipeline stage 0. Use with caution.
*/
- set_geom_state()
C++ Interface: set_geom_state(const GeomNode self, int n, const RenderState state)
- /**
Changes the RenderState associated with the nth geom of the node. This is
just the RenderState directly associated with the Geom; the actual state in
which the Geom is rendered will also be affected by RenderStates that
appear on the scene graph in nodes above this GeomNode.
Note that if this method is called in a downstream stage (for instance,
during cull or draw), then it will propagate the new list of Geoms upstream
all the way to pipeline stage 0, which may step on changes that were made
independently in pipeline stage 0. Use with caution.
*/
- set_preserved()
C++ Interface: set_preserved(const GeomNode self, bool value)
- /**
Sets the “preserved” flag. When this is true, the GeomNode will be left
untouched by any flatten operations.
*/
- unify()
C++ Interface: unify(const GeomNode self, int max_indices, bool preserve_order)
- /**
Attempts to unify all of the Geoms contained within this node into a single
Geom, or at least as few Geoms as possible. In turn, the individual
GeomPrimitives contained within each resulting Geom are also unified. The
goal is to reduce the number of GeomPrimitives within the node as far as
possible. This may result in composite primitives, such as triangle strips
and triangle fans, being decomposed into triangles. See also
Geom::unify().
max_indices represents the maximum number of indices that will be put in
any one GeomPrimitive. If preserve_order is true, then the primitives will
not be reordered during the operation, even if this results in a suboptimal
result.
In order for this to be successful, the primitives must reference the same
GeomVertexData, have the same fundamental primitive type, and have
compatible shade models.
*/
- writeGeoms()
C++ Interface: write_geoms(GeomNode self, ostream out, int indent_level)
- /**
Writes a short description of all the Geoms in the node.
*/
- writeVerbose()
C++ Interface: write_verbose(GeomNode self, ostream out, int indent_level)
- /**
Writes a detailed description of all the Geoms in the node.
*/