78using std::ostringstream;
83int NodePath::_max_search_depth = 7000;
86PStatCollector NodePath::_get_transform_pcollector(
"*:NodePath:get_transform");
87PStatCollector NodePath::_verify_complete_pcollector(
"*:NodePath:verify_complete");
98 nassertv(child_node !=
nullptr);
103 _head = PandaNode::get_top_component(child_node,
true,
104 pipeline_stage, current_thread);
107 _head = PandaNode::get_component(parent._head, child_node, pipeline_stage,
110 nassertv(_head !=
nullptr);
112 if (_head !=
nullptr) {
123operator bool ()
const {
136 return _head->get_length(pipeline_stage, current_thread);
161 nassertr(comp !=
nullptr,
nullptr);
162 comp = comp->
get_next(pipeline_stage, current_thread);
168 nassertr(comp !=
nullptr,
nullptr);
190 comp = comp->
get_next(pipeline_stage, current_thread);
216 while (!comp->
is_top_node(pipeline_stage, current_thread)) {
217 comp = comp->
get_next(pipeline_stage, current_thread);
233 nassertr_always(!
is_empty(), result);
241 for (
int i = 0; i < num_children; i++) {
243 child._head = PandaNode::get_component(_head, cr.
get_child(i),
244 pipeline_stage, current_thread);
259 nassertr_always(!
is_empty(), result);
266 for (
int i = 0; i < num_stashed; i++) {
268 stashed._head = PandaNode::get_component(_head, bottom_node->
get_stashed(i),
269 pipeline_stage, current_thread);
290 PandaNode *parent = _head->get_next(pipeline_stage, current_thread)->get_node();
292 nassertr(parent !=
nullptr && child !=
nullptr, 0);
294 if (child_index != -1) {
299 if (child_index != -1) {
315find(
const string &path)
const {
319 find_matches(col, path, 1);
341 find_matches(col, approx_path, 1);
361 find_matches(col, path, -1);
374 nassertr(
node !=
nullptr, col);
378 find_matches(col, approx_path, -1);
398 nassertv(other._error_type == ET_ok);
404 bool reparented = PandaNode::reparent(other._head, _head, sort,
false,
405 pipeline_stage, current_thread);
406 nassertv(reparented);
419 nassertv(other._error_type == ET_ok);
425 bool reparented = PandaNode::reparent(other._head, _head, sort,
true,
426 pipeline_stage, current_thread);
427 nassertv(reparented);
440 nassertv(other._error_type == ET_ok);
484 new_instance._head = PandaNode::attach(
nullptr,
node(), sort, pipeline_stage,
488 bool reparented = PandaNode::reparent(other._head, new_instance._head,
489 sort,
false, pipeline_stage,
504 nassertr(reparented, new_instance);
522 Thread *current_thread)
const {
542 nassertr(other._error_type == ET_ok,
fail());
546 PT(
PandaNode) copy_node = source_node->r_copy_subgraph(inst_map, current_thread);
547 nassertr(copy_node !=
nullptr,
fail());
549 copy_node->reset_prev_transform(current_thread);
555 const RenderState *state = source_node->get_state();
557 if (state->get_attrib(lattr)) {
564 if (light2.replace_copied_nodes(*
this, result, inst_map, current_thread)) {
565 new_lattr = DCAST(
LightAttrib, new_lattr->replace_off_light(light, light2));
573 if (light2.replace_copied_nodes(*
this, result, inst_map, current_thread)) {
574 new_lattr = DCAST(
LightAttrib, new_lattr->replace_on_light(light, light2));
578 if (new_lattr != lattr) {
579 result.
set_state(state->set_attrib(std::move(new_lattr)));
606 new_path._head = PandaNode::attach(_head,
node, sort, pipeline_stage,
628 nassertv(_error_type != ET_not_found);
636 PandaNode::detach(_head, pipeline_stage, current_thread);
639 if (
is_empty() || _head->has_key()) {
668 nassertv(_error_type != ET_not_found);
672 PandaNode::detach(_head, pipeline_stage, current_thread);
680reverse_ls(ostream &out,
int indent_level)
const {
685 indent_level =
get_parent().reverse_ls(out, indent_level);
687 node()->write(out, indent_level);
688 return indent_level + 2;
696output(ostream &out)
const {
697 switch (_error_type) {
699 out <<
"**not found**";
702 out <<
"**removed**";
711 if (_head ==
nullptr) {
725 nassertr_always(!
is_empty(), RenderState::make_empty());
726 return node()->get_state(current_thread);
735 nassertr(_error_type == ET_ok && other._error_type == ET_ok, RenderState::make_empty());
738 return get_net_state(current_thread);
741 return other.get_net_state(current_thread)->invert_compose(RenderState::make_empty());
744#if defined(_DEBUG) || (defined(HAVE_THREADS) && defined(SIMPLE_THREADS))
746 nassertr(other.
verify_complete(current_thread), RenderState::make_empty());
749 int a_count, b_count;
750 if (find_common_ancestor(*
this, other, a_count, b_count, current_thread) ==
nullptr) {
751 if (allow_unrelated_wrt) {
753 << *
this <<
" is not related to " << other <<
"\n";
756 << *
this <<
" is not related to " << other <<
"\n";
757 nassert_raise(
"unrelated nodes");
758 return RenderState::make_empty();
762 CPT(
RenderState) a_state = r_get_partial_state(_head, a_count, current_thread);
763 CPT(
RenderState) b_state = r_get_partial_state(other._head, b_count, current_thread);
764 return b_state->invert_compose(a_state);
775 nassertv(_error_type == ET_ok && other._error_type == ET_ok);
786 CPT(
RenderState) new_state = rel_state->compose(state);
797 nassertr_always(!
is_empty(), TransformState::make_identity());
798 return node()->get_transform(current_thread);
807 nassertr(_error_type == ET_ok && other._error_type == ET_ok, TransformState::make_identity());
811 return get_net_transform(current_thread);
814 return other.get_net_transform(current_thread)->invert_compose(TransformState::make_identity());
817#if defined(_DEBUG) || (defined(HAVE_THREADS) && defined(SIMPLE_THREADS))
818 nassertr(
verify_complete(current_thread), TransformState::make_identity());
819 nassertr(other.
verify_complete(current_thread), TransformState::make_identity());
822 int a_count, b_count;
823 if (find_common_ancestor(*
this, other, a_count, b_count, current_thread) ==
nullptr) {
824 if (allow_unrelated_wrt) {
825 if (pgraph_cat.is_debug()) {
827 << *
this <<
" is not related to " << other <<
"\n";
831 << *
this <<
" is not related to " << other <<
"\n";
832 nassert_raise(
"unrelated nodes");
833 return TransformState::make_identity();
839 a_transform = r_get_partial_transform(_head, a_count, current_thread);
840 if (a_transform !=
nullptr) {
841 b_transform = r_get_partial_transform(other._head, b_count, current_thread);
843 if (b_transform ==
nullptr) {
847 a_transform = r_get_net_transform(_head, current_thread);
848 b_transform = r_get_net_transform(other._head, current_thread);
851 return b_transform->invert_compose(a_transform);
862 nassertv(_error_type == ET_ok && other._error_type == ET_ok);
885 nassertr_always(!
is_empty(), TransformState::make_identity());
886 return node()->get_prev_transform(current_thread);
896 nassertr(_error_type == ET_ok && other._error_type == ET_ok, TransformState::make_identity());
899 return get_net_prev_transform(current_thread);
902 return other.get_net_prev_transform(current_thread)->invert_compose(TransformState::make_identity());
905#if defined(_DEBUG) || (defined(HAVE_THREADS) && defined(SIMPLE_THREADS))
906 nassertr(
verify_complete(current_thread), TransformState::make_identity());
907 nassertr(other.
verify_complete(current_thread), TransformState::make_identity());
910 int a_count, b_count;
911 if (find_common_ancestor(*
this, other, a_count, b_count, current_thread) ==
nullptr) {
912 if (allow_unrelated_wrt) {
914 << *
this <<
" is not related to " << other <<
"\n";
917 << *
this <<
" is not related to " << other <<
"\n";
918 nassert_raise(
"unrelated nodes");
919 return TransformState::make_identity();
923 CPT(
TransformState) a_prev_transform = r_get_partial_prev_transform(_head, a_count, current_thread);
924 CPT(
TransformState) b_prev_transform = r_get_partial_prev_transform(other._head, b_count, current_thread);
925 return b_prev_transform->invert_compose(a_prev_transform);
936 nassertv(_error_type == ET_ok && other._error_type == ET_ok);
948 set_prev_transform(new_trans, current_thread);
959set_pos(
const LVecBase3 &pos) {
971set_x(PN_stdfloat x) {
984set_y(PN_stdfloat y) {
997set_z(PN_stdfloat z) {
1016set_fluid_x(PN_stdfloat x) {
1024set_fluid_y(PN_stdfloat y) {
1032set_fluid_z(PN_stdfloat z) {
1044 nassertr_always(!
is_empty(), LPoint3(0.0f, 0.0f, 0.0f));
1059 nassertr_always(!
is_empty(), LPoint3(0.0f, 0.0f, 0.0f));
1068set_hpr(
const LVecBase3 &hpr) {
1071 nassertv(transform->
has_hpr());
1076set_h(PN_stdfloat h) {
1079 nassertv(transform->
has_hpr());
1080 LVecBase3 hpr = transform->
get_hpr();
1086set_p(PN_stdfloat p) {
1089 nassertv(transform->
has_hpr());
1090 LVecBase3 hpr = transform->
get_hpr();
1096set_r(PN_stdfloat r) {
1099 nassertv(transform->
has_hpr());
1100 LVecBase3 hpr = transform->
get_hpr();
1110 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1112 nassertr(transform->
has_hpr(), LVecBase3(0.0f, 0.0f, 0.0f));
1132 nassertr_always(!
is_empty(), LQuaternion::ident_quat());
1157 LVecBase3 scale = transform->
get_scale();
1171 LVecBase3 scale = transform->
get_scale();
1185 LVecBase3 scale = transform->
get_scale();
1195 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1212set_shxy(PN_stdfloat shxy) {
1215 LVecBase3 shear = transform->
get_shear();
1221set_shxz(PN_stdfloat shxz) {
1224 LVecBase3 shear = transform->
get_shear();
1230set_shyz(PN_stdfloat shyz) {
1233 LVecBase3 shear = transform->
get_shear();
1243 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1253set_pos_hpr(
const LVecBase3 &pos,
const LVecBase3 &hpr) {
1256 transform = TransformState::make_pos_hpr_scale_shear
1267set_pos_quat(
const LVecBase3 &pos,
const LQuaternion &quat) {
1270 transform = TransformState::make_pos_quat_scale_shear
1281set_hpr_scale(
const LVecBase3 &hpr,
const LVecBase3 &scale) {
1284 transform = TransformState::make_pos_hpr_scale_shear
1297 transform = TransformState::make_pos_quat_scale_shear
1308 const LVecBase3 &scale) {
1321 const LVecBase3 &scale) {
1324 (pos, quat, scale));
1334 const LVecBase3 &scale,
const LVecBase3 &shear) {
1337 (pos, hpr, scale, shear));
1347 const LVecBase3 &scale,
const LVecBase3 &shear) {
1350 (pos, quat, scale, shear));
1369look_at(
const LPoint3 &point,
const LVector3 &up) {
1384heads_up(
const LPoint3 &point,
const LVector3 &up) {
1399set_pos(
const NodePath &other,
const LVecBase3 &pos) {
1404 if (orig_transform->has_components()) {
1409 const LVecBase3 &orig_hpr = orig_transform->get_hpr();
1410 const LVecBase3 &orig_scale = orig_transform->get_scale();
1411 const LVecBase3 &orig_shear = orig_transform->get_shear();
1428 set_pos(other, pos);
1436 set_pos(other, pos);
1444 set_pos(other, pos);
1457 if (orig_transform->has_components()) {
1462 const LVecBase3 &orig_hpr = orig_transform->get_hpr();
1463 const LVecBase3 &orig_scale = orig_transform->get_scale();
1464 const LVecBase3 &orig_shear = orig_transform->get_shear();
1479set_fluid_x(
const NodePath &other, PN_stdfloat x) {
1487set_fluid_y(
const NodePath &other, PN_stdfloat y) {
1495set_fluid_z(
const NodePath &other, PN_stdfloat z) {
1508 nassertr_always(!
is_empty(), LPoint3(0.0f, 0.0f, 0.0f));
1523 nassertr_always(!
is_empty(), LPoint3(0.0f, 0.0f, 0.0f));
1534 nassertv(rel_transform->has_hpr());
1542 const LVecBase3 &orig_pos = transform->
get_pos();
1543 const LVecBase3 &orig_scale = transform->
get_scale();
1544 const LVecBase3 &orig_shear = transform->
get_shear();
1550 (orig_pos, transform->
get_hpr(), orig_scale, orig_shear));
1560set_h(
const NodePath &other, PN_stdfloat h) {
1562 LVecBase3 hpr =
get_hpr(other);
1568set_p(
const NodePath &other, PN_stdfloat p) {
1570 LVecBase3 hpr =
get_hpr(other);
1576set_r(
const NodePath &other, PN_stdfloat r) {
1578 LVecBase3 hpr =
get_hpr(other);
1589 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1591 nassertr(transform->
has_hpr(), LVecBase3(0.0f, 0.0f, 0.0f));
1609 const LVecBase3 &orig_pos = transform->
get_pos();
1610 const LVecBase3 &orig_scale = transform->
get_scale();
1611 const LVecBase3 &orig_shear = transform->
get_shear();
1617 (orig_pos, transform->
get_quat(), orig_scale, orig_shear));
1632 nassertr_always(!
is_empty(), LQuaternion::ident_quat());
1651 const LVecBase3 &orig_pos = transform->
get_pos();
1652 const LVecBase3 &orig_hpr = transform->
get_hpr();
1653 const LVecBase3 &orig_shear = transform->
get_shear();
1659 (orig_pos, orig_hpr, transform->
get_scale(), orig_shear));
1697 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1716 const LVecBase3 &orig_pos = transform->
get_pos();
1717 const LVecBase3 &orig_hpr = transform->
get_hpr();
1718 const LVecBase3 &orig_scale = transform->
get_scale();
1724 (orig_pos, orig_hpr, orig_scale, transform->
get_shear()));
1734set_shxy(
const NodePath &other, PN_stdfloat shxy) {
1742set_shxz(
const NodePath &other, PN_stdfloat shxz) {
1750set_shyz(
const NodePath &other, PN_stdfloat shyz) {
1762 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1773 const LVecBase3 &hpr) {
1783 const LVecBase3 &orig_scale = transform->
get_scale();
1784 const LVecBase3 &orig_shear = transform->
get_shear();
1786 set_transform(other, TransformState::make_pos_hpr_scale_shear
1787 (pos, hpr, rel_transform->get_scale(), rel_transform->get_shear()));
1791 orig_scale, orig_shear);
1796 set_transform(other, TransformState::make_pos_hpr_scale_shear
1797 (pos, hpr, rel_transform->get_scale(), rel_transform->get_shear()));
1808 const LQuaternion &quat) {
1818 const LVecBase3 &orig_scale = transform->
get_scale();
1819 const LVecBase3 &orig_shear = transform->
get_shear();
1821 set_transform(other, TransformState::make_pos_quat_scale_shear
1822 (pos, quat, rel_transform->get_scale(), rel_transform->get_shear()));
1826 orig_scale, orig_shear);
1831 set_transform(other, TransformState::make_pos_quat_scale_shear
1832 (pos, quat, rel_transform->get_scale(), rel_transform->get_shear()));
1849 transform = TransformState::make_pos_hpr_scale_shear
1861 const LVecBase3 &scale) {
1867 transform = TransformState::make_pos_quat_scale_shear
1878 const LVecBase3 &pos,
const LVecBase3 &hpr,
1879 const LVecBase3 &scale) {
1892 const LVecBase3 &pos,
const LQuaternion &quat,
1893 const LVecBase3 &scale) {
1896 (pos, quat, scale));
1906 const LVecBase3 &pos,
const LVecBase3 &hpr,
1907 const LVecBase3 &scale,
const LVecBase3 &shear) {
1909 set_transform(other, TransformState::make_pos_hpr_scale_shear
1910 (pos, hpr, scale, shear));
1920 const LVecBase3 &pos,
const LQuaternion &quat,
1921 const LVecBase3 &scale,
const LVecBase3 &shear) {
1923 set_transform(other, TransformState::make_pos_quat_scale_shear
1924 (pos, quat, scale, shear));
1960 LPoint3 rel_point = LPoint3(point) * transform->
get_mat();
1971 LVector3 rel_vector = LVector3(vec) * transform->
get_mat();
1980look_at(
const NodePath &other,
const LPoint3 &point,
const LVector3 &up) {
1984 LPoint3 rel_point = point * transform->
get_mat();
2002 LPoint3 rel_point = point * transform->
get_mat();
2018set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a,
2020 set_color(LColor(r, g, b, a), priority);
2029set_color(
const LColor &color,
int priority) {
2054 node()->clear_attrib(ColorAttrib::get_class_slot());
2063 nassertr_always(!
is_empty(),
false);
2064 return node()->has_attrib(ColorAttrib::get_class_slot());
2073 nassertr_always(!
is_empty(),
false);
2075 node()->get_attrib(ColorAttrib::get_class_slot());
2076 if (attrib !=
nullptr) {
2083 pgraph_cat.warning()
2084 <<
"get_color() called on " << *
this <<
" which has no color set.\n";
2086 return LColor(1.0f, 1.0f, 1.0f, 1.0f);
2096 nassertr_always(!
is_empty(),
false);
2097 return node()->has_attrib(ColorScaleAttrib::get_class_slot());
2108 node()->clear_attrib(ColorScaleAttrib::get_class_slot());
2120 node()->get_attrib(ColorScaleAttrib::get_class_slot());
2121 if (attrib !=
nullptr) {
2122 priority = max(priority,
2123 node()->
get_state()->get_override(ColorScaleAttrib::get_class_slot()));
2128 LVecBase4 prev_color_scale = csa->
get_scale();
2129 LVecBase4 new_color_scale(prev_color_scale[0]*scale[0],
2130 prev_color_scale[1]*scale[1],
2131 prev_color_scale[2]*scale[2],
2132 prev_color_scale[3]*scale[3]);
2150 node()->get_attrib(ColorScaleAttrib::get_class_slot());
2151 if (attrib !=
nullptr) {
2152 priority = max(priority,
2153 node()->
get_state()->get_override(ColorScaleAttrib::get_class_slot()));
2192 node()->get_attrib(ColorScaleAttrib::get_class_slot());
2193 if (attrib !=
nullptr) {
2194 priority = max(priority,
2195 node()->
get_state()->get_override(ColorScaleAttrib::get_class_slot()));
2200 node()->
set_attrib(csa->set_scale(LVecBase4(sc[0], sc[1], sc[2], scale)), priority);
2204 node()->
set_attrib(ColorScaleAttrib::make(LVecBase4(1.0f, 1.0f, 1.0f, scale)), priority);
2218 node()->get_attrib(ColorScaleAttrib::get_class_slot());
2219 if (attrib !=
nullptr) {
2220 priority = max(priority,
2221 node()->
get_state()->get_override(ColorScaleAttrib::get_class_slot()));
2226 node()->
set_attrib(csa->set_scale(LVecBase4(scale, scale, scale, sc[3])), priority);
2230 node()->
set_attrib(ColorScaleAttrib::make(LVecBase4(scale, scale, scale, 1.0f)), priority);
2241 static const LVecBase4 ident_scale(1.0f, 1.0f, 1.0f, 1.0f);
2242 nassertr_always(!
is_empty(), ident_scale);
2244 node()->get_attrib(ColorScaleAttrib::get_class_slot());
2245 if (attrib !=
nullptr) {
2264 if (light_obj !=
nullptr) {
2267 node()->get_attrib(LightAttrib::get_class_slot());
2268 if (attrib !=
nullptr) {
2269 priority = max(priority,
2270 node()->
get_state()->get_override(LightAttrib::get_class_slot()));
2283 }
else if (light.
node()->
is_of_type(PolylightNode::get_class_type())) {
2285 if (priority != 0) {
2288 pgraph_cat.warning()
2289 <<
"Ignoring priority on set_light(" << light <<
")\n";
2293 node()->get_effect(PolylightEffect::get_class_type());
2294 if (effect !=
nullptr) {
2308 nassert_raise(
"Not a Light object.");
2342 if (light_obj !=
nullptr) {
2344 node()->get_attrib(LightAttrib::get_class_slot());
2345 if (attrib !=
nullptr) {
2346 priority = max(priority,
2347 node()->
get_state()->get_override(LightAttrib::get_class_slot()));
2364 nassert_raise(
"Not a Light object.");
2374 node()->clear_attrib(LightAttrib::get_class_slot());
2388 if (light_obj !=
nullptr) {
2390 node()->get_attrib(LightAttrib::get_class_slot());
2391 if (attrib !=
nullptr) {
2393 la = DCAST(
LightAttrib, la->remove_on_light(light));
2394 la = DCAST(
LightAttrib, la->remove_off_light(light));
2396 if (la->is_identity()) {
2397 node()->clear_attrib(LightAttrib::get_class_slot());
2400 int priority =
node()->get_state()->get_override(LightAttrib::get_class_slot());
2406 }
else if (light.
node()->
is_of_type(PolylightNode::get_class_type())) {
2408 node()->get_effect(PolylightEffect::get_class_type());
2409 if (effect !=
nullptr) {
2417 nassert_raise(
"Not a Light object.");
2427 nassertr_always(!
is_empty(),
false);
2431 if (light_obj !=
nullptr) {
2433 node()->get_attrib(LightAttrib::get_class_slot());
2434 if (attrib !=
nullptr) {
2440 }
else if (light.
node()->
is_of_type(PolylightNode::get_class_type())) {
2442 node()->get_effect(PolylightEffect::get_class_type());
2443 if (effect !=
nullptr) {
2445 return ple->has_light(light);
2450 nassert_raise(
"Not a Light object.");
2461 nassertr_always(!
is_empty(),
false);
2464 node()->get_attrib(LightAttrib::get_class_slot());
2465 if (attrib !=
nullptr) {
2483 nassertr_always(!
is_empty(),
false);
2486 if (light_obj !=
nullptr) {
2488 node()->get_attrib(LightAttrib::get_class_slot());
2489 if (attrib !=
nullptr) {
2495 nassert_raise(
"Not a Light object.");
2511 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2512 if (attrib !=
nullptr) {
2513 priority = max(priority,
2514 node()->
get_state()->get_override(ClipPlaneAttrib::get_class_slot()));
2527 nassert_raise(
"Not a PlaneNode object.");
2559 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2560 if (attrib !=
nullptr) {
2561 priority = max(priority,
2562 node()->
get_state()->get_override(ClipPlaneAttrib::get_class_slot()));
2578 nassert_raise(
"Not a PlaneNode object.");
2588 node()->clear_attrib(ClipPlaneAttrib::get_class_slot());
2600 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2601 if (attrib !=
nullptr) {
2606 if (la->is_identity()) {
2607 node()->clear_attrib(ClipPlaneAttrib::get_class_slot());
2610 int priority =
node()->get_state()->get_override(ClipPlaneAttrib::get_class_slot());
2616 nassert_raise(
"Not a PlaneNode object.");
2626 nassertr_always(!
is_empty(),
false);
2630 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2631 if (attrib !=
nullptr) {
2637 nassert_raise(
"Not a PlaneNode object.");
2648 nassertr_always(!
is_empty(),
false);
2651 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2652 if (attrib !=
nullptr) {
2667 nassertr_always(!
is_empty(),
false);
2670 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2671 if (attrib !=
nullptr) {
2676 nassert_raise(
"Not a PlaneNode object.");
2692 node()->get_effect(OccluderEffect::get_class_type());
2693 if (effect !=
nullptr) {
2706 nassert_raise(
"Not an OccluderNode object.");
2728 node()->get_effect(OccluderEffect::get_class_type());
2729 if (effect !=
nullptr) {
2733 if (la->is_identity()) {
2742 nassert_raise(
"Not an OccluderNode object.");
2752 nassertr_always(!
is_empty(),
false);
2756 node()->get_effect(OccluderEffect::get_class_type());
2757 if (effect !=
nullptr) {
2763 nassert_raise(
"Not an OccluderNode object.");
2775set_scissor(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top) {
2776 set_effect(ScissorEffect::make_screen(LVecBase4(left, right, bottom, top)));
2799 const LPoint3 &c,
const LPoint3 &d) {
2800 set_effect(ScissorEffect::make_node(a, b, c, d));
2811 set_effect(ScissorEffect::make_node(a, b, other));
2823 const LPoint3 &a,
const LPoint3 &b,
2824 const LPoint3 &c,
const LPoint3 &d) {
2825 set_effect(ScissorEffect::make_node(a, b, c, d, other));
2846 return has_effect(ScissorEffect::get_class_type());
2867set_bin(
const string &bin_name,
int draw_order,
int priority) {
2869 node()->
set_attrib(CullBinAttrib::make(bin_name, draw_order), priority);
2879 node()->clear_attrib(CullBinAttrib::get_class_slot());
2888 nassertr_always(!
is_empty(),
false);
2889 return node()->has_attrib(CullBinAttrib::get_class_slot());
2899 nassertr_always(!
is_empty(),
string());
2901 node()->get_attrib(CullBinAttrib::get_class_slot());
2902 if (attrib !=
nullptr) {
2917 nassertr_always(!
is_empty(),
false);
2919 node()->get_attrib(CullBinAttrib::get_class_slot());
2920 if (attrib !=
nullptr) {
2955 node()->get_attrib(TextureAttrib::get_class_slot());
2956 if (attrib !=
nullptr) {
2958 int sg_priority =
node()->get_state()->get_override(TextureAttrib::get_class_slot());
2961 node()->
set_attrib(tsa->add_on_stage(stage, tex, priority), sg_priority);
3005 node()->get_attrib(TextureAttrib::get_class_slot());
3006 if (attrib !=
nullptr) {
3008 int sg_priority =
node()->get_state()->get_override(TextureAttrib::get_class_slot());
3011 node()->
set_attrib(tsa->add_on_stage(stage, tex, sampler, priority), sg_priority);
3016 node()->
set_attrib(tsa->add_on_stage(stage, tex, sampler, priority));
3043 node()->get_attrib(TextureAttrib::get_class_slot());
3044 if (attrib !=
nullptr) {
3046 int sg_priority =
node()->get_state()->get_override(TextureAttrib::get_class_slot());
3051 node()->
set_attrib(tsa->add_off_stage(stage, priority), sg_priority);
3070 node()->clear_attrib(TextureAttrib::get_class_slot());
3081 node()->get_attrib(TextureAttrib::get_class_slot());
3082 if (attrib !=
nullptr) {
3087 if (tsa->is_identity()) {
3088 node()->clear_attrib(TextureAttrib::get_class_slot());
3091 int priority =
node()->get_state()->get_override(TextureAttrib::get_class_slot());
3116 nassertr_always(!
is_empty(),
false);
3119 node()->get_attrib(TextureAttrib::get_class_slot());
3120 if (attrib !=
nullptr) {
3136 nassertr_always(!
is_empty(),
false);
3138 node()->get_attrib(TextureAttrib::get_class_slot());
3139 if (attrib !=
nullptr) {
3155 nassertr_always(!
is_empty(),
false);
3158 node()->get_attrib(TextureAttrib::get_class_slot());
3159 if (attrib !=
nullptr) {
3177 nassertr_always(!
is_empty(),
nullptr);
3179 node()->get_attrib(TextureAttrib::get_class_slot());
3180 if (attrib !=
nullptr) {
3194 nassertr_always(!
is_empty(),
nullptr);
3196 node()->get_attrib(TextureAttrib::get_class_slot());
3197 if (attrib !=
nullptr) {
3216 nassertv(tex !=
nullptr);
3218 r_replace_texture(
node(), tex, new_tex);
3246 node()->get_attrib(TextureAttrib::get_class_slot());
3257set_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()));
3278set_shader_off(
int priority) {
3279 set_shader(
nullptr, priority);
3286set_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()));
3307set_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) {
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(std::move(inp)));
3389 pnode->
set_attrib(sa->set_shader_input(std::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();
3615set_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()));
3641set_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) {
4236get_material()
const {
4237 nassertr_always(!
is_empty(),
nullptr);
4239 node()->get_attrib(MaterialAttrib::get_class_slot());
4240 if (attrib !=
nullptr) {
4259 nassertv(mat !=
nullptr);
4262 if (new_mat !=
nullptr) {
4263 new_attrib = MaterialAttrib::make(new_mat);
4298 node()->clear_attrib(FogAttrib::get_class_slot());
4309 nassertr_always(!
is_empty(),
false);
4311 node()->get_attrib(FogAttrib::get_class_slot());
4312 if (attrib !=
nullptr) {
4328 nassertr_always(!
is_empty(),
false);
4330 node()->get_attrib(FogAttrib::get_class_slot());
4331 if (attrib !=
nullptr) {
4347 nassertr_always(!
is_empty(),
nullptr);
4349 node()->get_attrib(FogAttrib::get_class_slot());
4350 if (attrib !=
nullptr) {
4366 node()->get_state()->get_attrib_def(rma);
4378 node()->get_state()->get_attrib_def(rma);
4391 node()->get_state()->get_attrib_def(rma);
4409 node()->get_state()->get_attrib_def(rma);
4425 node()->get_state()->get_attrib_def(rma);
4434set_render_mode(RenderModeAttrib::Mode mode, PN_stdfloat thickness,
int priority) {
4437 node()->
set_attrib(RenderModeAttrib::make(mode, thickness), priority);
4447 node()->clear_attrib(RenderModeAttrib::get_class_slot());
4457 nassertr_always(!
is_empty(),
false);
4458 return node()->has_attrib(RenderModeAttrib::get_class_slot());
4467 nassertr_always(!
is_empty(), RenderModeAttrib::M_unchanged);
4469 node()->get_attrib(RenderModeAttrib::get_class_slot());
4470 if (attrib !=
nullptr) {
4475 return RenderModeAttrib::M_unchanged;
4484 nassertr_always(!
is_empty(), 0.0f);
4486 node()->get_attrib(RenderModeAttrib::get_class_slot());
4487 if (attrib !=
nullptr) {
4501 nassertr_always(!
is_empty(), 0.0f);
4503 node()->get_attrib(RenderModeAttrib::get_class_slot());
4504 if (attrib !=
nullptr) {
4521 CullFaceAttrib::Mode mode =
4523 CullFaceAttrib::M_cull_none :
4524 CullFaceAttrib::M_cull_clockwise;
4539 node()->clear_attrib(CullFaceAttrib::get_class_slot());
4549 nassertr_always(!
is_empty(),
false);
4550 return node()->has_attrib(CullFaceAttrib::get_class_slot());
4562 nassertr_always(!
is_empty(),
false);
4564 node()->get_attrib(CullFaceAttrib::get_class_slot());
4565 if (attrib !=
nullptr) {
4582 DepthTestAttrib::PandaCompareFunc mode =
4584 DepthTestAttrib::M_less :
4585 DepthTestAttrib::M_none;
4597 node()->clear_attrib(DepthTestAttrib::get_class_slot());
4607 nassertr_always(!
is_empty(),
false);
4608 return node()->has_attrib(DepthTestAttrib::get_class_slot());
4619 nassertr_always(!
is_empty(),
false);
4621 node()->get_attrib(DepthTestAttrib::get_class_slot());
4622 if (attrib !=
nullptr) {
4624 return (dta->
get_mode() != DepthTestAttrib::M_none);
4639 DepthWriteAttrib::Mode mode =
4641 DepthWriteAttrib::M_on :
4642 DepthWriteAttrib::M_off;
4654 node()->clear_attrib(DepthWriteAttrib::get_class_slot());
4664 nassertr_always(!
is_empty(),
false);
4665 return node()->has_attrib(DepthWriteAttrib::get_class_slot());
4676 nassertr_always(!
is_empty(),
false);
4678 node()->get_attrib(DepthWriteAttrib::get_class_slot());
4679 if (attrib !=
nullptr) {
4681 return (dta->
get_mode() != DepthWriteAttrib::M_off);
4710 node()->clear_attrib(DepthOffsetAttrib::get_class_slot());
4720 nassertr_always(!
is_empty(),
false);
4721 return node()->has_attrib(DepthOffsetAttrib::get_class_slot());
4732 node()->get_attrib(DepthOffsetAttrib::get_class_slot());
4733 if (attrib !=
nullptr) {
4751 const LMatrix4 &rel_mat = transform->
get_mat();
4753 LVector3 up = LVector3::up();
4754 LVector3 rel_pos = -rel_mat.get_row3(3);
4762 if (offset != 0.0f) {
4763 LVector3 translate = rel_mat.get_row3(3);
4764 translate.normalize();
4765 translate *= offset;
4781 const LMatrix4 &rel_mat = transform->
get_mat();
4783 LVector3 up = LVector3::up() * rel_mat;
4784 LVector3 rel_pos = LVector3::forward() * rel_mat;
4792 if (offset != 0.0f) {
4793 LVector3 translate = rel_mat.get_row3(3);
4794 translate.normalize();
4795 translate *= offset;
4810 const LMatrix4 &rel_mat = transform->
get_mat();
4812 LVector3 up = LVector3::up();
4813 LVector3 rel_pos = -rel_mat.get_row3(3);
4821 if (offset != 0.0f) {
4822 LVector3 translate = rel_mat.get_row3(3);
4823 translate.normalize();
4824 translate *= offset;
4838 (LVector3::up(),
false,
true,
4839 offset, camera, LPoint3(0.0f, 0.0f, 0.0f));
4852 (LVector3::up(),
true,
false,
4853 offset, camera, LPoint3(0.0f, 0.0f, 0.0f), fixed_depth);
4866 (LVector3::up(),
false,
false,
4867 offset, camera, LPoint3(0.0f, 0.0f, 0.0f));
4885 nassertr_always(!
is_empty(),
false);
4886 return node()->has_effect(BillboardEffect::get_class_type());
4914 nassertr_always(!
is_empty(),
false);
4915 return node()->has_effect(CompassEffect::get_class_type());
4939 node()->clear_attrib(TransparencyAttrib::get_class_slot());
4950 nassertr_always(!
is_empty(),
false);
4951 return node()->has_attrib(TransparencyAttrib::get_class_slot());
4964 nassertr_always(!
is_empty(), TransparencyAttrib::M_none);
4966 node()->get_attrib(TransparencyAttrib::get_class_slot());
4967 if (attrib !=
nullptr) {
4972 return TransparencyAttrib::M_none;
4983set_logic_op(LogicOpAttrib::Operation op,
int priority) {
4999 node()->clear_attrib(LogicOpAttrib::get_class_slot());
5012 nassertr_always(!
is_empty(),
false);
5013 return node()->has_attrib(LogicOpAttrib::get_class_slot());
5028 nassertr_always(!
is_empty(), LogicOpAttrib::O_none);
5030 node()->get_attrib(LogicOpAttrib::get_class_slot());
5031 if (attrib !=
nullptr) {
5036 return LogicOpAttrib::O_none;
5057 node()->clear_attrib(AntialiasAttrib::get_class_slot());
5067 nassertr_always(!
is_empty(),
false);
5068 return node()->has_attrib(AntialiasAttrib::get_class_slot());
5077 nassertr_always(!
is_empty(), AntialiasAttrib::M_none);
5079 node()->get_attrib(AntialiasAttrib::get_class_slot());
5080 if (attrib !=
nullptr) {
5085 return AntialiasAttrib::M_none;
5095 nassertr_always(!
is_empty(),
false);
5096 return node()->has_attrib(AudioVolumeAttrib::get_class_slot());
5107 node()->clear_attrib(AudioVolumeAttrib::get_class_slot());
5118 node()->get_attrib(AudioVolumeAttrib::get_class_slot());
5119 if (attrib !=
nullptr) {
5120 priority = max(priority,
5121 node()->
get_state()->get_override(AudioVolumeAttrib::get_class_slot()));
5156 node()->get_attrib(AudioVolumeAttrib::get_class_slot());
5157 if (attrib !=
nullptr) {
5172 const RenderAttrib *attrib = net_state->get_attrib(AudioVolumeAttrib::get_class_slot());
5173 if (attrib !=
nullptr) {
5175 if (ava !=
nullptr) {
5195 comp = comp->
get_next(pipeline_stage, current_thread)) {
5200 result._head = comp;
5224 bool reparented = PandaNode::reparent(_head->get_next(pipeline_stage, current_thread),
5225 _head, sort,
true, pipeline_stage,
5227 nassertv(reparented);
5241 bool reparented = PandaNode::reparent(_head->get_next(pipeline_stage, current_thread),
5242 _head, sort,
false, pipeline_stage,
5244 nassertv(reparented);
5253 stashed_descendents.
unstash();
5265 if (comp !=
nullptr) {
5269 while (next !=
nullptr) {
5275 result._head = comp;
5280 next = next->
get_next(pipeline_stage, current_thread);
5293 return (other == *
this);
5301 return (other != *
this);
5312 return other.compare_to(*
this) > 0;
5327 return -other.compare_to(*
this);
5350 PStatTimer timer(_verify_complete_pcollector);
5353 nassertr(comp !=
nullptr,
false);
5358 nassertr(
node !=
nullptr,
false);
5359 int length = comp->
get_length(pipeline_stage, current_thread);
5361 comp = comp->
get_next(pipeline_stage, current_thread);
5363 while (comp !=
nullptr) {
5365 nassertr(next_node !=
nullptr,
false);
5368 pgraph_cat.warning()
5369 << *
this <<
" is incomplete; " << *
node <<
" is not a child of "
5370 << *next_node <<
"\n";
5374 if (comp->
get_length(pipeline_stage, current_thread) != length) {
5375 pgraph_cat.warning()
5376 << *
this <<
" is incomplete; length at " << *next_node
5377 <<
" indicates " << comp->
get_length(pipeline_stage, current_thread)
5378 <<
" while length at " << *
node <<
" indicates " << length <<
"\n";
5383 comp = comp->
get_next(pipeline_stage, current_thread);
5403 CPT(
RenderState) state = RenderState::make_empty();
5426 node()->prepare_scene(gsg, get_net_state());
5468get_bounds(
Thread *current_thread)
const {
5485force_recompute_bounds() {
5487 r_force_recompute_bounds(
node());
5496 get_bounds()->write(out);
5517 min_point.set(0.0f, 0.0f, 0.0f);
5518 max_point.set(0.0f, 0.0f, 0.0f);
5519 nassertr_always(!
is_empty(),
false);
5526 bool found_any =
false;
5527 node()->calc_tight_bounds(min_point, max_point, found_any,
5528 std::move(transform), current_thread);
5617 if (flatten_geoms) {
5645 if (flatten_geoms) {
5647 gr.
collect_vertex_data(
node(), ~(SceneGraphReducer::CVD_format | SceneGraphReducer::CVD_name | SceneGraphReducer::CVD_animation_type));
5672 gr.
apply_attribs(
node(), SceneGraphReducer::TT_apply_texture_color | SceneGraphReducer::TT_tex_matrix | SceneGraphReducer::TT_other);
5698 nassertr_always(!
is_empty(),
false);
5702 bool okflag =
false;
5722 nassertr_always(!
is_empty(),
false);
5726 bool okflag =
false;
5765 ostringstream stream;
5769 bool used_local_writer =
false;
5770 if (writer ==
nullptr) {
5776 writer = &local_writer;
5777 used_local_writer =
true;
5783 if (used_local_writer && num_nodes > 1) {
5806 for (
int i = 0; i < num_nodes; ++i) {
5808 nassertr(
node !=
nullptr,
false);
5831 if (reader ==
nullptr) {
5835 if (!buffer.
read_header(head, _bam_header.size())) {
5839 if (head != _bam_header) {
5843 reader = &local_reader;
5855 ErrorType error_type = (ErrorType)dgi.
get_uint8();
5857 if (num_nodes == 0) {
5859 result._error_type = error_type;
5863 for (
int i = 0; i < num_nodes; ++i) {
5866 if (
object ==
nullptr ||
5867 !object->
is_of_type(PandaNode::get_class_type())) {
5896 Thread *current_thread) {
5904 while (comp !=
nullptr && comp != source._head) {
5907 comp = comp->
get_next(pipeline_stage, current_thread);
5910 if (comp ==
nullptr) {
5918 for (it = nodes.rbegin(); it != nodes.rend(); ++it) {
5919 PandaNode::InstanceMap::const_iterator iit = inst_map.find(*it);
5920 nassertr_always(iit != inst_map.end(),
false);
5921 new_comp = PandaNode::get_component(new_comp, iit->second, pipeline_stage, current_thread);
5924 nassertr(new_comp !=
nullptr,
false);
5925 _head = std::move(new_comp);
5939 int &a_count,
int &b_count,
Thread *current_thread) {
5949 while (ac->
get_length(pipeline_stage, current_thread) > bc->
get_length(pipeline_stage, current_thread)) {
5950 nassertr(ac !=
nullptr,
nullptr);
5951 ac = ac->
get_next(pipeline_stage, current_thread);
5954 while (bc->
get_length(pipeline_stage, current_thread) > ac->
get_length(pipeline_stage, current_thread)) {
5955 nassertr(bc !=
nullptr,
nullptr);
5956 bc = bc->
get_next(pipeline_stage, current_thread);
5963 nassertr(ac !=
nullptr,
nullptr);
5964 nassertr(bc !=
nullptr,
nullptr);
5965 ac = ac->
get_next(pipeline_stage, current_thread);
5967 bc = bc->
get_next(pipeline_stage, current_thread);
5980 if (comp ==
nullptr) {
5981 return RenderState::make_empty();
5985 return r_get_net_state(comp->
get_next(pipeline_stage, current_thread), current_thread)->compose(state);
5996 Thread *current_thread)
const {
5997 if (n == 0 || comp ==
nullptr) {
5998 return RenderState::make_empty();
6002 return r_get_partial_state(comp->
get_next(pipeline_stage, current_thread), n - 1, current_thread)->compose(state);
6012 if (comp ==
nullptr) {
6013 return TransformState::make_identity();
6017 CPT(
TransformState) net_transform = r_get_net_transform(comp->
get_next(pipeline_stage, current_thread), current_thread);
6020 if (!node_cdata->_effects->has_adjust_transform()) {
6021 if (node_cdata->_transform->is_identity()) {
6022 return net_transform;
6024 return net_transform->compose(node_cdata->_transform);
6028 node_cdata->_effects->adjust_transform(net_transform, transform,
node);
6029 return net_transform->compose(transform);
6044 Thread *current_thread)
const {
6045 if (n == 0 || comp ==
nullptr) {
6046 return TransformState::make_identity();
6050 if (node_cdata->_effects->has_adjust_transform()) {
6054 CPT(
TransformState) partial = r_get_partial_transform(comp->
get_next(pipeline_stage, current_thread), n - 1, current_thread);
6055 if (partial ==
nullptr) {
6058 if (node_cdata->_transform->is_identity()) {
6061 return partial->compose(node_cdata->_transform);
6072 if (comp ==
nullptr) {
6073 return TransformState::make_identity();
6077 return r_get_net_prev_transform(comp->
get_next(pipeline_stage, current_thread), current_thread)->compose(transform);
6088 if (n == 0 || comp ==
nullptr) {
6089 return TransformState::make_identity();
6093 return r_get_partial_prev_transform(comp->
get_next(pipeline_stage, current_thread), n - 1, current_thread)->compose(transform);
6104 int max_matches)
const {
6106 pgraph_cat.warning()
6107 <<
"Attempt to extend an empty NodePath by '" << path
6113 find_matches(result, approx_path, max_matches);
6124 int max_matches)
const {
6126 pgraph_cat.warning()
6127 <<
"Attempt to extend an empty NodePath by: " << approx_path <<
".\n";
6134 nassertv(level->_node_path.
is_valid());
6136 find_matches(result, level, max_matches);
6145 int max_matches)
const {
6147 int num_levels_remaining = _max_search_depth;
6151 while (num_levels_remaining > 0 && level !=
nullptr) {
6152 if (pgraph_cat.is_spam()) {
6154 <<
"find_matches pass: " << result <<
", "
6155 << max_matches <<
", " << num_levels_remaining <<
"\n";
6159 num_levels_remaining--;
6166 while (entry !=
nullptr) {
6167 if (entry->
consider_node(result, next_level, max_matches, 0)) {
6171 while (entry !=
nullptr) {
6176 while (next_level !=
nullptr) {
6181 while (deleted_entries !=
nullptr) {
6183 delete deleted_entries;
6184 deleted_entries = next;
6194 entry->_next = deleted_entries;
6195 deleted_entries = entry;
6202 while (entry !=
nullptr) {
6204 entry->_next = deleted_entries;
6205 deleted_entries = entry;
6214 while (deleted_entries !=
nullptr) {
6216 delete deleted_entries;
6217 deleted_entries = next;
6231 DCAST_INTO_R(mnode,
node, count);
6238 for (
int i = 0; i < num_children; i++) {
6239 count += r_clear_model_nodes(cr.
get_child(i));
6250r_adjust_all_priorities(
PandaNode *node,
int adjustment) {
6254 DCAST_INTO_V(gnode,
node);
6257 for (
int i = 0; i < num_geoms; i++) {
6264 for (
int i = 0; i < num_children; i++) {
6265 r_adjust_all_priorities(cr.
get_child(i), adjustment);
6273r_force_recompute_bounds(
PandaNode *node) {
6276 DCAST_INTO_V(gnode,
node);
6279 for (
int i = 0; i < num_geoms; i++) {
6280 const Geom *geom = gnode->get_geom(i);
6281 geom->mark_bounds_stale();
6285 node->mark_bounds_stale();
6290 for (
int i = 0; i < num_children; i++) {
6291 r_force_recompute_bounds(cr.
get_child(i));
6305 into_collide_mask = (into_collide_mask & and_mask) | or_mask;
6311 for (
int i = 0; i < num_children; i++) {
6312 r_set_collide_mask(cr.
get_child(i), and_mask, or_mask, node_type);
6323 DCAST_INTO_R(gnode,
node,
false);
6326 for (
int i = 0; i < num_geoms; i++) {
6327 const Geom *geom = gnode->get_geom(i);
6329 if (vdata->has_column(name)) {
6338 for (
int i = 0; i < num_children; i++) {
6340 if (r_has_vertex_column(child, name)) {
6352r_find_all_vertex_columns(
PandaNode *node,
6353 NodePath::InternalNames &vertex_columns)
const {
6356 DCAST_INTO_V(gnode,
node);
6359 for (
int i = 0; i < num_geoms; ++i) {
6360 const Geom *geom = gnode->get_geom(i);
6363 for (
int j = 0; j < num_arrays; ++j) {
6366 for (
int k = 0; k < num_columns; ++k) {
6368 vertex_columns.insert(column->
get_name());
6377 for (
int i = 0; i < num_children; i++) {
6379 r_find_all_vertex_columns(child, vertex_columns);
6391 DCAST_INTO_R(gnode,
node,
nullptr);
6394 for (
int i = 0; i < num_geoms; i++) {
6400 geom_state->get_attrib(TextureAttrib::get_class_slot());
6401 if (attrib !=
nullptr) {
6405 if (texture !=
nullptr) {
6406 if (glob.
matches(texture->get_name())) {
6418 for (
int i = 0; i < num_children; i++) {
6420 CPT(
RenderState) next_state = state->compose(child->get_state());
6422 Texture *result = r_find_texture(child, next_state, glob);
6423 if (result !=
nullptr) {
6436 NodePath::Textures &textures)
const {
6439 DCAST_INTO_V(gnode,
node);
6442 for (
int i = 0; i < num_geoms; i++) {
6448 geom_state->get_attrib(TextureAttrib::get_class_slot());
6449 if (attrib !=
nullptr) {
6453 if (texture !=
nullptr) {
6454 textures.insert(texture);
6464 for (
int i = 0; i < num_children; i++) {
6466 CPT(
RenderState) next_state = state->compose(child->get_state());
6467 r_find_all_textures(child, next_state, textures);
6478 node->get_attrib(TextureAttrib::get_class_slot());
6479 if (attrib !=
nullptr) {
6488 DCAST_INTO_R(gnode,
node,
nullptr);
6491 for (
int i = 0; i < num_geoms; i++) {
6496 geom_state->get_attrib(TextureAttrib::get_class_slot());
6497 if (attrib !=
nullptr) {
6509 for (
int i = 0; i < num_children; i++) {
6512 Texture *result = r_find_texture(child, stage);
6513 if (result !=
nullptr) {
6526 NodePath::Textures &textures)
const {
6529 node->get_attrib(TextureAttrib::get_class_slot());
6530 if (attrib !=
nullptr) {
6539 DCAST_INTO_V(gnode,
node);
6542 for (
int i = 0; i < num_geoms; i++) {
6547 geom_state->get_attrib(TextureAttrib::get_class_slot());
6548 if (attrib !=
nullptr) {
6560 for (
int i = 0; i < num_children; i++) {
6562 r_find_all_textures(child, stage, textures);
6576 if (node_state->get_attrib(ta)) {
6577 CPT(
RenderAttrib) new_ta = ta->replace_texture(tex, new_tex);
6587 DCAST_INTO_V(gnode,
node);
6590 for (
int i = 0; i < num_geoms; i++) {
6595 if (geom_state->get_attrib(ta)) {
6596 CPT(
RenderAttrib) new_ta = ta->replace_texture(tex, new_tex);
6607 for (
size_t i = 0; i < num_children; ++i) {
6609 r_replace_texture(child, tex, new_tex);
6621 DCAST_INTO_R(gnode,
node,
nullptr);
6624 for (
int i = 0; i < num_geoms; i++) {
6630 geom_state->get_attrib(TextureAttrib::get_class_slot());
6631 if (attrib !=
nullptr) {
6635 if (texture_stage !=
nullptr) {
6637 return texture_stage;
6648 for (
int i = 0; i < num_children; i++) {
6650 CPT(
RenderState) next_state = state->compose(child->get_state());
6652 TextureStage *result = r_find_texture_stage(child, next_state, glob);
6653 if (result !=
nullptr) {
6666 NodePath::TextureStages &texture_stages)
const {
6669 DCAST_INTO_V(gnode,
node);
6672 for (
int i = 0; i < num_geoms; i++) {
6678 geom_state->get_attrib(TextureAttrib::get_class_slot());
6679 if (attrib !=
nullptr) {
6683 if (texture_stage !=
nullptr) {
6684 texture_stages.insert(texture_stage);
6694 for (
int i = 0; i < num_children; i++) {
6696 CPT(
RenderState) next_state = state->compose(child->get_state());
6697 r_find_all_texture_stages(child, next_state, texture_stages);
6708 node->get_attrib(TextureAttrib::get_class_slot());
6709 if (attrib !=
nullptr) {
6711 CPT(
RenderAttrib) new_attrib = ta->unify_texture_stages(stage);
6712 if (new_attrib != ta) {
6719 DCAST_INTO_V(gnode,
node);
6722 for (
int i = 0; i < num_geoms; i++) {
6727 state->get_attrib(TextureAttrib::get_class_slot());
6728 if (attrib !=
nullptr) {
6730 CPT(
RenderAttrib) new_attrib = ta->unify_texture_stages(stage);
6731 if (new_attrib != ta) {
6732 CPT(
RenderState) new_state = state->add_attrib(new_attrib);
6742 for (
int i = 0; i < num_children; i++) {
6744 r_unify_texture_stages(child, stage);
6756 DCAST_INTO_R(gnode,
node,
nullptr);
6759 for (
int i = 0; i < num_geoms; i++) {
6765 geom_state->get_attrib(MaterialAttrib::get_class_slot());
6766 if (attrib !=
nullptr) {
6770 if (material !=
nullptr) {
6771 if (glob.
matches(material->get_name())) {
6783 for (
int i = 0; i < num_children; i++) {
6785 CPT(
RenderState) next_state = state->compose(child->get_state());
6787 Material *result = r_find_material(child, next_state, glob);
6788 if (result !=
nullptr) {
6801 NodePath::Materials &materials)
const {
6804 DCAST_INTO_V(gnode,
node);
6807 for (
int i = 0; i < num_geoms; i++) {
6813 geom_state->get_attrib(MaterialAttrib::get_class_slot());
6814 if (attrib !=
nullptr) {
6818 if (material !=
nullptr) {
6819 materials.insert(material);
6829 for (
int i = 0; i < num_children; i++) {
6831 CPT(
RenderState) next_state = state->compose(child->get_state());
6832 r_find_all_materials(child, next_state, materials);
6846 if (node_state->get_attrib(ma)) {
6848 if (new_attrib !=
nullptr) {
6851 node->
set_state(node_state->remove_attrib(MaterialAttrib::get_class_slot()));
6860 DCAST_INTO_V(gnode,
node);
6863 for (
int i = 0; i < num_geoms; i++) {
6868 if (geom_state->get_attrib(ma)) {
6871 if (new_attrib !=
nullptr) {
6874 gnode->
set_geom_state(i, geom_state->remove_attrib(MaterialAttrib::get_class_slot()));
6884 for (
size_t i = 0; i < num_children; ++i) {
6886 r_replace_material(child, mat, new_attrib);
6904 if (root ==
nullptr || root ==
node()) {
6916 while (comp !=
nullptr) {
6918 path.push_back(
node);
6924 comp = comp->
get_next(pipeline_stage, current_thread);
6927 if (comp ==
nullptr) {
6935 for (
int i = path.size() - 1; i >= 0; --i) {
6949 if (
node.is_null()) {
6962 nassertd(!comp.is_null()) {
6963 while (p_list[pi++]) {}
6968 while (p_list[pi] !=
nullptr) {
6976 PandaNode::Paths::const_iterator it;
6977 for (it =
node->_paths.begin(); it !=
node->_paths.end(); ++it) {
6978 if ((*it)->get_next(pipeline_stage, current_thread) == comp) {
6985 if (it ==
node->_paths.end()) {
6991 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.
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.