79 using std::ostringstream;
84 int NodePath::_max_search_depth = 7000;
87 PStatCollector NodePath::_get_transform_pcollector(
"*:NodePath:get_transform");
88 PStatCollector NodePath::_verify_complete_pcollector(
"*:NodePath:verify_complete");
99 nassertv(child_node !=
nullptr);
104 _head = PandaNode::get_top_component(child_node,
true,
105 pipeline_stage, current_thread);
108 _head = PandaNode::get_component(parent._head, child_node, pipeline_stage,
111 nassertv(_head !=
nullptr);
113 if (_head !=
nullptr) {
124 operator bool ()
const {
137 return _head->get_length(pipeline_stage, current_thread);
162 nassertr(comp !=
nullptr,
nullptr);
163 comp = comp->
get_next(pipeline_stage, current_thread);
169 nassertr(comp !=
nullptr,
nullptr);
191 comp = comp->
get_next(pipeline_stage, current_thread);
217 while (!comp->
is_top_node(pipeline_stage, current_thread)) {
218 comp = comp->
get_next(pipeline_stage, current_thread);
234 nassertr_always(!
is_empty(), result);
242 for (
int i = 0; i < num_children; i++) {
244 child._head = PandaNode::get_component(_head, cr.
get_child(i),
245 pipeline_stage, current_thread);
260 nassertr_always(!
is_empty(), result);
267 for (
int i = 0; i < num_stashed; i++) {
269 stashed._head = PandaNode::get_component(_head, bottom_node->
get_stashed(i),
270 pipeline_stage, current_thread);
291 PandaNode *parent = _head->get_next(pipeline_stage, current_thread)->get_node();
293 nassertr(parent !=
nullptr && child !=
nullptr, 0);
295 if (child_index != -1) {
300 if (child_index != -1) {
316 find(
const string &path)
const {
320 find_matches(col, path, 1);
342 find_matches(col, approx_path, 1);
362 find_matches(col, path, -1);
375 nassertr(
node !=
nullptr, col);
379 find_matches(col, approx_path, -1);
399 nassertv(other._error_type == ET_ok);
405 bool reparented = PandaNode::reparent(other._head, _head, sort,
false,
406 pipeline_stage, current_thread);
407 nassertv(reparented);
420 nassertv(other._error_type == ET_ok);
426 bool reparented = PandaNode::reparent(other._head, _head, sort,
true,
427 pipeline_stage, current_thread);
428 nassertv(reparented);
441 nassertv(other._error_type == ET_ok);
485 new_instance._head = PandaNode::attach(
nullptr,
node(), sort, pipeline_stage,
489 bool reparented = PandaNode::reparent(other._head, new_instance._head,
490 sort,
false, pipeline_stage,
505 nassertr(reparented, new_instance);
523 Thread *current_thread)
const {
543 nassertr(other._error_type == ET_ok,
fail());
547 PT(
PandaNode) copy_node = source_node->r_copy_subgraph(inst_map, current_thread);
548 nassertr(copy_node !=
nullptr,
fail());
550 copy_node->reset_prev_transform(current_thread);
556 const RenderState *state = source_node->get_state();
558 if (state->get_attrib(lattr)) {
565 if (light2.replace_copied_nodes(*
this, result, inst_map, current_thread)) {
566 new_lattr = DCAST(
LightAttrib, new_lattr->replace_off_light(light, light2));
574 if (light2.replace_copied_nodes(*
this, result, inst_map, current_thread)) {
575 new_lattr = DCAST(
LightAttrib, new_lattr->replace_on_light(light, light2));
579 if (new_lattr != lattr) {
580 result.
set_state(state->set_attrib(std::move(new_lattr)));
607 new_path._head = PandaNode::attach(_head,
node, sort, pipeline_stage,
629 nassertv(_error_type != ET_not_found);
637 PandaNode::detach(_head, pipeline_stage, current_thread);
640 if (
is_empty() || _head->has_key()) {
669 nassertv(_error_type != ET_not_found);
673 PandaNode::detach(_head, pipeline_stage, current_thread);
681 reverse_ls(ostream &out,
int indent_level)
const {
686 indent_level =
get_parent().reverse_ls(out, indent_level);
688 node()->write(out, indent_level);
689 return indent_level + 2;
697 output(ostream &out)
const {
698 switch (_error_type) {
700 out <<
"**not found**";
703 out <<
"**removed**";
712 if (_head ==
nullptr) {
726 nassertr_always(!
is_empty(), RenderState::make_empty());
727 return node()->get_state(current_thread);
736 nassertr(_error_type == ET_ok && other._error_type == ET_ok, RenderState::make_empty());
739 return get_net_state(current_thread);
742 return other.get_net_state(current_thread)->invert_compose(RenderState::make_empty());
745 #if defined(_DEBUG) || (defined(HAVE_THREADS) && defined(SIMPLE_THREADS))
747 nassertr(other.
verify_complete(current_thread), RenderState::make_empty());
750 int a_count, b_count;
751 if (find_common_ancestor(*
this, other, a_count, b_count, current_thread) ==
nullptr) {
752 if (allow_unrelated_wrt) {
754 << *
this <<
" is not related to " << other <<
"\n";
757 << *
this <<
" is not related to " << other <<
"\n";
758 nassert_raise(
"unrelated nodes");
759 return RenderState::make_empty();
763 CPT(
RenderState) a_state = r_get_partial_state(_head, a_count, current_thread);
764 CPT(
RenderState) b_state = r_get_partial_state(other._head, b_count, current_thread);
765 return b_state->invert_compose(a_state);
776 nassertv(_error_type == ET_ok && other._error_type == ET_ok);
787 CPT(
RenderState) new_state = rel_state->compose(state);
798 nassertr_always(!
is_empty(), TransformState::make_identity());
799 return node()->get_transform(current_thread);
808 nassertr(_error_type == ET_ok && other._error_type == ET_ok, TransformState::make_identity());
812 return get_net_transform(current_thread);
815 return other.get_net_transform(current_thread)->invert_compose(TransformState::make_identity());
818 #if defined(_DEBUG) || (defined(HAVE_THREADS) && defined(SIMPLE_THREADS))
819 nassertr(
verify_complete(current_thread), TransformState::make_identity());
820 nassertr(other.
verify_complete(current_thread), TransformState::make_identity());
823 int a_count, b_count;
824 if (find_common_ancestor(*
this, other, a_count, b_count, current_thread) ==
nullptr) {
825 if (allow_unrelated_wrt) {
826 if (pgraph_cat.is_debug()) {
828 << *
this <<
" is not related to " << other <<
"\n";
832 << *
this <<
" is not related to " << other <<
"\n";
833 nassert_raise(
"unrelated nodes");
834 return TransformState::make_identity();
840 a_transform = r_get_partial_transform(_head, a_count, current_thread);
841 if (a_transform !=
nullptr) {
842 b_transform = r_get_partial_transform(other._head, b_count, current_thread);
844 if (b_transform ==
nullptr) {
848 a_transform = r_get_net_transform(_head, current_thread);
849 b_transform = r_get_net_transform(other._head, current_thread);
852 return b_transform->invert_compose(a_transform);
863 nassertv(_error_type == ET_ok && other._error_type == ET_ok);
886 nassertr_always(!
is_empty(), TransformState::make_identity());
887 return node()->get_prev_transform(current_thread);
897 nassertr(_error_type == ET_ok && other._error_type == ET_ok, TransformState::make_identity());
900 return get_net_prev_transform(current_thread);
903 return other.get_net_prev_transform(current_thread)->invert_compose(TransformState::make_identity());
906 #if defined(_DEBUG) || (defined(HAVE_THREADS) && defined(SIMPLE_THREADS))
907 nassertr(
verify_complete(current_thread), TransformState::make_identity());
908 nassertr(other.
verify_complete(current_thread), TransformState::make_identity());
911 int a_count, b_count;
912 if (find_common_ancestor(*
this, other, a_count, b_count, current_thread) ==
nullptr) {
913 if (allow_unrelated_wrt) {
915 << *
this <<
" is not related to " << other <<
"\n";
918 << *
this <<
" is not related to " << other <<
"\n";
919 nassert_raise(
"unrelated nodes");
920 return TransformState::make_identity();
924 CPT(
TransformState) a_prev_transform = r_get_partial_prev_transform(_head, a_count, current_thread);
925 CPT(
TransformState) b_prev_transform = r_get_partial_prev_transform(other._head, b_count, current_thread);
926 return b_prev_transform->invert_compose(a_prev_transform);
937 nassertv(_error_type == ET_ok && other._error_type == ET_ok);
949 set_prev_transform(new_trans, current_thread);
960 set_pos(
const LVecBase3 &pos) {
972 set_x(PN_stdfloat x) {
985 set_y(PN_stdfloat y) {
998 set_z(PN_stdfloat z) {
1017 set_fluid_x(PN_stdfloat x) {
1025 set_fluid_y(PN_stdfloat y) {
1033 set_fluid_z(PN_stdfloat z) {
1045 nassertr_always(!
is_empty(), LPoint3(0.0f, 0.0f, 0.0f));
1060 nassertr_always(!
is_empty(), LPoint3(0.0f, 0.0f, 0.0f));
1069 set_hpr(
const LVecBase3 &hpr) {
1072 nassertv(transform->
has_hpr());
1077 set_h(PN_stdfloat h) {
1080 nassertv(transform->
has_hpr());
1081 LVecBase3 hpr = transform->
get_hpr();
1087 set_p(PN_stdfloat p) {
1090 nassertv(transform->
has_hpr());
1091 LVecBase3 hpr = transform->
get_hpr();
1097 set_r(PN_stdfloat r) {
1100 nassertv(transform->
has_hpr());
1101 LVecBase3 hpr = transform->
get_hpr();
1111 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1113 nassertr(transform->
has_hpr(), LVecBase3(0.0f, 0.0f, 0.0f));
1122 set_quat(
const LQuaternion &quat) {
1133 nassertr_always(!
is_empty(), LQuaternion::ident_quat());
1158 LVecBase3 scale = transform->
get_scale();
1172 LVecBase3 scale = transform->
get_scale();
1186 LVecBase3 scale = transform->
get_scale();
1196 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1213 set_shxy(PN_stdfloat shxy) {
1216 LVecBase3 shear = transform->
get_shear();
1222 set_shxz(PN_stdfloat shxz) {
1225 LVecBase3 shear = transform->
get_shear();
1231 set_shyz(PN_stdfloat shyz) {
1234 LVecBase3 shear = transform->
get_shear();
1244 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1254 set_pos_hpr(
const LVecBase3 &pos,
const LVecBase3 &hpr) {
1257 transform = TransformState::make_pos_hpr_scale_shear
1268 set_pos_quat(
const LVecBase3 &pos,
const LQuaternion &quat) {
1271 transform = TransformState::make_pos_quat_scale_shear
1282 set_hpr_scale(
const LVecBase3 &hpr,
const LVecBase3 &scale) {
1285 transform = TransformState::make_pos_hpr_scale_shear
1295 set_quat_scale(
const LQuaternion &quat,
const LVecBase3 &scale) {
1298 transform = TransformState::make_pos_quat_scale_shear
1309 const LVecBase3 &scale) {
1322 const LVecBase3 &scale) {
1325 (pos, quat, scale));
1335 const LVecBase3 &scale,
const LVecBase3 &shear) {
1338 (pos, hpr, scale, shear));
1348 const LVecBase3 &scale,
const LVecBase3 &shear) {
1351 (pos, quat, scale, shear));
1359 set_mat(
const LMatrix4 &mat) {
1370 look_at(
const LPoint3 &point,
const LVector3 &up) {
1385 heads_up(
const LPoint3 &point,
const LVector3 &up) {
1400 set_pos(
const NodePath &other,
const LVecBase3 &pos) {
1405 if (orig_transform->has_components()) {
1410 const LVecBase3 &orig_hpr = orig_transform->get_hpr();
1411 const LVecBase3 &orig_scale = orig_transform->get_scale();
1412 const LVecBase3 &orig_shear = orig_transform->get_shear();
1429 set_pos(other, pos);
1437 set_pos(other, pos);
1445 set_pos(other, pos);
1458 if (orig_transform->has_components()) {
1463 const LVecBase3 &orig_hpr = orig_transform->get_hpr();
1464 const LVecBase3 &orig_scale = orig_transform->get_scale();
1465 const LVecBase3 &orig_shear = orig_transform->get_shear();
1480 set_fluid_x(
const NodePath &other, PN_stdfloat x) {
1488 set_fluid_y(
const NodePath &other, PN_stdfloat y) {
1496 set_fluid_z(
const NodePath &other, PN_stdfloat z) {
1509 nassertr_always(!
is_empty(), LPoint3(0.0f, 0.0f, 0.0f));
1524 nassertr_always(!
is_empty(), LPoint3(0.0f, 0.0f, 0.0f));
1535 nassertv(rel_transform->has_hpr());
1543 const LVecBase3 &orig_pos = transform->
get_pos();
1544 const LVecBase3 &orig_scale = transform->
get_scale();
1545 const LVecBase3 &orig_shear = transform->
get_shear();
1551 (orig_pos, transform->
get_hpr(), orig_scale, orig_shear));
1561 set_h(
const NodePath &other, PN_stdfloat h) {
1563 LVecBase3 hpr =
get_hpr(other);
1569 set_p(
const NodePath &other, PN_stdfloat p) {
1571 LVecBase3 hpr =
get_hpr(other);
1577 set_r(
const NodePath &other, PN_stdfloat r) {
1579 LVecBase3 hpr =
get_hpr(other);
1590 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1592 nassertr(transform->
has_hpr(), LVecBase3(0.0f, 0.0f, 0.0f));
1610 const LVecBase3 &orig_pos = transform->
get_pos();
1611 const LVecBase3 &orig_scale = transform->
get_scale();
1612 const LVecBase3 &orig_shear = transform->
get_shear();
1618 (orig_pos, transform->
get_quat(), orig_scale, orig_shear));
1633 nassertr_always(!
is_empty(), LQuaternion::ident_quat());
1652 const LVecBase3 &orig_pos = transform->
get_pos();
1653 const LVecBase3 &orig_hpr = transform->
get_hpr();
1654 const LVecBase3 &orig_shear = transform->
get_shear();
1660 (orig_pos, orig_hpr, transform->
get_scale(), orig_shear));
1698 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1717 const LVecBase3 &orig_pos = transform->
get_pos();
1718 const LVecBase3 &orig_hpr = transform->
get_hpr();
1719 const LVecBase3 &orig_scale = transform->
get_scale();
1725 (orig_pos, orig_hpr, orig_scale, transform->
get_shear()));
1735 set_shxy(
const NodePath &other, PN_stdfloat shxy) {
1743 set_shxz(
const NodePath &other, PN_stdfloat shxz) {
1751 set_shyz(
const NodePath &other, PN_stdfloat shyz) {
1763 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1774 const LVecBase3 &hpr) {
1784 const LVecBase3 &orig_scale = transform->
get_scale();
1785 const LVecBase3 &orig_shear = transform->
get_shear();
1787 set_transform(other, TransformState::make_pos_hpr_scale_shear
1788 (pos, hpr, rel_transform->get_scale(), rel_transform->get_shear()));
1792 orig_scale, orig_shear);
1797 set_transform(other, TransformState::make_pos_hpr_scale_shear
1798 (pos, hpr, rel_transform->get_scale(), rel_transform->get_shear()));
1809 const LQuaternion &quat) {
1819 const LVecBase3 &orig_scale = transform->
get_scale();
1820 const LVecBase3 &orig_shear = transform->
get_shear();
1822 set_transform(other, TransformState::make_pos_quat_scale_shear
1823 (pos, quat, rel_transform->get_scale(), rel_transform->get_shear()));
1827 orig_scale, orig_shear);
1832 set_transform(other, TransformState::make_pos_quat_scale_shear
1833 (pos, quat, rel_transform->get_scale(), rel_transform->get_shear()));
1850 transform = TransformState::make_pos_hpr_scale_shear
1862 const LVecBase3 &scale) {
1868 transform = TransformState::make_pos_quat_scale_shear
1879 const LVecBase3 &pos,
const LVecBase3 &hpr,
1880 const LVecBase3 &scale) {
1893 const LVecBase3 &pos,
const LQuaternion &quat,
1894 const LVecBase3 &scale) {
1897 (pos, quat, scale));
1907 const LVecBase3 &pos,
const LVecBase3 &hpr,
1908 const LVecBase3 &scale,
const LVecBase3 &shear) {
1910 set_transform(other, TransformState::make_pos_hpr_scale_shear
1911 (pos, hpr, scale, shear));
1921 const LVecBase3 &pos,
const LQuaternion &quat,
1922 const LVecBase3 &scale,
const LVecBase3 &shear) {
1924 set_transform(other, TransformState::make_pos_quat_scale_shear
1925 (pos, quat, scale, shear));
1961 LPoint3 rel_point = LPoint3(point) * transform->
get_mat();
1972 LVector3 rel_vector = LVector3(vec) * transform->
get_mat();
1981 look_at(
const NodePath &other,
const LPoint3 &point,
const LVector3 &up) {
1985 LPoint3 rel_point = point * transform->
get_mat();
1999 heads_up(
const NodePath &other,
const LPoint3 &point,
const LVector3 &up) {
2003 LPoint3 rel_point = point * transform->
get_mat();
2019 set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a,
2021 set_color(LColor(r, g, b, a), priority);
2030 set_color(
const LColor &color,
int priority) {
2055 node()->clear_attrib(ColorAttrib::get_class_slot());
2064 nassertr_always(!
is_empty(),
false);
2065 return node()->has_attrib(ColorAttrib::get_class_slot());
2074 nassertr_always(!
is_empty(),
false);
2076 node()->get_attrib(ColorAttrib::get_class_slot());
2077 if (attrib !=
nullptr) {
2084 pgraph_cat.warning()
2085 <<
"get_color() called on " << *
this <<
" which has no color set.\n";
2087 return LColor(1.0f, 1.0f, 1.0f, 1.0f);
2097 nassertr_always(!
is_empty(),
false);
2098 return node()->has_attrib(ColorScaleAttrib::get_class_slot());
2109 node()->clear_attrib(ColorScaleAttrib::get_class_slot());
2121 node()->get_attrib(ColorScaleAttrib::get_class_slot());
2122 if (attrib !=
nullptr) {
2123 priority = max(priority,
2124 node()->
get_state()->get_override(ColorScaleAttrib::get_class_slot()));
2129 LVecBase4 prev_color_scale = csa->
get_scale();
2130 LVecBase4 new_color_scale(prev_color_scale[0]*scale[0],
2131 prev_color_scale[1]*scale[1],
2132 prev_color_scale[2]*scale[2],
2133 prev_color_scale[3]*scale[3]);
2151 node()->get_attrib(ColorScaleAttrib::get_class_slot());
2152 if (attrib !=
nullptr) {
2153 priority = max(priority,
2154 node()->
get_state()->get_override(ColorScaleAttrib::get_class_slot()));
2193 node()->get_attrib(ColorScaleAttrib::get_class_slot());
2194 if (attrib !=
nullptr) {
2195 priority = max(priority,
2196 node()->
get_state()->get_override(ColorScaleAttrib::get_class_slot()));
2201 node()->
set_attrib(csa->set_scale(LVecBase4(sc[0], sc[1], sc[2], scale)), priority);
2205 node()->
set_attrib(ColorScaleAttrib::make(LVecBase4(1.0f, 1.0f, 1.0f, scale)), priority);
2219 node()->get_attrib(ColorScaleAttrib::get_class_slot());
2220 if (attrib !=
nullptr) {
2221 priority = max(priority,
2222 node()->
get_state()->get_override(ColorScaleAttrib::get_class_slot()));
2227 node()->
set_attrib(csa->set_scale(LVecBase4(scale, scale, scale, sc[3])), priority);
2231 node()->
set_attrib(ColorScaleAttrib::make(LVecBase4(scale, scale, scale, 1.0f)), priority);
2242 static const LVecBase4 ident_scale(1.0f, 1.0f, 1.0f, 1.0f);
2243 nassertr_always(!
is_empty(), ident_scale);
2245 node()->get_attrib(ColorScaleAttrib::get_class_slot());
2246 if (attrib !=
nullptr) {
2265 if (light_obj !=
nullptr) {
2268 node()->get_attrib(LightAttrib::get_class_slot());
2269 if (attrib !=
nullptr) {
2270 priority = max(priority,
2271 node()->
get_state()->get_override(LightAttrib::get_class_slot()));
2284 }
else if (light.
node()->
is_of_type(PolylightNode::get_class_type())) {
2286 if (priority != 0) {
2289 pgraph_cat.warning()
2290 <<
"Ignoring priority on set_light(" << light <<
")\n";
2294 node()->get_effect(PolylightEffect::get_class_type());
2295 if (effect !=
nullptr) {
2309 nassert_raise(
"Not a Light object.");
2343 if (light_obj !=
nullptr) {
2345 node()->get_attrib(LightAttrib::get_class_slot());
2346 if (attrib !=
nullptr) {
2347 priority = max(priority,
2348 node()->
get_state()->get_override(LightAttrib::get_class_slot()));
2365 nassert_raise(
"Not a Light object.");
2375 node()->clear_attrib(LightAttrib::get_class_slot());
2389 if (light_obj !=
nullptr) {
2391 node()->get_attrib(LightAttrib::get_class_slot());
2392 if (attrib !=
nullptr) {
2394 la = DCAST(
LightAttrib, la->remove_on_light(light));
2395 la = DCAST(
LightAttrib, la->remove_off_light(light));
2397 if (la->is_identity()) {
2398 node()->clear_attrib(LightAttrib::get_class_slot());
2401 int priority =
node()->get_state()->get_override(LightAttrib::get_class_slot());
2407 }
else if (light.
node()->
is_of_type(PolylightNode::get_class_type())) {
2409 node()->get_effect(PolylightEffect::get_class_type());
2410 if (effect !=
nullptr) {
2418 nassert_raise(
"Not a Light object.");
2428 nassertr_always(!
is_empty(),
false);
2432 if (light_obj !=
nullptr) {
2434 node()->get_attrib(LightAttrib::get_class_slot());
2435 if (attrib !=
nullptr) {
2441 }
else if (light.
node()->
is_of_type(PolylightNode::get_class_type())) {
2443 node()->get_effect(PolylightEffect::get_class_type());
2444 if (effect !=
nullptr) {
2446 return ple->has_light(light);
2451 nassert_raise(
"Not a Light object.");
2462 nassertr_always(!
is_empty(),
false);
2465 node()->get_attrib(LightAttrib::get_class_slot());
2466 if (attrib !=
nullptr) {
2484 nassertr_always(!
is_empty(),
false);
2487 if (light_obj !=
nullptr) {
2489 node()->get_attrib(LightAttrib::get_class_slot());
2490 if (attrib !=
nullptr) {
2496 nassert_raise(
"Not a Light object.");
2512 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2513 if (attrib !=
nullptr) {
2514 priority = max(priority,
2515 node()->
get_state()->get_override(ClipPlaneAttrib::get_class_slot()));
2528 nassert_raise(
"Not a PlaneNode object.");
2560 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2561 if (attrib !=
nullptr) {
2562 priority = max(priority,
2563 node()->
get_state()->get_override(ClipPlaneAttrib::get_class_slot()));
2579 nassert_raise(
"Not a PlaneNode object.");
2589 node()->clear_attrib(ClipPlaneAttrib::get_class_slot());
2601 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2602 if (attrib !=
nullptr) {
2607 if (la->is_identity()) {
2608 node()->clear_attrib(ClipPlaneAttrib::get_class_slot());
2611 int priority =
node()->get_state()->get_override(ClipPlaneAttrib::get_class_slot());
2617 nassert_raise(
"Not a PlaneNode object.");
2627 nassertr_always(!
is_empty(),
false);
2631 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2632 if (attrib !=
nullptr) {
2638 nassert_raise(
"Not a PlaneNode object.");
2649 nassertr_always(!
is_empty(),
false);
2652 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2653 if (attrib !=
nullptr) {
2668 nassertr_always(!
is_empty(),
false);
2671 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2672 if (attrib !=
nullptr) {
2677 nassert_raise(
"Not a PlaneNode object.");
2693 node()->get_effect(OccluderEffect::get_class_type());
2694 if (effect !=
nullptr) {
2707 nassert_raise(
"Not an OccluderNode object.");
2729 node()->get_effect(OccluderEffect::get_class_type());
2730 if (effect !=
nullptr) {
2734 if (la->is_identity()) {
2743 nassert_raise(
"Not an OccluderNode object.");
2753 nassertr_always(!
is_empty(),
false);
2757 node()->get_effect(OccluderEffect::get_class_type());
2758 if (effect !=
nullptr) {
2764 nassert_raise(
"Not an OccluderNode object.");
2776 set_scissor(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top) {
2777 set_effect(ScissorEffect::make_screen(LVecBase4(left, right, bottom, top)));
2800 const LPoint3 &c,
const LPoint3 &d) {
2801 set_effect(ScissorEffect::make_node(a, b, c, d));
2812 set_effect(ScissorEffect::make_node(a, b, other));
2824 const LPoint3 &a,
const LPoint3 &b,
2825 const LPoint3 &c,
const LPoint3 &d) {
2826 set_effect(ScissorEffect::make_node(a, b, c, d, other));
2847 return has_effect(ScissorEffect::get_class_type());
2868 set_bin(
const string &bin_name,
int draw_order,
int priority) {
2870 node()->
set_attrib(CullBinAttrib::make(bin_name, draw_order), priority);
2880 node()->clear_attrib(CullBinAttrib::get_class_slot());
2889 nassertr_always(!
is_empty(),
false);
2890 return node()->has_attrib(CullBinAttrib::get_class_slot());
2900 nassertr_always(!
is_empty(),
string());
2902 node()->get_attrib(CullBinAttrib::get_class_slot());
2903 if (attrib !=
nullptr) {
2918 nassertr_always(!
is_empty(),
false);
2920 node()->get_attrib(CullBinAttrib::get_class_slot());
2921 if (attrib !=
nullptr) {
2956 node()->get_attrib(TextureAttrib::get_class_slot());
2957 if (attrib !=
nullptr) {
2959 int sg_priority =
node()->get_state()->get_override(TextureAttrib::get_class_slot());
2962 node()->
set_attrib(tsa->add_on_stage(stage, tex, priority), sg_priority);
3006 node()->get_attrib(TextureAttrib::get_class_slot());
3007 if (attrib !=
nullptr) {
3009 int sg_priority =
node()->get_state()->get_override(TextureAttrib::get_class_slot());
3012 node()->
set_attrib(tsa->add_on_stage(stage, tex, sampler, priority), sg_priority);
3017 node()->
set_attrib(tsa->add_on_stage(stage, tex, sampler, priority));
3044 node()->get_attrib(TextureAttrib::get_class_slot());
3045 if (attrib !=
nullptr) {
3047 int sg_priority =
node()->get_state()->get_override(TextureAttrib::get_class_slot());
3052 node()->
set_attrib(tsa->add_off_stage(stage, priority), sg_priority);
3071 node()->clear_attrib(TextureAttrib::get_class_slot());
3082 node()->get_attrib(TextureAttrib::get_class_slot());
3083 if (attrib !=
nullptr) {
3088 if (tsa->is_identity()) {
3089 node()->clear_attrib(TextureAttrib::get_class_slot());
3092 int priority =
node()->get_state()->get_override(TextureAttrib::get_class_slot());
3117 nassertr_always(!
is_empty(),
false);
3120 node()->get_attrib(TextureAttrib::get_class_slot());
3121 if (attrib !=
nullptr) {
3137 nassertr_always(!
is_empty(),
false);
3139 node()->get_attrib(TextureAttrib::get_class_slot());
3140 if (attrib !=
nullptr) {
3156 nassertr_always(!
is_empty(),
false);
3159 node()->get_attrib(TextureAttrib::get_class_slot());
3160 if (attrib !=
nullptr) {
3178 nassertr_always(!
is_empty(),
nullptr);
3180 node()->get_attrib(TextureAttrib::get_class_slot());
3181 if (attrib !=
nullptr) {
3195 nassertr_always(!
is_empty(),
nullptr);
3197 node()->get_attrib(TextureAttrib::get_class_slot());
3198 if (attrib !=
nullptr) {
3215 nassertv(tex !=
nullptr);
3216 nassertv(new_tex !=
nullptr);
3218 r_replace_texture(
node(), tex, new_tex);
3246 node()->get_attrib(TextureAttrib::get_class_slot());
3257 set_shader(
const Shader *sha,
int priority) {
3261 node()->get_attrib(ShaderAttrib::get_class_slot());
3262 if (attrib !=
nullptr) {
3263 priority = max(priority,
3264 node()->
get_state()->get_override(ShaderAttrib::get_class_slot()));
3278 set_shader_off(
int priority) {
3279 set_shader(
nullptr, priority);
3286 set_shader_auto(
int priority) {
3290 node()->get_attrib(ShaderAttrib::get_class_slot());
3291 if (attrib !=
nullptr) {
3292 priority = max(priority,
3293 node()->
get_state()->get_override(ShaderAttrib::get_class_slot()));
3307 set_shader_auto(
BitMask32 shader_switch,
int priority) {
3311 node()->get_attrib(ShaderAttrib::get_class_slot());
3312 if (attrib !=
nullptr) {
3313 priority = max(priority,
3314 node()->
get_state()->get_override(ShaderAttrib::get_class_slot()));
3316 node()->
set_attrib(sa->set_shader_auto(shader_switch, priority));
3320 node()->
set_attrib(sa->set_shader_auto(shader_switch, priority));
3331 node()->get_attrib(ShaderAttrib::get_class_slot());
3332 if (attrib !=
nullptr) {
3342 get_shader()
const {
3343 nassertr_always(!
is_empty(),
nullptr);
3345 node()->get_attrib(ShaderAttrib::get_class_slot());
3346 if (attrib !=
nullptr) {
3348 return sa->get_shader();
3362 pnode->get_attrib(ShaderAttrib::get_class_slot());
3363 if (attrib !=
nullptr) {
3365 pnode->
set_attrib(sa->set_shader_input(inp));
3369 pnode->
set_attrib(sa->set_shader_input(inp));
3382 pnode->get_attrib(ShaderAttrib::get_class_slot());
3383 if (attrib !=
nullptr) {
3385 pnode->
set_attrib(sa->set_shader_input(move(inp)));
3389 pnode->
set_attrib(sa->set_shader_input(move(inp)));
3401 node()->get_attrib(ShaderAttrib::get_class_slot());
3402 if (attrib !=
nullptr) {
3404 return sa->get_shader_input(
id);
3418 node()->get_attrib(ShaderAttrib::get_class_slot());
3420 if (attrib !=
nullptr) {
3436 node()->get_attrib(ShaderAttrib::get_class_slot());
3437 if (attrib !=
nullptr) {
3453 node()->get_attrib(ShaderAttrib::get_class_slot());
3454 if (attrib !=
nullptr) {
3473 node()->get_attrib(TexMatrixAttrib::get_class_slot());
3474 if (attrib !=
nullptr) {
3492 node()->clear_attrib(TexMatrixAttrib::get_class_slot());
3503 node()->get_attrib(TexMatrixAttrib::get_class_slot());
3504 if (attrib !=
nullptr) {
3508 if (tma->is_empty()) {
3509 node()->clear_attrib(TexMatrixAttrib::get_class_slot());
3523 nassertr_always(!
is_empty(),
false);
3526 node()->get_attrib(TexMatrixAttrib::get_class_slot());
3527 if (attrib !=
nullptr) {
3529 return tma->has_stage(stage);
3542 nassertr_always(!
is_empty(),
nullptr);
3545 node()->get_attrib(TexMatrixAttrib::get_class_slot());
3546 if (attrib !=
nullptr) {
3548 return tma->get_transform(stage);
3551 return TransformState::make_identity();
3560 nassertv(_error_type == ET_ok && other._error_type == ET_ok);
3565 state->get_attrib(TexMatrixAttrib::get_class_slot());
3566 if (attrib !=
nullptr) {
3570 state = state->add_attrib(tma->add_stage(stage, transform));
3574 state = state->add_attrib(TexMatrixAttrib::make(stage, transform));
3584 CPT(
RenderState) new_state = rel_state->compose(state);
3588 node()->
set_attrib(new_state->get_attrib(TexMatrixAttrib::get_class_slot()));
3597 nassertr(_error_type == ET_ok && other._error_type == ET_ok, TransformState::make_identity());
3601 state->get_attrib(TexMatrixAttrib::get_class_slot());
3602 if (attrib !=
nullptr) {
3604 return tma->get_transform(stage);
3607 return TransformState::make_identity();
3615 set_tex_gen(
TextureStage *stage, RenderAttrib::TexGenMode mode,
int priority) {
3619 node()->get_attrib(TexGenAttrib::get_class_slot());
3623 if (attrib !=
nullptr) {
3624 priority = max(priority,
3625 node()->
get_state()->get_override(TextureAttrib::get_class_slot()));
3641 set_tex_gen(
TextureStage *stage, RenderAttrib::TexGenMode mode,
3642 const LTexCoord3 &constant_value,
int priority) {
3646 node()->get_attrib(TexGenAttrib::get_class_slot());
3650 if (attrib !=
nullptr) {
3651 priority = max(priority,
3652 node()->
get_state()->get_override(TextureAttrib::get_class_slot()));
3659 node()->
set_attrib(tga->add_stage(stage, mode, constant_value), priority);
3669 node()->clear_attrib(TexGenAttrib::get_class_slot());
3681 node()->get_attrib(TexGenAttrib::get_class_slot());
3682 if (attrib !=
nullptr) {
3686 if (tga->is_empty()) {
3687 node()->clear_attrib(TexGenAttrib::get_class_slot());
3701 nassertr_always(!
is_empty(),
false);
3704 node()->get_attrib(TexGenAttrib::get_class_slot());
3705 if (attrib !=
nullptr) {
3707 return tga->has_stage(stage);
3719 nassertr_always(!
is_empty(), TexGenAttrib::M_off);
3722 node()->get_attrib(TexGenAttrib::get_class_slot());
3723 if (attrib !=
nullptr) {
3725 return tga->get_mode(stage);
3728 return TexGenAttrib::M_off;
3748 node()->get_effect(TexProjectorEffect::get_class_type());
3752 if (effect !=
nullptr) {
3770 node()->get_effect(TexProjectorEffect::get_class_type());
3771 if (effect !=
nullptr) {
3775 if (tpe->is_empty()) {
3799 nassertr_always(!
is_empty(),
false);
3802 node()->get_effect(TexProjectorEffect::get_class_type());
3803 if (effect !=
nullptr) {
3805 return tpe->has_stage(stage);
3821 node()->get_effect(TexProjectorEffect::get_class_type());
3822 if (effect !=
nullptr) {
3824 return tpe->get_from(stage);
3840 node()->get_effect(TexProjectorEffect::get_class_type());
3841 if (effect !=
nullptr) {
3843 return tpe->get_to(stage);
3858 set_tex_gen(stage, TexGenAttrib::M_world_position);
3872 nassertr_always(!
is_empty(),
false);
3873 return r_has_vertex_column(
node(), name);
3883 InternalNames vertex_columns;
3884 r_find_all_vertex_columns(
node(), vertex_columns);
3887 InternalNames::iterator ti;
3888 for (ti = vertex_columns.begin(); ti != vertex_columns.end(); ++ti) {
3902 InternalNames vertex_columns;
3903 r_find_all_vertex_columns(
node(), vertex_columns);
3908 InternalNames::iterator ti;
3909 for (ti = vertex_columns.begin(); ti != vertex_columns.end(); ++ti) {
3925 InternalNames vertex_columns;
3926 r_find_all_vertex_columns(
node(), vertex_columns);
3928 CPT(
InternalName) texcoord_name = InternalName::get_texcoord();
3931 InternalNames::iterator ti;
3932 for (ti = vertex_columns.begin(); ti != vertex_columns.end(); ++ti) {
3933 if ((*ti)->get_top() == texcoord_name) {
3948 InternalNames vertex_columns;
3949 r_find_all_vertex_columns(
node(), vertex_columns);
3955 InternalNames::iterator ti;
3956 for (ti = vertex_columns.begin(); ti != vertex_columns.end(); ++ti) {
3958 if (name->
get_top() == texcoord_name) {
3965 if (glob.
matches(net_basename)) {
3980 nassertr_always(!
is_empty(),
nullptr);
3982 return r_find_texture(
node(), get_net_state(), glob);
3992 nassertr_always(!
is_empty(),
nullptr);
3993 return r_find_texture(
node(), stage);
4003 r_find_all_textures(
node(), get_net_state(), textures);
4006 Textures::iterator ti;
4007 for (ti = textures.begin(); ti != textures.end(); ++ti) {
4021 r_find_all_textures(
node(), get_net_state(), textures);
4026 Textures::iterator ti;
4027 for (ti = textures.begin(); ti != textures.end(); ++ti) {
4029 if (glob.
matches(texture->get_name())) {
4044 r_find_all_textures(
node(), stage, textures);
4047 Textures::iterator ti;
4048 for (ti = textures.begin(); ti != textures.end(); ++ti) {
4062 nassertr_always(!
is_empty(),
nullptr);
4064 return r_find_texture_stage(
node(), get_net_state(), glob);
4074 TextureStages texture_stages;
4075 r_find_all_texture_stages(
node(), get_net_state(), texture_stages);
4078 TextureStages::iterator ti;
4079 for (ti = texture_stages.begin(); ti != texture_stages.end(); ++ti) {
4095 r_unify_texture_stages(
node(), stage);
4106 TextureStages texture_stages;
4107 r_find_all_texture_stages(
node(), get_net_state(), texture_stages);
4112 TextureStages::iterator ti;
4113 for (ti = texture_stages.begin(); ti != texture_stages.end(); ++ti) {
4129 nassertr_always(!
is_empty(),
nullptr);
4131 return r_find_material(
node(), get_net_state(), glob);
4140 Materials materials;
4141 r_find_all_materials(
node(), get_net_state(), materials);
4144 Materials::iterator ti;
4145 for (ti = materials.begin(); ti != materials.end(); ++ti) {
4158 Materials materials;
4159 r_find_all_materials(
node(), get_net_state(), materials);
4164 Materials::iterator ti;
4165 for (ti = materials.begin(); ti != materials.end(); ++ti) {
4167 if (glob.
matches(material->get_name())) {
4184 nassertv(mat !=
nullptr);
4207 node()->clear_attrib(MaterialAttrib::get_class_slot());
4216 nassertr_always(!
is_empty(),
false);
4218 node()->get_attrib(MaterialAttrib::get_class_slot());
4219 if (attrib !=
nullptr) {
4236 get_material()
const {
4237 nassertr_always(!
is_empty(),
nullptr);
4239 node()->get_attrib(MaterialAttrib::get_class_slot());
4240 if (attrib !=
nullptr) {
4257 nassertv(mat !=
nullptr);
4258 nassertv(new_mat !=
nullptr);
4260 CPT(
RenderAttrib) new_attrib = MaterialAttrib::make(new_mat);
4294 node()->clear_attrib(FogAttrib::get_class_slot());
4305 nassertr_always(!
is_empty(),
false);
4307 node()->get_attrib(FogAttrib::get_class_slot());
4308 if (attrib !=
nullptr) {
4324 nassertr_always(!
is_empty(),
false);
4326 node()->get_attrib(FogAttrib::get_class_slot());
4327 if (attrib !=
nullptr) {
4343 nassertr_always(!
is_empty(),
nullptr);
4345 node()->get_attrib(FogAttrib::get_class_slot());
4346 if (attrib !=
nullptr) {
4362 node()->get_state()->get_attrib_def(rma);
4374 node()->get_state()->get_attrib_def(rma);
4387 node()->get_state()->get_attrib_def(rma);
4405 node()->get_state()->get_attrib_def(rma);
4421 node()->get_state()->get_attrib_def(rma);
4430 set_render_mode(RenderModeAttrib::Mode mode, PN_stdfloat thickness,
int priority) {
4433 node()->
set_attrib(RenderModeAttrib::make(mode, thickness), priority);
4443 node()->clear_attrib(RenderModeAttrib::get_class_slot());
4453 nassertr_always(!
is_empty(),
false);
4454 return node()->has_attrib(RenderModeAttrib::get_class_slot());
4463 nassertr_always(!
is_empty(), RenderModeAttrib::M_unchanged);
4465 node()->get_attrib(RenderModeAttrib::get_class_slot());
4466 if (attrib !=
nullptr) {
4471 return RenderModeAttrib::M_unchanged;
4480 nassertr_always(!
is_empty(), 0.0f);
4482 node()->get_attrib(RenderModeAttrib::get_class_slot());
4483 if (attrib !=
nullptr) {
4497 nassertr_always(!
is_empty(), 0.0f);
4499 node()->get_attrib(RenderModeAttrib::get_class_slot());
4500 if (attrib !=
nullptr) {
4517 CullFaceAttrib::Mode mode =
4519 CullFaceAttrib::M_cull_none :
4520 CullFaceAttrib::M_cull_clockwise;
4535 node()->clear_attrib(CullFaceAttrib::get_class_slot());
4545 nassertr_always(!
is_empty(),
false);
4546 return node()->has_attrib(CullFaceAttrib::get_class_slot());
4558 nassertr_always(!
is_empty(),
false);
4560 node()->get_attrib(CullFaceAttrib::get_class_slot());
4561 if (attrib !=
nullptr) {
4578 DepthTestAttrib::PandaCompareFunc mode =
4580 DepthTestAttrib::M_less :
4581 DepthTestAttrib::M_none;
4593 node()->clear_attrib(DepthTestAttrib::get_class_slot());
4603 nassertr_always(!
is_empty(),
false);
4604 return node()->has_attrib(DepthTestAttrib::get_class_slot());
4615 nassertr_always(!
is_empty(),
false);
4617 node()->get_attrib(DepthTestAttrib::get_class_slot());
4618 if (attrib !=
nullptr) {
4620 return (dta->
get_mode() != DepthTestAttrib::M_none);
4635 DepthWriteAttrib::Mode mode =
4637 DepthWriteAttrib::M_on :
4638 DepthWriteAttrib::M_off;
4650 node()->clear_attrib(DepthWriteAttrib::get_class_slot());
4660 nassertr_always(!
is_empty(),
false);
4661 return node()->has_attrib(DepthWriteAttrib::get_class_slot());
4672 nassertr_always(!
is_empty(),
false);
4674 node()->get_attrib(DepthWriteAttrib::get_class_slot());
4675 if (attrib !=
nullptr) {
4677 return (dta->
get_mode() != DepthWriteAttrib::M_off);
4706 node()->clear_attrib(DepthOffsetAttrib::get_class_slot());
4716 nassertr_always(!
is_empty(),
false);
4717 return node()->has_attrib(DepthOffsetAttrib::get_class_slot());
4728 node()->get_attrib(DepthOffsetAttrib::get_class_slot());
4729 if (attrib !=
nullptr) {
4747 const LMatrix4 &rel_mat = transform->
get_mat();
4749 LVector3 up = LVector3::up();
4750 LVector3 rel_pos = -rel_mat.get_row3(3);
4758 if (offset != 0.0f) {
4759 LVector3 translate = rel_mat.get_row3(3);
4760 translate.normalize();
4761 translate *= offset;
4777 const LMatrix4 &rel_mat = transform->
get_mat();
4779 LVector3 up = LVector3::up() * rel_mat;
4780 LVector3 rel_pos = LVector3::forward() * rel_mat;
4788 if (offset != 0.0f) {
4789 LVector3 translate = rel_mat.get_row3(3);
4790 translate.normalize();
4791 translate *= offset;
4806 const LMatrix4 &rel_mat = transform->
get_mat();
4808 LVector3 up = LVector3::up();
4809 LVector3 rel_pos = -rel_mat.get_row3(3);
4817 if (offset != 0.0f) {
4818 LVector3 translate = rel_mat.get_row3(3);
4819 translate.normalize();
4820 translate *= offset;
4834 (LVector3::up(),
false,
true,
4835 offset, camera, LPoint3(0.0f, 0.0f, 0.0f));
4848 (LVector3::up(),
true,
false,
4849 offset, camera, LPoint3(0.0f, 0.0f, 0.0f), fixed_depth);
4862 (LVector3::up(),
false,
false,
4863 offset, camera, LPoint3(0.0f, 0.0f, 0.0f));
4881 nassertr_always(!
is_empty(),
false);
4882 return node()->has_effect(BillboardEffect::get_class_type());
4910 nassertr_always(!
is_empty(),
false);
4911 return node()->has_effect(CompassEffect::get_class_type());
4935 node()->clear_attrib(TransparencyAttrib::get_class_slot());
4946 nassertr_always(!
is_empty(),
false);
4947 return node()->has_attrib(TransparencyAttrib::get_class_slot());
4960 nassertr_always(!
is_empty(), TransparencyAttrib::M_none);
4962 node()->get_attrib(TransparencyAttrib::get_class_slot());
4963 if (attrib !=
nullptr) {
4968 return TransparencyAttrib::M_none;
4979 set_logic_op(LogicOpAttrib::Operation op,
int priority) {
4995 node()->clear_attrib(LogicOpAttrib::get_class_slot());
5008 nassertr_always(!
is_empty(),
false);
5009 return node()->has_attrib(LogicOpAttrib::get_class_slot());
5024 nassertr_always(!
is_empty(), LogicOpAttrib::O_none);
5026 node()->get_attrib(LogicOpAttrib::get_class_slot());
5027 if (attrib !=
nullptr) {
5032 return LogicOpAttrib::O_none;
5053 node()->clear_attrib(AntialiasAttrib::get_class_slot());
5063 nassertr_always(!
is_empty(),
false);
5064 return node()->has_attrib(AntialiasAttrib::get_class_slot());
5073 nassertr_always(!
is_empty(), AntialiasAttrib::M_none);
5075 node()->get_attrib(AntialiasAttrib::get_class_slot());
5076 if (attrib !=
nullptr) {
5081 return AntialiasAttrib::M_none;
5091 nassertr_always(!
is_empty(),
false);
5092 return node()->has_attrib(AudioVolumeAttrib::get_class_slot());
5103 node()->clear_attrib(AudioVolumeAttrib::get_class_slot());
5114 node()->get_attrib(AudioVolumeAttrib::get_class_slot());
5115 if (attrib !=
nullptr) {
5116 priority = max(priority,
5117 node()->
get_state()->get_override(AudioVolumeAttrib::get_class_slot()));
5152 node()->get_attrib(AudioVolumeAttrib::get_class_slot());
5153 if (attrib !=
nullptr) {
5168 const RenderAttrib *attrib = net_state->get_attrib(AudioVolumeAttrib::get_class_slot());
5169 if (attrib !=
nullptr) {
5171 if (ava !=
nullptr) {
5191 comp = comp->
get_next(pipeline_stage, current_thread)) {
5196 result._head = comp;
5220 bool reparented = PandaNode::reparent(_head->get_next(pipeline_stage, current_thread),
5221 _head, sort,
true, pipeline_stage,
5223 nassertv(reparented);
5237 bool reparented = PandaNode::reparent(_head->get_next(pipeline_stage, current_thread),
5238 _head, sort,
false, pipeline_stage,
5240 nassertv(reparented);
5249 stashed_descendents.
unstash();
5261 if (comp !=
nullptr) {
5265 while (next !=
nullptr) {
5271 result._head = comp;
5276 next = next->
get_next(pipeline_stage, current_thread);
5289 return (other == *
this);
5297 return (other != *
this);
5308 return other.compare_to(*
this) > 0;
5323 return -other.compare_to(*
this);
5346 PStatTimer timer(_verify_complete_pcollector);
5349 nassertr(comp !=
nullptr,
false);
5354 nassertr(
node !=
nullptr,
false);
5355 int length = comp->
get_length(pipeline_stage, current_thread);
5357 comp = comp->
get_next(pipeline_stage, current_thread);
5359 while (comp !=
nullptr) {
5361 nassertr(next_node !=
nullptr,
false);
5364 pgraph_cat.warning()
5365 << *
this <<
" is incomplete; " << *
node <<
" is not a child of "
5366 << *next_node <<
"\n";
5370 if (comp->
get_length(pipeline_stage, current_thread) != length) {
5371 pgraph_cat.warning()
5372 << *
this <<
" is incomplete; length at " << *next_node
5373 <<
" indicates " << comp->
get_length(pipeline_stage, current_thread)
5374 <<
" while length at " << *
node <<
" indicates " << length <<
"\n";
5379 comp = comp->
get_next(pipeline_stage, current_thread);
5399 CPT(
RenderState) state = RenderState::make_empty();
5422 node()->prepare_scene(gsg, get_net_state());
5464 get_bounds(
Thread *current_thread)
const {
5481 force_recompute_bounds() {
5483 r_force_recompute_bounds(
node());
5492 get_bounds()->write(out);
5513 min_point.set(0.0f, 0.0f, 0.0f);
5514 max_point.set(0.0f, 0.0f, 0.0f);
5515 nassertr_always(!
is_empty(),
false);
5522 bool found_any =
false;
5523 node()->calc_tight_bounds(min_point, max_point, found_any,
5524 move(transform), current_thread);
5613 if (flatten_geoms) {
5641 if (flatten_geoms) {
5643 gr.
collect_vertex_data(
node(), ~(SceneGraphReducer::CVD_format | SceneGraphReducer::CVD_name | SceneGraphReducer::CVD_animation_type));
5668 gr.
apply_attribs(
node(), SceneGraphReducer::TT_apply_texture_color | SceneGraphReducer::TT_tex_matrix | SceneGraphReducer::TT_other);
5694 nassertr_always(!
is_empty(),
false);
5698 bool okflag =
false;
5718 nassertr_always(!
is_empty(),
false);
5722 bool okflag =
false;
5761 ostringstream stream;
5765 bool used_local_writer =
false;
5766 if (writer ==
nullptr) {
5772 writer = &local_writer;
5773 used_local_writer =
true;
5779 if (used_local_writer && num_nodes > 1) {
5802 for (
int i = 0; i < num_nodes; ++i) {
5804 nassertr(
node !=
nullptr,
false);
5827 if (reader ==
nullptr) {
5831 if (!buffer.
read_header(head, _bam_header.size())) {
5835 if (head != _bam_header) {
5839 reader = &local_reader;
5851 ErrorType error_type = (ErrorType)dgi.
get_uint8();
5853 if (num_nodes == 0) {
5855 result._error_type = error_type;
5859 for (
int i = 0; i < num_nodes; ++i) {
5862 if (
object ==
nullptr ||
5863 !object->
is_of_type(PandaNode::get_class_type())) {
5892 Thread *current_thread) {
5900 while (comp !=
nullptr && comp != source._head) {
5903 comp = comp->
get_next(pipeline_stage, current_thread);
5906 if (comp ==
nullptr) {
5914 for (it = nodes.rbegin(); it != nodes.rend(); ++it) {
5915 PandaNode::InstanceMap::const_iterator iit = inst_map.find(*it);
5916 nassertr_always(iit != inst_map.end(),
false);
5917 new_comp = PandaNode::get_component(new_comp, iit->second, pipeline_stage, current_thread);
5920 nassertr(new_comp !=
nullptr,
false);
5921 _head = std::move(new_comp);
5935 int &a_count,
int &b_count,
Thread *current_thread) {
5945 while (ac->
get_length(pipeline_stage, current_thread) > bc->
get_length(pipeline_stage, current_thread)) {
5946 nassertr(ac !=
nullptr,
nullptr);
5947 ac = ac->
get_next(pipeline_stage, current_thread);
5950 while (bc->
get_length(pipeline_stage, current_thread) > ac->
get_length(pipeline_stage, current_thread)) {
5951 nassertr(bc !=
nullptr,
nullptr);
5952 bc = bc->
get_next(pipeline_stage, current_thread);
5959 nassertr(ac !=
nullptr,
nullptr);
5960 nassertr(bc !=
nullptr,
nullptr);
5961 ac = ac->
get_next(pipeline_stage, current_thread);
5963 bc = bc->
get_next(pipeline_stage, current_thread);
5976 if (comp ==
nullptr) {
5977 return RenderState::make_empty();
5981 return r_get_net_state(comp->
get_next(pipeline_stage, current_thread), current_thread)->compose(state);
5992 Thread *current_thread)
const {
5993 if (n == 0 || comp ==
nullptr) {
5994 return RenderState::make_empty();
5998 return r_get_partial_state(comp->
get_next(pipeline_stage, current_thread), n - 1, current_thread)->compose(state);
6008 if (comp ==
nullptr) {
6009 return TransformState::make_identity();
6013 CPT(
TransformState) net_transform = r_get_net_transform(comp->
get_next(pipeline_stage, current_thread), current_thread);
6016 if (!node_cdata->_effects->has_adjust_transform()) {
6017 if (node_cdata->_transform->is_identity()) {
6018 return net_transform;
6020 return net_transform->compose(node_cdata->_transform);
6024 node_cdata->_effects->adjust_transform(net_transform, transform,
node);
6025 return net_transform->compose(transform);
6040 Thread *current_thread)
const {
6041 if (n == 0 || comp ==
nullptr) {
6042 return TransformState::make_identity();
6046 if (node_cdata->_effects->has_adjust_transform()) {
6050 CPT(
TransformState) partial = r_get_partial_transform(comp->
get_next(pipeline_stage, current_thread), n - 1, current_thread);
6051 if (partial ==
nullptr) {
6054 if (node_cdata->_transform->is_identity()) {
6057 return partial->compose(node_cdata->_transform);
6068 if (comp ==
nullptr) {
6069 return TransformState::make_identity();
6073 return r_get_net_prev_transform(comp->
get_next(pipeline_stage, current_thread), current_thread)->compose(transform);
6084 if (n == 0 || comp ==
nullptr) {
6085 return TransformState::make_identity();
6089 return r_get_partial_prev_transform(comp->
get_next(pipeline_stage, current_thread), n - 1, current_thread)->compose(transform);
6100 int max_matches)
const {
6102 pgraph_cat.warning()
6103 <<
"Attempt to extend an empty NodePath by '" << path
6109 find_matches(result, approx_path, max_matches);
6120 int max_matches)
const {
6122 pgraph_cat.warning()
6123 <<
"Attempt to extend an empty NodePath by: " << approx_path <<
".\n";
6130 nassertv(level->_node_path.
is_valid());
6132 find_matches(result, level, max_matches);
6141 int max_matches)
const {
6143 int num_levels_remaining = _max_search_depth;
6147 while (num_levels_remaining > 0 && level !=
nullptr) {
6148 if (pgraph_cat.is_spam()) {
6150 <<
"find_matches pass: " << result <<
", "
6151 << max_matches <<
", " << num_levels_remaining <<
"\n";
6155 num_levels_remaining--;
6162 while (entry !=
nullptr) {
6163 if (entry->
consider_node(result, next_level, max_matches, 0)) {
6167 while (entry !=
nullptr) {
6172 while (next_level !=
nullptr) {
6177 while (deleted_entries !=
nullptr) {
6179 delete deleted_entries;
6180 deleted_entries = next;
6190 entry->_next = deleted_entries;
6191 deleted_entries = entry;
6198 while (entry !=
nullptr) {
6200 entry->_next = deleted_entries;
6201 deleted_entries = entry;
6210 while (deleted_entries !=
nullptr) {
6212 delete deleted_entries;
6213 deleted_entries = next;
6227 DCAST_INTO_R(mnode,
node, count);
6234 for (
int i = 0; i < num_children; i++) {
6235 count += r_clear_model_nodes(cr.
get_child(i));
6246 r_adjust_all_priorities(
PandaNode *node,
int adjustment) {
6250 DCAST_INTO_V(gnode,
node);
6253 for (
int i = 0; i < num_geoms; i++) {
6260 for (
int i = 0; i < num_children; i++) {
6261 r_adjust_all_priorities(cr.
get_child(i), adjustment);
6269 r_force_recompute_bounds(
PandaNode *node) {
6272 DCAST_INTO_V(gnode,
node);
6275 for (
int i = 0; i < num_geoms; i++) {
6276 const Geom *geom = gnode->get_geom(i);
6277 geom->mark_bounds_stale();
6281 node->mark_bounds_stale();
6286 for (
int i = 0; i < num_children; i++) {
6287 r_force_recompute_bounds(cr.
get_child(i));
6301 into_collide_mask = (into_collide_mask & and_mask) | or_mask;
6307 for (
int i = 0; i < num_children; i++) {
6308 r_set_collide_mask(cr.
get_child(i), and_mask, or_mask, node_type);
6319 DCAST_INTO_R(gnode,
node,
false);
6322 for (
int i = 0; i < num_geoms; i++) {
6323 const Geom *geom = gnode->get_geom(i);
6325 if (vdata->has_column(name)) {
6334 for (
int i = 0; i < num_children; i++) {
6336 if (r_has_vertex_column(child, name)) {
6348 r_find_all_vertex_columns(
PandaNode *node,
6349 NodePath::InternalNames &vertex_columns)
const {
6352 DCAST_INTO_V(gnode,
node);
6355 for (
int i = 0; i < num_geoms; ++i) {
6356 const Geom *geom = gnode->get_geom(i);
6359 for (
int j = 0; j < num_arrays; ++j) {
6362 for (
int k = 0; k < num_columns; ++k) {
6364 vertex_columns.insert(column->
get_name());
6373 for (
int i = 0; i < num_children; i++) {
6375 r_find_all_vertex_columns(child, vertex_columns);
6387 DCAST_INTO_R(gnode,
node,
nullptr);
6390 for (
int i = 0; i < num_geoms; i++) {
6396 geom_state->get_attrib(TextureAttrib::get_class_slot());
6397 if (attrib !=
nullptr) {
6401 if (texture !=
nullptr) {
6402 if (glob.
matches(texture->get_name())) {
6414 for (
int i = 0; i < num_children; i++) {
6416 CPT(
RenderState) next_state = state->compose(child->get_state());
6418 Texture *result = r_find_texture(child, next_state, glob);
6419 if (result !=
nullptr) {
6432 NodePath::Textures &textures)
const {
6435 DCAST_INTO_V(gnode,
node);
6438 for (
int i = 0; i < num_geoms; i++) {
6444 geom_state->get_attrib(TextureAttrib::get_class_slot());
6445 if (attrib !=
nullptr) {
6449 if (texture !=
nullptr) {
6450 textures.insert(texture);
6460 for (
int i = 0; i < num_children; i++) {
6462 CPT(
RenderState) next_state = state->compose(child->get_state());
6463 r_find_all_textures(child, next_state, textures);
6474 node->get_attrib(TextureAttrib::get_class_slot());
6475 if (attrib !=
nullptr) {
6484 DCAST_INTO_R(gnode,
node,
nullptr);
6487 for (
int i = 0; i < num_geoms; i++) {
6492 geom_state->get_attrib(TextureAttrib::get_class_slot());
6493 if (attrib !=
nullptr) {
6505 for (
int i = 0; i < num_children; i++) {
6508 Texture *result = r_find_texture(child, stage);
6509 if (result !=
nullptr) {
6522 NodePath::Textures &textures)
const {
6525 node->get_attrib(TextureAttrib::get_class_slot());
6526 if (attrib !=
nullptr) {
6535 DCAST_INTO_V(gnode,
node);
6538 for (
int i = 0; i < num_geoms; i++) {
6543 geom_state->get_attrib(TextureAttrib::get_class_slot());
6544 if (attrib !=
nullptr) {
6556 for (
int i = 0; i < num_children; i++) {
6558 r_find_all_textures(child, stage, textures);
6572 if (node_state->get_attrib(ta)) {
6573 CPT(
RenderAttrib) new_ta = ta->replace_texture(tex, new_tex);
6583 DCAST_INTO_V(gnode,
node);
6586 for (
int i = 0; i < num_geoms; i++) {
6591 if (geom_state->get_attrib(ta)) {
6592 CPT(
RenderAttrib) new_ta = ta->replace_texture(tex, new_tex);
6603 for (
size_t i = 0; i < num_children; ++i) {
6605 r_replace_texture(child, tex, new_tex);
6617 DCAST_INTO_R(gnode,
node,
nullptr);
6620 for (
int i = 0; i < num_geoms; i++) {
6626 geom_state->get_attrib(TextureAttrib::get_class_slot());
6627 if (attrib !=
nullptr) {
6631 if (texture_stage !=
nullptr) {
6633 return texture_stage;
6644 for (
int i = 0; i < num_children; i++) {
6646 CPT(
RenderState) next_state = state->compose(child->get_state());
6648 TextureStage *result = r_find_texture_stage(child, next_state, glob);
6649 if (result !=
nullptr) {
6662 NodePath::TextureStages &texture_stages)
const {
6665 DCAST_INTO_V(gnode,
node);
6668 for (
int i = 0; i < num_geoms; i++) {
6674 geom_state->get_attrib(TextureAttrib::get_class_slot());
6675 if (attrib !=
nullptr) {
6679 if (texture_stage !=
nullptr) {
6680 texture_stages.insert(texture_stage);
6690 for (
int i = 0; i < num_children; i++) {
6692 CPT(
RenderState) next_state = state->compose(child->get_state());
6693 r_find_all_texture_stages(child, next_state, texture_stages);
6704 node->get_attrib(TextureAttrib::get_class_slot());
6705 if (attrib !=
nullptr) {
6707 CPT(
RenderAttrib) new_attrib = ta->unify_texture_stages(stage);
6708 if (new_attrib != ta) {
6715 DCAST_INTO_V(gnode,
node);
6718 for (
int i = 0; i < num_geoms; i++) {
6723 state->get_attrib(TextureAttrib::get_class_slot());
6724 if (attrib !=
nullptr) {
6726 CPT(
RenderAttrib) new_attrib = ta->unify_texture_stages(stage);
6727 if (new_attrib != ta) {
6728 CPT(
RenderState) new_state = state->add_attrib(new_attrib);
6738 for (
int i = 0; i < num_children; i++) {
6740 r_unify_texture_stages(child, stage);
6752 DCAST_INTO_R(gnode,
node,
nullptr);
6755 for (
int i = 0; i < num_geoms; i++) {
6761 geom_state->get_attrib(MaterialAttrib::get_class_slot());
6762 if (attrib !=
nullptr) {
6766 if (material !=
nullptr) {
6767 if (glob.
matches(material->get_name())) {
6779 for (
int i = 0; i < num_children; i++) {
6781 CPT(
RenderState) next_state = state->compose(child->get_state());
6783 Material *result = r_find_material(child, next_state, glob);
6784 if (result !=
nullptr) {
6797 NodePath::Materials &materials)
const {
6800 DCAST_INTO_V(gnode,
node);
6803 for (
int i = 0; i < num_geoms; i++) {
6809 geom_state->get_attrib(MaterialAttrib::get_class_slot());
6810 if (attrib !=
nullptr) {
6814 if (material !=
nullptr) {
6815 materials.insert(material);
6825 for (
int i = 0; i < num_children; i++) {
6827 CPT(
RenderState) next_state = state->compose(child->get_state());
6828 r_find_all_materials(child, next_state, materials);
6842 if (node_state->get_attrib(ma)) {
6852 DCAST_INTO_V(gnode,
node);
6855 for (
int i = 0; i < num_geoms; i++) {
6860 if (geom_state->get_attrib(ma)) {
6872 for (
size_t i = 0; i < num_children; ++i) {
6874 r_replace_material(child, mat, new_attrib);
6892 if (root ==
nullptr || root ==
node()) {
6904 while (comp !=
nullptr) {
6906 path.push_back(
node);
6912 comp = comp->
get_next(pipeline_stage, current_thread);
6915 if (comp ==
nullptr) {
6923 for (
int i = path.size() - 1; i >= 0; --i) {
6937 if (
node.is_null()) {
6950 nassertd(!comp.is_null()) {
6951 while (p_list[pi++]) {}
6956 while (p_list[pi] !=
nullptr) {
6964 PandaNode::Paths::const_iterator it;
6965 for (it =
node->_paths.begin(); it !=
node->_paths.end(); ++it) {
6966 if ((*it)->get_next(pipeline_stage, current_thread) == comp) {
6973 if (it ==
node->_paths.end()) {
6979 node->_paths.insert(comp);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Specifies whether or how to enable antialiasing, if supported by the backend renderer.
get_mode
Returns the specified antialias mode.
Applies a scale to audio volume for positional sounds in the scene graph.
get_volume
Returns the volume to be applied to sounds.
The principle public interface to reading and writing Bam disk files.
void close()
Closes the input or output stream.
bool open_write(const Filename &bam_filename, bool report_errors=true)
Attempts to open the indicated file for writing.
get_writer
Returns the BamWriter in charge of performing the write operations.
bool write_object(const TypedWritable *object)
Writes the indicated object to the Bam file.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
bool resolve()
This may be called at any time during processing of the Bam file to resolve all the known pointers so...
TypedWritable * read_object()
Reads a single object from the Bam file.
bool read_pointer(DatagramIterator &scan)
The interface for reading a pointer to another object from a Bam file.
set_source
Changes the source of future datagrams for this BamReader.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
bool write_object(const TypedWritable *obj)
Writes a single object to the Bam file, so that the BamReader::read_object() can later correctly rest...
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.
get_root_node
Returns the root node of the part of the scene graph we are currently writing out.
set_root_node
Sets the root node of the part of the scene graph we are currently writing out.
set_target
Changes the destination of future datagrams written by the BamWriter.
This defines a bounding sphere, consisting of a center and a radius.
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
This is a const pointer to an InternalName, and should be used in lieu of a CPT(InternalName) in func...
This functions similarly to a LightAttrib.
bool has_all_off() const
Returns true if this attrib disables all planes (although it may also enable some).
bool has_on_plane(const NodePath &plane) const
Returns true if the indicated plane is enabled by the attrib, false otherwise.
bool has_off_plane(const NodePath &plane) const
Returns true if the indicated plane is disabled by the attrib, false otherwise.
Indicates what color should be applied to renderable geometry.
get_color
If the type is T_flat or T_off, this returns the color that will be applied to geometry.
get_color_type
Returns the type of color specified by this ColorAttrib.
Applies a scale to colors in the scene graph and on vertices.
get_scale
Returns the scale to be applied to colors.
Assigns geometry to a particular bin by name.
get_draw_order
Returns the draw order this attribute specifies.
get_bin_name
Returns the name of the bin this attribute specifies.
Indicates which faces should be culled based on their vertex ordering.
get_actual_mode
Returns the actual culling mode, without considering the effects of the reverse flag.
This template class calls PipelineCycler::read_unlocked(), and then provides a transparent read-only ...
This class can be used to write a series of datagrams into a memory buffer.
bool read_header(std::string &header, size_t num_bytes)
Reads a sequence of bytes from the beginning of the datagram file.
virtual bool put_datagram(const Datagram &data) override
Writes the given datagram to the file.
virtual bool get_datagram(Datagram &data) override
Reads the next datagram from the file.
bool write_header(const std::string &header)
Writes a sequence of bytes to the beginning of the datagram file.
void swap_data(vector_uchar &other)
Swaps the data in the internal buffer with that of the other buffer.
A class to retrieve the individual data elements previously stored in a Datagram.
uint8_t get_uint8()
Extracts an unsigned 8-bit integer.
int32_t get_int32()
Extracts a signed 32-bit integer.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void add_int32(int32_t value)
Adds a signed 32-bit integer to the datagram.
void add_uint8(uint8_t value)
Adds an unsigned 8-bit integer to the datagram.
This is a special kind of attribute that instructs the graphics driver to apply an offset or bias to ...
get_offset
Returns the depth offset represented by this attrib.
Enables or disables writing to the depth buffer.
get_mode
Returns the depth write mode.
Enables or disables writing to the depth buffer.
get_mode
Returns the depth write mode.
The name of a file, such as a texture file or an Egg file.
This class is local to this package only; it doesn't get exported.
void write_level(std::ostream &out, int indent_level) const
Writes the entire level (a linked list of entries beginning at this entry).
bool consider_node(NodePathCollection &result, FindApproxLevelEntry *&next_level, int max_matches, int increment) const
Considers the node represented by the entry for matching the find path.
This class is local to this package only; it doesn't get exported.
void add_match_many(int flags)
Adds a component that will match a chain of zero or more consecutive nodes.
bool add_string(const std::string &str_path)
Adds a sequence of components separated by slashes, followed optionally by a semicolon and a sequence...
void add_match_pointer(PandaNode *pointer, int flags)
Adds a component that must match a particular node exactly, by pointer.
Applies a Fog to the geometry at and below this node.
get_fog
If the FogAttrib is not an 'off' FogAttrib, returns the fog that is associated.
bool is_off() const
Returns true if the FogAttrib is an 'off' FogAttrib, indicating that it should disable fog.
Specifies how atmospheric fog effects are applied to geometry.
A node that holds Geom objects, renderable pieces of geometry.
get_num_geoms
Returns the number of geoms in the node.
get_geom_state
Returns the RenderState associated with the nth geom of the node.
void set_geom_state(int n, const RenderState *state)
Changes the RenderState associated with the nth geom of the node.
This defines how a single column is interleaved within a vertex array stored within a Geom.
const InternalName * get_name() const
Returns the name of this particular data field, e.g.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
A container for geometry primitives.
This class can be used to test for string matches against standard Unix- shell filename globbing conv...
bool matches(const std::string &candidate) const
Returns true if the candidate string matches the pattern, false otherwise.
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
void add_name(const InternalName *name)
Adds a new InternalName to the collection.
Encodes a string name in a hash table, mapping it to a pointer.
int find_ancestor(const std::string &basename) const
Returns the index of the ancestor with the indicated basename, or -1 if no ancestor has that basename...
std::string get_net_basename(int n) const
Returns the basename of this name prefixed by the indicated number of ancestors.
const InternalName * get_top() const
Returns the oldest ancestor in the InternalName's chain, not counting the root.
get_name
Returns the complete name represented by the InternalName and all of its parents.
Indicates which set of lights should be considered "on" to illuminate geometry at this level and belo...
get_off_light
Returns the nth light turned off by the attribute, sorted in arbitrary (pointer) order.
bool has_all_off() const
Returns true if this attrib turns off all lights (although it may also turn some on).
get_num_off_lights
Returns the number of lights that are turned off by the attribute.
get_num_on_lights
Returns the number of lights that are turned on by the attribute.
bool has_off_light(const NodePath &light) const
Returns true if the indicated light is turned off by the attrib, false otherwise.
bool has_on_light(const NodePath &light) const
Returns true if the indicated light is turned on by the attrib, false otherwise.
get_on_light
Returns the nth light turned on by the attribute, sorted in render order.
Similar to MutexHolder, but for a light reentrant mutex.
The abstract interface to all kinds of lights.
If enabled, specifies that a custom logical operation be performed instead of any color blending.
get_operation
Returns the logic operation specified by this attribute.
Indicates which, if any, material should be applied to geometry.
bool is_off() const
Returns true if the MaterialAttrib is an 'off' MaterialAttrib, indicating that it should disable the ...
get_material
If the MaterialAttrib is not an 'off' MaterialAttrib, returns the material that is associated.
void add_material(Material *node_material)
Adds a new Material to the collection.
Defines the way an object appears in the presence of lighting.
This node is placed at key points within the scene graph to indicate the roots of "models": subtrees ...
void set_preserve_transform(PreserveTransform preserve_transform)
Sets the preserve_transform flag.
This is a set of zero or more NodePaths.
void unstash()
Unstashes all NodePaths in the collection.
void add_path(const NodePath &node_path)
Adds a new NodePath to the collection.
bool is_empty() const
Returns true if there are no NodePaths in the collection, false otherwise.
get_path
Returns the nth NodePath in the collection.
This is one component of a NodePath.
PandaNode * get_node() const
Returns the node referenced by this component.
bool is_top_node(int pipeline_stage, Thread *current_thread) const
Returns true if this component represents the top node in the path.
NodePathComponent * get_next(int pipeline_stage, Thread *current_thread) const
Returns the next component in the path.
int get_length(int pipeline_stage, Thread *current_thread) const
Returns the length of the path to this node.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
void stash(int sort=0, Thread *current_thread=Thread::get_current_thread())
Removes the referenced node (and the entire subgraph below this node) from the scene graph in any nor...
LogicOpAttrib::Operation get_logic_op() const
Returns the logical operation that has been specifically set on this node via set_logic_op(),...
void premunge_scene(GraphicsStateGuardianBase *gsg=nullptr)
Walks through the scene graph beginning at the bottom node, and internally adjusts any GeomVertexForm...
void set_x(PN_stdfloat x)
Sets the X component of the position transform, leaving other components untouched.
void clear_occluder()
Completely removes any occluders that may have been set via set_occluder() from this particular node.
void set_hpr_scale(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz)
Sets the rotation and scale components of the transform, leaving translation untouched.
void set_light(const NodePath &light, int priority=0)
Adds the indicated Light or PolylightNode to the list of lights that illuminate geometry at this node...
bool has_light_off() const
Returns true if all Lights have been specifically disabled on this particular node.
LPoint3 get_relative_point(const NodePath &other, const LVecBase3 &point) const
Given that the indicated point is in the coordinate system of the other node, returns the same point ...
NodePath copy_to(const NodePath &other, int sort=0, Thread *current_thread=Thread::get_current_thread()) const
Functions like instance_to(), except a deep copy is made of the referenced node and all of its descen...
void set_sz(PN_stdfloat sz)
Sets the z-scale component of the transform, leaving other components untouched.
void compose_color_scale(const LVecBase4 &scale, int priority=0)
multiplies the color scale component of the transform, with previous color scale leaving translation ...
bool has_depth_test() const
Returns true if a depth-test adjustment has been explicitly set on this particular node via set_depth...
get_ancestor
Returns the nth ancestor of the path, where 0 is the NodePath itself and get_num_nodes() - 1 is get_t...
void set_quat(const LQuaternion &quat)
Sets the rotation component of the transform, leaving translation and scale untouched.
get_children
Returns the set of all child nodes of the referenced node.
bool get_depth_test() const
Returns true if depth-test rendering has been specifically set on this node via set_depth_test(),...
void clear_two_sided()
Completely removes any two-sided adjustment that may have been set on this node via set_two_sided().
void set_alpha_scale(PN_stdfloat scale, int priority=0)
Sets the alpha scale component of the transform without (much) affecting the color scale.
void set_scissor(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top)
Sets up a scissor region on the nodes rendered at this level and below.
LVector3 get_pos_delta() const
Returns the delta vector from this node's position in the previous frame (according to set_prev_trans...
bool get_depth_write() const
Returns true if depth-write rendering has been specifically set on this node via set_depth_write(),...
void show_bounds()
Causes the bounding volume of the bottom node and all of its descendants (that is,...
void clear_clip_plane()
Completely removes any clip planes that may have been set via set_clip_plane() or set_clip_plane_off(...
void set_audio_volume_off(int priority=0)
Disables any audio volume attribute inherited from above.
bool has_texture_off() const
Returns true if texturing has been specifically disabled on this particular node via set_texture_off(...
void do_billboard_point_eye(const NodePath &camera, PN_stdfloat offset)
Performs a billboard-type rotate to the indicated camera node, one time only, and leaves the object r...
bool verify_complete(Thread *current_thread=Thread::get_current_thread()) const
Returns true if all of the nodes described in the NodePath are connected, or false otherwise.
void clear_depth_test()
Completely removes any depth-test adjustment that may have been set on this node via set_depth_test()...
bool has_transparency() const
Returns true if a transparent-rendering adjustment has been explicitly set on this particular node vi...
void clear_depth_write()
Completely removes any depth-write adjustment that may have been set on this node via set_depth_write...
NodePath find_path_to(PandaNode *node) const
Searches for the indicated node below this node and returns the shortest NodePath that connects them.
void do_billboard_axis(const NodePath &camera, PN_stdfloat offset)
Performs a billboard-type rotate to the indicated camera node, one time only, and leaves the object r...
void set_billboard_point_eye(PN_stdfloat offset=0.0, bool fixed_depth=false)
Puts a billboard transition on the node such that it will rotate in three dimensions about the origin...
bool operator<(const NodePath &other) const
Returns true if this NodePath sorts before the other one, false otherwise.
bool has_vertex_column(const InternalName *name) const
Returns true if there are at least some vertices at this node and below that contain a reference to t...
static NodePath not_found()
Creates a NodePath with the ET_not_found error type set.
void clear_tex_gen()
Removes the texture coordinate generation mode from all texture stages on this node.
void set_depth_write(bool depth_write, int priority=0)
Specifically sets or disables the writing to the depth buffer on this particular node.
void set_occluder(const NodePath &occluder)
Adds the indicated occluder to the list of occluders that apply to geometry at this node and below.
void set_sy(PN_stdfloat sy)
Sets the y-scale component of the transform, leaving other components untouched.
RenderModeAttrib::Mode get_render_mode() const
Returns the render mode that has been specifically set on this node via set_render_mode(),...
RenderAttrib::TexGenMode get_tex_gen(TextureStage *stage) const
Returns the texture coordinate generation mode for the given stage, or M_off if there is no explicit ...
bool has_light(const NodePath &light) const
Returns true if the indicated Light or PolylightNode has been specifically enabled on this particular...
bool has_audio_volume() const
Returns true if an audio volume has been applied to the referenced node, false otherwise.
int flatten_light()
Analyzes the geometry below this node and reports the number of vertices, triangles,...
void set_pos_quat_scale(const LVecBase3 &pos, const LQuaternion &quat, const LVecBase3 &scale)
Replaces the translation, rotation, and scale components, implicitly setting shear to 0.
void wrt_reparent_to(const NodePath &other, int sort=0, Thread *current_thread=Thread::get_current_thread())
This functions identically to reparent_to(), except the transform on this node is also adjusted so th...
LVecBase3 get_hpr() const
Retrieves the rotation component of the transform.
void set_mat(const LMatrix4 &mat)
Directly sets an arbitrary 4x4 transform matrix.
void project_texture(TextureStage *stage, Texture *tex, const NodePath &projector)
A convenience function to enable projective texturing at this node level and below,...
void output(std::ostream &out) const
Writes a sensible description of the NodePath to the indicated output stream.
void set_pos_quat_scale_shear(const LVecBase3 &pos, const LQuaternion &quat, const LVecBase3 &scale, const LVecBase3 &shear)
Completely replaces the transform with new translation, rotation, scale, and shear components.
void show_tight_bounds()
Similar to show_bounds(), this draws a bounding box representing the "tight" bounds of this node and ...
LPoint3 get_pos() const
Retrieves the translation component of the transform.
int flatten_medium()
A more thorough flattening than flatten_light(), this first applies all the transforms,...
void set_clip_plane(const NodePath &clip_plane, int priority=0)
Adds the indicated clipping plane to the list of planes that apply to geometry at this node and below...
NodePath find(const std::string &path) const
Searches for a node below the referenced node that matches the indicated string.
void clear_depth_offset()
Completely removes any depth-offset adjustment that may have been set on this node via set_depth_offs...
void prepare_scene(GraphicsStateGuardianBase *gsg)
Walks through the scene graph beginning at the bottom node, and does whatever initialization is requi...
const TransformState * get_prev_transform(Thread *current_thread=Thread::get_current_thread()) const
Returns the transform that has been set as this node's "previous" position.
void set_depth_offset(int bias, int priority=0)
This instructs the graphics driver to apply an offset or bias to the generated depth values for rende...
void look_at(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Sets the transform on this NodePath so that it rotates to face the indicated point in space.
void hide_bounds()
Stops the rendering of the bounding volume begun with show_bounds().
bool has_fog_off() const
Returns true if a fog has been specifically disabled on this particular node via set_fog_off(),...
InternalNameCollection find_all_vertex_columns() const
Returns a list of all vertex array columns stored on some geometry found at this node level and below...
Texture * get_texture() const
Returns the base-level texture that has been set on this particular node, or NULL if no texture has b...
void replace_texture(Texture *tex, Texture *new_tex)
Recursively searches the scene graph for references to the given texture, and replaces them with the ...
PN_stdfloat get_render_mode_thickness() const
Returns the render mode thickness that has been specifically set on this node via set_render_mode(),...
void set_texture(Texture *tex, int priority=0)
Adds the indicated texture to the list of textures that will be rendered on the default texture stage...
LVecBase3 get_shear() const
Retrieves the shear component of the transform.
LVecBase3 get_scale() const
Retrieves the scale component of the transform.
bool has_logic_op() const
Returns true if a logical operation has been explicitly set on this particular node via set_logic_op(...
void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is called by make_from_bam to read in all of the relevant data from the BamFil...
bool has_effect(TypeHandle type) const
Returns true if there is a render effect of the indicated type defined on this node,...
void remove_node(Thread *current_thread=Thread::get_current_thread())
Disconnects the referenced node from the scene graph.
LVector3 get_relative_vector(const NodePath &other, const LVecBase3 &vec) const
Given that the indicated vector is in the coordinate system of the other node, returns the same vecto...
void set_z(PN_stdfloat z)
Sets the Z component of the position transform, leaving other components untouched.
NodePath get_tex_projector_from(TextureStage *stage) const
Returns the "from" node associated with the TexProjectorEffect on the indicated stage.
bool has_bin() const
Returns true if the node has been assigned to the a particular rendering bin via set_bin(),...
void set_tex_transform(TextureStage *stage, const TransformState *transform)
Sets the texture matrix on the current node to the indicated transform for the given stage.
void set_antialias(unsigned short mode, int priority=0)
Specifies the antialiasing type that should be applied at this node and below.
void set_pos_hpr_scale(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz)
Completely replaces the transform with new translation, rotation, and scale components.
void clear_color()
Completely removes any color adjustment from the node.
bool operator!=(const NodePath &other) const
Returns true if the two paths are not equivalent.
bool has_tex_projector(TextureStage *stage) const
Returns true if this node has a TexProjectorEffect for the indicated stage, false otherwise.
bool is_empty() const
Returns true if the NodePath contains no nodes.
void set_fog_off(int priority=0)
Sets the geometry at this level and below to render using no fog.
bool has_clip_plane_off() const
Returns true if all clipping planes have been specifically disabled on this particular node.
InternalNameCollection find_all_texcoords() const
Returns a list of all texture coordinate sets used by any geometry at this node level and below.
void clear_billboard()
Removes any billboard effect from the node.
void set_sx(PN_stdfloat sx)
Sets the x-scale component of the transform, leaving other components untouched.
bool has_depth_offset() const
Returns true if a depth-offset adjustment has been explicitly set on this particular node via set_dep...
void set_logic_op(LogicOpAttrib::Operation op, int priority=0)
Specifically sets or disables a logical operation on this particular node.
void do_billboard_point_world(const NodePath &camera, PN_stdfloat offset)
Performs a billboard-type rotate to the indicated camera node, one time only, and leaves the object r...
get_node
Returns the nth node of the path, where 0 is the referenced (bottom) node and get_num_nodes() - 1 is ...
bool has_color() const
Returns true if a color has been applied to the given node, false otherwise.
void reverse_ls() const
Lists the hierarchy at and above the referenced node.
void set_compass(const NodePath &reference=NodePath())
Puts a compass effect on the node, so that it will retain a fixed rotation relative to the reference ...
int get_bin_draw_order() const
Returns the drawing order associated with the bin that this particular node was assigned to via set_b...
TextureStageCollection find_all_texture_stages() const
Returns a list of a TextureStages applied to geometry at this node and below.
const SamplerState & get_texture_sampler() const
Returns the sampler state that has been given for the base-level texture that has been set on this pa...
void set_clip_plane_off(int priority=0)
Sets the geometry at this level and below to render using no clip_planes at all.
Texture * find_texture(const std::string &name) const
Returns the first texture found applied to geometry at this node or below that matches the indicated ...
void set_fluid_pos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Sets the translation component, without changing the "previous" position, so that the collision syste...
get_num_nodes
Returns the number of nodes in the path.
int complete_pointers(TypedWritable **plist, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
bool has_texture() const
Returns true if a texture has been applied to this particular node via set_texture(),...
bool has_depth_write() const
Returns true if a depth-write adjustment has been explicitly set on this particular node via set_dept...
void clear_logic_op()
Completely removes any logical operation that may have been set on this node via set_logic_op().
const LMatrix4 & get_mat() const
Returns the transform matrix that has been applied to the referenced node, or the identity matrix if ...
NodePathCollection find_all_matches(const std::string &path) const
Returns the complete set of all NodePaths that begin with this NodePath and can be extended by path.
void clear_light()
Completely removes any lighting operations that may have been set via set_light() or set_light_off() ...
bool is_stashed() const
Returns true if the referenced node is stashed either directly, or because some ancestor is stashed.
void clear_material()
Completely removes any material adjustment that may have been set via set_material() from this partic...
PandaNode * node() const
Returns the referenced node of the path.
Material * find_material(const std::string &name) const
Returns the first material found applied to geometry at this node or below that matches the indicated...
void clear_texture()
Completely removes any texture adjustment that may have been set via set_texture() or set_texture_off...
void unify_texture_stages(TextureStage *stage)
Searches through all TextureStages at this node and below.
bool has_render_mode() const
Returns true if a render mode has been explicitly set on this particular node via set_render_mode() (...
bool has_scissor() const
Returns true if a scissor region was defined at this node by a previous call to set_scissor().
const LVecBase4 & get_color_scale() const
Returns the complete color scale vector that has been applied to this node via a previous call to set...
void clear_render_mode()
Completely removes any render mode adjustment that may have been set on this node via set_render_mode...
void reparent_to(const NodePath &other, int sort=0, Thread *current_thread=Thread::get_current_thread())
Removes the referenced node of the NodePath from its current parent and attaches it to the referenced...
NodePath()
This constructs an empty NodePath with no nodes.
bool has_fog() const
Returns true if a fog has been applied to this particular node via set_fog(), false otherwise.
void set_tex_projector(TextureStage *stage, const NodePath &from, const NodePath &to, int lens_index=0)
Establishes a TexProjectorEffect on this node, which can be used to establish projective texturing (b...
bool has_billboard() const
Returns true if there is any billboard effect on the node.
void set_effect(const RenderEffect *effect)
Adds the indicated render effect to the scene graph on this node.
bool has_clip_plane(const NodePath &clip_plane) const
Returns true if the indicated clipping plane has been specifically applied to this particular node.
std::string get_bin_name() const
Returns the name of the bin that this particular node was assigned to via set_bin(),...
void set_pos_quat(const LVecBase3 &pos, const LQuaternion &quat)
Sets the translation and rotation component of the transform, leaving scale untouched.
void set_material(Material *tex, int priority=0)
Sets the geometry at this level and below to render using the indicated material.
int get_instance_count() const
Returns the geometry instance count, or 0 if disabled.
void set_render_mode_filled_wireframe(const LColor &wireframe_color, int priority=0)
Sets up the geometry at this level and below (unless overridden) to render in filled,...
void set_audio_volume(PN_stdfloat volume, int priority=0)
Sets the audio volume component of the transform.
void unstash(int sort=0, Thread *current_thread=Thread::get_current_thread())
Undoes the effect of a previous stash() on this node: makes the referenced node (and the entire subgr...
bool calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point, const NodePath &other=NodePath(), Thread *current_thread=Thread::get_current_thread()) const
Calculates the minimum and maximum vertices of all Geoms at this NodePath's bottom node and below.
bool has_two_sided() const
Returns true if a two-sided adjustment has been explicitly set on this particular node via set_two_si...
void clear_compass()
Removes any compass effect from the node.
bool write_bam_file(const Filename &filename) const
Writes the contents of this node and below out to a bam file with the indicated filename.
int compare_to(const NodePath &other) const
Returns a number less than zero if this NodePath sorts before the other one, greater than zero if it ...
vector_uchar encode_to_bam_stream() const
Converts the NodePath object into a single stream of data using a BamWriter, and returns that data as...
bool has_occluder(const NodePath &occluder) const
Returns true if the indicated occluder has been specifically applied to this particular node.
get_sort
Returns the sort value of the referenced node within its parent; that is, the sort number passed on t...
void set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a=1.0, int priority=0)
Applies a scene-graph color to the referenced node.
bool get_render_mode_perspective() const
Returns the flag that has been set on this node via set_render_mode_perspective(),...
LColor get_color() const
Returns the color that has been assigned to the node, or black if no color has been assigned.
LQuaternion get_quat() const
Retrieves the rotation component of the transform.
NodePath find_net_tag(const std::string &key) const
Returns the lowest ancestor of this node that contains a tag definition with the indicated key,...
void clear_antialias()
Completely removes any antialias setting that may have been set on this node via set_antialias().
bool has_tex_transform(TextureStage *stage) const
Returns true if there is an explicit texture matrix on the current node for the given stage.
void set_texture_off(int priority=0)
Sets the geometry at this level and below to render using no texture, on any stage.
bool operator==(const NodePath &other) const
Returns true if the two paths are equivalent; that is, if they contain the same list of nodes in the ...
void set_state(const RenderState *state, Thread *current_thread=Thread::get_current_thread())
Changes the complete state object on this node.
void set_depth_test(bool depth_test, int priority=0)
Specifically sets or disables the testing of the depth buffer on this particular node.
bool has_antialias() const
Returns true if an antialias setting has been explicitly mode on this particular node via set_antiali...
int get_depth_offset() const
Returns the depth offset value if it has been specified using set_depth_offset, or 0 if not.
NodePathCollection find_all_paths_to(PandaNode *node) const
Returns the set of all NodePaths that extend from this NodePath down to the indicated node.
void set_pos_hpr_scale_shear(const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale, const LVecBase3 &shear)
Completely replaces the transform with new translation, rotation, scale, and shear components.
bool is_singleton(Thread *current_thread=Thread::get_current_thread()) const
Returns true if the NodePath contains exactly one node.
const RenderState * get_state(Thread *current_thread=Thread::get_current_thread()) const
Returns the complete state object set on this node.
void set_fog(Fog *fog, int priority=0)
Sets the geometry at this level and below to render using the indicated fog.
TextureCollection find_all_textures() const
Returns a list of a textures applied to geometry at this node and below.
static NodePath decode_from_bam_stream(vector_uchar data, BamReader *reader=nullptr)
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the N...
void clear_fog()
Completely removes any fog adjustment that may have been set via set_fog() or set_fog_off() from this...
void heads_up(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Behaves like look_at(), but with a strong preference to keeping the up vector oriented in the indicat...
void set_color_scale_off(int priority=0)
Disables any color scale attribute inherited from above.
void set_shear(PN_stdfloat shxy, PN_stdfloat shxz, PN_stdfloat shyz)
Sets the shear component of the transform, leaving translation, rotation, and scale untouched.
bool has_material() const
Returns true if a material has been applied to this particular node via set_material(),...
void clear_bin()
Completely removes any bin adjustment that may have been set via set_bin() from this particular node.
bool has_tex_gen(TextureStage *stage) const
Returns true if there is a mode for automatic texture coordinate generation on the current node for t...
NodePath get_top(Thread *current_thread=Thread::get_current_thread()) const
Returns a singleton NodePath that represents the top of the path, or empty NodePath if this path is e...
void clear_scissor()
Removes the scissor region that was defined at this node level by a previous call to set_scissor().
void clear_transparency()
Completely removes any transparency adjustment that may have been set on this node via set_transparen...
NodePath attach_new_node(PandaNode *node, int sort=0, Thread *current_thread=Thread::get_current_thread()) const
Attaches a new node, with or without existing parents, to the scene graph below the referenced node o...
void unstash_all(Thread *current_thread=Thread::get_current_thread())
Unstashes this node and all stashed child nodes.
void stash_to(const NodePath &other, int sort=0, Thread *current_thread=Thread::get_current_thread())
Similar to reparent_to(), but the node is added to its new parent's stashed list, so that the result ...
has_parent
Returns true if the referenced node has a parent; i.e.
void set_billboard_axis(PN_stdfloat offset=0.0)
Puts a billboard transition on the node such that it will rotate in two dimensions around the up axis...
bool write_bam_stream(std::ostream &out) const
Writes the contents of this node and below out to the indicated stream.
get_parent
Returns the NodePath to the parent of the referenced node: that is, this NodePath,...
void set_material_off(int priority=0)
Sets the geometry at this level and below to render using no material.
void set_all_color_scale(PN_stdfloat scale, int priority=0)
Scales all the color components of the object by the same amount, darkening the object,...
void set_pos_hpr(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r)
Sets the translation and rotation component of the transform, leaving scale untouched.
static NodePath fail()
Creates a NodePath with the ET_fail error type set.
const TransformState * get_transform(Thread *current_thread=Thread::get_current_thread()) const
Returns the complete transform object set on this node.
void set_bin(const std::string &bin_name, int draw_order, int priority=0)
Assigns the geometry at this level and below to the named rendering bin.
bool has_compass() const
Returns true if there is any compass effect on the node.
void clear_tex_transform()
Removes all texture matrices from the current node.
void set_scale(PN_stdfloat scale)
Sets the scale component of the transform, leaving translation and rotation untouched.
void apply_texture_colors()
Removes textures from Geoms at this node and below by applying the texture colors to the vertices.
void set_render_mode(RenderModeAttrib::Mode mode, PN_stdfloat thickness, int priority=0)
Sets up the geometry at this level and below (unless overridden) to render in the specified mode and ...
MaterialCollection find_all_materials() const
Returns a list of a materials applied to geometry at this node and below.
static NodePath removed()
Creates a NodePath with the ET_removed error type set.
void detach_node(Thread *current_thread=Thread::get_current_thread())
Disconnects the referenced node from its parent, but does not immediately delete it.
void set_two_sided(bool two_sided, int priority=0)
Specifically sets or disables two-sided rendering mode on this particular node.
Fog * get_fog() const
Returns the fog that has been set on this particular node, or NULL if no fog has been set.
PN_stdfloat get_net_audio_volume() const
Returns the complete audio volume for this node taking highers nodes in the graph into account.
void set_render_mode_wireframe(int priority=0)
Sets up the geometry at this level and below (unless overridden) to render in wireframe mode.
void set_quat_scale(const LQuaternion &quat, const LVecBase3 &scale)
Sets the rotation and scale components of the transform, leaving translation untouched.
void clear_color_scale()
Completely removes any color scale from the referenced node.
void set_render_mode_thickness(PN_stdfloat thickness, int priority=0)
Sets up the point geometry at this level and below to render as thick points (that is,...
void clear_tex_projector()
Removes the TexProjectorEffect for all stages from this node.
void set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r)
Sets the rotation component of the transform, leaving translation and scale untouched.
bool has_tag(const std::string &key) const
Returns true if a value has been defined on this node for the particular key (even if that value is t...
void set_instance_count(int instance_count)
Sets the geometry instance count, or 0 if geometry instancing should be disabled.
void set_y(PN_stdfloat y)
Sets the Y component of the position transform, leaving other components untouched.
void clear_audio_volume()
Completely removes any audio volume from the referenced node.
void set_billboard_point_world(PN_stdfloat offset=0.0)
Puts a billboard transition on the node such that it will rotate in three dimensions about the origin...
NodePath instance_under_node(const NodePath &other, const std::string &name, int sort=0, Thread *current_thread=Thread::get_current_thread()) const
Behaves like instance_to(), but implicitly creates a new node to instance the geometry under,...
void set_render_mode_filled(int priority=0)
Sets up the geometry at this level and below (unless overridden) to render in filled (i....
NodePath get_tex_projector_to(TextureStage *stage) const
Returns the "to" node associated with the TexProjectorEffect on the indicated stage.
NodePath instance_to(const NodePath &other, int sort=0, Thread *current_thread=Thread::get_current_thread()) const
Adds the referenced node of the NodePath as a child of the referenced node of the indicated other Nod...
void set_transparency(TransparencyAttrib::Mode mode, int priority=0)
Specifically sets or disables transparent rendering mode on this particular node.
bool get_two_sided() const
Returns true if two-sided rendering has been specifically set on this node via set_two_sided(),...
int get_key() const
Returns an integer that is guaranteed to be the same for all NodePaths that represent the same node i...
void clear_effect(TypeHandle type)
Removes the render effect of the given type from this node.
bool has_color_scale() const
Returns true if a color scale has been applied to the referenced node, false otherwise.
int flatten_strong()
The strongest possible flattening.
TransparencyAttrib::Mode get_transparency() const
Returns the transparent rendering that has been specifically set on this node via set_transparency(),...
TextureStage * find_texture_stage(const std::string &name) const
Returns the first TextureStage found applied to geometry at this node or below that matches the indic...
void set_color_off(int priority=0)
Sets the geometry at this level and below to render using the geometry color.
PN_stdfloat get_audio_volume() const
Returns the complete audio volume that has been applied to this node via a previous call to set_audio...
void set_render_mode_perspective(bool perspective, int priority=0)
Sets up the point geometry at this level and below to render as perspective sprites (that is,...
unsigned short get_antialias() const
Returns the antialias setting that has been specifically set on this node via set_antialias(),...
get_stashed_children
Returns the set of all child nodes of the referenced node that have been stashed.
void set_color_scale(const LVecBase4 &scale, int priority=0)
Sets the color scale component of the transform, leaving translation and rotation untouched.
void write_datagram(BamWriter *manager, Datagram &dg) const
Writes the contents of this object to the datagram for shipping out to a Bam file.
NodePath get_stashed_ancestor(Thread *current_thread=Thread::get_current_thread()) const
Returns the NodePath at or above the referenced node that is stashed, or an empty NodePath if no ance...
NodePath get_hidden_ancestor(DrawMask camera_mask=PandaNode::get_overall_bit(), Thread *current_thread=Thread::get_current_thread()) const
Returns the NodePath at or above the referenced node that is hidden to the indicated camera(s),...
void set_transform(const TransformState *transform, Thread *current_thread=Thread::get_current_thread())
Changes the complete transform object on this node.
void write_bounds(std::ostream &out) const
Writes a description of the bounding volume containing the bottom node and all of its descendants to ...
void set_light_off(int priority=0)
Sets the geometry at this level and below to render using no lights at all.
This functions similarly to a LightAttrib or ClipPlaneAttrib.
bool has_on_occluder(const NodePath &occluder) const
Returns true if the indicated occluder is enabled by the effect, false otherwise.
A lightweight class that represents a single element that may be timed and/or counted via stats.
A lightweight class that can be used to automatically start and stop a PStatCollector around a sectio...
PandaNode * get_child(size_t n) const
Returns the nth child of the node.
size_t get_num_children() const
Returns the number of children of the node.
A basic node of the scene graph or data graph.
get_draw_control_mask
Returns the set of bits in draw_show_mask that are considered meaningful.
virtual bool is_geom_node() const
A simple downcast check.
void reset_prev_transform(Thread *current_thread=Thread::get_current_thread())
Resets the transform that represents this node's "previous" position to the same as the current trans...
void clear_effect(TypeHandle type)
Removes the render effect of the given type from this node.
is_overall_hidden
Returns true if the node has been hidden to all cameras by clearing its overall bit.
int find_stashed(PandaNode *node, Thread *current_thread=Thread::get_current_thread()) const
Returns the index of the indicated stashed node, if it is a stashed child, or -1 if it is not.
int find_child(PandaNode *node, Thread *current_thread=Thread::get_current_thread()) const
Returns the index of the indicated child node, if it is a child, or -1 if it is not.
get_into_collide_mask
Returns the "into" collide mask for this node.
get_num_stashed
Returns the number of stashed nodes this node has.
get_draw_show_mask
Returns the hide/show bits of this particular node.
set_state
Sets the complete RenderState that will be applied to all nodes at this level and below.
void set_effect(const RenderEffect *effect)
Adds the indicated render effect to the scene graph on this node.
int find_parent(PandaNode *node, Thread *current_thread=Thread::get_current_thread()) const
Returns the index of the indicated parent node, if it is a parent, or -1 if it is not.
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
int get_child_sort(int n, Thread *current_thread=Thread::get_current_thread()) const
Returns the sort index of the nth child node of this node (that is, the number that was passed to add...
void set_attrib(const RenderAttrib *attrib, int override=0)
Adds the indicated render attribute to the scene graph on this node.
get_stashed
Returns the nth stashed child of this node.
set_into_collide_mask
Sets the "into" CollideMask.
get_children
Returns an object that can be used to walk through the list of children of the node.
int get_stashed_sort(int n, Thread *current_thread=Thread::get_current_thread()) const
Returns the sort index of the nth stashed node of this node (that is, the number that was passed to a...
virtual Light * as_light()
Cross-casts the node to a Light pointer, if it is one of the four kinds of Light nodes,...
A PolylightEffect can be used on a node to define a LightGroup for that node.
This is the base class for a number of render attributes (other than transform) that may be set on sc...
This is the base class for a number of special render effects that may be set on scene graph nodes to...
Specifies how polygons are to be drawn.
get_perspective
Returns the perspective flag.
get_thickness
Returns the line width or point thickness.
get_wireframe_color
Returns the color that is used in M_filled_wireframe mode to distinguish the wireframe from the rest ...
get_mode
Returns the render mode.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Represents a set of settings that indicate how a texture is sampled.
static const SamplerState & get_default()
Returns a reference to the global default immutable SamplerState object.
An interface for simplifying ("flattening") scene graphs by eliminating unneeded nodes and collapsing...
int collect_vertex_data(PandaNode *root, int collect_bits=~0)
Collects all different GeomVertexData blocks that have compatible formats at this node and below into...
int flatten(PandaNode *root, int combine_siblings_bits)
Simplifies the graph by removing unnecessary nodes and nodes.
int make_compatible_state(PandaNode *root)
Searches for GeomNodes that contain multiple Geoms that differ only in their ColorAttribs.
void unify(PandaNode *root, bool preserve_order)
Calls unify() on every GeomNode at this level and below.
void premunge(PandaNode *root, const RenderState *initial_state)
Walks the scene graph rooted at this node and below, and uses the indicated GSG to premunge every Geo...
void apply_attribs(PandaNode *node, int attrib_types=~(TT_clip_plane|TT_cull_face|TT_apply_texture_color))
Walks the scene graph, accumulating attribs of the indicated types, applying them to the vertices,...
get_instance_count
Returns the number of geometry instances.
Computes texture coordinates for geometry automatically based on vertex position and/or normal.
Applies a transform matrix to UV's before they are rendered.
This effect automatically applies a computed texture matrix to the specified texture stage,...
Indicates the set of TextureStages and their associated Textures that should be applied to (or remove...
get_num_on_stages
Returns the number of stages that are turned on by the attribute.
has_on_stage
Returns true if the indicated stage is turned on by the attrib, false otherwise.
bool has_off_stage(TextureStage *stage) const
Returns true if the indicated stage is turned off by the attrib, false otherwise.
Texture * get_texture() const
If the TextureAttrib is not an 'off' TextureAttrib, returns the base-level texture that is associated...
get_on_texture
Returns the texture associated with the indicated stage, or NULL if no texture is associated.
get_on_stage
Returns the nth stage turned on by the attribute, sorted in render order.
get_on_sampler
Returns the sampler associated with the indicated stage, or the one associated with its texture if no...
bool has_all_off() const
Returns true if this attrib turns off all stages (although it may also turn some on).
Manages a list of Texture objects, as returned by TexturePool::find_all_textures().
void add_texture(Texture *texture)
Adds a new Texture to the collection.
void add_texture_stage(TextureStage *node_texture_stage)
Adds a new TextureStage to the collection.
Defines the properties of a named stage of the multitexture pipeline.
get_default
Returns the default TextureStage that will be used for all texturing that does not name a particular ...
get_name
Returns the name of this texture stage.
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
A thread; that is, a lightweight process.
get_pipeline_stage
Returns the Pipeline stage number associated with this thread.
is_true_threads
Returns true if a real threading library is available that supports actual OS-implemented threads,...
get_current_thread
Returns a pointer to the currently-executing Thread object.
This controls the enabling of transparency.
get_mode
Returns the transparency mode.
TypeHandle is the identifier used to differentiate C++ class types.
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
Base class for objects that can be written to and read from Bam files.
This class is a wrapper around a NodePath that, unlike the actual NodePath class, doesn't hold a refe...
This is a class designed to support low-overhead traversals of the complete scene graph,...
is_valid
Returns true if the WorkingNodePath object appears to be a valid NodePath reference,...
This is our own Panda specialization on the default STL map.
This is our own Panda specialization on the default STL vector.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PT(Material) NodePath
Returns the material that has been set on this particular node, or NULL if no material has been set.
CPT(RenderState) NodePath
Returns the state changes that must be made to transition to the render state of this node from the r...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.