Panda3D
|
The smallest atom of cull. More...
#include "cullableObject.h"
Classes | |
class | PointData |
class | SortPoints |
class | SourceFormat |
Public Member Functions | |
CullableObject () | |
Creates an empty CullableObject whose pointers can be filled in later. | |
CullableObject (const Geom *geom, const RenderState *state, const TransformState *net_transform, const TransformState *modelview_transform, const GraphicsStateGuardianBase *gsg) | |
Creates a CullableObject based the indicated geom, with the indicated render state and transform. | |
CullableObject (const CullableObject ©) | |
Copies the CullableObject, but does not copy its children (decals). | |
CullableObject (const Geom *geom, const RenderState *state, const TransformState *net_transform, const TransformState *modelview_transform, const TransformState *internal_transform) | |
Creates a CullableObject based the indicated geom, with the indicated render state and transform. | |
~CullableObject () | |
Automatically deletes the whole chain of these things. | |
CPT (Geom) _geom | |
CPT (GeomVertexData) _munged_data | |
CPT (RenderState) _state | |
CPT (TransformState) _net_transform | |
CPT (TransformState) _modelview_transform | |
CPT (TransformState) _internal_transform | |
void | draw (GraphicsStateGuardianBase *gsg, bool force, Thread *current_thread) |
Draws the cullable object on the GSG immediately, in the GSG's current state. | |
CullableObject * | get_next () const |
Returns the next object in the decal chain, or NULL for the end of the chain. | |
bool | has_decals () const |
Returns true if the object has decals associated with it. | |
bool | is_fancy () const |
Returns true if the object has something fancy to it: decals, maybe, or a draw_callback, that prevents it from being rendered inline. | |
bool | munge_geom (GraphicsStateGuardianBase *gsg, GeomMunger *munger, const CullTraverser *traverser, bool force) |
Uses the indicated GeomMunger to transform the geom and/or its vertices. | |
void | operator= (const CullableObject ©) |
Copies the CullableObject, but does not copy its children (decals). | |
void | output (ostream &out) const |
PT (GeomMunger) _munger | |
bool | request_resident () const |
Returns true if all the data necessary to render this object is currently resident in memory. | |
void | set_draw_callback (CallbackObject *draw_callback) |
Specifies a CallbackObject that will be responsible for drawing this object. | |
void | set_next (CullableObject *next) |
Sets the next object in the decal chain. | |
Static Public Member Functions | |
static void | flush_level () |
Flushes the PStatCollectors used during traversal. | |
static TypeHandle | get_class_type () |
static void | init_type () |
The smallest atom of cull.
This is normally just a Geom and its associated state, but it also represent a number of Geoms to be drawn together, with a number of Geoms decalled onto them.
Definition at line 44 of file cullableObject.h.
CullableObject::CullableObject | ( | ) | [inline] |
Creates an empty CullableObject whose pointers can be filled in later.
Definition at line 22 of file cullableObject.I.
CullableObject::CullableObject | ( | const Geom * | geom, |
const RenderState * | state, | ||
const TransformState * | net_transform, | ||
const TransformState * | modelview_transform, | ||
const GraphicsStateGuardianBase * | gsg | ||
) | [inline] |
Creates a CullableObject based the indicated geom, with the indicated render state and transform.
Definition at line 37 of file cullableObject.I.
CullableObject::CullableObject | ( | const Geom * | geom, |
const RenderState * | state, | ||
const TransformState * | net_transform, | ||
const TransformState * | modelview_transform, | ||
const TransformState * | internal_transform | ||
) | [inline] |
Creates a CullableObject based the indicated geom, with the indicated render state and transform.
Definition at line 60 of file cullableObject.I.
CullableObject::CullableObject | ( | const CullableObject & | copy | ) | [inline] |
Copies the CullableObject, but does not copy its children (decals).
Definition at line 84 of file cullableObject.I.
CullableObject::~CullableObject | ( | ) |
Automatically deletes the whole chain of these things.
Definition at line 202 of file cullableObject.cxx.
References set_draw_callback().
void CullableObject::draw | ( | GraphicsStateGuardianBase * | gsg, |
bool | force, | ||
Thread * | current_thread | ||
) | [inline] |
Draws the cullable object on the GSG immediately, in the GSG's current state.
This should only be called from the draw thread.
Definition at line 148 of file cullableObject.I.
Referenced by GeomDrawCallbackData::upcall().
void CullableObject::flush_level | ( | ) | [inline, static] |
Flushes the PStatCollectors used during traversal.
Definition at line 232 of file cullableObject.I.
Referenced by GraphicsEngine::render_frame().
CullableObject * CullableObject::get_next | ( | ) | const [inline] |
Returns the next object in the decal chain, or NULL for the end of the chain.
Definition at line 219 of file cullableObject.I.
Referenced by CullBin::ResultGraphBuilder::add_object().
bool CullableObject::has_decals | ( | ) | const [inline] |
Returns true if the object has decals associated with it.
Definition at line 136 of file cullableObject.I.
bool CullableObject::is_fancy | ( | ) | const [inline] |
Returns true if the object has something fancy to it: decals, maybe, or a draw_callback, that prevents it from being rendered inline.
Definition at line 125 of file cullableObject.I.
Referenced by CullBin::ResultGraphBuilder::add_object().
bool CullableObject::munge_geom | ( | GraphicsStateGuardianBase * | gsg, |
GeomMunger * | munger, | ||
const CullTraverser * | traverser, | ||
bool | force | ||
) |
Uses the indicated GeomMunger to transform the geom and/or its vertices.
If force is false, this may do nothing and return false if the vertex data is nonresident. If force is true, this will always return true, but it may have to block while the vertex data is paged in.
Definition at line 57 of file cullableObject.cxx.
References GeomVertexFormat::get_animation(), GeomVertexAnimationSpec::get_animation_type(), CullTraverser::get_current_thread(), ClockObject::get_frame_time(), ClockObject::get_global_clock(), CullTraverser::get_gsg(), munge_geom(), and GeomMunger::munge_geom().
Referenced by CullResult::add_object(), munge_geom(), and DrawCullHandler::record_object().
void CullableObject::operator= | ( | const CullableObject & | copy | ) | [inline] |
Copies the CullableObject, but does not copy its children (decals).
Definition at line 106 of file cullableObject.I.
bool CullableObject::request_resident | ( | ) | const [inline] |
Returns true if all the data necessary to render this object is currently resident in memory.
If this returns false, the data will be brought back into memory shortly; try again later.
Definition at line 167 of file cullableObject.I.
void CullableObject::set_draw_callback | ( | CallbackObject * | draw_callback | ) | [inline] |
Specifies a CallbackObject that will be responsible for drawing this object.
Definition at line 186 of file cullableObject.I.
References ReferenceCount::ref().
Referenced by SpeedTreeNode::add_for_draw(), CallbackNode::add_for_draw(), NodeCullCallbackData::upcall(), and ~CullableObject().
void CullableObject::set_next | ( | CullableObject * | next | ) | [inline] |
Sets the next object in the decal chain.
This next object will be destructed when this object destructs.
Definition at line 206 of file cullableObject.I.