Panda3D
 All Classes Functions Variables Enumerations
Classes | Public Member Functions | Static Public Member Functions | List of all members
CullableObject Class Reference

The smallest atom of cull. More...

#include "cullableObject.h"

Public Member Functions

 CullableObject ()
 Creates an empty CullableObject whose pointers can be filled in later. More...
 
 CullableObject (const Geom *geom, const RenderState *state, const TransformState *internal_transform)
 Creates a CullableObject based the indicated geom, with the indicated render state and transform. More...
 
 CullableObject (const CullableObject &copy)
 Copies the CullableObject. More...
 
 CPT (Geom) _geom
 
 CPT (GeomVertexData) _munged_data
 
 CPT (RenderState) _state
 
 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. More...
 
bool munge_geom (GraphicsStateGuardianBase *gsg, GeomMunger *munger, const CullTraverser *traverser, bool force)
 Uses the indicated GeomMunger to transform the geom and/or its vertices. More...
 
void operator= (const CullableObject &copy)
 Copies the CullableObject. More...
 
void output (ostream &out) const
 
 PT (GeomMunger) _munger
 
 PT (CallbackObject) _draw_callback
 
bool request_resident () const
 Returns true if all the data necessary to render this object is currently resident in memory. More...
 
void set_draw_callback (CallbackObject *draw_callback)
 Specifies a CallbackObject that will be responsible for drawing this object. More...
 

Static Public Member Functions

static void flush_level ()
 Flushes the PStatCollectors used during traversal. More...
 
static TypeHandle get_class_type ()
 
static void init_type ()
 

Detailed Description

The smallest atom of cull.

This is normally just a Geom and its associated state, but it also contain a draw callback.

Definition at line 45 of file cullableObject.h.

Constructor & Destructor Documentation

CullableObject::CullableObject ( )
inline

Creates an empty CullableObject whose pointers can be filled in later.

Definition at line 23 of file cullableObject.I.

CullableObject::CullableObject ( const Geom geom,
const RenderState state,
const TransformState *  internal_transform 
)
inline

Creates a CullableObject based the indicated geom, with the indicated render state and transform.

Definition at line 36 of file cullableObject.I.

CullableObject::CullableObject ( const CullableObject copy)
inline

Copies the CullableObject.

Definition at line 53 of file cullableObject.I.

Member Function Documentation

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 88 of file cullableObject.I.

References GeomDrawCallbackData::get_lost_state().

Referenced by GeomDrawCallbackData::upcall().

void CullableObject::flush_level ( )
inlinestatic

Flushes the PStatCollectors used during traversal.

Definition at line 145 of file cullableObject.I.

Referenced by GraphicsEngine::render_frame().

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 CullTraverser::get_current_thread(), ClockObject::get_frame_time(), ClockObject::get_global_clock(), CullTraverser::get_gsg(), and GeomMunger::munge_geom().

Referenced by CullResult::add_object(), and DrawCullHandler::record_object().

void CullableObject::operator= ( const CullableObject copy)
inline

Copies the CullableObject.

Definition at line 71 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 116 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 135 of file cullableObject.I.

Referenced by CallbackNode::add_for_draw(), ComputeNode::add_for_draw(), and NodeCullCallbackData::upcall().


The documentation for this class was generated from the following files: