added set_color_scale to nodepathCollection

This commit is contained in:
Asad M. Zaman 2007-03-21 23:11:13 +00:00
parent 863fdd7449
commit 4d949e95a6
3 changed files with 32 additions and 2 deletions

View File

@ -441,7 +441,32 @@ set_color(float r, float g, float b, float a, int priority) {
void NodePathCollection::
set_color(const Colorf &color, int priority) {
for (int i = 0; i < get_num_paths(); i++) {
get_path(i).node()->set_attrib(ColorAttrib::make_flat(color), priority);
get_path(i).set_color(color, priority);
//get_path(i).node()->set_attrib(ColorAttrib::make_flat(color), priority);
}
}
////////////////////////////////////////////////////////////////////
// Function: NodePathCollection::set_color_scale
// Access: Published
// Description: Applies color scales to all NodePaths in the collection
////////////////////////////////////////////////////////////////////
void NodePathCollection::
set_color_scale(float r, float g, float b, float a, int priority) {
for (int i = 0; i < get_num_paths(); i++) {
get_path(i).set_color_scale(Colorf(r, g, b, a), priority);
}
}
////////////////////////////////////////////////////////////////////
// Function: NodePathCollection::set_color_scale
// Access: Published
// Description: Applies color scales to all NodePaths in the collection
////////////////////////////////////////////////////////////////////
void NodePathCollection::
set_color_scale(const Colorf &color, int priority) {
for (int i = 0; i < get_num_paths(); i++) {
get_path(i).set_color_scale(color, priority);
}
}

View File

@ -72,6 +72,10 @@ PUBLISHED:
int priority = 0);
void set_color(const Colorf &color, int priority = 0);
void set_color_scale(float r, float g, float b, float a = 1.0,
int priority = 0);
void set_color_scale(const Colorf &color, int priority = 0);
void output(ostream &out) const;
void write(ostream &out, int indent_level = 0) const;

View File

@ -286,7 +286,8 @@ cull_callback(CullTraverser *trav, CullTraverserData &data) {
// Get the net trasform of the _cell_out as seen from the camera.
CPT(TransformState) cell_transform =
trav->get_camera_transform()->invert_compose(_cell_out.get_net_transform());
// trav->get_camera_transform()->invert_compose(_cell_out.get_net_transform());
_cell_out.get_net_transform();
CPT(TransformState) frustum_transform =
_cell_out.get_net_transform()->invert_compose(portal_viewer->_scene_setup->get_cull_center().get_net_transform());