79 using std::ostringstream;
84 int NodePath::_max_search_depth = 7000;
87 PStatCollector NodePath::_get_transform_pcollector(
"*:NodePath:get_transform");
88 PStatCollector NodePath::_verify_complete_pcollector(
"*:NodePath:verify_complete");
99 nassertv(child_node !=
nullptr);
104 _head = PandaNode::get_top_component(child_node,
true,
105 pipeline_stage, current_thread);
108 _head = PandaNode::get_component(parent._head, child_node, pipeline_stage,
111 nassertv(_head !=
nullptr);
113 if (_head !=
nullptr) {
124 operator bool ()
const {
137 return _head->get_length(pipeline_stage, current_thread);
162 nassertr(comp !=
nullptr,
nullptr);
163 comp = comp->
get_next(pipeline_stage, current_thread);
169 nassertr(comp !=
nullptr,
nullptr);
191 comp = comp->
get_next(pipeline_stage, current_thread);
217 while (!comp->
is_top_node(pipeline_stage, current_thread)) {
218 comp = comp->
get_next(pipeline_stage, current_thread);
234 nassertr_always(!
is_empty(), result);
242 for (
int i = 0; i < num_children; i++) {
244 child._head = PandaNode::get_component(_head, cr.
get_child(i),
245 pipeline_stage, current_thread);
260 nassertr_always(!
is_empty(), result);
267 for (
int i = 0; i < num_stashed; i++) {
269 stashed._head = PandaNode::get_component(_head, bottom_node->
get_stashed(i),
270 pipeline_stage, current_thread);
291 PandaNode *parent = _head->get_next(pipeline_stage, current_thread)->get_node();
293 nassertr(parent !=
nullptr && child !=
nullptr, 0);
295 if (child_index != -1) {
300 if (child_index != -1) {
314 find(
const string &path)
const {
318 find_matches(col, path, 1);
340 find_matches(col, approx_path, 1);
358 find_matches(col, path, -1);
371 nassertr(
node !=
nullptr, col);
375 find_matches(col, approx_path, -1);
395 nassertv(other._error_type == ET_ok);
401 bool reparented = PandaNode::reparent(other._head, _head, sort,
false,
402 pipeline_stage, current_thread);
403 nassertv(reparented);
416 nassertv(other._error_type == ET_ok);
422 bool reparented = PandaNode::reparent(other._head, _head, sort,
true,
423 pipeline_stage, current_thread);
424 nassertv(reparented);
437 nassertv(other._error_type == ET_ok);
481 new_instance._head = PandaNode::attach(
nullptr,
node(), sort, pipeline_stage,
485 bool reparented = PandaNode::reparent(other._head, new_instance._head,
486 sort,
false, pipeline_stage,
501 nassertr(reparented, new_instance);
519 Thread *current_thread)
const {
539 nassertr(other._error_type == ET_ok,
fail());
543 PT(
PandaNode) copy_node = source_node->r_copy_subgraph(inst_map, current_thread);
544 nassertr(copy_node !=
nullptr,
fail());
546 copy_node->reset_prev_transform(current_thread);
552 const RenderState *state = source_node->get_state();
554 if (state->get_attrib(lattr)) {
561 if (light2.replace_copied_nodes(*
this, result, inst_map, current_thread)) {
562 new_lattr = DCAST(
LightAttrib, new_lattr->replace_off_light(light, light2));
570 if (light2.replace_copied_nodes(*
this, result, inst_map, current_thread)) {
571 new_lattr = DCAST(
LightAttrib, new_lattr->replace_on_light(light, light2));
575 if (new_lattr != lattr) {
576 result.
set_state(state->set_attrib(std::move(new_lattr)));
603 new_path._head = PandaNode::attach(_head,
node, sort, pipeline_stage,
625 nassertv(_error_type != ET_not_found);
633 PandaNode::detach(_head, pipeline_stage, current_thread);
636 if (
is_empty() || _head->has_key()) {
665 nassertv(_error_type != ET_not_found);
669 PandaNode::detach(_head, pipeline_stage, current_thread);
677 reverse_ls(ostream &out,
int indent_level)
const {
682 indent_level =
get_parent().reverse_ls(out, indent_level);
684 node()->write(out, indent_level);
685 return indent_level + 2;
693 output(ostream &out)
const {
694 switch (_error_type) {
696 out <<
"**not found**";
699 out <<
"**removed**";
708 if (_head ==
nullptr) {
722 nassertr_always(!
is_empty(), RenderState::make_empty());
723 return node()->get_state(current_thread);
732 nassertr(_error_type == ET_ok && other._error_type == ET_ok, RenderState::make_empty());
735 return get_net_state(current_thread);
738 return other.get_net_state(current_thread)->invert_compose(RenderState::make_empty());
741 #if defined(_DEBUG) || (defined(HAVE_THREADS) && defined(SIMPLE_THREADS))
743 nassertr(other.
verify_complete(current_thread), RenderState::make_empty());
746 int a_count, b_count;
747 if (find_common_ancestor(*
this, other, a_count, b_count, current_thread) ==
nullptr) {
748 if (allow_unrelated_wrt) {
750 << *
this <<
" is not related to " << other <<
"\n";
753 << *
this <<
" is not related to " << other <<
"\n";
754 nassert_raise(
"unrelated nodes");
755 return RenderState::make_empty();
759 CPT(
RenderState) a_state = r_get_partial_state(_head, a_count, current_thread);
760 CPT(
RenderState) b_state = r_get_partial_state(other._head, b_count, current_thread);
761 return b_state->invert_compose(a_state);
772 nassertv(_error_type == ET_ok && other._error_type == ET_ok);
783 CPT(
RenderState) new_state = rel_state->compose(state);
794 nassertr_always(!
is_empty(), TransformState::make_identity());
795 return node()->get_transform(current_thread);
804 nassertr(_error_type == ET_ok && other._error_type == ET_ok, TransformState::make_identity());
808 return get_net_transform(current_thread);
811 return other.get_net_transform(current_thread)->invert_compose(TransformState::make_identity());
814 #if defined(_DEBUG) || (defined(HAVE_THREADS) && defined(SIMPLE_THREADS))
815 nassertr(
verify_complete(current_thread), TransformState::make_identity());
816 nassertr(other.
verify_complete(current_thread), TransformState::make_identity());
819 int a_count, b_count;
820 if (find_common_ancestor(*
this, other, a_count, b_count, current_thread) ==
nullptr) {
821 if (allow_unrelated_wrt) {
822 if (pgraph_cat.is_debug()) {
824 << *
this <<
" is not related to " << other <<
"\n";
828 << *
this <<
" is not related to " << other <<
"\n";
829 nassert_raise(
"unrelated nodes");
830 return TransformState::make_identity();
836 a_transform = r_get_partial_transform(_head, a_count, current_thread);
837 if (a_transform !=
nullptr) {
838 b_transform = r_get_partial_transform(other._head, b_count, current_thread);
840 if (b_transform ==
nullptr) {
844 a_transform = r_get_net_transform(_head, current_thread);
845 b_transform = r_get_net_transform(other._head, current_thread);
848 return b_transform->invert_compose(a_transform);
859 nassertv(_error_type == ET_ok && other._error_type == ET_ok);
882 nassertr_always(!
is_empty(), TransformState::make_identity());
883 return node()->get_prev_transform(current_thread);
893 nassertr(_error_type == ET_ok && other._error_type == ET_ok, TransformState::make_identity());
896 return get_net_prev_transform(current_thread);
899 return other.get_net_prev_transform(current_thread)->invert_compose(TransformState::make_identity());
902 #if defined(_DEBUG) || (defined(HAVE_THREADS) && defined(SIMPLE_THREADS))
903 nassertr(
verify_complete(current_thread), TransformState::make_identity());
904 nassertr(other.
verify_complete(current_thread), TransformState::make_identity());
907 int a_count, b_count;
908 if (find_common_ancestor(*
this, other, a_count, b_count, current_thread) ==
nullptr) {
909 if (allow_unrelated_wrt) {
911 << *
this <<
" is not related to " << other <<
"\n";
914 << *
this <<
" is not related to " << other <<
"\n";
915 nassert_raise(
"unrelated nodes");
916 return TransformState::make_identity();
920 CPT(
TransformState) a_prev_transform = r_get_partial_prev_transform(_head, a_count, current_thread);
921 CPT(
TransformState) b_prev_transform = r_get_partial_prev_transform(other._head, b_count, current_thread);
922 return b_prev_transform->invert_compose(a_prev_transform);
933 nassertv(_error_type == ET_ok && other._error_type == ET_ok);
945 set_prev_transform(new_trans, current_thread);
956 set_pos(
const LVecBase3 &pos) {
968 set_x(PN_stdfloat x) {
981 set_y(PN_stdfloat y) {
994 set_z(PN_stdfloat z) {
1013 set_fluid_x(PN_stdfloat x) {
1021 set_fluid_y(PN_stdfloat y) {
1029 set_fluid_z(PN_stdfloat z) {
1041 nassertr_always(!
is_empty(), LPoint3(0.0f, 0.0f, 0.0f));
1056 nassertr_always(!
is_empty(), LPoint3(0.0f, 0.0f, 0.0f));
1065 set_hpr(
const LVecBase3 &hpr) {
1068 nassertv(transform->
has_hpr());
1073 set_h(PN_stdfloat h) {
1076 nassertv(transform->
has_hpr());
1077 LVecBase3 hpr = transform->
get_hpr();
1083 set_p(PN_stdfloat p) {
1086 nassertv(transform->
has_hpr());
1087 LVecBase3 hpr = transform->
get_hpr();
1093 set_r(PN_stdfloat r) {
1096 nassertv(transform->
has_hpr());
1097 LVecBase3 hpr = transform->
get_hpr();
1107 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1109 nassertr(transform->
has_hpr(), LVecBase3(0.0f, 0.0f, 0.0f));
1118 set_quat(
const LQuaternion &quat) {
1129 nassertr_always(!
is_empty(), LQuaternion::ident_quat());
1154 LVecBase3 scale = transform->
get_scale();
1168 LVecBase3 scale = transform->
get_scale();
1182 LVecBase3 scale = transform->
get_scale();
1192 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1209 set_shxy(PN_stdfloat shxy) {
1212 LVecBase3 shear = transform->
get_shear();
1218 set_shxz(PN_stdfloat shxz) {
1221 LVecBase3 shear = transform->
get_shear();
1227 set_shyz(PN_stdfloat shyz) {
1230 LVecBase3 shear = transform->
get_shear();
1240 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1250 set_pos_hpr(
const LVecBase3 &pos,
const LVecBase3 &hpr) {
1253 transform = TransformState::make_pos_hpr_scale_shear
1264 set_pos_quat(
const LVecBase3 &pos,
const LQuaternion &quat) {
1267 transform = TransformState::make_pos_quat_scale_shear
1278 set_hpr_scale(
const LVecBase3 &hpr,
const LVecBase3 &scale) {
1281 transform = TransformState::make_pos_hpr_scale_shear
1291 set_quat_scale(
const LQuaternion &quat,
const LVecBase3 &scale) {
1294 transform = TransformState::make_pos_quat_scale_shear
1305 const LVecBase3 &scale) {
1318 const LVecBase3 &scale) {
1321 (pos, quat, scale));
1331 const LVecBase3 &scale,
const LVecBase3 &shear) {
1334 (pos, hpr, scale, shear));
1344 const LVecBase3 &scale,
const LVecBase3 &shear) {
1347 (pos, quat, scale, shear));
1355 set_mat(
const LMatrix4 &mat) {
1366 look_at(
const LPoint3 &point,
const LVector3 &up) {
1381 heads_up(
const LPoint3 &point,
const LVector3 &up) {
1396 set_pos(
const NodePath &other,
const LVecBase3 &pos) {
1401 if (orig_transform->has_components()) {
1406 const LVecBase3 &orig_hpr = orig_transform->get_hpr();
1407 const LVecBase3 &orig_scale = orig_transform->get_scale();
1408 const LVecBase3 &orig_shear = orig_transform->get_shear();
1425 set_pos(other, pos);
1433 set_pos(other, pos);
1441 set_pos(other, pos);
1454 if (orig_transform->has_components()) {
1459 const LVecBase3 &orig_hpr = orig_transform->get_hpr();
1460 const LVecBase3 &orig_scale = orig_transform->get_scale();
1461 const LVecBase3 &orig_shear = orig_transform->get_shear();
1476 set_fluid_x(
const NodePath &other, PN_stdfloat x) {
1484 set_fluid_y(
const NodePath &other, PN_stdfloat y) {
1492 set_fluid_z(
const NodePath &other, PN_stdfloat z) {
1505 nassertr_always(!
is_empty(), LPoint3(0.0f, 0.0f, 0.0f));
1520 nassertr_always(!
is_empty(), LPoint3(0.0f, 0.0f, 0.0f));
1531 nassertv(rel_transform->has_hpr());
1539 const LVecBase3 &orig_pos = transform->
get_pos();
1540 const LVecBase3 &orig_scale = transform->
get_scale();
1541 const LVecBase3 &orig_shear = transform->
get_shear();
1547 (orig_pos, transform->
get_hpr(), orig_scale, orig_shear));
1557 set_h(
const NodePath &other, PN_stdfloat h) {
1559 LVecBase3 hpr =
get_hpr(other);
1565 set_p(
const NodePath &other, PN_stdfloat p) {
1567 LVecBase3 hpr =
get_hpr(other);
1573 set_r(
const NodePath &other, PN_stdfloat r) {
1575 LVecBase3 hpr =
get_hpr(other);
1586 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1588 nassertr(transform->
has_hpr(), LVecBase3(0.0f, 0.0f, 0.0f));
1606 const LVecBase3 &orig_pos = transform->
get_pos();
1607 const LVecBase3 &orig_scale = transform->
get_scale();
1608 const LVecBase3 &orig_shear = transform->
get_shear();
1614 (orig_pos, transform->
get_quat(), orig_scale, orig_shear));
1629 nassertr_always(!
is_empty(), LQuaternion::ident_quat());
1648 const LVecBase3 &orig_pos = transform->
get_pos();
1649 const LVecBase3 &orig_hpr = transform->
get_hpr();
1650 const LVecBase3 &orig_shear = transform->
get_shear();
1656 (orig_pos, orig_hpr, transform->
get_scale(), orig_shear));
1694 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1713 const LVecBase3 &orig_pos = transform->
get_pos();
1714 const LVecBase3 &orig_hpr = transform->
get_hpr();
1715 const LVecBase3 &orig_scale = transform->
get_scale();
1721 (orig_pos, orig_hpr, orig_scale, transform->
get_shear()));
1731 set_shxy(
const NodePath &other, PN_stdfloat shxy) {
1739 set_shxz(
const NodePath &other, PN_stdfloat shxz) {
1747 set_shyz(
const NodePath &other, PN_stdfloat shyz) {
1759 nassertr_always(!
is_empty(), LVecBase3(0.0f, 0.0f, 0.0f));
1770 const LVecBase3 &hpr) {
1780 const LVecBase3 &orig_scale = transform->
get_scale();
1781 const LVecBase3 &orig_shear = transform->
get_shear();
1783 set_transform(other, TransformState::make_pos_hpr_scale_shear
1784 (pos, hpr, rel_transform->get_scale(), rel_transform->get_shear()));
1788 orig_scale, orig_shear);
1793 set_transform(other, TransformState::make_pos_hpr_scale_shear
1794 (pos, hpr, rel_transform->get_scale(), rel_transform->get_shear()));
1805 const LQuaternion &quat) {
1815 const LVecBase3 &orig_scale = transform->
get_scale();
1816 const LVecBase3 &orig_shear = transform->
get_shear();
1818 set_transform(other, TransformState::make_pos_quat_scale_shear
1819 (pos, quat, rel_transform->get_scale(), rel_transform->get_shear()));
1823 orig_scale, orig_shear);
1828 set_transform(other, TransformState::make_pos_quat_scale_shear
1829 (pos, quat, rel_transform->get_scale(), rel_transform->get_shear()));
1846 transform = TransformState::make_pos_hpr_scale_shear
1858 const LVecBase3 &scale) {
1864 transform = TransformState::make_pos_quat_scale_shear
1875 const LVecBase3 &pos,
const LVecBase3 &hpr,
1876 const LVecBase3 &scale) {
1889 const LVecBase3 &pos,
const LQuaternion &quat,
1890 const LVecBase3 &scale) {
1893 (pos, quat, scale));
1903 const LVecBase3 &pos,
const LVecBase3 &hpr,
1904 const LVecBase3 &scale,
const LVecBase3 &shear) {
1906 set_transform(other, TransformState::make_pos_hpr_scale_shear
1907 (pos, hpr, scale, shear));
1917 const LVecBase3 &pos,
const LQuaternion &quat,
1918 const LVecBase3 &scale,
const LVecBase3 &shear) {
1920 set_transform(other, TransformState::make_pos_quat_scale_shear
1921 (pos, quat, scale, shear));
1957 LPoint3 rel_point = LPoint3(point) * transform->
get_mat();
1968 LVector3 rel_vector = LVector3(vec) * transform->
get_mat();
1977 look_at(
const NodePath &other,
const LPoint3 &point,
const LVector3 &up) {
1981 LPoint3 rel_point = point * transform->
get_mat();
1995 heads_up(
const NodePath &other,
const LPoint3 &point,
const LVector3 &up) {
1999 LPoint3 rel_point = point * transform->
get_mat();
2015 set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a,
2017 set_color(LColor(r, g, b, a), priority);
2026 set_color(
const LColor &color,
int priority) {
2051 node()->clear_attrib(ColorAttrib::get_class_slot());
2060 nassertr_always(!
is_empty(),
false);
2061 return node()->has_attrib(ColorAttrib::get_class_slot());
2070 nassertr_always(!
is_empty(),
false);
2072 node()->get_attrib(ColorAttrib::get_class_slot());
2073 if (attrib !=
nullptr) {
2080 pgraph_cat.warning()
2081 <<
"get_color() called on " << *
this <<
" which has no color set.\n";
2083 return LColor(1.0f, 1.0f, 1.0f, 1.0f);
2093 nassertr_always(!
is_empty(),
false);
2094 return node()->has_attrib(ColorScaleAttrib::get_class_slot());
2105 node()->clear_attrib(ColorScaleAttrib::get_class_slot());
2117 node()->get_attrib(ColorScaleAttrib::get_class_slot());
2118 if (attrib !=
nullptr) {
2119 priority = max(priority,
2120 node()->
get_state()->get_override(ColorScaleAttrib::get_class_slot()));
2125 LVecBase4 prev_color_scale = csa->
get_scale();
2126 LVecBase4 new_color_scale(prev_color_scale[0]*scale[0],
2127 prev_color_scale[1]*scale[1],
2128 prev_color_scale[2]*scale[2],
2129 prev_color_scale[3]*scale[3]);
2147 node()->get_attrib(ColorScaleAttrib::get_class_slot());
2148 if (attrib !=
nullptr) {
2149 priority = max(priority,
2150 node()->
get_state()->get_override(ColorScaleAttrib::get_class_slot()));
2189 node()->get_attrib(ColorScaleAttrib::get_class_slot());
2190 if (attrib !=
nullptr) {
2191 priority = max(priority,
2192 node()->
get_state()->get_override(ColorScaleAttrib::get_class_slot()));
2197 node()->
set_attrib(csa->set_scale(LVecBase4(sc[0], sc[1], sc[2], scale)), priority);
2201 node()->
set_attrib(ColorScaleAttrib::make(LVecBase4(1.0f, 1.0f, 1.0f, scale)), priority);
2215 node()->get_attrib(ColorScaleAttrib::get_class_slot());
2216 if (attrib !=
nullptr) {
2217 priority = max(priority,
2218 node()->
get_state()->get_override(ColorScaleAttrib::get_class_slot()));
2223 node()->
set_attrib(csa->set_scale(LVecBase4(scale, scale, scale, sc[3])), priority);
2227 node()->
set_attrib(ColorScaleAttrib::make(LVecBase4(scale, scale, scale, 1.0f)), priority);
2238 static const LVecBase4 ident_scale(1.0f, 1.0f, 1.0f, 1.0f);
2239 nassertr_always(!
is_empty(), ident_scale);
2241 node()->get_attrib(ColorScaleAttrib::get_class_slot());
2242 if (attrib !=
nullptr) {
2261 if (light_obj !=
nullptr) {
2264 node()->get_attrib(LightAttrib::get_class_slot());
2265 if (attrib !=
nullptr) {
2266 priority = max(priority,
2267 node()->
get_state()->get_override(LightAttrib::get_class_slot()));
2280 }
else if (light.
node()->
is_of_type(PolylightNode::get_class_type())) {
2282 if (priority != 0) {
2285 pgraph_cat.warning()
2286 <<
"Ignoring priority on set_light(" << light <<
")\n";
2290 node()->get_effect(PolylightEffect::get_class_type());
2291 if (effect !=
nullptr) {
2305 nassert_raise(
"Not a Light object.");
2339 if (light_obj !=
nullptr) {
2341 node()->get_attrib(LightAttrib::get_class_slot());
2342 if (attrib !=
nullptr) {
2343 priority = max(priority,
2344 node()->
get_state()->get_override(LightAttrib::get_class_slot()));
2361 nassert_raise(
"Not a Light object.");
2371 node()->clear_attrib(LightAttrib::get_class_slot());
2385 if (light_obj !=
nullptr) {
2387 node()->get_attrib(LightAttrib::get_class_slot());
2388 if (attrib !=
nullptr) {
2390 la = DCAST(
LightAttrib, la->remove_on_light(light));
2391 la = DCAST(
LightAttrib, la->remove_off_light(light));
2393 if (la->is_identity()) {
2394 node()->clear_attrib(LightAttrib::get_class_slot());
2397 int priority =
node()->get_state()->get_override(LightAttrib::get_class_slot());
2403 }
else if (light.
node()->
is_of_type(PolylightNode::get_class_type())) {
2405 node()->get_effect(PolylightEffect::get_class_type());
2406 if (effect !=
nullptr) {
2414 nassert_raise(
"Not a Light object.");
2424 nassertr_always(!
is_empty(),
false);
2428 if (light_obj !=
nullptr) {
2430 node()->get_attrib(LightAttrib::get_class_slot());
2431 if (attrib !=
nullptr) {
2437 }
else if (light.
node()->
is_of_type(PolylightNode::get_class_type())) {
2439 node()->get_effect(PolylightEffect::get_class_type());
2440 if (effect !=
nullptr) {
2442 return ple->has_light(light);
2447 nassert_raise(
"Not a Light object.");
2458 nassertr_always(!
is_empty(),
false);
2461 node()->get_attrib(LightAttrib::get_class_slot());
2462 if (attrib !=
nullptr) {
2480 nassertr_always(!
is_empty(),
false);
2483 if (light_obj !=
nullptr) {
2485 node()->get_attrib(LightAttrib::get_class_slot());
2486 if (attrib !=
nullptr) {
2492 nassert_raise(
"Not a Light object.");
2508 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2509 if (attrib !=
nullptr) {
2510 priority = max(priority,
2511 node()->
get_state()->get_override(ClipPlaneAttrib::get_class_slot()));
2524 nassert_raise(
"Not a PlaneNode object.");
2556 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2557 if (attrib !=
nullptr) {
2558 priority = max(priority,
2559 node()->
get_state()->get_override(ClipPlaneAttrib::get_class_slot()));
2575 nassert_raise(
"Not a PlaneNode object.");
2585 node()->clear_attrib(ClipPlaneAttrib::get_class_slot());
2597 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2598 if (attrib !=
nullptr) {
2603 if (la->is_identity()) {
2604 node()->clear_attrib(ClipPlaneAttrib::get_class_slot());
2607 int priority =
node()->get_state()->get_override(ClipPlaneAttrib::get_class_slot());
2613 nassert_raise(
"Not a PlaneNode object.");
2623 nassertr_always(!
is_empty(),
false);
2627 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2628 if (attrib !=
nullptr) {
2634 nassert_raise(
"Not a PlaneNode object.");
2645 nassertr_always(!
is_empty(),
false);
2648 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2649 if (attrib !=
nullptr) {
2664 nassertr_always(!
is_empty(),
false);
2667 node()->get_attrib(ClipPlaneAttrib::get_class_slot());
2668 if (attrib !=
nullptr) {
2673 nassert_raise(
"Not a PlaneNode object.");
2689 node()->get_effect(OccluderEffect::get_class_type());
2690 if (effect !=
nullptr) {
2703 nassert_raise(
"Not an OccluderNode object.");
2725 node()->get_effect(OccluderEffect::get_class_type());
2726 if (effect !=
nullptr) {
2730 if (la->is_identity()) {
2739 nassert_raise(
"Not an OccluderNode object.");
2749 nassertr_always(!
is_empty(),
false);
2753 node()->get_effect(OccluderEffect::get_class_type());
2754 if (effect !=
nullptr) {
2760 nassert_raise(
"Not an OccluderNode object.");
2772 set_scissor(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top) {
2773 set_effect(ScissorEffect::make_screen(LVecBase4(left, right, bottom, top)));
2796 const LPoint3 &c,
const LPoint3 &d) {
2797 set_effect(ScissorEffect::make_node(a, b, c, d));
2808 set_effect(ScissorEffect::make_node(a, b, other));
2820 const LPoint3 &a,
const LPoint3 &b,
2821 const LPoint3 &c,
const LPoint3 &d) {
2822 set_effect(ScissorEffect::make_node(a, b, c, d, other));
2843 return has_effect(ScissorEffect::get_class_type());
2864 set_bin(
const string &bin_name,
int draw_order,
int priority) {
2866 node()->
set_attrib(CullBinAttrib::make(bin_name, draw_order), priority);
2876 node()->clear_attrib(CullBinAttrib::get_class_slot());
2885 nassertr_always(!
is_empty(),
false);
2886 return node()->has_attrib(CullBinAttrib::get_class_slot());
2896 nassertr_always(!
is_empty(),
string());
2898 node()->get_attrib(CullBinAttrib::get_class_slot());
2899 if (attrib !=
nullptr) {
2914 nassertr_always(!
is_empty(),
false);
2916 node()->get_attrib(CullBinAttrib::get_class_slot());
2917 if (attrib !=
nullptr) {
2952 node()->get_attrib(TextureAttrib::get_class_slot());
2953 if (attrib !=
nullptr) {
2955 int sg_priority =
node()->get_state()->get_override(TextureAttrib::get_class_slot());
2958 node()->
set_attrib(tsa->add_on_stage(stage, tex, priority), sg_priority);
3002 node()->get_attrib(TextureAttrib::get_class_slot());
3003 if (attrib !=
nullptr) {
3005 int sg_priority =
node()->get_state()->get_override(TextureAttrib::get_class_slot());
3008 node()->
set_attrib(tsa->add_on_stage(stage, tex, sampler, priority), sg_priority);
3013 node()->
set_attrib(tsa->add_on_stage(stage, tex, sampler, priority));
3040 node()->get_attrib(TextureAttrib::get_class_slot());
3041 if (attrib !=
nullptr) {
3043 int sg_priority =
node()->get_state()->get_override(TextureAttrib::get_class_slot());
3048 node()->
set_attrib(tsa->add_off_stage(stage, priority), sg_priority);
3067 node()->clear_attrib(TextureAttrib::get_class_slot());
3078 node()->get_attrib(TextureAttrib::get_class_slot());
3079 if (attrib !=
nullptr) {
3084 if (tsa->is_identity()) {
3085 node()->clear_attrib(TextureAttrib::get_class_slot());
3088 int priority =
node()->get_state()->get_override(TextureAttrib::get_class_slot());
3113 nassertr_always(!
is_empty(),
false);
3116 node()->get_attrib(TextureAttrib::get_class_slot());
3117 if (attrib !=
nullptr) {
3133 nassertr_always(!
is_empty(),
false);
3135 node()->get_attrib(TextureAttrib::get_class_slot());
3136 if (attrib !=
nullptr) {
3152 nassertr_always(!
is_empty(),
false);
3155 node()->get_attrib(TextureAttrib::get_class_slot());
3156 if (attrib !=
nullptr) {
3174 nassertr_always(!
is_empty(),
nullptr);
3176 node()->get_attrib(TextureAttrib::get_class_slot());
3177 if (attrib !=
nullptr) {
3191 nassertr_always(!
is_empty(),
nullptr);
3193 node()->get_attrib(TextureAttrib::get_class_slot());
3194 if (attrib !=
nullptr) {
3211 nassertv(tex !=
nullptr);
3212 nassertv(new_tex !=
nullptr);
3214 r_replace_texture(
node(), tex, new_tex);
3242 node()->get_attrib(TextureAttrib::get_class_slot());
3253 set_shader(
const Shader *sha,
int priority) {
3257 node()->get_attrib(ShaderAttrib::get_class_slot());
3258 if (attrib !=
nullptr) {
3259 priority = max(priority,
3260 node()->
get_state()->get_override(ShaderAttrib::get_class_slot()));
3274 set_shader_off(
int priority) {
3275 set_shader(
nullptr, priority);
3282 set_shader_auto(
int priority) {
3286 node()->get_attrib(ShaderAttrib::get_class_slot());
3287 if (attrib !=
nullptr) {
3288 priority = max(priority,
3289 node()->
get_state()->get_override(ShaderAttrib::get_class_slot()));
3303 set_shader_auto(
BitMask32 shader_switch,
int priority) {
3307 node()->get_attrib(ShaderAttrib::get_class_slot());
3308 if (attrib !=
nullptr) {
3309 priority = max(priority,
3310 node()->
get_state()->get_override(ShaderAttrib::get_class_slot()));
3312 node()->
set_attrib(sa->set_shader_auto(shader_switch, priority));
3316 node()->
set_attrib(sa->set_shader_auto(shader_switch, priority));
3327 node()->get_attrib(ShaderAttrib::get_class_slot());
3328 if (attrib !=
nullptr) {
3338 get_shader()
const {
3339 nassertr_always(!
is_empty(),
nullptr);
3341 node()->get_attrib(ShaderAttrib::get_class_slot());
3342 if (attrib !=
nullptr) {
3344 return sa->get_shader();
3358 pnode->get_attrib(ShaderAttrib::get_class_slot());
3359 if (attrib !=
nullptr) {
3361 pnode->
set_attrib(sa->set_shader_input(inp));
3365 pnode->
set_attrib(sa->set_shader_input(inp));
3378 pnode->get_attrib(ShaderAttrib::get_class_slot());
3379 if (attrib !=
nullptr) {
3381 pnode->
set_attrib(sa->set_shader_input(move(inp)));
3385 pnode->
set_attrib(sa->set_shader_input(move(inp)));
3397 node()->get_attrib(ShaderAttrib::get_class_slot());
3398 if (attrib !=
nullptr) {
3400 return sa->get_shader_input(
id);
3414 node()->get_attrib(ShaderAttrib::get_class_slot());
3416 if (attrib !=
nullptr) {
3432 node()->get_attrib(ShaderAttrib::get_class_slot());
3433 if (attrib !=
nullptr) {
3449 node()->get_attrib(ShaderAttrib::get_class_slot());
3450 if (attrib !=
nullptr) {
3469 node()->get_attrib(TexMatrixAttrib::get_class_slot());
3470 if (attrib !=
nullptr) {
3488 node()->clear_attrib(TexMatrixAttrib::get_class_slot());
3499 node()->get_attrib(TexMatrixAttrib::get_class_slot());
3500 if (attrib !=
nullptr) {
3504 if (tma->is_empty()) {
3505 node()->clear_attrib(TexMatrixAttrib::get_class_slot());
3519 nassertr_always(!
is_empty(),
false);
3522 node()->get_attrib(TexMatrixAttrib::get_class_slot());
3523 if (attrib !=
nullptr) {
3525 return tma->has_stage(stage);
3538 nassertr_always(!
is_empty(),
nullptr);
3541 node()->get_attrib(TexMatrixAttrib::get_class_slot());
3542 if (attrib !=
nullptr) {
3544 return tma->get_transform(stage);
3547 return TransformState::make_identity();
3556 nassertv(_error_type == ET_ok && other._error_type == ET_ok);
3561 state->get_attrib(TexMatrixAttrib::get_class_slot());
3562 if (attrib !=
nullptr) {
3566 state = state->add_attrib(tma->add_stage(stage, transform));
3570 state = state->add_attrib(TexMatrixAttrib::make(stage, transform));
3580 CPT(
RenderState) new_state = rel_state->compose(state);
3584 node()->
set_attrib(new_state->get_attrib(TexMatrixAttrib::get_class_slot()));
3593 nassertr(_error_type == ET_ok && other._error_type == ET_ok, TransformState::make_identity());
3597 state->get_attrib(TexMatrixAttrib::get_class_slot());
3598 if (attrib !=
nullptr) {
3600 return tma->get_transform(stage);
3603 return TransformState::make_identity();
3611 set_tex_gen(
TextureStage *stage, RenderAttrib::TexGenMode mode,
int priority) {
3615 node()->get_attrib(TexGenAttrib::get_class_slot());
3619 if (attrib !=
nullptr) {
3620 priority = max(priority,
3621 node()->
get_state()->get_override(TextureAttrib::get_class_slot()));
3637 set_tex_gen(
TextureStage *stage, RenderAttrib::TexGenMode mode,
3638 const LTexCoord3 &constant_value,
int priority) {
3642 node()->get_attrib(TexGenAttrib::get_class_slot());
3646 if (attrib !=
nullptr) {
3647 priority = max(priority,
3648 node()->
get_state()->get_override(TextureAttrib::get_class_slot()));
3655 node()->
set_attrib(tga->add_stage(stage, mode, constant_value), priority);
3665 node()->clear_attrib(TexGenAttrib::get_class_slot());
3677 node()->get_attrib(TexGenAttrib::get_class_slot());
3678 if (attrib !=
nullptr) {
3682 if (tga->is_empty()) {
3683 node()->clear_attrib(TexGenAttrib::get_class_slot());
3697 nassertr_always(!
is_empty(),
false);
3700 node()->get_attrib(TexGenAttrib::get_class_slot());
3701 if (attrib !=
nullptr) {
3703 return tga->has_stage(stage);
3715 nassertr_always(!
is_empty(), TexGenAttrib::M_off);
3718 node()->get_attrib(TexGenAttrib::get_class_slot());
3719 if (attrib !=
nullptr) {
3721 return tga->get_mode(stage);
3724 return TexGenAttrib::M_off;
3744 node()->get_effect(TexProjectorEffect::get_class_type());
3748 if (effect !=
nullptr) {
3766 node()->get_effect(TexProjectorEffect::get_class_type());
3767 if (effect !=
nullptr) {
3771 if (tpe->is_empty()) {
3795 nassertr_always(!
is_empty(),
false);
3798 node()->get_effect(TexProjectorEffect::get_class_type());
3799 if (effect !=
nullptr) {
3801 return tpe->has_stage(stage);
3817 node()->get_effect(TexProjectorEffect::get_class_type());
3818 if (effect !=
nullptr) {
3820 return tpe->get_from(stage);
3836 node()->get_effect(TexProjectorEffect::get_class_type());
3837 if (effect !=
nullptr) {
3839 return tpe->get_to(stage);
3854 set_tex_gen(stage, TexGenAttrib::M_world_position);
3868 nassertr_always(!
is_empty(),
false);
3869 return r_has_vertex_column(
node(), name);
3879 InternalNames vertex_columns;
3880 r_find_all_vertex_columns(
node(), vertex_columns);
3883 InternalNames::iterator ti;
3884 for (ti = vertex_columns.begin(); ti != vertex_columns.end(); ++ti) {
3898 InternalNames vertex_columns;
3899 r_find_all_vertex_columns(
node(), vertex_columns);
3904 InternalNames::iterator ti;
3905 for (ti = vertex_columns.begin(); ti != vertex_columns.end(); ++ti) {
3921 InternalNames vertex_columns;
3922 r_find_all_vertex_columns(
node(), vertex_columns);
3924 CPT(
InternalName) texcoord_name = InternalName::get_texcoord();
3927 InternalNames::iterator ti;
3928 for (ti = vertex_columns.begin(); ti != vertex_columns.end(); ++ti) {
3929 if ((*ti)->get_top() == texcoord_name) {
3944 InternalNames vertex_columns;
3945 r_find_all_vertex_columns(
node(), vertex_columns);
3951 InternalNames::iterator ti;
3952 for (ti = vertex_columns.begin(); ti != vertex_columns.end(); ++ti) {
3954 if (name->
get_top() == texcoord_name) {
3961 if (glob.
matches(net_basename)) {
3976 nassertr_always(!
is_empty(),
nullptr);
3978 return r_find_texture(
node(), get_net_state(), glob);
3988 nassertr_always(!
is_empty(),
nullptr);
3989 return r_find_texture(
node(), stage);
3999 r_find_all_textures(
node(), get_net_state(), textures);
4002 Textures::iterator ti;
4003 for (ti = textures.begin(); ti != textures.end(); ++ti) {
4017 r_find_all_textures(
node(), get_net_state(), textures);
4022 Textures::iterator ti;
4023 for (ti = textures.begin(); ti != textures.end(); ++ti) {
4025 if (glob.
matches(texture->get_name())) {
4040 r_find_all_textures(
node(), stage, textures);
4043 Textures::iterator ti;
4044 for (ti = textures.begin(); ti != textures.end(); ++ti) {
4058 nassertr_always(!
is_empty(),
nullptr);
4060 return r_find_texture_stage(
node(), get_net_state(), glob);
4070 TextureStages texture_stages;
4071 r_find_all_texture_stages(
node(), get_net_state(), texture_stages);
4074 TextureStages::iterator ti;
4075 for (ti = texture_stages.begin(); ti != texture_stages.end(); ++ti) {
4091 r_unify_texture_stages(
node(), stage);
4102 TextureStages texture_stages;
4103 r_find_all_texture_stages(
node(), get_net_state(), texture_stages);
4108 TextureStages::iterator ti;
4109 for (ti = texture_stages.begin(); ti != texture_stages.end(); ++ti) {
4125 nassertr_always(!
is_empty(),
nullptr);
4127 return r_find_material(
node(), get_net_state(), glob);
4136 Materials materials;
4137 r_find_all_materials(
node(), get_net_state(), materials);
4140 Materials::iterator ti;
4141 for (ti = materials.begin(); ti != materials.end(); ++ti) {
4154 Materials materials;
4155 r_find_all_materials(
node(), get_net_state(), materials);
4160 Materials::iterator ti;
4161 for (ti = materials.begin(); ti != materials.end(); ++ti) {
4163 if (glob.
matches(material->get_name())) {
4180 nassertv(mat !=
nullptr);
4203 node()->clear_attrib(MaterialAttrib::get_class_slot());
4212 nassertr_always(!
is_empty(),
false);
4214 node()->get_attrib(MaterialAttrib::get_class_slot());
4215 if (attrib !=
nullptr) {
4232 get_material()
const {
4233 nassertr_always(!
is_empty(),
nullptr);
4235 node()->get_attrib(MaterialAttrib::get_class_slot());
4236 if (attrib !=
nullptr) {
4253 nassertv(mat !=
nullptr);
4254 nassertv(new_mat !=
nullptr);
4256 CPT(
RenderAttrib) new_attrib = MaterialAttrib::make(new_mat);
4290 node()->clear_attrib(FogAttrib::get_class_slot());
4301 nassertr_always(!
is_empty(),
false);
4303 node()->get_attrib(FogAttrib::get_class_slot());
4304 if (attrib !=
nullptr) {
4320 nassertr_always(!
is_empty(),
false);
4322 node()->get_attrib(FogAttrib::get_class_slot());
4323 if (attrib !=
nullptr) {
4339 nassertr_always(!
is_empty(),
nullptr);
4341 node()->get_attrib(FogAttrib::get_class_slot());
4342 if (attrib !=
nullptr) {
4358 node()->get_state()->get_attrib_def(rma);
4370 node()->get_state()->get_attrib_def(rma);
4383 node()->get_state()->get_attrib_def(rma);
4401 node()->get_state()->get_attrib_def(rma);
4417 node()->get_state()->get_attrib_def(rma);
4426 set_render_mode(RenderModeAttrib::Mode mode, PN_stdfloat thickness,
int priority) {
4429 node()->
set_attrib(RenderModeAttrib::make(mode, thickness), priority);
4439 node()->clear_attrib(RenderModeAttrib::get_class_slot());
4449 nassertr_always(!
is_empty(),
false);
4450 return node()->has_attrib(RenderModeAttrib::get_class_slot());
4459 nassertr_always(!
is_empty(), RenderModeAttrib::M_unchanged);
4461 node()->get_attrib(RenderModeAttrib::get_class_slot());
4462 if (attrib !=
nullptr) {
4467 return RenderModeAttrib::M_unchanged;
4476 nassertr_always(!
is_empty(), 0.0f);
4478 node()->get_attrib(RenderModeAttrib::get_class_slot());
4479 if (attrib !=
nullptr) {
4493 nassertr_always(!
is_empty(), 0.0f);
4495 node()->get_attrib(RenderModeAttrib::get_class_slot());
4496 if (attrib !=
nullptr) {
4513 CullFaceAttrib::Mode mode =
4515 CullFaceAttrib::M_cull_none :
4516 CullFaceAttrib::M_cull_clockwise;
4531 node()->clear_attrib(CullFaceAttrib::get_class_slot());
4541 nassertr_always(!
is_empty(),
false);
4542 return node()->has_attrib(CullFaceAttrib::get_class_slot());
4554 nassertr_always(!
is_empty(),
false);
4556 node()->get_attrib(CullFaceAttrib::get_class_slot());
4557 if (attrib !=
nullptr) {
4574 DepthTestAttrib::PandaCompareFunc mode =
4576 DepthTestAttrib::M_less :
4577 DepthTestAttrib::M_none;
4589 node()->clear_attrib(DepthTestAttrib::get_class_slot());
4599 nassertr_always(!
is_empty(),
false);
4600 return node()->has_attrib(DepthTestAttrib::get_class_slot());
4611 nassertr_always(!
is_empty(),
false);
4613 node()->get_attrib(DepthTestAttrib::get_class_slot());
4614 if (attrib !=
nullptr) {
4616 return (dta->
get_mode() != DepthTestAttrib::M_none);
4631 DepthWriteAttrib::Mode mode =
4633 DepthWriteAttrib::M_on :
4634 DepthWriteAttrib::M_off;
4646 node()->clear_attrib(DepthWriteAttrib::get_class_slot());
4656 nassertr_always(!
is_empty(),
false);
4657 return node()->has_attrib(DepthWriteAttrib::get_class_slot());
4668 nassertr_always(!
is_empty(),
false);
4670 node()->get_attrib(DepthWriteAttrib::get_class_slot());
4671 if (attrib !=
nullptr) {
4673 return (dta->
get_mode() != DepthWriteAttrib::M_off);
4702 node()->clear_attrib(DepthOffsetAttrib::get_class_slot());
4712 nassertr_always(!
is_empty(),
false);
4713 return node()->has_attrib(DepthOffsetAttrib::get_class_slot());
4724 node()->get_attrib(DepthOffsetAttrib::get_class_slot());
4725 if (attrib !=
nullptr) {
4743 const LMatrix4 &rel_mat = transform->
get_mat();
4745 LVector3 up = LVector3::up();
4746 LVector3 rel_pos = -rel_mat.get_row3(3);
4754 if (offset != 0.0f) {
4755 LVector3 translate = rel_mat.get_row3(3);
4756 translate.normalize();
4757 translate *= offset;
4773 const LMatrix4 &rel_mat = transform->
get_mat();
4775 LVector3 up = LVector3::up() * rel_mat;
4776 LVector3 rel_pos = LVector3::forward() * rel_mat;
4784 if (offset != 0.0f) {
4785 LVector3 translate = rel_mat.get_row3(3);
4786 translate.normalize();
4787 translate *= offset;
4802 const LMatrix4 &rel_mat = transform->
get_mat();
4804 LVector3 up = LVector3::up();
4805 LVector3 rel_pos = -rel_mat.get_row3(3);
4813 if (offset != 0.0f) {
4814 LVector3 translate = rel_mat.get_row3(3);
4815 translate.normalize();
4816 translate *= offset;
4830 (LVector3::up(),
false,
true,
4831 offset, camera, LPoint3(0.0f, 0.0f, 0.0f));
4844 (LVector3::up(),
true,
false,
4845 offset, camera, LPoint3(0.0f, 0.0f, 0.0f), fixed_depth);
4858 (LVector3::up(),
false,
false,
4859 offset, camera, LPoint3(0.0f, 0.0f, 0.0f));
4877 nassertr_always(!
is_empty(),
false);
4878 return node()->has_effect(BillboardEffect::get_class_type());
4906 nassertr_always(!
is_empty(),
false);
4907 return node()->has_effect(CompassEffect::get_class_type());
4931 node()->clear_attrib(TransparencyAttrib::get_class_slot());
4942 nassertr_always(!
is_empty(),
false);
4943 return node()->has_attrib(TransparencyAttrib::get_class_slot());
4956 nassertr_always(!
is_empty(), TransparencyAttrib::M_none);
4958 node()->get_attrib(TransparencyAttrib::get_class_slot());
4959 if (attrib !=
nullptr) {
4964 return TransparencyAttrib::M_none;
4975 set_logic_op(LogicOpAttrib::Operation op,
int priority) {
4991 node()->clear_attrib(LogicOpAttrib::get_class_slot());
5004 nassertr_always(!
is_empty(),
false);
5005 return node()->has_attrib(LogicOpAttrib::get_class_slot());
5020 nassertr_always(!
is_empty(), LogicOpAttrib::O_none);
5022 node()->get_attrib(LogicOpAttrib::get_class_slot());
5023 if (attrib !=
nullptr) {
5028 return LogicOpAttrib::O_none;
5049 node()->clear_attrib(AntialiasAttrib::get_class_slot());
5059 nassertr_always(!
is_empty(),
false);
5060 return node()->has_attrib(AntialiasAttrib::get_class_slot());
5069 nassertr_always(!
is_empty(), AntialiasAttrib::M_none);
5071 node()->get_attrib(AntialiasAttrib::get_class_slot());
5072 if (attrib !=
nullptr) {
5077 return AntialiasAttrib::M_none;
5087 nassertr_always(!
is_empty(),
false);
5088 return node()->has_attrib(AudioVolumeAttrib::get_class_slot());
5099 node()->clear_attrib(AudioVolumeAttrib::get_class_slot());
5110 node()->get_attrib(AudioVolumeAttrib::get_class_slot());
5111 if (attrib !=
nullptr) {
5112 priority = max(priority,
5113 node()->
get_state()->get_override(AudioVolumeAttrib::get_class_slot()));
5148 node()->get_attrib(AudioVolumeAttrib::get_class_slot());
5149 if (attrib !=
nullptr) {
5164 const RenderAttrib *attrib = net_state->get_attrib(AudioVolumeAttrib::get_class_slot());
5165 if (attrib !=
nullptr) {
5167 if (ava !=
nullptr) {
5187 comp = comp->
get_next(pipeline_stage, current_thread)) {
5192 result._head = comp;
5216 bool reparented = PandaNode::reparent(_head->get_next(pipeline_stage, current_thread),
5217 _head, sort,
true, pipeline_stage,
5219 nassertv(reparented);
5233 bool reparented = PandaNode::reparent(_head->get_next(pipeline_stage, current_thread),
5234 _head, sort,
false, pipeline_stage,
5236 nassertv(reparented);
5245 stashed_descendents.
unstash();
5257 if (comp !=
nullptr) {
5261 while (next !=
nullptr) {
5267 result._head = comp;
5272 next = next->
get_next(pipeline_stage, current_thread);
5285 return (other == *
this);
5293 return (other != *
this);
5304 return other.compare_to(*
this) > 0;
5319 return -other.compare_to(*
this);
5342 PStatTimer timer(_verify_complete_pcollector);
5345 nassertr(comp !=
nullptr,
false);
5350 nassertr(
node !=
nullptr,
false);
5351 int length = comp->
get_length(pipeline_stage, current_thread);
5353 comp = comp->
get_next(pipeline_stage, current_thread);
5355 while (comp !=
nullptr) {
5357 nassertr(next_node !=
nullptr,
false);
5360 pgraph_cat.warning()
5361 << *
this <<
" is incomplete; " << *
node <<
" is not a child of "
5362 << *next_node <<
"\n";
5366 if (comp->
get_length(pipeline_stage, current_thread) != length) {
5367 pgraph_cat.warning()
5368 << *
this <<
" is incomplete; length at " << *next_node
5369 <<
" indicates " << comp->
get_length(pipeline_stage, current_thread)
5370 <<
" while length at " << *
node <<
" indicates " << length <<
"\n";
5375 comp = comp->
get_next(pipeline_stage, current_thread);
5395 CPT(
RenderState) state = RenderState::make_empty();
5418 node()->prepare_scene(gsg, get_net_state());
5460 get_bounds(
Thread *current_thread)
const {
5477 force_recompute_bounds() {
5479 r_force_recompute_bounds(
node());
5488 get_bounds()->write(out);
5509 min_point.set(0.0f, 0.0f, 0.0f);
5510 max_point.set(0.0f, 0.0f, 0.0f);
5511 nassertr_always(!
is_empty(),
false);
5518 bool found_any =
false;
5519 node()->calc_tight_bounds(min_point, max_point, found_any,
5520 move(transform), current_thread);
5609 if (flatten_geoms) {
5637 if (flatten_geoms) {
5639 gr.
collect_vertex_data(
node(), ~(SceneGraphReducer::CVD_format | SceneGraphReducer::CVD_name | SceneGraphReducer::CVD_animation_type));
5664 gr.
apply_attribs(
node(), SceneGraphReducer::TT_apply_texture_color | SceneGraphReducer::TT_tex_matrix | SceneGraphReducer::TT_other);
5690 nassertr_always(!
is_empty(),
false);
5694 bool okflag =
false;
5714 nassertr_always(!
is_empty(),
false);
5718 bool okflag =
false;
5757 ostringstream stream;
5761 bool used_local_writer =
false;
5762 if (writer ==
nullptr) {
5768 writer = &local_writer;
5769 used_local_writer =
true;
5775 if (used_local_writer && num_nodes > 1) {
5798 for (
int i = 0; i < num_nodes; ++i) {
5800 nassertr(
node !=
nullptr,
false);
5823 if (reader ==
nullptr) {
5827 if (!buffer.
read_header(head, _bam_header.size())) {
5831 if (head != _bam_header) {
5835 reader = &local_reader;
5847 ErrorType error_type = (ErrorType)dgi.
get_uint8();
5849 if (num_nodes == 0) {
5851 result._error_type = error_type;
5855 for (
int i = 0; i < num_nodes; ++i) {
5858 if (
object ==
nullptr ||
5859 !object->
is_of_type(PandaNode::get_class_type())) {
5888 Thread *current_thread) {
5896 while (comp !=
nullptr && comp != source._head) {
5899 comp = comp->
get_next(pipeline_stage, current_thread);
5902 if (comp ==
nullptr) {
5910 for (it = nodes.rbegin(); it != nodes.rend(); ++it) {
5911 PandaNode::InstanceMap::const_iterator iit = inst_map.find(*it);
5912 nassertr_always(iit != inst_map.end(),
false);
5913 new_comp = PandaNode::get_component(new_comp, iit->second, pipeline_stage, current_thread);
5916 nassertr(new_comp !=
nullptr,
false);
5917 _head = std::move(new_comp);
5931 int &a_count,
int &b_count,
Thread *current_thread) {
5941 while (ac->
get_length(pipeline_stage, current_thread) > bc->
get_length(pipeline_stage, current_thread)) {
5942 nassertr(ac !=
nullptr,
nullptr);
5943 ac = ac->
get_next(pipeline_stage, current_thread);
5946 while (bc->
get_length(pipeline_stage, current_thread) > ac->
get_length(pipeline_stage, current_thread)) {
5947 nassertr(bc !=
nullptr,
nullptr);
5948 bc = bc->
get_next(pipeline_stage, current_thread);
5955 nassertr(ac !=
nullptr,
nullptr);
5956 nassertr(bc !=
nullptr,
nullptr);
5957 ac = ac->
get_next(pipeline_stage, current_thread);
5959 bc = bc->
get_next(pipeline_stage, current_thread);
5972 if (comp ==
nullptr) {
5973 return RenderState::make_empty();
5977 return r_get_net_state(comp->
get_next(pipeline_stage, current_thread), current_thread)->compose(state);
5988 Thread *current_thread)
const {
5989 if (n == 0 || comp ==
nullptr) {
5990 return RenderState::make_empty();
5994 return r_get_partial_state(comp->
get_next(pipeline_stage, current_thread), n - 1, current_thread)->compose(state);
6004 if (comp ==
nullptr) {
6005 return TransformState::make_identity();
6009 CPT(
TransformState) net_transform = r_get_net_transform(comp->
get_next(pipeline_stage, current_thread), current_thread);
6012 if (!node_cdata->_effects->has_adjust_transform()) {
6013 if (node_cdata->_transform->is_identity()) {
6014 return net_transform;
6016 return net_transform->compose(node_cdata->_transform);
6020 node_cdata->_effects->adjust_transform(net_transform, transform,
node);
6021 return net_transform->compose(transform);
6036 Thread *current_thread)
const {
6037 if (n == 0 || comp ==
nullptr) {
6038 return TransformState::make_identity();
6042 if (node_cdata->_effects->has_adjust_transform()) {
6046 CPT(
TransformState) partial = r_get_partial_transform(comp->
get_next(pipeline_stage, current_thread), n - 1, current_thread);
6047 if (partial ==
nullptr) {
6050 if (node_cdata->_transform->is_identity()) {
6053 return partial->compose(node_cdata->_transform);
6064 if (comp ==
nullptr) {
6065 return TransformState::make_identity();
6069 return r_get_net_prev_transform(comp->
get_next(pipeline_stage, current_thread), current_thread)->compose(transform);
6080 if (n == 0 || comp ==
nullptr) {
6081 return TransformState::make_identity();
6085 return r_get_partial_prev_transform(comp->
get_next(pipeline_stage, current_thread), n - 1, current_thread)->compose(transform);
6096 int max_matches)
const {
6098 pgraph_cat.warning()
6099 <<
"Attempt to extend an empty NodePath by '" << path
6105 find_matches(result, approx_path, max_matches);
6116 int max_matches)
const {
6118 pgraph_cat.warning()
6119 <<
"Attempt to extend an empty NodePath by: " << approx_path <<
".\n";
6126 nassertv(level->_node_path.
is_valid());
6128 find_matches(result, level, max_matches);
6137 int max_matches)
const {
6139 int num_levels_remaining = _max_search_depth;
6143 while (num_levels_remaining > 0 && level !=
nullptr) {
6144 if (pgraph_cat.is_spam()) {
6146 <<
"find_matches pass: " << result <<
", "
6147 << max_matches <<
", " << num_levels_remaining <<
"\n";
6151 num_levels_remaining--;
6158 while (entry !=
nullptr) {
6159 if (entry->
consider_node(result, next_level, max_matches, 0)) {
6163 while (entry !=
nullptr) {
6168 while (next_level !=
nullptr) {
6173 while (deleted_entries !=
nullptr) {
6175 delete deleted_entries;
6176 deleted_entries = next;
6186 entry->_next = deleted_entries;
6187 deleted_entries = entry;
6194 while (entry !=
nullptr) {
6196 entry->_next = deleted_entries;
6197 deleted_entries = entry;
6206 while (deleted_entries !=
nullptr) {
6208 delete deleted_entries;
6209 deleted_entries = next;
6223 DCAST_INTO_R(mnode,
node, count);
6230 for (
int i = 0; i < num_children; i++) {
6231 count += r_clear_model_nodes(cr.
get_child(i));
6242 r_adjust_all_priorities(
PandaNode *node,
int adjustment) {
6246 DCAST_INTO_V(gnode,
node);
6249 for (
int i = 0; i < num_geoms; i++) {
6256 for (
int i = 0; i < num_children; i++) {
6257 r_adjust_all_priorities(cr.
get_child(i), adjustment);
6265 r_force_recompute_bounds(
PandaNode *node) {
6268 DCAST_INTO_V(gnode,
node);
6271 for (
int i = 0; i < num_geoms; i++) {
6272 const Geom *geom = gnode->get_geom(i);
6273 geom->mark_bounds_stale();
6277 node->mark_bounds_stale();
6282 for (
int i = 0; i < num_children; i++) {
6283 r_force_recompute_bounds(cr.
get_child(i));
6297 into_collide_mask = (into_collide_mask & and_mask) | or_mask;
6303 for (
int i = 0; i < num_children; i++) {
6304 r_set_collide_mask(cr.
get_child(i), and_mask, or_mask, node_type);
6315 DCAST_INTO_R(gnode,
node,
false);
6318 for (
int i = 0; i < num_geoms; i++) {
6319 const Geom *geom = gnode->get_geom(i);
6321 if (vdata->has_column(name)) {
6330 for (
int i = 0; i < num_children; i++) {
6332 if (r_has_vertex_column(child, name)) {
6344 r_find_all_vertex_columns(
PandaNode *node,
6345 NodePath::InternalNames &vertex_columns)
const {
6348 DCAST_INTO_V(gnode,
node);
6351 for (
int i = 0; i < num_geoms; ++i) {
6352 const Geom *geom = gnode->get_geom(i);
6355 for (
int j = 0; j < num_arrays; ++j) {
6358 for (
int k = 0; k < num_columns; ++k) {
6360 vertex_columns.insert(column->
get_name());
6369 for (
int i = 0; i < num_children; i++) {
6371 r_find_all_vertex_columns(child, vertex_columns);
6383 DCAST_INTO_R(gnode,
node,
nullptr);
6386 for (
int i = 0; i < num_geoms; i++) {
6392 geom_state->get_attrib(TextureAttrib::get_class_slot());
6393 if (attrib !=
nullptr) {
6397 if (texture !=
nullptr) {
6398 if (glob.
matches(texture->get_name())) {
6410 for (
int i = 0; i < num_children; i++) {
6412 CPT(
RenderState) next_state = state->compose(child->get_state());
6414 Texture *result = r_find_texture(child, next_state, glob);
6415 if (result !=
nullptr) {
6428 NodePath::Textures &textures)
const {
6431 DCAST_INTO_V(gnode,
node);
6434 for (
int i = 0; i < num_geoms; i++) {
6440 geom_state->get_attrib(TextureAttrib::get_class_slot());
6441 if (attrib !=
nullptr) {
6445 if (texture !=
nullptr) {
6446 textures.insert(texture);
6456 for (
int i = 0; i < num_children; i++) {
6458 CPT(
RenderState) next_state = state->compose(child->get_state());
6459 r_find_all_textures(child, next_state, textures);
6470 node->get_attrib(TextureAttrib::get_class_slot());
6471 if (attrib !=
nullptr) {
6480 DCAST_INTO_R(gnode,
node,
nullptr);
6483 for (
int i = 0; i < num_geoms; i++) {
6488 geom_state->get_attrib(TextureAttrib::get_class_slot());
6489 if (attrib !=
nullptr) {
6501 for (
int i = 0; i < num_children; i++) {
6504 Texture *result = r_find_texture(child, stage);
6505 if (result !=
nullptr) {
6518 NodePath::Textures &textures)
const {
6521 node->get_attrib(TextureAttrib::get_class_slot());
6522 if (attrib !=
nullptr) {
6531 DCAST_INTO_V(gnode,
node);
6534 for (
int i = 0; i < num_geoms; i++) {
6539 geom_state->get_attrib(TextureAttrib::get_class_slot());
6540 if (attrib !=
nullptr) {
6552 for (
int i = 0; i < num_children; i++) {
6554 r_find_all_textures(child, stage, textures);
6568 if (node_state->get_attrib(ta)) {
6569 CPT(
RenderAttrib) new_ta = ta->replace_texture(tex, new_tex);
6579 DCAST_INTO_V(gnode,
node);
6582 for (
int i = 0; i < num_geoms; i++) {
6587 if (geom_state->get_attrib(ta)) {
6588 CPT(
RenderAttrib) new_ta = ta->replace_texture(tex, new_tex);
6599 for (
size_t i = 0; i < num_children; ++i) {
6601 r_replace_texture(child, tex, new_tex);
6613 DCAST_INTO_R(gnode,
node,
nullptr);
6616 for (
int i = 0; i < num_geoms; i++) {
6622 geom_state->get_attrib(TextureAttrib::get_class_slot());
6623 if (attrib !=
nullptr) {
6627 if (texture_stage !=
nullptr) {
6629 return texture_stage;
6640 for (
int i = 0; i < num_children; i++) {
6642 CPT(
RenderState) next_state = state->compose(child->get_state());
6644 TextureStage *result = r_find_texture_stage(child, next_state, glob);
6645 if (result !=
nullptr) {
6658 NodePath::TextureStages &texture_stages)
const {
6661 DCAST_INTO_V(gnode,
node);
6664 for (
int i = 0; i < num_geoms; i++) {
6670 geom_state->get_attrib(TextureAttrib::get_class_slot());
6671 if (attrib !=
nullptr) {
6675 if (texture_stage !=
nullptr) {
6676 texture_stages.insert(texture_stage);
6686 for (
int i = 0; i < num_children; i++) {
6688 CPT(
RenderState) next_state = state->compose(child->get_state());
6689 r_find_all_texture_stages(child, next_state, texture_stages);
6700 node->get_attrib(TextureAttrib::get_class_slot());
6701 if (attrib !=
nullptr) {
6703 CPT(
RenderAttrib) new_attrib = ta->unify_texture_stages(stage);
6704 if (new_attrib != ta) {
6711 DCAST_INTO_V(gnode,
node);
6714 for (
int i = 0; i < num_geoms; i++) {
6719 state->get_attrib(TextureAttrib::get_class_slot());
6720 if (attrib !=
nullptr) {
6722 CPT(
RenderAttrib) new_attrib = ta->unify_texture_stages(stage);
6723 if (new_attrib != ta) {
6724 CPT(
RenderState) new_state = state->add_attrib(new_attrib);
6734 for (
int i = 0; i < num_children; i++) {
6736 r_unify_texture_stages(child, stage);
6748 DCAST_INTO_R(gnode,
node,
nullptr);
6751 for (
int i = 0; i < num_geoms; i++) {
6757 geom_state->get_attrib(MaterialAttrib::get_class_slot());
6758 if (attrib !=
nullptr) {
6762 if (material !=
nullptr) {
6763 if (glob.
matches(material->get_name())) {
6775 for (
int i = 0; i < num_children; i++) {
6777 CPT(
RenderState) next_state = state->compose(child->get_state());
6779 Material *result = r_find_material(child, next_state, glob);
6780 if (result !=
nullptr) {
6793 NodePath::Materials &materials)
const {
6796 DCAST_INTO_V(gnode,
node);
6799 for (
int i = 0; i < num_geoms; i++) {
6805 geom_state->get_attrib(MaterialAttrib::get_class_slot());
6806 if (attrib !=
nullptr) {
6810 if (material !=
nullptr) {
6811 materials.insert(material);
6821 for (
int i = 0; i < num_children; i++) {
6823 CPT(
RenderState) next_state = state->compose(child->get_state());
6824 r_find_all_materials(child, next_state, materials);
6838 if (node_state->get_attrib(ma)) {
6848 DCAST_INTO_V(gnode,
node);
6851 for (
int i = 0; i < num_geoms; i++) {
6856 if (geom_state->get_attrib(ma)) {
6868 for (
size_t i = 0; i < num_children; ++i) {
6870 r_replace_material(child, mat, new_attrib);
6888 if (root ==
nullptr || root ==
node()) {
6900 while (comp !=
nullptr) {
6902 path.push_back(
node);
6908 comp = comp->
get_next(pipeline_stage, current_thread);
6911 if (comp ==
nullptr) {
6919 for (
int i = path.size() - 1; i >= 0; --i) {
6933 if (
node.is_null()) {
6946 nassertd(!comp.is_null()) {
6947 while (p_list[pi++]) {}
6952 while (p_list[pi] !=
nullptr) {
6960 PandaNode::Paths::const_iterator it;
6961 for (it =
node->_paths.begin(); it !=
node->_paths.end(); ++it) {
6962 if ((*it)->get_next(pipeline_stage, current_thread) == comp) {
6969 if (it ==
node->_paths.end()) {
6975 node->_paths.insert(comp);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Specifies whether or how to enable antialiasing, if supported by the backend renderer.
get_mode
Returns the specified antialias mode.
Applies a scale to audio volume for positional sounds in the scene graph.
get_volume
Returns the volume to be applied to sounds.
The principle public interface to reading and writing Bam disk files.
void close()
Closes the input or output stream.
bool open_write(const Filename &bam_filename, bool report_errors=true)
Attempts to open the indicated file for writing.
get_writer
Returns the BamWriter in charge of performing the write operations.
bool write_object(const TypedWritable *object)
Writes the indicated object to the Bam file.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
bool resolve()
This may be called at any time during processing of the Bam file to resolve all the known pointers so...
TypedWritable * read_object()
Reads a single object from the Bam file.
bool read_pointer(DatagramIterator &scan)
The interface for reading a pointer to another object from a Bam file.
set_source
Changes the source of future datagrams for this BamReader.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
bool write_object(const TypedWritable *obj)
Writes a single object to the Bam file, so that the BamReader::read_object() can later correctly rest...
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.
get_root_node
Returns the root node of the part of the scene graph we are currently writing out.
set_root_node
Sets the root node of the part of the scene graph we are currently writing out.
set_target
Changes the destination of future datagrams written by the BamWriter.
This defines a bounding sphere, consisting of a center and a radius.
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
This is a const pointer to an InternalName, and should be used in lieu of a CPT(InternalName) in func...
This functions similarly to a LightAttrib.
bool has_all_off() const
Returns true if this attrib disables all planes (although it may also enable some).
bool has_on_plane(const NodePath &plane) const
Returns true if the indicated plane is enabled by the attrib, false otherwise.
bool has_off_plane(const NodePath &plane) const
Returns true if the indicated plane is disabled by the attrib, false otherwise.
Indicates what color should be applied to renderable geometry.
get_color
If the type is T_flat or T_off, this returns the color that will be applied to geometry.
get_color_type
Returns the type of color specified by this ColorAttrib.
Applies a scale to colors in the scene graph and on vertices.
get_scale
Returns the scale to be applied to colors.
Assigns geometry to a particular bin by name.
get_draw_order
Returns the draw order this attribute specifies.
get_bin_name
Returns the name of the bin this attribute specifies.
Indicates which faces should be culled based on their vertex ordering.
get_actual_mode
Returns the actual culling mode, without considering the effects of the reverse flag.
This template class calls PipelineCycler::read_unlocked(), and then provides a transparent read-only ...
This class can be used to write a series of datagrams into a memory buffer.
bool read_header(std::string &header, size_t num_bytes)
Reads a sequence of bytes from the beginning of the datagram file.
virtual bool put_datagram(const Datagram &data) override
Writes the given datagram to the file.
virtual bool get_datagram(Datagram &data) override
Reads the next datagram from the file.
bool write_header(const std::string &header)
Writes a sequence of bytes to the beginning of the datagram file.
void swap_data(vector_uchar &other)
Swaps the data in the internal buffer with that of the other buffer.
A class to retrieve the individual data elements previously stored in a Datagram.
uint8_t get_uint8()
Extracts an unsigned 8-bit integer.
int32_t get_int32()
Extracts a signed 32-bit integer.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void add_int32(int32_t value)
Adds a signed 32-bit integer to the datagram.
void add_uint8(uint8_t value)
Adds an unsigned 8-bit integer to the datagram.
This is a special kind of attribute that instructs the graphics driver to apply an offset or bias to ...
get_offset
Returns the depth offset represented by this attrib.
Enables or disables writing to the depth buffer.
get_mode
Returns the depth write mode.
Enables or disables writing to the depth buffer.
get_mode
Returns the depth write mode.
The name of a file, such as a texture file or an Egg file.
This class is local to this package only; it doesn't get exported.
void write_level(std::ostream &out, int indent_level) const
Writes the entire level (a linked list of entries beginning at this entry).
bool consider_node(NodePathCollection &result, FindApproxLevelEntry *&next_level, int max_matches, int increment) const
Considers the node represented by the entry for matching the find path.
This class is local to this package only; it doesn't get exported.
void add_match_many(int flags)
Adds a component that will match a chain of zero or more consecutive nodes.
bool add_string(const std::string &str_path)
Adds a sequence of components separated by slashes, followed optionally by a semicolon and a sequence...
void add_match_pointer(PandaNode *pointer, int flags)
Adds a component that must match a particular node exactly, by pointer.
Applies a Fog to the geometry at and below this node.
get_fog
If the FogAttrib is not an 'off' FogAttrib, returns the fog that is associated.
bool is_off() const
Returns true if the FogAttrib is an 'off' FogAttrib, indicating that it should disable fog.
Specifies how atmospheric fog effects are applied to geometry.
A node that holds Geom objects, renderable pieces of geometry.
get_num_geoms
Returns the number of geoms in the node.
get_geom_state
Returns the RenderState associated with the nth geom of the node.
void set_geom_state(int n, const RenderState *state)
Changes the RenderState associated with the nth geom of the node.
This defines how a single column is interleaved within a vertex array stored within a Geom.
const InternalName * get_name() const
Returns the name of this particular data field, e.g.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
A container for geometry primitives.
This class can be used to test for string matches against standard Unix- shell filename globbing conv...
bool matches(const std::string &candidate) const
Returns true if the candidate string matches the pattern, false otherwise.
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
void add_name(const InternalName *name)
Adds a new InternalName to the collection.
Encodes a string name in a hash table, mapping it to a pointer.
int find_ancestor(const std::string &basename) const
Returns the index of the ancestor with the indicated basename, or -1 if no ancestor has that basename...
std::string get_net_basename(int n) const
Returns the basename of this name prefixed by the indicated number of ancestors.
const InternalName * get_top() const
Returns the oldest ancestor in the InternalName's chain, not counting the root.
get_name
Returns the complete name represented by the InternalName and all of its parents.
Indicates which set of lights should be considered "on" to illuminate geometry at this level and belo...
get_off_light
Returns the nth light turned off by the attribute, sorted in arbitrary (pointer) order.
bool has_all_off() const
Returns true if this attrib turns off all lights (although it may also turn some on).
get_num_off_lights
Returns the number of lights that are turned off by the attribute.
get_num_on_lights
Returns the number of lights that are turned on by the attribute.
bool has_off_light(const NodePath &light) const
Returns true if the indicated light is turned off by the attrib, false otherwise.
bool has_on_light(const NodePath &light) const
Returns true if the indicated light is turned on by the attrib, false otherwise.
get_on_light
Returns the nth light turned on by the attribute, sorted in render order.
Similar to MutexHolder, but for a light reentrant mutex.
The abstract interface to all kinds of lights.
If enabled, specifies that a custom logical operation be performed instead of any color blending.
get_operation
Returns the logic operation specified by this attribute.
Indicates which, if any, material should be applied to geometry.
bool is_off() const
Returns true if the MaterialAttrib is an 'off' MaterialAttrib, indicating that it should disable the ...
get_material
If the MaterialAttrib is not an 'off' MaterialAttrib, returns the material that is associated.
void add_material(Material *node_material)
Adds a new Material to the collection.
Defines the way an object appears in the presence of lighting.
This node is placed at key points within the scene graph to indicate the roots of "models": subtrees ...
void set_preserve_transform(PreserveTransform preserve_transform)
Sets the preserve_transform flag.
This is a set of zero or more NodePaths.
void unstash()
Unstashes all NodePaths in the collection.
void add_path(const NodePath &node_path)
Adds a new NodePath to the collection.
bool is_empty() const
Returns true if there are no NodePaths in the collection, false otherwise.
get_path
Returns the nth NodePath in the collection.
This is one component of a NodePath.
PandaNode * get_node() const
Returns the node referenced by this component.
bool is_top_node(int pipeline_stage, Thread *current_thread) const
Returns true if this component represents the top node in the path.
NodePathComponent * get_next(int pipeline_stage, Thread *current_thread) const
Returns the next component in the path.
int get_length(int pipeline_stage, Thread *current_thread) const
Returns the length of the path to this node.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
void stash(int sort=0, Thread *current_thread=Thread::get_current_thread())
Removes the referenced node (and the entire subgraph below this node) from the scene graph in any nor...
LogicOpAttrib::Operation get_logic_op() const
Returns the logical operation that has been specifically set on this node via set_logic_op(),...
void premunge_scene(GraphicsStateGuardianBase *gsg=nullptr)
Walks through the scene graph beginning at the bottom node, and internally adjusts any GeomVertexForm...
void set_x(PN_stdfloat x)
Sets the X component of the position transform, leaving other components untouched.
void clear_occluder()
Completely removes any occluders that may have been set via set_occluder() from this particular node.
void set_hpr_scale(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz)
Sets the rotation and scale components of the transform, leaving translation untouched.
void set_light(const NodePath &light, int priority=0)
Adds the indicated Light or PolylightNode to the list of lights that illuminate geometry at this node...
bool has_light_off() const
Returns true if all Lights have been specifically disabled on this particular node.
LPoint3 get_relative_point(const NodePath &other, const LVecBase3 &point) const
Given that the indicated point is in the coordinate system of the other node, returns the same point ...
NodePath copy_to(const NodePath &other, int sort=0, Thread *current_thread=Thread::get_current_thread()) const
Functions like instance_to(), except a deep copy is made of the referenced node and all of its descen...
void set_sz(PN_stdfloat sz)
Sets the z-scale component of the transform, leaving other components untouched.
void compose_color_scale(const LVecBase4 &scale, int priority=0)
multiplies the color scale component of the transform, with previous color scale leaving translation ...
bool has_depth_test() const
Returns true if a depth-test adjustment has been explicitly set on this particular node via set_depth...
get_ancestor
Returns the nth ancestor of the path, where 0 is the NodePath itself and get_num_nodes() - 1 is get_t...
void set_quat(const LQuaternion &quat)
Sets the rotation component of the transform, leaving translation and scale untouched.
get_children
Returns the set of all child nodes of the referenced node.
bool get_depth_test() const
Returns true if depth-test rendering has been specifically set on this node via set_depth_test(),...
void clear_two_sided()
Completely removes any two-sided adjustment that may have been set on this node via set_two_sided().
void set_alpha_scale(PN_stdfloat scale, int priority=0)
Sets the alpha scale component of the transform without (much) affecting the color scale.
void set_scissor(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top)
Sets up a scissor region on the nodes rendered at this level and below.
LVector3 get_pos_delta() const
Returns the delta vector from this node's position in the previous frame (according to set_prev_trans...
bool get_depth_write() const
Returns true if depth-write rendering has been specifically set on this node via set_depth_write(),...
void show_bounds()
Causes the bounding volume of the bottom node and all of its descendants (that is,...
void clear_clip_plane()
Completely removes any clip planes that may have been set via set_clip_plane() or set_clip_plane_off(...
void set_audio_volume_off(int priority=0)
Disables any audio volume attribute inherited from above.
bool has_texture_off() const
Returns true if texturing has been specifically disabled on this particular node via set_texture_off(...
void do_billboard_point_eye(const NodePath &camera, PN_stdfloat offset)
Performs a billboard-type rotate to the indicated camera node, one time only, and leaves the object r...
bool verify_complete(Thread *current_thread=Thread::get_current_thread()) const
Returns true if all of the nodes described in the NodePath are connected, or false otherwise.
void clear_depth_test()
Completely removes any depth-test adjustment that may have been set on this node via set_depth_test()...
bool has_transparency() const
Returns true if a transparent-rendering adjustment has been explicitly set on this particular node vi...
void clear_depth_write()
Completely removes any depth-write adjustment that may have been set on this node via set_depth_write...
NodePath find_path_to(PandaNode *node) const
Searches for the indicated node below this node and returns the shortest NodePath that connects them.
void do_billboard_axis(const NodePath &camera, PN_stdfloat offset)
Performs a billboard-type rotate to the indicated camera node, one time only, and leaves the object r...
void set_billboard_point_eye(PN_stdfloat offset=0.0, bool fixed_depth=false)
Puts a billboard transition on the node such that it will rotate in three dimensions about the origin...
bool operator<(const NodePath &other) const
Returns true if this NodePath sorts before the other one, false otherwise.
bool has_vertex_column(const InternalName *name) const
Returns true if there are at least some vertices at this node and below that contain a reference to t...
static NodePath not_found()
Creates a NodePath with the ET_not_found error type set.
void clear_tex_gen()
Removes the texture coordinate generation mode from all texture stages on this node.
void set_depth_write(bool depth_write, int priority=0)
Specifically sets or disables the writing to the depth buffer on this particular node.
void set_occluder(const NodePath &occluder)
Adds the indicated occluder to the list of occluders that apply to geometry at this node and below.
void set_sy(PN_stdfloat sy)
Sets the y-scale component of the transform, leaving other components untouched.
RenderModeAttrib::Mode get_render_mode() const
Returns the render mode that has been specifically set on this node via set_render_mode(),...
RenderAttrib::TexGenMode get_tex_gen(TextureStage *stage) const
Returns the texture coordinate generation mode for the given stage, or M_off if there is no explicit ...
bool has_light(const NodePath &light) const
Returns true if the indicated Light or PolylightNode has been specifically enabled on this particular...
bool has_audio_volume() const
Returns true if an audio volume has been applied to the referenced node, false otherwise.
int flatten_light()
Analyzes the geometry below this node and reports the number of vertices, triangles,...
void set_pos_quat_scale(const LVecBase3 &pos, const LQuaternion &quat, const LVecBase3 &scale)
Replaces the translation, rotation, and scale components, implicitly setting shear to 0.
void wrt_reparent_to(const NodePath &other, int sort=0, Thread *current_thread=Thread::get_current_thread())
This functions identically to reparent_to(), except the transform on this node is also adjusted so th...
LVecBase3 get_hpr() const
Retrieves the rotation component of the transform.
void set_mat(const LMatrix4 &mat)
Directly sets an arbitrary 4x4 transform matrix.
void project_texture(TextureStage *stage, Texture *tex, const NodePath &projector)
A convenience function to enable projective texturing at this node level and below,...
void output(std::ostream &out) const
Writes a sensible description of the NodePath to the indicated output stream.
void set_pos_quat_scale_shear(const LVecBase3 &pos, const LQuaternion &quat, const LVecBase3 &scale, const LVecBase3 &shear)
Completely replaces the transform with new translation, rotation, scale, and shear components.
void show_tight_bounds()
Similar to show_bounds(), this draws a bounding box representing the "tight" bounds of this node and ...
LPoint3 get_pos() const
Retrieves the translation component of the transform.
int flatten_medium()
A more thorough flattening than flatten_light(), this first applies all the transforms,...
void set_clip_plane(const NodePath &clip_plane, int priority=0)
Adds the indicated clipping plane to the list of planes that apply to geometry at this node and below...
NodePath find(const std::string &path) const
Searches for a node below the referenced node that matches the indicated string.
void clear_depth_offset()
Completely removes any depth-offset adjustment that may have been set on this node via set_depth_offs...
void prepare_scene(GraphicsStateGuardianBase *gsg)
Walks through the scene graph beginning at the bottom node, and does whatever initialization is requi...
const TransformState * get_prev_transform(Thread *current_thread=Thread::get_current_thread()) const
Returns the transform that has been set as this node's "previous" position.
void set_depth_offset(int bias, int priority=0)
This instructs the graphics driver to apply an offset or bias to the generated depth values for rende...
void look_at(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Sets the transform on this NodePath so that it rotates to face the indicated point in space.
void hide_bounds()
Stops the rendering of the bounding volume begun with show_bounds().
bool has_fog_off() const
Returns true if a fog has been specifically disabled on this particular node via set_fog_off(),...
InternalNameCollection find_all_vertex_columns() const
Returns a list of all vertex array columns stored on some geometry found at this node level and below...
Texture * get_texture() const
Returns the base-level texture that has been set on this particular node, or NULL if no texture has b...
void replace_texture(Texture *tex, Texture *new_tex)
Recursively searches the scene graph for references to the given texture, and replaces them with the ...
PN_stdfloat get_render_mode_thickness() const
Returns the render mode thickness that has been specifically set on this node via set_render_mode(),...
void set_texture(Texture *tex, int priority=0)
Adds the indicated texture to the list of textures that will be rendered on the default texture stage...
LVecBase3 get_shear() const
Retrieves the shear component of the transform.
LVecBase3 get_scale() const
Retrieves the scale component of the transform.
bool has_logic_op() const
Returns true if a logical operation has been explicitly set on this particular node via set_logic_op(...
void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is called by make_from_bam to read in all of the relevant data from the BamFil...
bool has_effect(TypeHandle type) const
Returns true if there is a render effect of the indicated type defined on this node,...
void remove_node(Thread *current_thread=Thread::get_current_thread())
Disconnects the referenced node from the scene graph.
LVector3 get_relative_vector(const NodePath &other, const LVecBase3 &vec) const
Given that the indicated vector is in the coordinate system of the other node, returns the same vecto...
void set_z(PN_stdfloat z)
Sets the Z component of the position transform, leaving other components untouched.
NodePath get_tex_projector_from(TextureStage *stage) const
Returns the "from" node associated with the TexProjectorEffect on the indicated stage.
bool has_bin() const
Returns true if the node has been assigned to the a particular rendering bin via set_bin(),...
void set_tex_transform(TextureStage *stage, const TransformState *transform)
Sets the texture matrix on the current node to the indicated transform for the given stage.
void set_antialias(unsigned short mode, int priority=0)
Specifies the antialiasing type that should be applied at this node and below.
void set_pos_hpr_scale(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz)
Completely replaces the transform with new translation, rotation, and scale components.
void clear_color()
Completely removes any color adjustment from the node.
bool operator!=(const NodePath &other) const
Returns true if the two paths are not equivalent.
bool has_tex_projector(TextureStage *stage) const
Returns true if this node has a TexProjectorEffect for the indicated stage, false otherwise.
bool is_empty() const
Returns true if the NodePath contains no nodes.
void set_fog_off(int priority=0)
Sets the geometry at this level and below to render using no fog.
bool has_clip_plane_off() const
Returns true if all clipping planes have been specifically disabled on this particular node.
InternalNameCollection find_all_texcoords() const
Returns a list of all texture coordinate sets used by any geometry at this node level and below.
void clear_billboard()
Removes any billboard effect from the node.
void set_sx(PN_stdfloat sx)
Sets the x-scale component of the transform, leaving other components untouched.
bool has_depth_offset() const
Returns true if a depth-offset adjustment has been explicitly set on this particular node via set_dep...
void set_logic_op(LogicOpAttrib::Operation op, int priority=0)
Specifically sets or disables a logical operation on this particular node.
void do_billboard_point_world(const NodePath &camera, PN_stdfloat offset)
Performs a billboard-type rotate to the indicated camera node, one time only, and leaves the object r...
get_node
Returns the nth node of the path, where 0 is the referenced (bottom) node and get_num_nodes() - 1 is ...
bool has_color() const
Returns true if a color has been applied to the given node, false otherwise.
void reverse_ls() const
Lists the hierarchy at and above the referenced node.
void set_compass(const NodePath &reference=NodePath())
Puts a compass effect on the node, so that it will retain a fixed rotation relative to the reference ...
int get_bin_draw_order() const
Returns the drawing order associated with the bin that this particular node was assigned to via set_b...
TextureStageCollection find_all_texture_stages() const
Returns a list of a TextureStages applied to geometry at this node and below.
const SamplerState & get_texture_sampler() const
Returns the sampler state that has been given for the base-level texture that has been set on this pa...
void set_clip_plane_off(int priority=0)
Sets the geometry at this level and below to render using no clip_planes at all.
Texture * find_texture(const std::string &name) const
Returns the first texture found applied to geometry at this node or below that matches the indicated ...
void set_fluid_pos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Sets the translation component, without changing the "previous" position, so that the collision syste...
get_num_nodes
Returns the number of nodes in the path.
int complete_pointers(TypedWritable **plist, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
bool has_texture() const
Returns true if a texture has been applied to this particular node via set_texture(),...
bool has_depth_write() const
Returns true if a depth-write adjustment has been explicitly set on this particular node via set_dept...
void clear_logic_op()
Completely removes any logical operation that may have been set on this node via set_logic_op().
const LMatrix4 & get_mat() const
Returns the transform matrix that has been applied to the referenced node, or the identity matrix if ...
NodePathCollection find_all_matches(const std::string &path) const
Returns the complete set of all NodePaths that begin with this NodePath and can be extended by path.
void clear_light()
Completely removes any lighting operations that may have been set via set_light() or set_light_off() ...
bool is_stashed() const
Returns true if the referenced node is stashed either directly, or because some ancestor is stashed.
void clear_material()
Completely removes any material adjustment that may have been set via set_material() from this partic...
PandaNode * node() const
Returns the referenced node of the path.
Material * find_material(const std::string &name) const
Returns the first material found applied to geometry at this node or below that matches the indicated...
void clear_texture()
Completely removes any texture adjustment that may have been set via set_texture() or set_texture_off...
void unify_texture_stages(TextureStage *stage)
Searches through all TextureStages at this node and below.
bool has_render_mode() const
Returns true if a render mode has been explicitly set on this particular node via set_render_mode() (...
bool has_scissor() const
Returns true if a scissor region was defined at this node by a previous call to set_scissor().
const LVecBase4 & get_color_scale() const
Returns the complete color scale vector that has been applied to this node via a previous call to set...
void clear_render_mode()
Completely removes any render mode adjustment that may have been set on this node via set_render_mode...
void reparent_to(const NodePath &other, int sort=0, Thread *current_thread=Thread::get_current_thread())
Removes the referenced node of the NodePath from its current parent and attaches it to the referenced...
NodePath()
This constructs an empty NodePath with no nodes.
bool has_fog() const
Returns true if a fog has been applied to this particular node via set_fog(), false otherwise.
void set_tex_projector(TextureStage *stage, const NodePath &from, const NodePath &to, int lens_index=0)
Establishes a TexProjectorEffect on this node, which can be used to establish projective texturing (b...
bool has_billboard() const
Returns true if there is any billboard effect on the node.
void set_effect(const RenderEffect *effect)
Adds the indicated render effect to the scene graph on this node.
bool has_clip_plane(const NodePath &clip_plane) const
Returns true if the indicated clipping plane has been specifically applied to this particular node.
std::string get_bin_name() const
Returns the name of the bin that this particular node was assigned to via set_bin(),...
void set_pos_quat(const LVecBase3 &pos, const LQuaternion &quat)
Sets the translation and rotation component of the transform, leaving scale untouched.
void set_material(Material *tex, int priority=0)
Sets the geometry at this level and below to render using the indicated material.
int get_instance_count() const
Returns the geometry instance count, or 0 if disabled.
void set_render_mode_filled_wireframe(const LColor &wireframe_color, int priority=0)
Sets up the geometry at this level and below (unless overridden) to render in filled,...
void set_audio_volume(PN_stdfloat volume, int priority=0)
Sets the audio volume component of the transform.
void unstash(int sort=0, Thread *current_thread=Thread::get_current_thread())
Undoes the effect of a previous stash() on this node: makes the referenced node (and the entire subgr...
bool calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point, const NodePath &other=NodePath(), Thread *current_thread=Thread::get_current_thread()) const
Calculates the minimum and maximum vertices of all Geoms at this NodePath's bottom node and below.
bool has_two_sided() const
Returns true if a two-sided adjustment has been explicitly set on this particular node via set_two_si...
void clear_compass()
Removes any compass effect from the node.
bool write_bam_file(const Filename &filename) const
Writes the contents of this node and below out to a bam file with the indicated filename.
int compare_to(const NodePath &other) const
Returns a number less than zero if this NodePath sorts before the other one, greater than zero if it ...
vector_uchar encode_to_bam_stream() const
Converts the NodePath object into a single stream of data using a BamWriter, and returns that data as...
bool has_occluder(const NodePath &occluder) const
Returns true if the indicated occluder has been specifically applied to this particular node.
get_sort
Returns the sort value of the referenced node within its parent; that is, the sort number passed on t...
void set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a=1.0, int priority=0)
Applies a scene-graph color to the referenced node.
bool get_render_mode_perspective() const
Returns the flag that has been set on this node via set_render_mode_perspective(),...
LColor get_color() const
Returns the color that has been assigned to the node, or black if no color has been assigned.
LQuaternion get_quat() const
Retrieves the rotation component of the transform.
NodePath find_net_tag(const std::string &key) const
Returns the lowest ancestor of this node that contains a tag definition with the indicated key,...
void clear_antialias()
Completely removes any antialias setting that may have been set on this node via set_antialias().
bool has_tex_transform(TextureStage *stage) const
Returns true if there is an explicit texture matrix on the current node for the given stage.
void set_texture_off(int priority=0)
Sets the geometry at this level and below to render using no texture, on any stage.
bool operator==(const NodePath &other) const
Returns true if the two paths are equivalent; that is, if they contain the same list of nodes in the ...
void set_state(const RenderState *state, Thread *current_thread=Thread::get_current_thread())
Changes the complete state object on this node.
void set_depth_test(bool depth_test, int priority=0)
Specifically sets or disables the testing of the depth buffer on this particular node.
bool has_antialias() const
Returns true if an antialias setting has been explicitly mode on this particular node via set_antiali...
int get_depth_offset() const
Returns the depth offset value if it has been specified using set_depth_offset, or 0 if not.
NodePathCollection find_all_paths_to(PandaNode *node) const
Returns the set of all NodePaths that extend from this NodePath down to the indicated node.
void set_pos_hpr_scale_shear(const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale, const LVecBase3 &shear)
Completely replaces the transform with new translation, rotation, scale, and shear components.
bool is_singleton(Thread *current_thread=Thread::get_current_thread()) const
Returns true if the NodePath contains exactly one node.
const RenderState * get_state(Thread *current_thread=Thread::get_current_thread()) const
Returns the complete state object set on this node.
void set_fog(Fog *fog, int priority=0)
Sets the geometry at this level and below to render using the indicated fog.
TextureCollection find_all_textures() const
Returns a list of a textures applied to geometry at this node and below.
static NodePath decode_from_bam_stream(vector_uchar data, BamReader *reader=nullptr)
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the N...
void clear_fog()
Completely removes any fog adjustment that may have been set via set_fog() or set_fog_off() from this...
void heads_up(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Behaves like look_at(), but with a strong preference to keeping the up vector oriented in the indicat...
void set_color_scale_off(int priority=0)
Disables any color scale attribute inherited from above.
void set_shear(PN_stdfloat shxy, PN_stdfloat shxz, PN_stdfloat shyz)
Sets the shear component of the transform, leaving translation, rotation, and scale untouched.
bool has_material() const
Returns true if a material has been applied to this particular node via set_material(),...
void clear_bin()
Completely removes any bin adjustment that may have been set via set_bin() from this particular node.
bool has_tex_gen(TextureStage *stage) const
Returns true if there is a mode for automatic texture coordinate generation on the current node for t...
NodePath get_top(Thread *current_thread=Thread::get_current_thread()) const
Returns a singleton NodePath that represents the top of the path, or empty NodePath if this path is e...
void clear_scissor()
Removes the scissor region that was defined at this node level by a previous call to set_scissor().
void clear_transparency()
Completely removes any transparency adjustment that may have been set on this node via set_transparen...
NodePath attach_new_node(PandaNode *node, int sort=0, Thread *current_thread=Thread::get_current_thread()) const
Attaches a new node, with or without existing parents, to the scene graph below the referenced node o...
void unstash_all(Thread *current_thread=Thread::get_current_thread())
Unstashes this node and all stashed child nodes.
void stash_to(const NodePath &other, int sort=0, Thread *current_thread=Thread::get_current_thread())
Similar to reparent_to(), but the node is added to its new parent's stashed list, so that the result ...
has_parent
Returns true if the referenced node has a parent; i.e.
void set_billboard_axis(PN_stdfloat offset=0.0)
Puts a billboard transition on the node such that it will rotate in two dimensions around the up axis...
bool write_bam_stream(std::ostream &out) const
Writes the contents of this node and below out to the indicated stream.
get_parent
Returns the NodePath to the parent of the referenced node: that is, this NodePath,...
void set_material_off(int priority=0)
Sets the geometry at this level and below to render using no material.
void set_all_color_scale(PN_stdfloat scale, int priority=0)
Scales all the color components of the object by the same amount, darkening the object,...
void set_pos_hpr(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r)
Sets the translation and rotation component of the transform, leaving scale untouched.
static NodePath fail()
Creates a NodePath with the ET_fail error type set.
const TransformState * get_transform(Thread *current_thread=Thread::get_current_thread()) const
Returns the complete transform object set on this node.
void set_bin(const std::string &bin_name, int draw_order, int priority=0)
Assigns the geometry at this level and below to the named rendering bin.
bool has_compass() const
Returns true if there is any compass effect on the node.
void clear_tex_transform()
Removes all texture matrices from the current node.
void set_scale(PN_stdfloat scale)
Sets the scale component of the transform, leaving translation and rotation untouched.
void apply_texture_colors()
Removes textures from Geoms at this node and below by applying the texture colors to the vertices.
void set_render_mode(RenderModeAttrib::Mode mode, PN_stdfloat thickness, int priority=0)
Sets up the geometry at this level and below (unless overridden) to render in the specified mode and ...
MaterialCollection find_all_materials() const
Returns a list of a materials applied to geometry at this node and below.
static NodePath removed()
Creates a NodePath with the ET_removed error type set.
void detach_node(Thread *current_thread=Thread::get_current_thread())
Disconnects the referenced node from its parent, but does not immediately delete it.
void set_two_sided(bool two_sided, int priority=0)
Specifically sets or disables two-sided rendering mode on this particular node.
Fog * get_fog() const
Returns the fog that has been set on this particular node, or NULL if no fog has been set.
PN_stdfloat get_net_audio_volume() const
Returns the complete audio volume for this node taking highers nodes in the graph into account.
void set_render_mode_wireframe(int priority=0)
Sets up the geometry at this level and below (unless overridden) to render in wireframe mode.
void set_quat_scale(const LQuaternion &quat, const LVecBase3 &scale)
Sets the rotation and scale components of the transform, leaving translation untouched.
void clear_color_scale()
Completely removes any color scale from the referenced node.
void set_render_mode_thickness(PN_stdfloat thickness, int priority=0)
Sets up the point geometry at this level and below to render as thick points (that is,...
void clear_tex_projector()
Removes the TexProjectorEffect for all stages from this node.
void set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r)
Sets the rotation component of the transform, leaving translation and scale untouched.
bool has_tag(const std::string &key) const
Returns true if a value has been defined on this node for the particular key (even if that value is t...
void set_instance_count(int instance_count)
Sets the geometry instance count, or 0 if geometry instancing should be disabled.
void set_y(PN_stdfloat y)
Sets the Y component of the position transform, leaving other components untouched.
void clear_audio_volume()
Completely removes any audio volume from the referenced node.
void set_billboard_point_world(PN_stdfloat offset=0.0)
Puts a billboard transition on the node such that it will rotate in three dimensions about the origin...
NodePath instance_under_node(const NodePath &other, const std::string &name, int sort=0, Thread *current_thread=Thread::get_current_thread()) const
Behaves like instance_to(), but implicitly creates a new node to instance the geometry under,...
void set_render_mode_filled(int priority=0)
Sets up the geometry at this level and below (unless overridden) to render in filled (i....
NodePath get_tex_projector_to(TextureStage *stage) const
Returns the "to" node associated with the TexProjectorEffect on the indicated stage.
NodePath instance_to(const NodePath &other, int sort=0, Thread *current_thread=Thread::get_current_thread()) const
Adds the referenced node of the NodePath as a child of the referenced node of the indicated other Nod...
void set_transparency(TransparencyAttrib::Mode mode, int priority=0)
Specifically sets or disables transparent rendering mode on this particular node.
bool get_two_sided() const
Returns true if two-sided rendering has been specifically set on this node via set_two_sided(),...
int get_key() const
Returns an integer that is guaranteed to be the same for all NodePaths that represent the same node i...
void clear_effect(TypeHandle type)
Removes the render effect of the given type from this node.
bool has_color_scale() const
Returns true if a color scale has been applied to the referenced node, false otherwise.
int flatten_strong()
The strongest possible flattening.
TransparencyAttrib::Mode get_transparency() const
Returns the transparent rendering that has been specifically set on this node via set_transparency(),...
TextureStage * find_texture_stage(const std::string &name) const
Returns the first TextureStage found applied to geometry at this node or below that matches the indic...
void set_color_off(int priority=0)
Sets the geometry at this level and below to render using the geometry color.
PN_stdfloat get_audio_volume() const
Returns the complete audio volume that has been applied to this node via a previous call to set_audio...
void set_render_mode_perspective(bool perspective, int priority=0)
Sets up the point geometry at this level and below to render as perspective sprites (that is,...
unsigned short get_antialias() const
Returns the antialias setting that has been specifically set on this node via set_antialias(),...
get_stashed_children
Returns the set of all child nodes of the referenced node that have been stashed.
void set_color_scale(const LVecBase4 &scale, int priority=0)
Sets the color scale component of the transform, leaving translation and rotation untouched.
void write_datagram(BamWriter *manager, Datagram &dg) const
Writes the contents of this object to the datagram for shipping out to a Bam file.
NodePath get_stashed_ancestor(Thread *current_thread=Thread::get_current_thread()) const
Returns the NodePath at or above the referenced node that is stashed, or an empty NodePath if no ance...
NodePath get_hidden_ancestor(DrawMask camera_mask=PandaNode::get_overall_bit(), Thread *current_thread=Thread::get_current_thread()) const
Returns the NodePath at or above the referenced node that is hidden to the indicated camera(s),...
void set_transform(const TransformState *transform, Thread *current_thread=Thread::get_current_thread())
Changes the complete transform object on this node.
void write_bounds(std::ostream &out) const
Writes a description of the bounding volume containing the bottom node and all of its descendants to ...
void set_light_off(int priority=0)
Sets the geometry at this level and below to render using no lights at all.
This functions similarly to a LightAttrib or ClipPlaneAttrib.
bool has_on_occluder(const NodePath &occluder) const
Returns true if the indicated occluder is enabled by the effect, false otherwise.
A lightweight class that represents a single element that may be timed and/or counted via stats.
A lightweight class that can be used to automatically start and stop a PStatCollector around a sectio...
PandaNode * get_child(size_t n) const
Returns the nth child of the node.
size_t get_num_children() const
Returns the number of children of the node.
A basic node of the scene graph or data graph.
get_draw_control_mask
Returns the set of bits in draw_show_mask that are considered meaningful.
virtual bool is_geom_node() const
A simple downcast check.
void reset_prev_transform(Thread *current_thread=Thread::get_current_thread())
Resets the transform that represents this node's "previous" position to the same as the current trans...
void clear_effect(TypeHandle type)
Removes the render effect of the given type from this node.
is_overall_hidden
Returns true if the node has been hidden to all cameras by clearing its overall bit.
int find_stashed(PandaNode *node, Thread *current_thread=Thread::get_current_thread()) const
Returns the index of the indicated stashed node, if it is a stashed child, or -1 if it is not.
int find_child(PandaNode *node, Thread *current_thread=Thread::get_current_thread()) const
Returns the index of the indicated child node, if it is a child, or -1 if it is not.
get_into_collide_mask
Returns the "into" collide mask for this node.
get_num_stashed
Returns the number of stashed nodes this node has.
get_draw_show_mask
Returns the hide/show bits of this particular node.
set_state
Sets the complete RenderState that will be applied to all nodes at this level and below.
void set_effect(const RenderEffect *effect)
Adds the indicated render effect to the scene graph on this node.
int find_parent(PandaNode *node, Thread *current_thread=Thread::get_current_thread()) const
Returns the index of the indicated parent node, if it is a parent, or -1 if it is not.
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
int get_child_sort(int n, Thread *current_thread=Thread::get_current_thread()) const
Returns the sort index of the nth child node of this node (that is, the number that was passed to add...
void set_attrib(const RenderAttrib *attrib, int override=0)
Adds the indicated render attribute to the scene graph on this node.
get_stashed
Returns the nth stashed child of this node.
set_into_collide_mask
Sets the "into" CollideMask.
get_children
Returns an object that can be used to walk through the list of children of the node.
int get_stashed_sort(int n, Thread *current_thread=Thread::get_current_thread()) const
Returns the sort index of the nth stashed node of this node (that is, the number that was passed to a...
virtual Light * as_light()
Cross-casts the node to a Light pointer, if it is one of the four kinds of Light nodes,...
A PolylightEffect can be used on a node to define a LightGroup for that node.
This is the base class for a number of render attributes (other than transform) that may be set on sc...
This is the base class for a number of special render effects that may be set on scene graph nodes to...
Specifies how polygons are to be drawn.
get_perspective
Returns the perspective flag.
get_thickness
Returns the line width or point thickness.
get_wireframe_color
Returns the color that is used in M_filled_wireframe mode to distinguish the wireframe from the rest ...
get_mode
Returns the render mode.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Represents a set of settings that indicate how a texture is sampled.
static const SamplerState & get_default()
Returns a reference to the global default immutable SamplerState object.
An interface for simplifying ("flattening") scene graphs by eliminating unneeded nodes and collapsing...
int collect_vertex_data(PandaNode *root, int collect_bits=~0)
Collects all different GeomVertexData blocks that have compatible formats at this node and below into...
int flatten(PandaNode *root, int combine_siblings_bits)
Simplifies the graph by removing unnecessary nodes and nodes.
int make_compatible_state(PandaNode *root)
Searches for GeomNodes that contain multiple Geoms that differ only in their ColorAttribs.
void unify(PandaNode *root, bool preserve_order)
Calls unify() on every GeomNode at this level and below.
void premunge(PandaNode *root, const RenderState *initial_state)
Walks the scene graph rooted at this node and below, and uses the indicated GSG to premunge every Geo...
void apply_attribs(PandaNode *node, int attrib_types=~(TT_clip_plane|TT_cull_face|TT_apply_texture_color))
Walks the scene graph, accumulating attribs of the indicated types, applying them to the vertices,...
get_instance_count
Returns the number of geometry instances.
Computes texture coordinates for geometry automatically based on vertex position and/or normal.
Applies a transform matrix to UV's before they are rendered.
This effect automatically applies a computed texture matrix to the specified texture stage,...
Indicates the set of TextureStages and their associated Textures that should be applied to (or remove...
get_num_on_stages
Returns the number of stages that are turned on by the attribute.
has_on_stage
Returns true if the indicated stage is turned on by the attrib, false otherwise.
bool has_off_stage(TextureStage *stage) const
Returns true if the indicated stage is turned off by the attrib, false otherwise.
Texture * get_texture() const
If the TextureAttrib is not an 'off' TextureAttrib, returns the base-level texture that is associated...
get_on_texture
Returns the texture associated with the indicated stage, or NULL if no texture is associated.
get_on_stage
Returns the nth stage turned on by the attribute, sorted in render order.
get_on_sampler
Returns the sampler associated with the indicated stage, or the one associated with its texture if no...
bool has_all_off() const
Returns true if this attrib turns off all stages (although it may also turn some on).
Manages a list of Texture objects, as returned by TexturePool::find_all_textures().
void add_texture(Texture *texture)
Adds a new Texture to the collection.
void add_texture_stage(TextureStage *node_texture_stage)
Adds a new TextureStage to the collection.
Defines the properties of a named stage of the multitexture pipeline.
get_default
Returns the default TextureStage that will be used for all texturing that does not name a particular ...
get_name
Returns the name of this texture stage.
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
A thread; that is, a lightweight process.
get_pipeline_stage
Returns the Pipeline stage number associated with this thread.
is_true_threads
Returns true if a real threading library is available that supports actual OS-implemented threads,...
get_current_thread
Returns a pointer to the currently-executing Thread object.
This controls the enabling of transparency.
get_mode
Returns the transparency mode.
TypeHandle is the identifier used to differentiate C++ class types.
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
Base class for objects that can be written to and read from Bam files.
This class is a wrapper around a NodePath that, unlike the actual NodePath class, doesn't hold a refe...
This is a class designed to support low-overhead traversals of the complete scene graph,...
is_valid
Returns true if the WorkingNodePath object appears to be a valid NodePath reference,...
This is our own Panda specialization on the default STL map.
This is our own Panda specialization on the default STL vector.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PT(Material) NodePath
Returns the material that has been set on this particular node, or NULL if no material has been set.
CPT(RenderState) NodePath
Returns the state changes that must be made to transition to the render state of this node from the r...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.