Panda3D

Loading...
Searching...
No Matches
nodePath.h
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file nodePath.h
10 * @author drose
11 * @date 2002-02-25
12 * @author fperazzi, PandaSE
13 * @date 2010-04-06
14 * for set_shader_input)
15 * @author weifengh, PandaSE
16 * @date 2010-04-30
17 */
18
19#ifndef NODEPATH_H
20#define NODEPATH_H
21
22#include "pandabase.h"
23
24#include "pandaNode.h"
25#include "renderState.h"
26#include "transformState.h"
27#include "renderModeAttrib.h"
28#include "transparencyAttrib.h"
29#include "logicOpAttrib.h"
30#include "nodePathComponent.h"
31#include "pointerTo.h"
32#include "referenceCount.h"
33#include "pnotify.h"
34#include "typedObject.h"
35#include "pta_float.h"
36#include "pta_double.h"
37#include "pta_LMatrix4.h"
38#include "pta_LMatrix3.h"
39#include "pta_LVecBase4.h"
40#include "pta_LVecBase3.h"
41#include "pta_LVecBase2.h"
42#include "stl_compares.h"
43#include "shaderInput.h"
44#include "internalNameCollection.h"
45#include "materialCollection.h"
46#include "textureCollection.h"
47#include "textureStageCollection.h"
48
49 class NodePathCollection;
50 class FindApproxPath;
51 class FindApproxLevelEntry;
52 class Light;
53 class PolylightNode;
54 class Texture;
55 class TextureStage;
56 class Material;
57 class Fog;
58 class GlobPattern;
59 class PreparedGraphicsObjects;
60 class SamplerState;
61 class Shader;
62 class ShaderBuffer;
63 class ShaderInput;
64 class WeakNodePath;
65
66//
67// A NodePath is the fundamental unit of high-level interaction with the scene
68// graph. It encapsulates the complete path down to a node from some other
69// node, usually the root of the scene graph. This is used to resolve
70// ambiguities associated with instancing.
71//
72// NodePath also contains a number of handy high-level methods for common
73// scene-graph manipulations, such as reparenting, and common state changes,
74// such as repositioning.
75//
76// There are also a number of NodePath methods for finding nodes deep within
77// the tree by name or by type. These take a path string, which at its
78// simplest consists of a series of node names separated by slashes, like a
79// directory pathname.
80//
81// Each component of the path string may optionally consist of one of the
82// following special names, instead of a node name:
83//
84// * -- matches exactly one node, with any name.
85// ** -- matches any sequence of zero or more nodes.
86// +typename -- matches any node that is or derives from the given type.
87// -typename -- matches any node that is the given type exactly.
88// =tag -- matches any node that has the indicated tag.
89// =tag=value -- matches any node whose tag matches the indicated value.
90//
91// Furthermore, a node name may itself contain standard filename globbing
92// characters, like *, ?, and [a-z], that will be accepted as a partial match.
93// (In fact, the '*' special name may be seen as just a special case of this.)
94// The globbing characters may not be used with the typename matches or with
95// tag matches, but they may be used to match a tag's value in the =tag=value
96// syntax.
97//
98// The special characters "@@", appearing at the beginning of a node name,
99// indicate a stashed node. Normally, stashed nodes are not returned by a
100// find (but see the special flags, below), but a stashed node may be found if
101// it is explicitly named with its leading @@ characters. By extension, "@@*"
102// may be used to identify any stashed node.
103//
104// Examples:
105//
106// "room//graph" will look for a node named "graph", which is a child of an
107// unnamed node, which is a child of a node named "room", which is a child of
108// the starting path.
109//
110// "**/red*" will look for any node anywhere in the tree (below the starting
111// path) with a name that begins with "red".
112//
113// "**/+PartBundleNode/**/head" will look for a node named "head", somewhere
114// below a PartBundleNode anywhere in the tree.
115//
116//
117// The search is always potentially ambiguous, even if the special wildcard
118// operators are not used, because there may be multiple nodes in the tree
119// with the same name. In general, in the case of an ambiguity, the shortest
120// path is preferred; when a method (such as extend_by) must choose only only
121// one of several possible paths, it will choose the shortest available; on
122// the other hand, when a method (such as find_all_matches) is to return all
123// of the matching paths, it will sort them so that the shortest paths appear
124// first in the output.
125//
126//
127// Special flags. The entire string may optionally be followed by the ";"
128// character, followed by one or more of the following special control flags,
129// with no intervening spaces or punctuation:
130//
131// -h Do not return hidden nodes.
132// +h Do return hidden nodes.
133// -s Do not return stashed nodes unless explicitly referenced with @@.
134// +s Return stashed nodes even without any explicit @@ characters.
135// -i Node name comparisons are not case insensitive: case must match
136// exactly.
137// +i Node name comparisons are case insensitive: case is not important.
138// This affects matches against the node name only; node type and tag
139// strings are always case sensitive.
140//
141// The default flags are +h-s-i.
142//
143
144/**
145 * NodePath is the fundamental system for disambiguating instances, and also
146 * provides a higher-level interface for manipulating the scene graph.
147 *
148 * A NodePath is a list of connected nodes from the root of the graph to any
149 * sub-node. Each NodePath therefore uniquely describes one instance of a
150 * node.
151 *
152 * NodePaths themselves are lightweight objects that may easily be copied and
153 * passed by value. Their data is stored as a series of NodePathComponents
154 * that are stored on the nodes. Holding a NodePath will keep a reference
155 * count to all the nodes in the path. However, if any node in the path is
156 * removed or reparented (perhaps through a different NodePath), the NodePath
157 * will automatically be updated to reflect the changes.
158 */
159 class EXPCL_PANDA_PGRAPH NodePath {
160PUBLISHED:
161 // This enumeration is returned by get_error_type() for an empty NodePath to
162 // report the reason it's empty.
163 enum ErrorType {
164 ET_ok = 0, // i.e. not empty, or never assigned to anything.
165 ET_not_found, // returned from a failed find() or similar function.
166 ET_removed, // remove_node() was previously called on this NodePath.
167 ET_fail, // general failure return from some function.
168 };
169
170 INLINE NodePath();
171 INLINE explicit NodePath(const std::string &top_node_name, Thread *current_thread = Thread::get_current_thread());
172 INLINE explicit NodePath(PandaNode *node, Thread *current_thread = Thread::get_current_thread());
173 INLINE static NodePath any_path(PandaNode *node, Thread *current_thread = Thread::get_current_thread());
174 explicit NodePath(const NodePath &parent, PandaNode *child_node,
175 Thread *current_thread = Thread::get_current_thread());
176
177 INLINE NodePath(const NodePath &copy);
178 INLINE NodePath(NodePath &&from) noexcept;
179
180 INLINE void operator = (const NodePath &copy);
181 INLINE void operator = (NodePath &&from) noexcept;
182
183 INLINE void clear();
184
185 EXTENSION(NodePath __copy__() const);
186 EXTENSION(PyObject *__deepcopy__(PyObject *self, PyObject *memo) const);
187 EXTENSION(PyObject *__reduce__(PyObject *self) const);
188 EXTENSION(PyObject *__reduce_persist__(PyObject *self, PyObject *pickler) const);
189
190 INLINE static NodePath not_found();
191 INLINE static NodePath removed();
192 INLINE static NodePath fail();
193
194 INLINE static void set_max_search_depth(int max_search_depth);
195 INLINE static int get_max_search_depth();
196
197 // Methods to query a NodePath's contents.
198 INLINE bool is_empty() const;
199 operator bool () const;
200
201 INLINE bool is_singleton(Thread *current_thread = Thread::get_current_thread()) const;
202 int get_num_nodes(Thread *current_thread = Thread::get_current_thread()) const;
203 PandaNode *get_node(int index, Thread *current_thread = Thread::get_current_thread()) const;
204 MAKE_SEQ(get_nodes, get_num_nodes, get_node);
205 MAKE_SEQ_PROPERTY(nodes, get_num_nodes, get_node);
206 NodePath get_ancestor(int index, Thread *current_thread = Thread::get_current_thread()) const;
207 MAKE_SEQ(get_ancestors, get_num_nodes, get_ancestor);
208 MAKE_SEQ_PROPERTY(ancestors, get_num_nodes, get_ancestor);
209
210 INLINE ErrorType get_error_type() const;
211 MAKE_PROPERTY(error_type, get_error_type);
212
213 INLINE PandaNode *get_top_node(Thread *current_thread = Thread::get_current_thread()) const;
214 NodePath get_top(Thread *current_thread = Thread::get_current_thread()) const;
215
216 INLINE PandaNode *node() const;
217
218 INLINE int get_key() const;
219 INLINE size_t add_hash(size_t hash) const;
220
221 INLINE bool is_same_graph(const NodePath &other, Thread *current_thread = Thread::get_current_thread()) const;
222 INLINE bool is_ancestor_of(const NodePath &other, Thread *current_thread = Thread::get_current_thread()) const;
223 INLINE NodePath get_common_ancestor(const NodePath &other, Thread *current_thread = Thread::get_current_thread()) const;
224
225 // Methods that return collections of NodePaths derived from or related to
226 // this one.
227
228 NodePathCollection get_children(Thread *current_thread = Thread::get_current_thread()) const;
229 INLINE int get_num_children(Thread *current_thread = Thread::get_current_thread()) const;
230 INLINE NodePath get_child(int n, Thread *current_thread = Thread::get_current_thread()) const;
231 NodePathCollection get_stashed_children(Thread *current_thread = Thread::get_current_thread()) const;
232
233 MAKE_PROPERTY(children, get_children);
234 MAKE_PROPERTY(stashed_children, get_stashed_children);
235
236 INLINE int count_num_descendants() const;
237
238 INLINE bool has_parent(Thread *current_thread = Thread::get_current_thread()) const;
239 INLINE NodePath get_parent(Thread *current_thread = Thread::get_current_thread()) const;
240 int get_sort(Thread *current_thread = Thread::get_current_thread()) const;
241
242 MAKE_PROPERTY2(parent, has_parent, get_parent);
243 MAKE_PROPERTY(sort, get_sort);
244
245 NodePath find(const std::string &path) const;
246 NodePath find_path_to(PandaNode *node) const;
247 NodePathCollection find_all_matches(const std::string &path) const;
248 NodePathCollection find_all_paths_to(PandaNode *node) const;
249
250 // Methods that actually move nodes around in the scene graph. The optional
251 // "sort" parameter can be used to force a particular ordering between
252 // sibling nodes, useful when dealing with LOD's and similar switch nodes.
253 // If the sort value is the same, nodes will be arranged in the order they
254 // were added.
255 void reparent_to(const NodePath &other, int sort = 0,
256 Thread *current_thread = Thread::get_current_thread());
257 void stash_to(const NodePath &other, int sort = 0,
258 Thread *current_thread = Thread::get_current_thread());
259 void wrt_reparent_to(const NodePath &other, int sort = 0,
260 Thread *current_thread = Thread::get_current_thread());
261 NodePath instance_to(const NodePath &other, int sort = 0,
262 Thread *current_thread = Thread::get_current_thread()) const;
263 NodePath instance_under_node(const NodePath &other, const std::string &name,
264 int sort = 0,
265 Thread *current_thread = Thread::get_current_thread()) const;
266 NodePath copy_to(const NodePath &other, int sort = 0,
267 Thread *current_thread = Thread::get_current_thread()) const;
268 NodePath attach_new_node(PandaNode *node, int sort = 0,
269 Thread *current_thread = Thread::get_current_thread()) const;
270 INLINE NodePath attach_new_node(const std::string &name, int sort = 0,
271 Thread *current_thread = Thread::get_current_thread()) const;
272 void remove_node(Thread *current_thread = Thread::get_current_thread());
273 void detach_node(Thread *current_thread = Thread::get_current_thread());
274
275 // Handy ways to look at what's there, and other miscellaneous operations.
276
277 void output(std::ostream &out) const;
278
279 INLINE void ls() const;
280 INLINE void ls(std::ostream &out, int indent_level = 0) const;
281 INLINE void reverse_ls() const;
282 int reverse_ls(std::ostream &out, int indent_level = 0) const;
283
284 // Aggregate transform and state information.
285 const RenderState *get_state(Thread *current_thread = Thread::get_current_thread()) const;
286 INLINE void set_state(const RenderState *state, Thread *current_thread = Thread::get_current_thread());
287 CPT(RenderState) get_state(const NodePath &other, Thread *current_thread = Thread::get_current_thread()) const;
288 void set_state(const NodePath &other, const RenderState *state, Thread *current_thread = Thread::get_current_thread());
289 INLINE CPT(RenderState) get_net_state(Thread *current_thread = Thread::get_current_thread()) const;
290
291 INLINE void set_attrib(const RenderAttrib *attrib, int priority = 0);
292 INLINE const RenderAttrib *get_attrib(TypeHandle type) const;
293 INLINE bool has_attrib(TypeHandle type) const;
294 INLINE void clear_attrib(TypeHandle type);
295
296 INLINE void set_effect(const RenderEffect *effect);
297 INLINE const RenderEffect *get_effect(TypeHandle type) const;
298 INLINE bool has_effect(TypeHandle type) const;
299 INLINE void clear_effect(TypeHandle type);
300
301 INLINE void set_effects(const RenderEffects *effects);
302 INLINE const RenderEffects *get_effects() const;
303 INLINE void clear_effects();
304
305 const TransformState *get_transform(Thread *current_thread = Thread::get_current_thread()) const;
306 INLINE void clear_transform(Thread *current_thread = Thread::get_current_thread());
307 INLINE void set_transform(const TransformState *transform, Thread *current_thread = Thread::get_current_thread());
308 CPT(TransformState) get_transform(const NodePath &other, Thread *current_thread = Thread::get_current_thread()) const;
309 INLINE void clear_transform(const NodePath &other, Thread *current_thread = Thread::get_current_thread());
310 void set_transform(const NodePath &other, const TransformState *transform, Thread *current_thread = Thread::get_current_thread());
311 INLINE CPT(TransformState) get_net_transform(Thread *current_thread = Thread::get_current_thread()) const;
312
313 const TransformState *get_prev_transform(Thread *current_thread = Thread::get_current_thread()) const;
314 INLINE void set_prev_transform(const TransformState *transform, Thread *current_thread = Thread::get_current_thread());
315 CPT(TransformState) get_prev_transform(const NodePath &other, Thread *current_thread = Thread::get_current_thread()) const;
316 void set_prev_transform(const NodePath &other, const TransformState *transform, Thread *current_thread = Thread::get_current_thread());
317 INLINE CPT(TransformState) get_net_prev_transform(Thread *current_thread = Thread::get_current_thread()) const;
318
319
320 // Methods that get and set the matrix transform: pos, hpr, scale, in the
321 // local coordinate system.
322
323 INLINE void set_pos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
324 void set_pos(const LVecBase3 &pos);
325 void set_x(PN_stdfloat x);
326 void set_y(PN_stdfloat y);
327 void set_z(PN_stdfloat z);
328 INLINE void set_fluid_pos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
329 void set_fluid_pos(const LVecBase3 &pos);
330 void set_fluid_x(PN_stdfloat x);
331 void set_fluid_y(PN_stdfloat y);
332 void set_fluid_z(PN_stdfloat z);
333 LPoint3 get_pos() const;
334 INLINE PN_stdfloat get_x() const;
335 INLINE PN_stdfloat get_y() const;
336 INLINE PN_stdfloat get_z() const;
337
338 LVector3 get_pos_delta() const;
339
340 INLINE void set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
341 void set_hpr(const LVecBase3 &hpr);
342 void set_h(PN_stdfloat h);
343 void set_p(PN_stdfloat p);
344 void set_r(PN_stdfloat r);
345 LVecBase3 get_hpr() const;
346 INLINE PN_stdfloat get_h() const;
347 INLINE PN_stdfloat get_p() const;
348 INLINE PN_stdfloat get_r() const;
349
350 void set_quat(const LQuaternion &quat);
351 LQuaternion get_quat() const;
352
353 INLINE void set_scale(PN_stdfloat scale);
354 INLINE void set_scale(PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz);
355 void set_scale(const LVecBase3 &scale);
356 void set_sx(PN_stdfloat sx);
357 void set_sy(PN_stdfloat sy);
358 void set_sz(PN_stdfloat sz);
359 LVecBase3 get_scale() const;
360 INLINE PN_stdfloat get_sx() const;
361 INLINE PN_stdfloat get_sy() const;
362 INLINE PN_stdfloat get_sz() const;
363
364 INLINE void set_shear(PN_stdfloat shxy, PN_stdfloat shxz, PN_stdfloat shyz);
365 void set_shear(const LVecBase3 &shear);
366 void set_shxy(PN_stdfloat shxy);
367 void set_shxz(PN_stdfloat shxz);
368 void set_shyz(PN_stdfloat shyz);
369 LVecBase3 get_shear() const;
370 INLINE PN_stdfloat get_shxy() const;
371 INLINE PN_stdfloat get_shxz() const;
372 INLINE PN_stdfloat get_shyz() const;
373
374 INLINE void set_pos_hpr(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z,
375 PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
376 void set_pos_hpr(const LVecBase3 &pos,
377 const LVecBase3 &hpr);
378 void set_pos_quat(const LVecBase3 &pos,
379 const LQuaternion &quat);
380
381 INLINE void set_hpr_scale(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r,
382 PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz);
383 void set_hpr_scale(const LVecBase3 &hpr,
384 const LVecBase3 &scale);
385 void set_quat_scale(const LQuaternion &quat,
386 const LVecBase3 &scale);
387 INLINE void set_pos_hpr_scale(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z,
388 PN_stdfloat h, PN_stdfloat p, PN_stdfloat r,
389 PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz);
390 void set_pos_hpr_scale(const LVecBase3 &pos,
391 const LVecBase3 &hpr,
392 const LVecBase3 &scale);
393 void set_pos_quat_scale(const LVecBase3 &pos,
394 const LQuaternion &quat,
395 const LVecBase3 &scale);
396 void set_pos_hpr_scale_shear(const LVecBase3 &pos,
397 const LVecBase3 &hpr,
398 const LVecBase3 &scale,
399 const LVecBase3 &shear);
400 void set_pos_quat_scale_shear(const LVecBase3 &pos,
401 const LQuaternion &quat,
402 const LVecBase3 &scale,
403 const LVecBase3 &shear);
404
405 void set_mat(const LMatrix4 &mat);
406 INLINE void clear_mat();
407 INLINE bool has_mat() const;
408 INLINE const LMatrix4 &get_mat() const;
409
410 INLINE void look_at(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
411 void look_at(const LPoint3 &point, const LVector3 &up = LVector3::up());
412 INLINE void heads_up(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
413 void heads_up(const LPoint3 &point, const LVector3 &up = LVector3::up());
414
415 // Methods that get and set the matrix transforms relative to some other
416 // node in the scene graph. These perform an implicit wrt().
417
418 INLINE void set_pos(const NodePath &other, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
419 void set_pos(const NodePath &other, const LVecBase3 &pos);
420 void set_x(const NodePath &other, PN_stdfloat x);
421 void set_y(const NodePath &other, PN_stdfloat y);
422 void set_z(const NodePath &other, PN_stdfloat z);
423 INLINE void set_fluid_pos(const NodePath &other, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
424 void set_fluid_pos(const NodePath &other, const LVecBase3 &pos);
425 void set_fluid_x(const NodePath &other, PN_stdfloat x);
426 void set_fluid_y(const NodePath &other, PN_stdfloat y);
427 void set_fluid_z(const NodePath &other, PN_stdfloat z);
428 LPoint3 get_pos(const NodePath &other) const;
429 INLINE PN_stdfloat get_x(const NodePath &other) const;
430 INLINE PN_stdfloat get_y(const NodePath &other) const;
431 INLINE PN_stdfloat get_z(const NodePath &other) const;
432
433 LVector3 get_pos_delta(const NodePath &other) const;
434
435 INLINE void set_hpr(const NodePath &other, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
436 void set_hpr(const NodePath &other, const LVecBase3 &hpr);
437 void set_h(const NodePath &other, PN_stdfloat h);
438 void set_p(const NodePath &other, PN_stdfloat p);
439 void set_r(const NodePath &other, PN_stdfloat r);
440 LVecBase3 get_hpr(const NodePath &other) const;
441 INLINE PN_stdfloat get_h(const NodePath &other) const;
442 INLINE PN_stdfloat get_p(const NodePath &other) const;
443 INLINE PN_stdfloat get_r(const NodePath &other) const;
444
445 void set_quat(const NodePath &other, const LQuaternion &quat);
446 LQuaternion get_quat(const NodePath &other) const;
447
448 INLINE void set_scale(const NodePath &other, PN_stdfloat scale);
449 INLINE void set_scale(const NodePath &other, PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz);
450 void set_scale(const NodePath &other, const LVecBase3 &scale);
451 void set_sx(const NodePath &other, PN_stdfloat sx);
452 void set_sy(const NodePath &other, PN_stdfloat sy);
453 void set_sz(const NodePath &other, PN_stdfloat sz);
454 LVecBase3 get_scale(const NodePath &other) const;
455 INLINE PN_stdfloat get_sx(const NodePath &other) const;
456 INLINE PN_stdfloat get_sy(const NodePath &other) const;
457 INLINE PN_stdfloat get_sz(const NodePath &other) const;
458
459 INLINE void set_shear(const NodePath &other, PN_stdfloat shxy, PN_stdfloat shxz, PN_stdfloat shyz);
460 void set_shear(const NodePath &other, const LVecBase3 &shear);
461 void set_shxy(const NodePath &other, PN_stdfloat shxy);
462 void set_shxz(const NodePath &other, PN_stdfloat shxz);
463 void set_shyz(const NodePath &other, PN_stdfloat shyz);
464 LVecBase3 get_shear(const NodePath &other) const;
465 INLINE PN_stdfloat get_shxy(const NodePath &other) const;
466 INLINE PN_stdfloat get_shxz(const NodePath &other) const;
467 INLINE PN_stdfloat get_shyz(const NodePath &other) const;
468
469 INLINE void set_pos_hpr(const NodePath &other,
470 PN_stdfloat x, PN_stdfloat y, PN_stdfloat z,
471 PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
472 void set_pos_hpr(const NodePath &other,
473 const LVecBase3 &pos,
474 const LVecBase3 &hpr);
475 void set_pos_quat(const NodePath &other,
476 const LVecBase3 &pos,
477 const LQuaternion &quat);
478 INLINE void set_hpr_scale(const NodePath &other,
479 PN_stdfloat h, PN_stdfloat p, PN_stdfloat r,
480 PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz);
481 void set_hpr_scale(const NodePath &other,
482 const LVecBase3 &hpr,
483 const LVecBase3 &scale);
484 void set_quat_scale(const NodePath &other,
485 const LQuaternion &quat,
486 const LVecBase3 &scale);
487 INLINE void set_pos_hpr_scale(const NodePath &other,
488 PN_stdfloat x, PN_stdfloat y, PN_stdfloat z,
489 PN_stdfloat h, PN_stdfloat p, PN_stdfloat r,
490 PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz);
491 void set_pos_hpr_scale(const NodePath &other,
492 const LVecBase3 &pos,
493 const LVecBase3 &hpr,
494 const LVecBase3 &scale);
495 void set_pos_quat_scale(const NodePath &other,
496 const LVecBase3 &pos,
497 const LQuaternion &quat,
498 const LVecBase3 &scale);
499 void set_pos_hpr_scale_shear(const NodePath &other,
500 const LVecBase3 &pos,
501 const LVecBase3 &hpr,
502 const LVecBase3 &scale,
503 const LVecBase3 &shear);
504 void set_pos_quat_scale_shear(const NodePath &other,
505 const LVecBase3 &pos,
506 const LQuaternion &quat,
507 const LVecBase3 &scale,
508 const LVecBase3 &shear);
509
510 LMatrix4 get_mat(const NodePath &other) const;
511 void set_mat(const NodePath &other, const LMatrix4 &mat);
512
513 LPoint3 get_relative_point(const NodePath &other, const LVecBase3 &point) const;
514 LVector3 get_relative_vector(const NodePath &other, const LVecBase3 &vec) const;
515
516 INLINE void look_at(const NodePath &other,
517 PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
518 void look_at(const NodePath &other,
519 const LPoint3 &point = LPoint3(0.0, 0.0, 0.0),
520 const LVector3 &up = LVector3::up());
521 INLINE void heads_up(const NodePath &other,
522 PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
523 void heads_up(const NodePath &other,
524 const LPoint3 &point = LPoint3(0.0, 0.0, 0.0),
525 const LVector3 &up = LVector3::up());
526
527 INLINE PN_stdfloat get_distance(const NodePath &other) const;
528
529
530 // Methods that affect appearance of geometry: color, texture, etc. These
531 // affect the state at the bottom level only.
532
533 void set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a = 1.0,
534 int priority = 0);
535 void set_color(const LColor &color, int priority = 0);
536 void set_color_off(int priority = 0);
537 void clear_color();
538 bool has_color() const;
539 LColor get_color() const;
540
541 bool has_color_scale() const;
542 void clear_color_scale();
543 void set_color_scale(const LVecBase4 &scale,
544 int priority = 0);
545 INLINE void set_color_scale(PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz, PN_stdfloat sa,
546 int priority = 0);
547 void compose_color_scale(const LVecBase4 &scale,
548 int priority = 0);
549 INLINE void compose_color_scale(PN_stdfloat sx, PN_stdfloat sy, PN_stdfloat sz, PN_stdfloat sa,
550 int priority = 0);
551 void set_color_scale_off(int priority = 0);
552
553 void set_alpha_scale(PN_stdfloat scale, int priority = 0);
554 void set_all_color_scale(PN_stdfloat scale, int priority = 0);
555 INLINE void set_sr(PN_stdfloat sr);
556 INLINE void set_sg(PN_stdfloat sg);
557 INLINE void set_sb(PN_stdfloat sb);
558 INLINE void set_sa(PN_stdfloat sa);
559
560 const LVecBase4 &get_color_scale() const;
561 INLINE PN_stdfloat get_sr() const;
562 INLINE PN_stdfloat get_sg() const;
563 INLINE PN_stdfloat get_sb() const;
564 INLINE PN_stdfloat get_sa() const;
565
566 void set_light(const NodePath &light, int priority = 0);
567 void set_light_off(int priority = 0);
568 void set_light_off(const NodePath &light, int priority = 0);
569 void clear_light();
570 void clear_light(const NodePath &light);
571 bool has_light(const NodePath &light) const;
572 bool has_light_off() const;
573 bool has_light_off(const NodePath &light) const;
574
575 void set_clip_plane(const NodePath &clip_plane, int priority = 0);
576 void set_clip_plane_off(int priority = 0);
577 void set_clip_plane_off(const NodePath &clip_plane, int priority = 0);
578 void clear_clip_plane();
579 void clear_clip_plane(const NodePath &clip_plane);
580 bool has_clip_plane(const NodePath &clip_plane) const;
581 bool has_clip_plane_off() const;
582 bool has_clip_plane_off(const NodePath &clip_plane) const;
583
584 void set_scissor(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top);
585 void set_scissor(const LPoint3 &a, const LPoint3 &b);
586 void set_scissor(const LPoint3 &a, const LPoint3 &b,
587 const LPoint3 &c, const LPoint3 &d);
588 void set_scissor(const NodePath &other,
589 const LPoint3 &a, const LPoint3 &b);
590 void set_scissor(const NodePath &other,
591 const LPoint3 &a, const LPoint3 &b,
592 const LPoint3 &c, const LPoint3 &d);
593 void clear_scissor();
594 bool has_scissor() const;
595
596 void set_occluder(const NodePath &occluder);
597 void clear_occluder();
598 void clear_occluder(const NodePath &occluder);
599 bool has_occluder(const NodePath &occluder) const;
600
601 void set_bin(const std::string &bin_name, int draw_order, int priority = 0);
602 void clear_bin();
603 bool has_bin() const;
604 std::string get_bin_name() const;
605 int get_bin_draw_order() const;
606
607 void set_texture(Texture *tex, int priority = 0);
608 void set_texture(TextureStage *stage, Texture *tex, int priority = 0);
609 void set_texture(Texture *tex, const SamplerState &sampler, int priority = 0);
610 void set_texture(TextureStage *stage, Texture *tex, const SamplerState &sampler, int priority = 0);
611 void set_texture_off(int priority = 0);
612 void set_texture_off(TextureStage *stage, int priority = 0);
613 void clear_texture();
614 void clear_texture(TextureStage *stage);
615 bool has_texture() const;
616 bool has_texture(TextureStage *stage) const;
617 bool has_texture_off() const;
618 bool has_texture_off(TextureStage *stage) const;
619 Texture *get_texture() const;
620 Texture *get_texture(TextureStage *stage) const;
621 void replace_texture(Texture *tex, Texture *new_tex);
622#ifdef CPPPARSER // Let interrogate know this also accepts None
623 void replace_texture(Texture *tex, std::nullptr_t new_tex);
624#endif
625 const SamplerState &get_texture_sampler() const;
626 const SamplerState &get_texture_sampler(TextureStage *stage) const;
627
628 void set_shader(const Shader *sha, int priority = 0);
629 void set_shader_off(int priority = 0);
630 void set_shader_auto(int priority = 0);
631 void set_shader_auto(BitMask32 shader_switch, int priority=0);
632 void clear_shader();
633
634 void set_shader_input(const ShaderInput &input);
635 void set_shader_input(ShaderInput &&input);
636
637 INLINE void set_shader_input(CPT_InternalName id, Texture *tex, const SamplerState &sampler, int priority=0);
638 INLINE void set_shader_input(CPT_InternalName id, Texture *tex, bool read, bool write, int z=-1, int n=0, int priority=0);
639
640 public:
641 INLINE void set_shader_input(CPT_InternalName id, Texture *tex, int priority=0);
642 INLINE void set_shader_input(CPT_InternalName id, ShaderBuffer *buf, int priority=0);
643 INLINE void set_shader_input(CPT_InternalName id, const NodePath &np, int priority=0);
644 INLINE void set_shader_input(CPT_InternalName id, const PTA_float &v, int priority=0);
645 INLINE void set_shader_input(CPT_InternalName id, const PTA_double &v, int priority=0);
646 INLINE void set_shader_input(CPT_InternalName id, const PTA_int &v, int priority=0);
647 INLINE void set_shader_input(CPT_InternalName id, const PTA_LVecBase4 &v, int priority=0);
648 INLINE void set_shader_input(CPT_InternalName id, const PTA_LVecBase3 &v, int priority=0);
649 INLINE void set_shader_input(CPT_InternalName id, const PTA_LVecBase2 &v, int priority=0);
650 INLINE void set_shader_input(CPT_InternalName id, const PTA_LMatrix4 &v, int priority=0);
651 INLINE void set_shader_input(CPT_InternalName id, const PTA_LMatrix3 &v, int priority=0);
652 INLINE void set_shader_input(CPT_InternalName id, const LVecBase4 &v, int priority=0);
653 INLINE void set_shader_input(CPT_InternalName id, const LVecBase3 &v, int priority=0);
654 INLINE void set_shader_input(CPT_InternalName id, const LVecBase2 &v, int priority=0);
655 INLINE void set_shader_input(CPT_InternalName id, const LMatrix4 &v, int priority=0);
656 INLINE void set_shader_input(CPT_InternalName id, const LMatrix3 &v, int priority=0);
657 INLINE void set_shader_input(CPT_InternalName id, const PTA_LVecBase4i &v, int priority=0);
658 INLINE void set_shader_input(CPT_InternalName id, const PTA_LVecBase3i &v, int priority=0);
659 INLINE void set_shader_input(CPT_InternalName id, const PTA_LVecBase2i &v, int priority=0);
660 INLINE void set_shader_input(CPT_InternalName id, const LVecBase4i &v, int priority=0);
661 INLINE void set_shader_input(CPT_InternalName id, const LVecBase3i &v, int priority=0);
662 INLINE void set_shader_input(CPT_InternalName id, const LVecBase2i &v, int priority=0);
663PUBLISHED:
664 INLINE void set_shader_input(CPT_InternalName id, int n1, int n2, int n3=0,
665 int n4=0, int priority=0);
666 INLINE void set_shader_input(CPT_InternalName id, PN_stdfloat n1, PN_stdfloat n2,
667 PN_stdfloat n3=0, PN_stdfloat n4=0, int priority=0);
668
669 EXTENSION(void set_shader_input(CPT_InternalName, PyObject *, int priority=0));
670 EXTENSION(void set_shader_inputs(PyObject *args, PyObject *kwargs));
671
672 void clear_shader_input(CPT_InternalName id);
673 void set_instance_count(int instance_count);
674
675 const Shader *get_shader() const;
676 ShaderInput get_shader_input(CPT_InternalName id) const;
677 int get_instance_count() const;
678
679 void set_tex_transform(TextureStage *stage, const TransformState *transform);
680 void clear_tex_transform();
681 void clear_tex_transform(TextureStage *stage);
682 bool has_tex_transform(TextureStage *stage) const;
683 CPT(TransformState) get_tex_transform(TextureStage *stage) const;
684
685 INLINE void set_tex_offset(TextureStage *stage, PN_stdfloat u, PN_stdfloat v);
686 INLINE void set_tex_offset(TextureStage *stage, const LVecBase2 &uv);
687 INLINE void set_tex_rotate(TextureStage *stage, PN_stdfloat r);
688 INLINE void set_tex_scale(TextureStage *stage, PN_stdfloat scale);
689 INLINE void set_tex_scale(TextureStage *stage, PN_stdfloat su, PN_stdfloat sv);
690 INLINE void set_tex_scale(TextureStage *stage, const LVecBase2 &scale);
691 INLINE LVecBase2 get_tex_offset(TextureStage *stage) const;
692 INLINE PN_stdfloat get_tex_rotate(TextureStage *stage) const;
693 INLINE LVecBase2 get_tex_scale(TextureStage *stage) const;
694
695 INLINE void set_tex_pos(TextureStage *stage, PN_stdfloat u, PN_stdfloat v, PN_stdfloat w);
696 INLINE void set_tex_pos(TextureStage *stage, const LVecBase3 &uvw);
697 INLINE void set_tex_hpr(TextureStage *stage, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
698 INLINE void set_tex_hpr(TextureStage *stage, const LVecBase3 &hpr);
699 INLINE void set_tex_scale(TextureStage *stage, PN_stdfloat su, PN_stdfloat sv, PN_stdfloat sw);
700 INLINE void set_tex_scale(TextureStage *stage, const LVecBase3 &scale);
701 INLINE LVecBase3 get_tex_pos(TextureStage *stage) const;
702 INLINE LVecBase3 get_tex_hpr(TextureStage *stage) const;
703 INLINE LVecBase3 get_tex_scale_3d(TextureStage *stage) const;
704
705 void set_tex_transform(const NodePath &other, TextureStage *stage, const TransformState *transform);
706 CPT(TransformState) get_tex_transform(const NodePath &other, TextureStage *stage) const;
707
708 INLINE void set_tex_offset(const NodePath &other, TextureStage *stage, PN_stdfloat u, PN_stdfloat v);
709 INLINE void set_tex_offset(const NodePath &other, TextureStage *stage, const LVecBase2 &uv);
710 INLINE void set_tex_rotate(const NodePath &other, TextureStage *stage, PN_stdfloat r);
711 INLINE void set_tex_scale(const NodePath &other, TextureStage *stage, PN_stdfloat scale);
712 INLINE void set_tex_scale(const NodePath &other, TextureStage *stage, PN_stdfloat su, PN_stdfloat sv);
713 INLINE void set_tex_scale(const NodePath &other, TextureStage *stage, const LVecBase2 &scale);
714 INLINE LVecBase2 get_tex_offset(const NodePath &other, TextureStage *stage) const;
715 INLINE PN_stdfloat get_tex_rotate(const NodePath &other, TextureStage *stage) const;
716 INLINE LVecBase2 get_tex_scale(const NodePath &other, TextureStage *stage) const;
717
718 INLINE void set_tex_pos(const NodePath &other, TextureStage *stage, PN_stdfloat u, PN_stdfloat v, PN_stdfloat w);
719 INLINE void set_tex_pos(const NodePath &other, TextureStage *stage, const LVecBase3 &uvw);
720 INLINE void set_tex_hpr(const NodePath &other, TextureStage *stage, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
721 INLINE void set_tex_hpr(const NodePath &other, TextureStage *stage, const LVecBase3 &hpr);
722 INLINE void set_tex_scale(const NodePath &other, TextureStage *stage, PN_stdfloat su, PN_stdfloat sv, PN_stdfloat sw);
723 INLINE void set_tex_scale(const NodePath &other, TextureStage *stage, const LVecBase3 &scale);
724 INLINE LVecBase3 get_tex_pos(const NodePath &other, TextureStage *stage) const;
725 INLINE LVecBase3 get_tex_hpr(const NodePath &other, TextureStage *stage) const;
726 INLINE LVecBase3 get_tex_scale_3d(const NodePath &other, TextureStage *stage) const;
727
728 void set_tex_gen(TextureStage *stage, RenderAttrib::TexGenMode mode, int priority = 0);
729 void set_tex_gen(TextureStage *stage, RenderAttrib::TexGenMode mode,
730 const LTexCoord3 &constant_value,
731 int priority = 0);
732 void clear_tex_gen();
733 void clear_tex_gen(TextureStage *stage);
734 bool has_tex_gen(TextureStage *stage) const;
735 RenderAttrib::TexGenMode get_tex_gen(TextureStage *stage) const;
736
737 void set_tex_projector(TextureStage *stage, const NodePath &from, const NodePath &to,
738 int lens_index = 0);
739 void clear_tex_projector(TextureStage *stage);
740 void clear_tex_projector();
741 bool has_tex_projector(TextureStage *stage) const;
742 NodePath get_tex_projector_from(TextureStage *stage) const;
743 NodePath get_tex_projector_to(TextureStage *stage) const;
744
745 void project_texture(TextureStage *stage, Texture *tex, const NodePath &projector);
746 INLINE void clear_project_texture(TextureStage *stage);
747
748 INLINE bool has_texcoord(const std::string &texcoord_name) const;
749 bool has_vertex_column(const InternalName *name) const;
750 InternalNameCollection find_all_vertex_columns() const;
751 InternalNameCollection find_all_vertex_columns(const std::string &name) const;
752 InternalNameCollection find_all_texcoords() const;
753 InternalNameCollection find_all_texcoords(const std::string &name) const;
754
755 Texture *find_texture(const std::string &name) const;
756 Texture *find_texture(TextureStage *stage) const;
757 TextureCollection find_all_textures() const;
758 TextureCollection find_all_textures(const std::string &name) const;
759 TextureCollection find_all_textures(TextureStage *stage) const;
760
761 TextureStage *find_texture_stage(const std::string &name) const;
762 TextureStageCollection find_all_texture_stages() const;
763 TextureStageCollection find_all_texture_stages(const std::string &name) const;
764
765 void unify_texture_stages(TextureStage *stage);
766
767 Material *find_material(const std::string &name) const;
768 MaterialCollection find_all_materials() const;
769 MaterialCollection find_all_materials(const std::string &name) const;
770
771 void set_material(Material *tex, int priority = 0);
772 void set_material_off(int priority = 0);
773 void clear_material();
774 bool has_material() const;
775 PT(Material) get_material() const;
776 void replace_material(Material *mat, Material *new_mat);
777#ifdef CPPPARSER // Let interrogate know this also accepts None
778 void replace_material(Material *mat, std::nullptr_t new_mat);
779#endif
780
781 void set_fog(Fog *fog, int priority = 0);
782 void set_fog_off(int priority = 0);
783 void clear_fog();
784 bool has_fog() const;
785 bool has_fog_off() const;
786 Fog *get_fog() const;
787
788 void set_render_mode_wireframe(int priority = 0);
789 void set_render_mode_filled(int priority = 0);
790 void set_render_mode_filled_wireframe(const LColor &wireframe_color, int priority = 0);
791 void set_render_mode_thickness(PN_stdfloat thickness, int priority = 0);
792 void set_render_mode_perspective(bool perspective, int priority = 0);
793 void set_render_mode(RenderModeAttrib::Mode mode, PN_stdfloat thickness, int priority = 0);
794 void clear_render_mode();
795 bool has_render_mode() const;
796 RenderModeAttrib::Mode get_render_mode() const;
797 PN_stdfloat get_render_mode_thickness() const;
798 bool get_render_mode_perspective() const;
799
800 void set_two_sided(bool two_sided, int priority = 0);
801 void clear_two_sided();
802 bool has_two_sided() const;
803 bool get_two_sided() const;
804
805 void set_depth_test(bool depth_test, int priority = 0);
806 void clear_depth_test();
807 bool has_depth_test() const;
808 bool get_depth_test() const;
809
810 void set_depth_write(bool depth_write, int priority = 0);
811 void clear_depth_write();
812 bool has_depth_write() const;
813 bool get_depth_write() const;
814
815 void set_depth_offset(int bias, int priority = 0);
816 void clear_depth_offset();
817 bool has_depth_offset() const;
818 int get_depth_offset() const;
819
820 void do_billboard_axis(const NodePath &camera, PN_stdfloat offset);
821 void do_billboard_point_eye(const NodePath &camera, PN_stdfloat offset);
822 void do_billboard_point_world(const NodePath &camera, PN_stdfloat offset);
823 INLINE void set_billboard_axis(PN_stdfloat offset = 0.0);
824 INLINE void set_billboard_point_eye(PN_stdfloat offset = 0.0, bool fixed_depth = false);
825 INLINE void set_billboard_point_world(PN_stdfloat offset = 0.0);
826 void set_billboard_axis(const NodePath &camera, PN_stdfloat offset);
827 void set_billboard_point_eye(const NodePath &camera, PN_stdfloat offset, bool fixed_depth = false);
828 void set_billboard_point_world(const NodePath &camera, PN_stdfloat offset);
829 void clear_billboard();
830 bool has_billboard() const;
831
832 void set_compass(const NodePath &reference = NodePath());
833 void clear_compass();
834 bool has_compass() const;
835
836 void set_transparency(TransparencyAttrib::Mode mode, int priority = 0);
837 void clear_transparency();
838 bool has_transparency() const;
839 TransparencyAttrib::Mode get_transparency() const;
840
841 void set_logic_op(LogicOpAttrib::Operation op, int priority = 0);
842 void clear_logic_op();
843 bool has_logic_op() const;
844 LogicOpAttrib::Operation get_logic_op() const;
845
846 void set_antialias(unsigned short mode, int priority = 0);
847 void clear_antialias();
848 bool has_antialias() const;
849 unsigned short get_antialias() const;
850
851 bool has_audio_volume() const;
852 void clear_audio_volume();
853 void set_audio_volume(PN_stdfloat volume,
854 int priority = 0);
855 void set_audio_volume_off(int priority = 0);
856 PN_stdfloat get_audio_volume() const;
857 PN_stdfloat get_net_audio_volume() const;
858
859 INLINE void adjust_all_priorities(int adjustment);
860
861 // Variants on show and hide
862 INLINE void show();
863 INLINE void show(DrawMask camera_mask);
864 INLINE void show_through();
865 INLINE void show_through(DrawMask camera_mask);
866 INLINE void hide();
867 INLINE void hide(DrawMask camera_mask);
868 INLINE bool is_hidden(DrawMask camera_mask = PandaNode::get_overall_bit()) const;
869 NodePath get_hidden_ancestor(DrawMask camera_mask = PandaNode::get_overall_bit(),
870 Thread *current_thread = Thread::get_current_thread()) const;
871
872 void stash(int sort = 0, Thread *current_thread = Thread::get_current_thread());
873 void unstash(int sort = 0, Thread *current_thread = Thread::get_current_thread());
874 void unstash_all(Thread *current_thread = Thread::get_current_thread());
875 INLINE bool is_stashed() const;
876 NodePath get_stashed_ancestor(Thread *current_thread = Thread::get_current_thread()) const;
877
878 INLINE CollideMask get_collide_mask() const;
879 INLINE void set_collide_mask(CollideMask new_mask, CollideMask bits_to_change = CollideMask::all_on(),
880 TypeHandle node_type = TypeHandle::none());
881
882 // Comparison methods
883 INLINE bool operator == (const NodePath &other) const;
884 INLINE bool operator != (const NodePath &other) const;
885 INLINE bool operator < (const NodePath &other) const;
886 INLINE int compare_to(const NodePath &other) const;
887
888 bool operator == (const WeakNodePath &other) const;
889 bool operator != (const WeakNodePath &other) const;
890 bool operator < (const WeakNodePath &other) const;
891 int compare_to(const WeakNodePath &other) const;
892
893 // Miscellaneous
894 bool verify_complete(Thread *current_thread = Thread::get_current_thread()) const;
895
896 void premunge_scene(GraphicsStateGuardianBase *gsg = nullptr);
897 void prepare_scene(GraphicsStateGuardianBase *gsg);
898
899 void show_bounds();
900 void show_tight_bounds();
901 void hide_bounds();
902 PT(BoundingVolume) get_bounds(Thread *current_thread = Thread::get_current_thread()) const;
903 void force_recompute_bounds();
904 void write_bounds(std::ostream &out) const;
905 bool calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point,
906 const NodePath &other = NodePath(),
907 Thread *current_thread = Thread::get_current_thread()) const;
908
909 EXTENSION(PyObject *get_tight_bounds(const NodePath &other = NodePath()) const);
910
911 // void analyze() const;
912
913 int flatten_light();
914 int flatten_medium();
915 int flatten_strong();
916 void apply_texture_colors();
917 INLINE int clear_model_nodes();
918
919 INLINE void set_tag(const std::string &key, const std::string &value);
920 INLINE std::string get_tag(const std::string &key) const;
921 INLINE void get_tag_keys(vector_string &keys) const;
922 INLINE bool has_tag(const std::string &key) const;
923 INLINE void clear_tag(const std::string &key);
924 INLINE std::string get_net_tag(const std::string &key) const;
925 INLINE bool has_net_tag(const std::string &key) const;
926 NodePath find_net_tag(const std::string &key) const;
927
928 MAKE_MAP_PROPERTY(net_tags, has_net_tag, get_net_tag);
929
930 EXTENSION(INLINE PyObject *get_tags() const);
931 EXTENSION(INLINE PyObject *get_tag_keys() const);
932 MAKE_PROPERTY(tags, get_tags);
933
934 EXTENSION(PyObject *get_python_tags());
935 EXTENSION(INLINE void set_python_tag(PyObject *keys, PyObject *value));
936 EXTENSION(INLINE PyObject *get_python_tag(PyObject *keys) const);
937 EXTENSION(INLINE PyObject *get_python_tag_keys() const);
938 EXTENSION(INLINE bool has_python_tag(PyObject *keys) const);
939 EXTENSION(INLINE void clear_python_tag(PyObject *keys));
940 EXTENSION(INLINE PyObject *get_net_python_tag(PyObject *keys) const);
941 EXTENSION(INLINE bool has_net_python_tag(PyObject *keys) const);
942 EXTENSION(NodePath find_net_python_tag(PyObject *keys) const);
943 MAKE_PROPERTY(python_tags, get_python_tags);
944
945 EXTENSION(int __traverse__(visitproc visit, void *arg));
946
947 INLINE void list_tags() const;
948
949 INLINE void set_name(const std::string &name);
950 INLINE std::string get_name() const;
951 MAKE_PROPERTY(name, get_name, set_name);
952
953 BLOCKING bool write_bam_file(const Filename &filename) const;
954 BLOCKING bool write_bam_stream(std::ostream &out) const;
955
956 INLINE vector_uchar encode_to_bam_stream() const;
957 bool encode_to_bam_stream(vector_uchar &data, BamWriter *writer = nullptr) const;
958 static NodePath decode_from_bam_stream(vector_uchar data, BamReader *reader = nullptr);
959
960 private:
961 bool replace_copied_nodes(const NodePath &source, const NodePath &dest,
962 const PandaNode::InstanceMap &inst_map,
963 Thread *current_thread);
964
965 static NodePathComponent *
966 find_common_ancestor(const NodePath &a, const NodePath &b,
967 int &a_count, int &b_count,
968 Thread *current_thread);
969
970 CPT(RenderState) r_get_net_state(NodePathComponent *comp,
971 Thread *current_thread) const;
972 CPT(RenderState) r_get_partial_state(NodePathComponent *comp, int n,
973 Thread *current_thread) const;
974 CPT(TransformState) r_get_net_transform(NodePathComponent *comp,
975 Thread *current_thread) const;
976 CPT(TransformState) r_get_partial_transform(NodePathComponent *comp, int n,
977 Thread *current_thread) const;
978 CPT(TransformState) r_get_net_prev_transform(NodePathComponent *comp,
979 Thread *current_thread) const;
980 CPT(TransformState) r_get_partial_prev_transform(NodePathComponent *comp,
981 int n, Thread *current_thread) const;
982
983 void find_matches(NodePathCollection &result,
984 const std::string &approx_path_str,
985 int max_matches) const;
986 void find_matches(NodePathCollection &result,
987 FindApproxPath &approx_path,
988 int max_matches) const;
989 void find_matches(NodePathCollection &result,
990 FindApproxLevelEntry *level,
991 int max_matches) const;
992
993 int r_clear_model_nodes(PandaNode *node);
994 void r_adjust_all_priorities(PandaNode *node, int adjustment);
995
996 void r_force_recompute_bounds(PandaNode *node);
997
998 void r_set_collide_mask(PandaNode *node,
999 CollideMask and_mask, CollideMask or_mask,
1000 TypeHandle node_type);
1001
1002 typedef phash_set<const InternalName *, pointer_hash> InternalNames;
1003 bool r_has_vertex_column(PandaNode *node, const InternalName *name) const;
1004 void r_find_all_vertex_columns(PandaNode *node,
1005 InternalNames &vertex_columns) const;
1006
1007 typedef phash_set<Texture *, pointer_hash> Textures;
1008 Texture *r_find_texture(PandaNode *node, const RenderState *state,
1009 const GlobPattern &glob) const;
1010 void r_find_all_textures(PandaNode *node, const RenderState *state,
1011 Textures &textures) const;
1012 Texture *r_find_texture(PandaNode *node, TextureStage *stage) const;
1013 void r_find_all_textures(PandaNode *node, TextureStage *stage,
1014 Textures &textures) const;
1015 static void r_replace_texture(PandaNode *node, Texture *tex, Texture *new_tex);
1016
1017 typedef phash_set<TextureStage *, pointer_hash> TextureStages;
1018 TextureStage *r_find_texture_stage(PandaNode *node, const RenderState *state,
1019 const GlobPattern &glob) const;
1020 void r_find_all_texture_stages(PandaNode *node, const RenderState *state,
1021 TextureStages &texture_stages) const;
1022
1023 void r_unify_texture_stages(PandaNode *node, TextureStage *stage);
1024
1025 typedef phash_set<Material *, pointer_hash> Materials;
1026 Material *r_find_material(PandaNode *node, const RenderState *state,
1027 const GlobPattern &glob) const;
1028 void r_find_all_materials(PandaNode *node, const RenderState *state,
1029 Materials &materials) const;
1030 static void r_replace_material(PandaNode *node, Material *mat,
1031 const MaterialAttrib *new_attrib);
1032
1033 PT(NodePathComponent) _head;
1034 int _backup_key;
1035 ErrorType _error_type;
1036 static int _max_search_depth;
1037
1038 static PStatCollector _get_transform_pcollector;
1039 static PStatCollector _verify_complete_pcollector;
1040
1041 public:
1042 void write_datagram(BamWriter *manager, Datagram &dg) const;
1043 int complete_pointers(TypedWritable **plist, BamReader *manager);
1044 void fillin(DatagramIterator &scan, BamReader *manager);
1045
1046 public:
1047 static TypeHandle get_class_type() {
1048 return _type_handle;
1049 }
1050 static void init_type() {
1051 register_type(_type_handle, "NodePath");
1052 }
1053
1054 private:
1055 static TypeHandle _type_handle;
1056
1057 friend class NodePathCollection;
1058 friend class WorkingNodePath;
1059 friend class WeakNodePath;
1060 friend class CullTraverserData;
1061};
1062
1063INLINE std::ostream &operator << (std::ostream &out, const NodePath &node_path);
1064
1065#include "nodePathCollection.h"
1066
1067#include "nodePath.I"
1068
1069#endif
BamReader
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition bamReader.h:110
BamWriter
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition bamWriter.h:63
BitMask< uint32_t, 32 >::all_on
static BitMask< uint32_t, nbits > all_on()
BoundingVolume
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
Definition boundingVolume.h:41
CPT_InternalName
This is a const pointer to an InternalName, and should be used in lieu of a CPT(InternalName) in func...
Definition internalName.h:193
DatagramIterator
A class to retrieve the individual data elements previously stored in a Datagram.
Definition datagramIterator.h:30
Datagram
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition datagram.h:38
Filename
The name of a file, such as a texture file or an Egg file.
Definition filename.h:44
FindApproxLevelEntry
This class is local to this package only; it doesn't get exported.
Definition findApproxLevelEntry.h:29
FindApproxPath
This class is local to this package only; it doesn't get exported.
Definition findApproxPath.h:31
Fog
Specifies how atmospheric fog effects are applied to geometry.
Definition fog.h:41
GlobPattern
This class can be used to test for string matches against standard Unix- shell filename globbing conv...
Definition globPattern.h:32
GraphicsStateGuardianBase
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
Definition graphicsStateGuardianBase.h:110
InternalNameCollection
Definition internalNameCollection.h:24
InternalName
Encodes a string name in a hash table, mapping it to a pointer.
Definition internalName.h:38
Light
The abstract interface to all kinds of lights.
Definition light.h:38
MaterialAttrib
Indicates which, if any, material should be applied to geometry.
Definition materialAttrib.h:27
MaterialCollection
Definition materialCollection.h:24
Material
Defines the way an object appears in the presence of lighting.
Definition material.h:43
NodePathCollection
This is a set of zero or more NodePaths.
Definition nodePathCollection.h:26
NodePathComponent
This is one component of a NodePath.
Definition nodePathComponent.h:42
NodePath
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition nodePath.h:159
NodePath::stash
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...
Definition nodePath.cxx:5219
NodePath::get_logic_op
LogicOpAttrib::Operation get_logic_op() const
Returns the logical operation that has been specifically set on this node via set_logic_op(),...
Definition nodePath.cxx:5027
NodePath::premunge_scene
void premunge_scene(GraphicsStateGuardianBase *gsg=nullptr)
Walks through the scene graph beginning at the bottom node, and internally adjusts any GeomVertexForm...
Definition nodePath.cxx:5400
NodePath::set_tex_hpr
void set_tex_hpr(TextureStage *stage, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r)
Sets a texture matrix on the current node to apply the indicated rotation, as a 3-D HPR,...
Definition nodePath.I:1434
NodePath::set_x
void set_x(PN_stdfloat x)
Sets the X component of the position transform, leaving other components untouched.
Definition nodePath.cxx:971
NodePath::clear_occluder
void clear_occluder()
Completely removes any occluders that may have been set via set_occluder() from this particular node.
Definition nodePath.cxx:2714
NodePath::set_sa
void set_sa(PN_stdfloat sa)
Sets the alpha component of the color scale.
Definition nodePath.I:1041
NodePath::force_recompute_bounds
void force_recompute_bounds()
Forces the recomputing of all the bounding volumes at every node in the subgraph beginning at this no...
Definition nodePath.cxx:5485
NodePath::set_hpr_scale
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.
Definition nodePath.I:737
NodePath::set_light
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...
Definition nodePath.cxx:2260
NodePath::set_max_search_depth
static void set_max_search_depth(int max_search_depth)
Certain operations, such as find() or find_all_matches(), require a traversal of the scene graph to s...
Definition nodePath.I:171
NodePath::has_light_off
bool has_light_off() const
Returns true if all Lights have been specifically disabled on this particular node.
Definition nodePath.cxx:2460
NodePath::any_path
static NodePath any_path(PandaNode *node, Thread *current_thread=Thread::get_current_thread())
Returns a new NodePath that represents any arbitrary path from the root to the indicated node.
Definition nodePath.I:62
NodePath::set_tex_gen
void set_tex_gen(TextureStage *stage, RenderAttrib::TexGenMode mode, int priority=0)
Enables automatic texture coordinate generation for the indicated texture stage.
Definition nodePath.cxx:3615
NodePath::get_relative_point
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 ...
Definition nodePath.cxx:1958
NodePath::copy_to
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...
Definition nodePath.cxx:538
NodePath::set_sz
void set_sz(PN_stdfloat sz)
Sets the z-scale component of the transform, leaving other components untouched.
Definition nodePath.cxx:1182
NodePath::compose_color_scale
void compose_color_scale(const LVecBase4 &scale, int priority=0)
multiplies the color scale component of the transform, with previous color scale leaving translation ...
Definition nodePath.cxx:2116
NodePath::set_sb
void set_sb(PN_stdfloat sb)
Sets the blue component of the color scale.
Definition nodePath.I:1029
NodePath::get_tag_keys
void get_tag_keys(vector_string &keys) const
Fills the given vector up with the list of tags on this PandaNode.
Definition nodePath.I:2026
NodePath::has_depth_test
bool has_depth_test() const
Returns true if a depth-test adjustment has been explicitly set on this particular node via set_depth...
Definition nodePath.cxx:4606
NodePath::get_ancestor
get_ancestor
Returns the nth ancestor of the path, where 0 is the NodePath itself and get_num_nodes() - 1 is get_t...
Definition nodePath.h:207
NodePath::list_tags
void list_tags() const
Lists the tags to the nout stream, one per line.
Definition nodePath.I:2082
NodePath::set_quat
void set_quat(const LQuaternion &quat)
Sets the rotation component of the transform, leaving translation and scale untouched.
Definition nodePath.cxx:1121
NodePath::clear_transform
void clear_transform(Thread *current_thread=Thread::get_current_thread())
Sets the transform object on this node to identity.
Definition nodePath.I:557
NodePath::get_children
get_children
Returns the set of all child nodes of the referenced node.
Definition nodePath.h:233
NodePath::get_depth_test
bool get_depth_test() const
Returns true if depth-test rendering has been specifically set on this node via set_depth_test(),...
Definition nodePath.cxx:4618
NodePath::is_same_graph
bool is_same_graph(const NodePath &other, Thread *current_thread=Thread::get_current_thread()) const
Returns true if the node represented by this NodePath is parented within the same graph as that of th...
Definition nodePath.I:275
NodePath::get_num_children
int get_num_children(Thread *current_thread=Thread::get_current_thread()) const
Returns the number of children of the referenced node.
Definition nodePath.I:328
NodePath::clear_two_sided
void clear_two_sided()
Completely removes any two-sided adjustment that may have been set on this node via set_two_sided().
Definition nodePath.cxx:4537
NodePath::set_alpha_scale
void set_alpha_scale(PN_stdfloat scale, int priority=0)
Sets the alpha scale component of the transform without (much) affecting the color scale.
Definition nodePath.cxx:2188
NodePath::set_scissor
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.
Definition nodePath.cxx:2775
NodePath::get_pos_delta
LVector3 get_pos_delta() const
Returns the delta vector from this node's position in the previous frame (according to set_prev_trans...
Definition nodePath.cxx:1058
NodePath::get_depth_write
bool get_depth_write() const
Returns true if depth-write rendering has been specifically set on this node via set_depth_write(),...
Definition nodePath.cxx:4675
NodePath::show_bounds
void show_bounds()
Causes the bounding volume of the bottom node and all of its descendants (that is,...
Definition nodePath.cxx:5436
NodePath::clear_clip_plane
void clear_clip_plane()
Completely removes any clip planes that may have been set via set_clip_plane() or set_clip_plane_off(...
Definition nodePath.cxx:2586
NodePath::set_audio_volume_off
void set_audio_volume_off(int priority=0)
Disables any audio volume attribute inherited from above.
Definition nodePath.cxx:5143
NodePath::has_texture_off
bool has_texture_off() const
Returns true if texturing has been specifically disabled on this particular node via set_texture_off(...
Definition nodePath.cxx:3135
NodePath::count_num_descendants
int count_num_descendants() const
Returns the number of nodes at and below this level.
Definition nodePath.I:350
NodePath::do_billboard_point_eye
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...
Definition nodePath.cxx:4777
NodePath::clear_mat
void clear_mat()
Completely removes any transform from the referenced node.
Definition nodePath.I:756
NodePath::verify_complete
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.
Definition nodePath.cxx:5335
NodePath::clear_depth_test
void clear_depth_test()
Completely removes any depth-test adjustment that may have been set on this node via set_depth_test()...
Definition nodePath.cxx:4595
NodePath::has_transparency
bool has_transparency() const
Returns true if a transparent-rendering adjustment has been explicitly set on this particular node vi...
Definition nodePath.cxx:4949
NodePath::clear_depth_write
void clear_depth_write()
Completely removes any depth-write adjustment that may have been set on this node via set_depth_write...
Definition nodePath.cxx:4652
NodePath::find_path_to
NodePath find_path_to(PandaNode *node) const
Searches for the indicated node below this node and returns the shortest NodePath that connects them.
Definition nodePath.cxx:333
NodePath::do_billboard_axis
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...
Definition nodePath.cxx:4747
NodePath::set_billboard_point_eye
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...
Definition nodePath.I:1763
NodePath::has_vertex_column
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...
Definition nodePath.cxx:3871
NodePath::not_found
static NodePath not_found()
Creates a NodePath with the ET_not_found error type set.
Definition nodePath.I:129
NodePath::get_max_search_depth
static int get_max_search_depth()
Returns the current setting of the search depth limit.
Definition nodePath.I:180
NodePath::clear_tex_gen
void clear_tex_gen()
Removes the texture coordinate generation mode from all texture stages on this node.
Definition nodePath.cxx:3667
NodePath::set_depth_write
void set_depth_write(bool depth_write, int priority=0)
Specifically sets or disables the writing to the depth buffer on this particular node.
Definition nodePath.cxx:4636
NodePath::set_occluder
void set_occluder(const NodePath &occluder)
Adds the indicated occluder to the list of occluders that apply to geometry at this node and below.
Definition nodePath.cxx:2688
NodePath::set_sy
void set_sy(PN_stdfloat sy)
Sets the y-scale component of the transform, leaving other components untouched.
Definition nodePath.cxx:1168
NodePath::get_render_mode
RenderModeAttrib::Mode get_render_mode() const
Returns the render mode that has been specifically set on this node via set_render_mode(),...
Definition nodePath.cxx:4466
NodePath::get_tex_gen
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 ...
Definition nodePath.cxx:3718
NodePath::has_light
bool has_light(const NodePath &light) const
Returns true if the indicated Light or PolylightNode has been specifically enabled on this particular...
Definition nodePath.cxx:2426
NodePath::has_audio_volume
bool has_audio_volume() const
Returns true if an audio volume has been applied to the referenced node, false otherwise.
Definition nodePath.cxx:5094
NodePath::flatten_light
int flatten_light()
Analyzes the geometry below this node and reports the number of vertices, triangles,...
Definition nodePath.cxx:5591
NodePath::show
void show()
Undoes the effect of a previous hide() on this node: makes the referenced node (and the entire subgra...
Definition nodePath.I:1796
NodePath::add_hash
size_t add_hash(size_t hash) const
Adds the NodePath into the running hash.
Definition nodePath.I:264
NodePath::set_pos_quat_scale
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.
Definition nodePath.cxx:1320
NodePath::set_sr
void set_sr(PN_stdfloat sr)
Sets the red component of the color scale.
Definition nodePath.I:1005
NodePath::clear_effects
void clear_effects()
Resets this node to have no render effects.
Definition nodePath.I:548
NodePath::wrt_reparent_to
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...
Definition nodePath.cxx:436
NodePath::get_hpr
LVecBase3 get_hpr() const
Retrieves the rotation component of the transform.
Definition nodePath.cxx:1109
NodePath::set_mat
void set_mat(const LMatrix4 &mat)
Directly sets an arbitrary 4x4 transform matrix.
Definition nodePath.cxx:1358
NodePath::project_texture
void project_texture(TextureStage *stage, Texture *tex, const NodePath &projector)
A convenience function to enable projective texturing at this node level and below,...
Definition nodePath.cxx:3855
NodePath::get_top_node
PandaNode * get_top_node(Thread *current_thread=Thread::get_current_thread()) const
Returns the top node of the path, or NULL if the path is empty.
Definition nodePath.I:215
NodePath::output
void output(std::ostream &out) const
Writes a sensible description of the NodePath to the indicated output stream.
Definition nodePath.cxx:696
NodePath::set_pos_quat_scale_shear
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.
Definition nodePath.cxx:1346
NodePath::show_tight_bounds
void show_tight_bounds()
Similar to show_bounds(), this draws a bounding box representing the "tight" bounds of this node and ...
Definition nodePath.cxx:5448
NodePath::get_pos
LPoint3 get_pos() const
Retrieves the translation component of the transform.
Definition nodePath.cxx:1043
NodePath::flatten_medium
int flatten_medium()
A more thorough flattening than flatten_light(), this first applies all the transforms,...
Definition nodePath.cxx:5611
NodePath::set_clip_plane
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...
Definition nodePath.cxx:2507
NodePath::find
NodePath find(const std::string &path) const
Searches for a node below the referenced node that matches the indicated string.
Definition nodePath.cxx:315
NodePath::clear_depth_offset
void clear_depth_offset()
Completely removes any depth-offset adjustment that may have been set on this node via set_depth_offs...
Definition nodePath.cxx:4708
NodePath::prepare_scene
void prepare_scene(GraphicsStateGuardianBase *gsg)
Walks through the scene graph beginning at the bottom node, and does whatever initialization is requi...
Definition nodePath.cxx:5423
NodePath::get_prev_transform
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.
Definition nodePath.cxx:882
NodePath::set_depth_offset
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...
Definition nodePath.cxx:4697
NodePath::look_at
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.
Definition nodePath.I:789
NodePath::hide
void hide()
Makes the referenced node (and the entire subgraph below this node) invisible to all cameras.
Definition nodePath.I:1853
NodePath::hide_bounds
void hide_bounds()
Stops the rendering of the bounding volume begun with show_bounds().
Definition nodePath.cxx:5457
NodePath::get_effect
const RenderEffect * get_effect(TypeHandle type) const
Returns the render effect of the indicated type, if it is defined on the node, or NULL if it is not.
Definition nodePath.I:500
NodePath::has_fog_off
bool has_fog_off() const
Returns true if a fog has been specifically disabled on this particular node via set_fog_off(),...
Definition nodePath.cxx:4327
NodePath::find_all_vertex_columns
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...
Definition nodePath.cxx:3881
NodePath::get_texture
Texture * get_texture() const
Returns the base-level texture that has been set on this particular node, or NULL if no texture has b...
Definition nodePath.cxx:3176
NodePath::replace_texture
void replace_texture(Texture *tex, Texture *new_tex)
Recursively searches the scene graph for references to the given texture, and replaces them with the ...
Definition nodePath.cxx:3214
NodePath::get_render_mode_thickness
PN_stdfloat get_render_mode_thickness() const
Returns the render mode thickness that has been specifically set on this node via set_render_mode(),...
Definition nodePath.cxx:4483
NodePath::set_texture
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...
Definition nodePath.cxx:2937
NodePath::get_shear
LVecBase3 get_shear() const
Retrieves the shear component of the transform.
Definition nodePath.cxx:1242
NodePath::set_name
set_name
Changes the name of the referenced node.
Definition nodePath.h:951
NodePath::get_scale
LVecBase3 get_scale() const
Retrieves the scale component of the transform.
Definition nodePath.cxx:1194
NodePath::has_logic_op
bool has_logic_op() const
Returns true if a logical operation has been explicitly set on this particular node via set_logic_op(...
Definition nodePath.cxx:5011
NodePath::fillin
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...
Definition nodePath.cxx:7006
NodePath::has_effect
bool has_effect(TypeHandle type) const
Returns true if there is a render effect of the indicated type defined on this node,...
Definition nodePath.I:510
NodePath::get_material
PointerTo< Material > get_material() const
Returns the material that has been set on this particular node, or NULL if no material has been set.
Definition nodePath.cxx:4236
NodePath::remove_node
void remove_node(Thread *current_thread=Thread::get_current_thread())
Disconnects the referenced node from the scene graph.
Definition nodePath.cxx:627
NodePath::get_net_tag
get_net_tag
Returns the tag value that has been defined on this node, or the nearest ancestor node,...
Definition nodePath.h:928
NodePath::get_relative_vector
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...
Definition nodePath.cxx:1969
NodePath::set_z
void set_z(PN_stdfloat z)
Sets the Z component of the position transform, leaving other components untouched.
Definition nodePath.cxx:997
NodePath::get_tex_projector_from
NodePath get_tex_projector_from(TextureStage *stage) const
Returns the "from" node associated with the TexProjectorEffect on the indicated stage.
Definition nodePath.cxx:3817
NodePath::get_common_ancestor
NodePath get_common_ancestor(const NodePath &other, Thread *current_thread=Thread::get_current_thread()) const
Returns the lowest NodePath that both of these two NodePaths have in common: the first ancestor that ...
Definition nodePath.I:312
NodePath::has_bin
bool has_bin() const
Returns true if the node has been assigned to the a particular rendering bin via set_bin(),...
Definition nodePath.cxx:2887
NodePath::adjust_all_priorities
void adjust_all_priorities(int adjustment)
Adds the indicated adjustment amount (which may be negative) to the priority for all transitions on t...
Definition nodePath.I:1784
NodePath::set_tex_transform
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.
Definition nodePath.cxx:3469
NodePath::clear_tex_projector
void clear_tex_projector(TextureStage *stage)
Removes the TexProjectorEffect for the indicated stage from this node.
Definition nodePath.cxx:3766
NodePath::set_antialias
void set_antialias(unsigned short mode, int priority=0)
Specifies the antialiasing type that should be applied at this node and below.
Definition nodePath.cxx:5044
NodePath::set_sg
void set_sg(PN_stdfloat sg)
Sets the green component of the color scale.
Definition nodePath.I:1017
NodePath::set_pos_hpr_scale
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.
Definition nodePath.I:746
NodePath::get_sb
PN_stdfloat get_sb() const
Gets the blue component of the color scale.
Definition nodePath.I:1071
NodePath::clear_color
void clear_color()
Completely removes any color adjustment from the node.
Definition nodePath.cxx:2052
NodePath::has_tex_projector
bool has_tex_projector(TextureStage *stage) const
Returns true if this node has a TexProjectorEffect for the indicated stage, false otherwise.
Definition nodePath.cxx:3798
NodePath::is_empty
bool is_empty() const
Returns true if the NodePath contains no nodes.
Definition nodePath.I:188
NodePath::clear_tag
void clear_tag(const std::string &key)
Removes the value defined for this key on this particular node.
Definition nodePath.I:2051
NodePath::set_fog_off
void set_fog_off(int priority=0)
Sets the geometry at this level and below to render using no fog.
Definition nodePath.cxx:4285
NodePath::has_clip_plane_off
bool has_clip_plane_off() const
Returns true if all clipping planes have been specifically disabled on this particular node.
Definition nodePath.cxx:2647
NodePath::get_tex_rotate
PN_stdfloat get_tex_rotate(TextureStage *stage) const
Returns the rotation set for the UV's for the given stage on the current node.
Definition nodePath.I:1387
NodePath::find_all_texcoords
InternalNameCollection find_all_texcoords() const
Returns a list of all texture coordinate sets used by any geometry at this node level and below.
Definition nodePath.cxx:3923
NodePath::clear_billboard
void clear_billboard()
Removes any billboard effect from the node.
Definition nodePath.cxx:4875
NodePath::set_sx
void set_sx(PN_stdfloat sx)
Sets the x-scale component of the transform, leaving other components untouched.
Definition nodePath.cxx:1154
NodePath::has_depth_offset
bool has_depth_offset() const
Returns true if a depth-offset adjustment has been explicitly set on this particular node via set_dep...
Definition nodePath.cxx:4719
NodePath::set_logic_op
void set_logic_op(LogicOpAttrib::Operation op, int priority=0)
Specifically sets or disables a logical operation on this particular node.
Definition nodePath.cxx:4983
NodePath::get_tex_pos
LVecBase3 get_tex_pos(TextureStage *stage) const
Returns the offset set for the UVW's for the given stage on the current node.
Definition nodePath.I:1482
NodePath::do_billboard_point_world
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...
Definition nodePath.cxx:4806
NodePath::get_node
get_node
Returns the nth node of the path, where 0 is the referenced (bottom) node and get_num_nodes() - 1 is ...
Definition nodePath.h:204
NodePath::has_color
bool has_color() const
Returns true if a color has been applied to the given node, false otherwise.
Definition nodePath.cxx:2062
NodePath::reverse_ls
void reverse_ls() const
Lists the hierarchy at and above the referenced node.
Definition nodePath.I:419
NodePath::get_tex_scale
LVecBase2 get_tex_scale(TextureStage *stage) const
Returns the scale set for the UV's for the given stage on the current node.
Definition nodePath.I:1398
NodePath::set_compass
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 ...
Definition nodePath.cxx:4895
NodePath::get_bin_draw_order
int get_bin_draw_order() const
Returns the drawing order associated with the bin that this particular node was assigned to via set_b...
Definition nodePath.cxx:2916
NodePath::find_all_texture_stages
TextureStageCollection find_all_texture_stages() const
Returns a list of a TextureStages applied to geometry at this node and below.
Definition nodePath.cxx:4072
NodePath::get_texture_sampler
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...
Definition nodePath.cxx:3230
NodePath::get_error_type
get_error_type
If is_empty() is true, this returns a code that represents the reason why the NodePath is empty.
Definition nodePath.h:211
NodePath::set_clip_plane_off
void set_clip_plane_off(int priority=0)
Sets the geometry at this level and below to render using no clip_planes at all.
Definition nodePath.cxx:2541
NodePath::find_texture
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 ...
Definition nodePath.cxx:3979
NodePath::set_fluid_pos
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...
Definition nodePath.I:627
NodePath::get_num_nodes
get_num_nodes
Returns the number of nodes in the path.
Definition nodePath.h:204
NodePath::complete_pointers
int complete_pointers(TypedWritable **plist, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
Definition nodePath.cxx:6946
NodePath::has_texture
bool has_texture() const
Returns true if a texture has been applied to this particular node via set_texture(),...
Definition nodePath.cxx:3104
NodePath::has_depth_write
bool has_depth_write() const
Returns true if a depth-write adjustment has been explicitly set on this particular node via set_dept...
Definition nodePath.cxx:4663
NodePath::clear_logic_op
void clear_logic_op()
Completely removes any logical operation that may have been set on this node via set_logic_op().
Definition nodePath.cxx:4997
NodePath::get_mat
const LMatrix4 & get_mat() const
Returns the transform matrix that has been applied to the referenced node, or the identity matrix if ...
Definition nodePath.I:776
NodePath::clear_model_nodes
int clear_model_nodes()
Recursively walks through the scene graph at this level and below, looking for ModelNodes,...
Definition nodePath.I:1984
NodePath::set_collide_mask
void set_collide_mask(CollideMask new_mask, CollideMask bits_to_change=CollideMask::all_on(), TypeHandle node_type=TypeHandle::none())
Recursively applies the indicated CollideMask to the into_collide_masks for all nodes at this level a...
Definition nodePath.I:1915
NodePath::find_all_matches
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.
Definition nodePath.cxx:357
NodePath::clear_light
void clear_light()
Completely removes any lighting operations that may have been set via set_light() or set_light_off() ...
Definition nodePath.cxx:2372
NodePath::is_stashed
bool is_stashed() const
Returns true if the referenced node is stashed either directly, or because some ancestor is stashed.
Definition nodePath.I:1887
NodePath::clear_material
void clear_material()
Completely removes any material adjustment that may have been set via set_material() from this partic...
Definition nodePath.cxx:4205
NodePath::is_ancestor_of
bool is_ancestor_of(const NodePath &other, Thread *current_thread=Thread::get_current_thread()) const
Returns true if the node represented by this NodePath is a parent or other ancestor of the other Node...
Definition nodePath.I:294
NodePath::node
PandaNode * node() const
Returns the referenced node of the path.
Definition nodePath.I:227
NodePath::find_material
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...
Definition nodePath.cxx:4128
NodePath::clear_texture
void clear_texture()
Completely removes any texture adjustment that may have been set via set_texture() or set_texture_off...
Definition nodePath.cxx:3068
NodePath::unify_texture_stages
void unify_texture_stages(TextureStage *stage)
Searches through all TextureStages at this node and below.
Definition nodePath.cxx:4093
NodePath::has_render_mode
bool has_render_mode() const
Returns true if a render mode has been explicitly set on this particular node via set_render_mode() (...
Definition nodePath.cxx:4456
NodePath::has_scissor
bool has_scissor() const
Returns true if a scissor region was defined at this node by a previous call to set_scissor().
Definition nodePath.cxx:2845
NodePath::get_color_scale
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...
Definition nodePath.cxx:2240
NodePath::clear_render_mode
void clear_render_mode()
Completely removes any render mode adjustment that may have been set on this node via set_render_mode...
Definition nodePath.cxx:4445
NodePath::get_tex_offset
LVecBase2 get_tex_offset(TextureStage *stage) const
Returns the offset set for the UV's for the given stage on the current node.
Definition nodePath.I:1375
NodePath::reparent_to
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...
Definition nodePath.cxx:394
NodePath::NodePath
NodePath()
This constructs an empty NodePath with no nodes.
Definition nodePath.I:18
NodePath::has_fog
bool has_fog() const
Returns true if a fog has been applied to this particular node via set_fog(), false otherwise.
Definition nodePath.cxx:4308
NodePath::set_tex_projector
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...
Definition nodePath.cxx:3743
NodePath::has_billboard
bool has_billboard() const
Returns true if there is any billboard effect on the node.
Definition nodePath.cxx:4884
NodePath::get_distance
PN_stdfloat get_distance(const NodePath &other) const
Returns the straight-line distance between this referenced node's coordinate frame's origin,...
Definition nodePath.I:979
NodePath::set_effect
void set_effect(const RenderEffect *effect)
Adds the indicated render effect to the scene graph on this node.
Definition nodePath.I:490
NodePath::replace_material
void replace_material(Material *mat, Material *new_mat)
Recursively searches the scene graph for references to the given material, and replaces them with the...
Definition nodePath.cxx:4257
NodePath::get_tex_transform
ConstPointerTo< TransformState > get_tex_transform(TextureStage *stage) const
Returns the texture matrix on the current node for the given stage, or identity transform if there is...
Definition nodePath.cxx:3541
NodePath::has_clip_plane
bool has_clip_plane(const NodePath &clip_plane) const
Returns true if the indicated clipping plane has been specifically applied to this particular node.
Definition nodePath.cxx:2625
NodePath::get_bin_name
std::string get_bin_name() const
Returns the name of the bin that this particular node was assigned to via set_bin(),...
Definition nodePath.cxx:2898
NodePath::get_collide_mask
CollideMask get_collide_mask() const
Returns the union of all of the into_collide_masks for nodes at this level and below.
Definition nodePath.I:1899
NodePath::set_pos_quat
void set_pos_quat(const LVecBase3 &pos, const LQuaternion &quat)
Sets the translation and rotation component of the transform, leaving scale untouched.
Definition nodePath.cxx:1267
NodePath::set_material
void set_material(Material *tex, int priority=0)
Sets the geometry at this level and below to render using the indicated material.
Definition nodePath.cxx:4182
NodePath::clear_attrib
void clear_attrib(TypeHandle type)
Removes the render attribute of the given type from this node.
Definition nodePath.I:480
NodePath::get_instance_count
int get_instance_count() const
Returns the geometry instance count, or 0 if disabled.
Definition nodePath.cxx:3414
NodePath::set_render_mode_filled_wireframe
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,...
Definition nodePath.cxx:4388
NodePath::set_audio_volume
void set_audio_volume(PN_stdfloat volume, int priority=0)
Sets the audio volume component of the transform.
Definition nodePath.cxx:5114
NodePath::unstash
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...
Definition nodePath.cxx:5236
NodePath::calc_tight_bounds
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.
Definition nodePath.cxx:5515
NodePath::has_two_sided
bool has_two_sided() const
Returns true if a two-sided adjustment has been explicitly set on this particular node via set_two_si...
Definition nodePath.cxx:4548
NodePath::ls
void ls() const
Lists the hierarchy at and below the referenced node.
Definition nodePath.I:399
NodePath::clear_compass
void clear_compass()
Removes any compass effect from the node.
Definition nodePath.cxx:4904
NodePath::write_bam_file
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.
Definition nodePath.cxx:5697
NodePath::has_mat
bool has_mat() const
Returns true if a non-identity transform matrix has been applied to the referenced node,...
Definition nodePath.I:766
NodePath::compare_to
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 ...
Definition nodePath.I:1965
NodePath::encode_to_bam_stream
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...
Definition nodePath.I:2115
NodePath::has_occluder
bool has_occluder(const NodePath &occluder) const
Returns true if the indicated occluder has been specifically applied to this particular node.
Definition nodePath.cxx:2751
NodePath::get_sort
get_sort
Returns the sort value of the referenced node within its parent; that is, the sort number passed on t...
Definition nodePath.h:243
NodePath::set_color
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.
Definition nodePath.cxx:2018
NodePath::get_render_mode_perspective
bool get_render_mode_perspective() const
Returns the flag that has been set on this node via set_render_mode_perspective(),...
Definition nodePath.cxx:4500
NodePath::get_color
LColor get_color() const
Returns the color that has been assigned to the node, or black if no color has been assigned.
Definition nodePath.cxx:2072
NodePath::get_child
NodePath get_child(int n, Thread *current_thread=Thread::get_current_thread()) const
Returns a NodePath representing the nth child of the referenced node.
Definition nodePath.I:337
NodePath::get_quat
LQuaternion get_quat() const
Retrieves the rotation component of the transform.
Definition nodePath.cxx:1131
NodePath::find_net_tag
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,...
Definition nodePath.cxx:5681
NodePath::clear_antialias
void clear_antialias()
Completely removes any antialias setting that may have been set on this node via set_antialias().
Definition nodePath.cxx:5055
NodePath::has_tex_transform
bool has_tex_transform(TextureStage *stage) const
Returns true if there is an explicit texture matrix on the current node for the given stage.
Definition nodePath.cxx:3522
NodePath::set_texture_off
void set_texture_off(int priority=0)
Sets the geometry at this level and below to render using no texture, on any stage.
Definition nodePath.cxx:3027
NodePath::set_state
void set_state(const RenderState *state, Thread *current_thread=Thread::get_current_thread())
Changes the complete state object on this node.
Definition nodePath.I:427
NodePath::set_depth_test
void set_depth_test(bool depth_test, int priority=0)
Specifically sets or disables the testing of the depth buffer on this particular node.
Definition nodePath.cxx:4579
NodePath::has_antialias
bool has_antialias() const
Returns true if an antialias setting has been explicitly mode on this particular node via set_antiali...
Definition nodePath.cxx:5066
NodePath::get_depth_offset
int get_depth_offset() const
Returns the depth offset value if it has been specified using set_depth_offset, or 0 if not.
Definition nodePath.cxx:4729
NodePath::find_all_paths_to
NodePathCollection find_all_paths_to(PandaNode *node) const
Returns the set of all NodePaths that extend from this NodePath down to the indicated node.
Definition nodePath.cxx:370
NodePath::set_pos_hpr_scale_shear
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.
Definition nodePath.cxx:1333
NodePath::is_singleton
bool is_singleton(Thread *current_thread=Thread::get_current_thread()) const
Returns true if the NodePath contains exactly one node.
Definition nodePath.I:196
NodePath::get_state
const RenderState * get_state(Thread *current_thread=Thread::get_current_thread()) const
Returns the complete state object set on this node.
Definition nodePath.cxx:722
NodePath::set_fog
void set_fog(Fog *fog, int priority=0)
Sets the geometry at this level and below to render using the indicated fog.
Definition nodePath.cxx:4273
NodePath::find_all_textures
TextureCollection find_all_textures() const
Returns a list of a textures applied to geometry at this node and below.
Definition nodePath.cxx:4000
NodePath::get_sr
PN_stdfloat get_sr() const
Gets the red component of the color scale.
Definition nodePath.I:1053
NodePath::decode_from_bam_stream
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...
Definition nodePath.cxx:5825
NodePath::clear_fog
void clear_fog()
Completely removes any fog adjustment that may have been set via set_fog() or set_fog_off() from this...
Definition nodePath.cxx:4296
NodePath::heads_up
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...
Definition nodePath.I:798
NodePath::is_hidden
bool is_hidden(DrawMask camera_mask=PandaNode::get_overall_bit()) const
Returns true if the referenced node is hidden from the indicated camera(s) either directly,...
Definition nodePath.I:1878
NodePath::set_color_scale_off
void set_color_scale_off(int priority=0)
Disables any color scale attribute inherited from above.
Definition nodePath.cxx:2177
NodePath::get_bounds
PointerTo< BoundingVolume > get_bounds(Thread *current_thread=Thread::get_current_thread()) const
Returns a newly-allocated bounding volume containing the bottom node and all of its descendants.
Definition nodePath.cxx:5468
NodePath::set_shear
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.
Definition nodePath.I:704
NodePath::has_material
bool has_material() const
Returns true if a material has been applied to this particular node via set_material(),...
Definition nodePath.cxx:4215
NodePath::clear_bin
void clear_bin()
Completely removes any bin adjustment that may have been set via set_bin() from this particular node.
Definition nodePath.cxx:2877
NodePath::has_tex_gen
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...
Definition nodePath.cxx:3700
NodePath::get_attrib
const RenderAttrib * get_attrib(TypeHandle type) const
Returns the render attribute of the indicated type, if it is defined on the node, or NULL if it is no...
Definition nodePath.I:459
NodePath::get_top
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...
Definition nodePath.cxx:208
NodePath::clear_scissor
void clear_scissor()
Removes the scissor region that was defined at this node level by a previous call to set_scissor().
Definition nodePath.cxx:2833
NodePath::has_texcoord
bool has_texcoord(const std::string &texcoord_name) const
Returns true if there are at least some vertices at this node and below that use the named texture co...
Definition nodePath.I:1744
NodePath::clear_transparency
void clear_transparency()
Completely removes any transparency adjustment that may have been set on this node via set_transparen...
Definition nodePath.cxx:4937
NodePath::attach_new_node
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...
Definition nodePath.cxx:599
NodePath::unstash_all
void unstash_all(Thread *current_thread=Thread::get_current_thread())
Unstashes this node and all stashed child nodes.
Definition nodePath.cxx:5251
NodePath::stash_to
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 ...
Definition nodePath.cxx:415
NodePath::has_parent
has_parent
Returns true if the referenced node has a parent; i.e.
Definition nodePath.h:242
NodePath::set_billboard_axis
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...
Definition nodePath.I:1753
NodePath::write_bam_stream
bool write_bam_stream(std::ostream &out) const
Writes the contents of this node and below out to the indicated stream.
Definition nodePath.cxx:5721
NodePath::get_parent
get_parent
Returns the NodePath to the parent of the referenced node: that is, this NodePath,...
Definition nodePath.h:242
NodePath::set_material_off
void set_material_off(int priority=0)
Sets the geometry at this level and below to render using no material.
Definition nodePath.cxx:4195
NodePath::set_all_color_scale
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,...
Definition nodePath.cxx:2214
NodePath::set_pos_hpr
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.
Definition nodePath.I:728
NodePath::get_tex_hpr
LVecBase3 get_tex_hpr(TextureStage *stage) const
Returns the 3-D HPR set for the UVW's for the given stage on the current node.
Definition nodePath.I:1494
NodePath::set_tex_pos
void set_tex_pos(TextureStage *stage, PN_stdfloat u, PN_stdfloat v, PN_stdfloat w)
Sets a texture matrix on the current node to apply the indicated offset to UVW's for the given stage.
Definition nodePath.I:1410
NodePath::fail
static NodePath fail()
Creates a NodePath with the ET_fail error type set.
Definition nodePath.I:149
NodePath::get_transform
const TransformState * get_transform(Thread *current_thread=Thread::get_current_thread()) const
Returns the complete transform object set on this node.
Definition nodePath.cxx:794
NodePath::set_bin
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.
Definition nodePath.cxx:2867
NodePath::set_tex_offset
void set_tex_offset(TextureStage *stage, PN_stdfloat u, PN_stdfloat v)
Sets a texture matrix on the current node to apply the indicated offset to UV's for the given stage.
Definition nodePath.I:1301
NodePath::get_sg
PN_stdfloat get_sg() const
Gets the green component of the color scale.
Definition nodePath.I:1062
NodePath::has_compass
bool has_compass() const
Returns true if there is any compass effect on the node.
Definition nodePath.cxx:4913
NodePath::clear_tex_transform
void clear_tex_transform()
Removes all texture matrices from the current node.
Definition nodePath.cxx:3490
NodePath::set_scale
void set_scale(PN_stdfloat scale)
Sets the scale component of the transform, leaving translation and rotation untouched.
Definition nodePath.I:675
NodePath::apply_texture_colors
void apply_texture_colors()
Removes textures from Geoms at this node and below by applying the texture colors to the vertices.
Definition nodePath.cxx:5669
NodePath::set_render_mode
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 ...
Definition nodePath.cxx:4434
NodePath::find_all_materials
MaterialCollection find_all_materials() const
Returns a list of a materials applied to geometry at this node and below.
Definition nodePath.cxx:4138
NodePath::removed
static NodePath removed()
Creates a NodePath with the ET_removed error type set.
Definition nodePath.I:139
NodePath::detach_node
void detach_node(Thread *current_thread=Thread::get_current_thread())
Disconnects the referenced node from its parent, but does not immediately delete it.
Definition nodePath.cxx:667
NodePath::set_two_sided
void set_two_sided(bool two_sided, int priority=0)
Specifically sets or disables two-sided rendering mode on this particular node.
Definition nodePath.cxx:4518
NodePath::get_fog
Fog * get_fog() const
Returns the fog that has been set on this particular node, or NULL if no fog has been set.
Definition nodePath.cxx:4346
NodePath::get_net_audio_volume
PN_stdfloat get_net_audio_volume() const
Returns the complete audio volume for this node taking highers nodes in the graph into account.
Definition nodePath.cxx:5170
NodePath::set_render_mode_wireframe
void set_render_mode_wireframe(int priority=0)
Sets up the geometry at this level and below (unless overridden) to render in wireframe mode.
Definition nodePath.cxx:4363
NodePath::set_quat_scale
void set_quat_scale(const LQuaternion &quat, const LVecBase3 &scale)
Sets the rotation and scale components of the transform, leaving translation untouched.
Definition nodePath.cxx:1294
NodePath::clear_color_scale
void clear_color_scale()
Completely removes any color scale from the referenced node.
Definition nodePath.cxx:2106
NodePath::set_render_mode_thickness
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,...
Definition nodePath.cxx:4422
NodePath::clear_project_texture
void clear_project_texture(TextureStage *stage)
Undoes the effect of project_texture().
Definition nodePath.I:1732
NodePath::get_name
get_name
Returns the name of the referenced node.
Definition nodePath.h:951
NodePath::set_hpr
void set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r)
Sets the rotation component of the transform, leaving translation and scale untouched.
Definition nodePath.I:651
NodePath::has_tag
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...
Definition nodePath.I:2037
NodePath::set_instance_count
void set_instance_count(int instance_count)
Sets the geometry instance count, or 0 if geometry instancing should be disabled.
Definition nodePath.cxx:3449
NodePath::set_y
void set_y(PN_stdfloat y)
Sets the Y component of the position transform, leaving other components untouched.
Definition nodePath.cxx:984
NodePath::clear_audio_volume
void clear_audio_volume()
Completely removes any audio volume from the referenced node.
Definition nodePath.cxx:5105
NodePath::set_billboard_point_world
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...
Definition nodePath.I:1772
NodePath::get_tex_scale_3d
LVecBase3 get_tex_scale_3d(TextureStage *stage) const
Returns the scale set for the UVW's for the given stage on the current node.
Definition nodePath.I:1506
NodePath::instance_under_node
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,...
Definition nodePath.cxx:521
NodePath::set_render_mode_filled
void set_render_mode_filled(int priority=0)
Sets up the geometry at this level and below (unless overridden) to render in filled (i....
Definition nodePath.cxx:4375
NodePath::set_tex_scale
void set_tex_scale(TextureStage *stage, PN_stdfloat scale)
Sets a texture matrix on the current node to apply the indicated scale to UVW's for the given stage.
Definition nodePath.I:1338
NodePath::get_tex_projector_to
NodePath get_tex_projector_to(TextureStage *stage) const
Returns the "to" node associated with the TexProjectorEffect on the indicated stage.
Definition nodePath.cxx:3836
NodePath::instance_to
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...
Definition nodePath.cxx:474
NodePath::get_effects
const RenderEffects * get_effects() const
Returns the complete RenderEffects that will be applied to this node.
Definition nodePath.I:539
NodePath::set_transparency
void set_transparency(TransparencyAttrib::Mode mode, int priority=0)
Specifically sets or disables transparent rendering mode on this particular node.
Definition nodePath.cxx:4924
NodePath::has_net_tag
has_net_tag
Returns true if the indicated tag value has been defined on this node or on any ancestor node,...
Definition nodePath.h:928
NodePath::get_two_sided
bool get_two_sided() const
Returns true if two-sided rendering has been specifically set on this node via set_two_sided(),...
Definition nodePath.cxx:4561
NodePath::has_attrib
bool has_attrib(TypeHandle type) const
Returns true if there is a render attribute of the indicated type defined on this node,...
Definition nodePath.I:469
NodePath::get_key
int get_key() const
Returns an integer that is guaranteed to be the same for all NodePaths that represent the same node i...
Definition nodePath.I:245
NodePath::clear_effect
void clear_effect(TypeHandle type)
Removes the render effect of the given type from this node.
Definition nodePath.I:519
NodePath::has_color_scale
bool has_color_scale() const
Returns true if a color scale has been applied to the referenced node, false otherwise.
Definition nodePath.cxx:2095
NodePath::clear
void clear()
Sets this NodePath to the empty NodePath.
Definition nodePath.I:119
NodePath::flatten_strong
int flatten_strong()
The strongest possible flattening.
Definition nodePath.cxx:5639
NodePath::get_transparency
TransparencyAttrib::Mode get_transparency() const
Returns the transparent rendering that has been specifically set on this node via set_transparency(),...
Definition nodePath.cxx:4963
NodePath::find_texture_stage
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...
Definition nodePath.cxx:4061
NodePath::set_color_off
void set_color_off(int priority=0)
Sets the geometry at this level and below to render using the geometry color.
Definition nodePath.cxx:2041
NodePath::get_audio_volume
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...
Definition nodePath.cxx:5154
NodePath::set_render_mode_perspective
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,...
Definition nodePath.cxx:4406
NodePath::set_tex_rotate
void set_tex_rotate(TextureStage *stage, PN_stdfloat r)
Sets a texture matrix on the current node to apply the indicated rotation, clockwise in degrees,...
Definition nodePath.I:1325
NodePath::get_antialias
unsigned short get_antialias() const
Returns the antialias setting that has been specifically set on this node via set_antialias(),...
Definition nodePath.cxx:5076
NodePath::get_stashed_children
get_stashed_children
Returns the set of all child nodes of the referenced node that have been stashed.
Definition nodePath.h:234
NodePath::set_color_scale
void set_color_scale(const LVecBase4 &scale, int priority=0)
Sets the color scale component of the transform, leaving translation and rotation untouched.
Definition nodePath.cxx:2146
NodePath::write_datagram
void write_datagram(BamWriter *manager, Datagram &dg) const
Writes the contents of this object to the datagram for shipping out to a Bam file.
Definition nodePath.cxx:6895
NodePath::set_effects
void set_effects(const RenderEffects *effects)
Sets the complete RenderEffects that will be applied this node.
Definition nodePath.I:530
NodePath::get_sa
PN_stdfloat get_sa() const
Gets the alpha component of the color scale.
Definition nodePath.I:1080
NodePath::get_stashed_ancestor
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...
Definition nodePath.cxx:5263
NodePath::get_hidden_ancestor
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),...
Definition nodePath.cxx:5189
NodePath::set_tag
void set_tag(const std::string &key, const std::string &value)
Associates a user-defined value with a user-defined key which is stored on the node.
Definition nodePath.I:1999
NodePath::set_transform
void set_transform(const TransformState *transform, Thread *current_thread=Thread::get_current_thread())
Changes the complete transform object on this node.
Definition nodePath.I:565
NodePath::write_bounds
void write_bounds(std::ostream &out) const
Writes a description of the bounding volume containing the bottom node and all of its descendants to ...
Definition nodePath.cxx:5495
NodePath::set_light_off
void set_light_off(int priority=0)
Sets the geometry at this level and below to render using no lights at all.
Definition nodePath.cxx:2321
NodePath::show_through
void show_through()
Makes the referenced node visible just to the cameras whose camera_mask shares the indicated bits.
Definition nodePath.I:1823
NodePath::get_tag
std::string get_tag(const std::string &key) const
Retrieves the user-defined value that was previously set on this node for the particular key,...
Definition nodePath.I:2010
PStatCollector
A lightweight class that represents a single element that may be timed and/or counted via stats.
Definition pStatCollector.h:43
PandaNode
A basic node of the scene graph or data graph.
Definition pandaNode.h:65
PolylightNode
A PolylightNode.
Definition polylightNode.h:29
PreparedGraphicsObjects
A table of objects that are saved within the graphics context for reference by handle later.
Definition preparedGraphicsObjects.h:58
RenderAttrib
This is the base class for a number of render attributes (other than transform) that may be set on sc...
Definition renderAttrib.h:51
RenderEffect
This is the base class for a number of special render effects that may be set on scene graph nodes to...
Definition renderEffect.h:48
RenderEffects
This represents a unique collection of RenderEffect objects that correspond to a particular renderabl...
Definition renderEffects.h:41
RenderState
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Definition renderState.h:47
SamplerState
Represents a set of settings that indicate how a texture is sampled.
Definition samplerState.h:36
ShaderBuffer
This is a generic buffer object that lives in graphics memory.
Definition shaderBuffer.h:33
ShaderInput
This is a small container class that can hold any one of the value types that can be passed as input ...
Definition shaderInput.h:40
Shader
Definition shader.h:49
TextureCollection
Manages a list of Texture objects, as returned by TexturePool::find_all_textures().
Definition textureCollection.h:25
TextureStageCollection
Definition textureStageCollection.h:24
TextureStage
Defines the properties of a named stage of the multitexture pipeline.
Definition textureStage.h:35
Texture
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
Definition texture.h:72
Thread
A thread; that is, a lightweight process.
Definition thread.h:46
Thread::get_current_thread
get_current_thread
Returns a pointer to the currently-executing Thread object.
Definition thread.h:109
TransformState
Indicates a coordinate-system transform on vertices.
Definition transformState.h:54
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
TypedWritable
Base class for objects that can be written to and read from Bam files.
Definition typedWritable.h:35
WeakNodePath
This class is a wrapper around a NodePath that, unlike the actual NodePath class, doesn't hold a refe...
Definition weakNodePath.h:32
plist
This is our own Panda specialization on the default STL list.
Definition plist.h:35
reference
internalNameCollection.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
materialCollection.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
nodePathCollection.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
nodePathComponent.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
nodePath.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandaNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pnotify.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pointerTo.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_LMatrix3.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_LMatrix4.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_LVecBase2.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_LVecBase3.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_LVecBase4.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_double.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_float.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
referenceCount.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition register_type.I:22
renderModeAttrib.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
renderState.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
shaderInput.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
stl_compares.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
textureCollection.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
textureStageCollection.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
transformState.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
transparencyAttrib.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
typedObject.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.