Panda3D
Loading...
Searching...
No Matches
modelLoadRequest.I
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 modelLoadRequest.I
10 * @author drose
11 * @date 2006-08-29
12 */
13
14/**
15 * Returns the filename associated with this asynchronous ModelLoadRequest.
16 */
17INLINE const Filename &ModelLoadRequest::
18get_filename() const {
19 return _filename;
20}
21
22/**
23 * Returns the LoaderOptions associated with this asynchronous
24 * ModelLoadRequest.
25 */
27get_options() const {
28 return _options;
29}
30
31/**
32 * Returns the Loader object associated with this asynchronous
33 * ModelLoadRequest.
34 */
36get_loader() const {
37 return _loader;
38}
39
40/**
41 * Returns true if this request has completed, false if it is still pending or
42 * if it has been cancelled. When this returns true, you may retrieve the
43 * model loaded by calling get_model().
44 * Equivalent to `req.done() and not req.cancelled()`.
45 * @see done()
46 */
48is_ready() const {
49 return (FutureState)AtomicAdjust::get(_future_state) == FS_finished;
50}
51
52/**
53 * Returns the model that was loaded asynchronously, if any, or null if there
54 * was an error. It is an error to call this unless done() returns true.
55 * @deprecated Use result() instead.
56 */
58get_model() const {
59 nassertr_always(done(), nullptr);
60 return (PandaNode *)_result;
61}
bool done() const
Returns true if the future is done or has been cancelled.
Definition asyncFuture.I:29
static Integer get(const Integer &var)
Atomically retrieves the snapshot value of the indicated variable.
The name of a file, such as a texture file or an Egg file.
Definition filename.h:44
Specifies parameters that may be passed to the loader.
A convenient class for loading models from disk, in bam or egg format (or any of a number of other fo...
Definition loader.h:42
PandaNode * get_model() const
Returns the model that was loaded asynchronously, if any, or null if there was an error.
get_filename
Returns the filename associated with this asynchronous ModelLoadRequest.
get_loader
Returns the Loader object associated with this asynchronous ModelLoadRequest.
get_options
Returns the LoaderOptions associated with this asynchronous ModelLoadRequest.
bool is_ready() const
Returns true if this request has completed, false if it is still pending or if it has been cancelled.
A basic node of the scene graph or data graph.
Definition pandaNode.h:65