Panda3D
Functions
partBundle.cxx File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

#include "partBundle.h"
#include "animBundle.h"
#include "animBundleNode.h"
#include "animControl.h"
#include "loader.h"
#include "animPreloadTable.h"
#include "config_chan.h"
#include "bitArray.h"
#include "string_utils.h"
#include "indent.h"
#include "datagram.h"
#include "datagramIterator.h"
#include "bamReader.h"
#include "bamWriter.h"
#include "configVariableEnum.h"
#include "loaderOptions.h"
#include "bindAnimRequest.h"
#include <algorithm>

Go to the source code of this file.

Functions

istream & operator >> (istream &in, PartBundle::BlendType &blend_type)
 
ostream & operator<< (ostream &out, PartBundle::BlendType blend_type)
 
 PT (PartBundle) PartBundle
 Returns a PartBundle that is a duplicate of this one, but with the indicated transform applied. More...
 
 PT (AnimControl) PartBundle
 Binds the animation to the bundle, if possible, and returns a new AnimControl that can be used to start and stop the animation. More...
 

Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
drose
Date
1999-02-22

Definition in file partBundle.cxx.

Function Documentation

◆ PT() [1/2]

PT ( PartBundle  )

Returns a PartBundle that is a duplicate of this one, but with the indicated transform applied.

If this is called multiple times with the same TransformState pointer, it returns the same PartBundle each time.

Definition at line 148 of file partBundle.cxx.

References TransformState::is_identity().

◆ PT() [2/2]

PT ( AnimControl  )

Binds the animation to the bundle, if possible, and returns a new AnimControl that can be used to start and stop the animation.

Binds an animation to the bundle.

If the anim hierarchy does not match the part hierarchy, returns NULL.

If hierarchy_match_flags is 0, only an exact match is accepted; otherwise, it may contain a union of PartGroup::HierarchyMatchFlags values indicating conditions that will be tolerated (but warnings will still be issued).

If subset is specified, it restricts the binding only to the named subtree of joints.

The AnimControl is not stored within the PartBundle; it is the user's responsibility to maintain the pointer. The animation will automatically unbind itself when the AnimControl destructs (i.e. its reference count goes to zero).

The animation is loaded from the disk via the indicated Loader object. In other respects, this behaves similarly to bind_anim(), with the addition of asynchronous support.

If allow_aysnc is true, the load will be asynchronous if possible. This requires that the animation basename can be found in the PartBundle's preload table (see get_anim_preload()).

In an asynchronous load, the animation file will be loaded and bound in a sub-thread. This means that the animation will not necessarily be available at the time this method returns. You may still use the returned AnimControl immediately, though, but no visible effect will occur until the animation eventually becomes available.

You can test AnimControl::is_pending() to see if the animation has been loaded yet, or wait for it to finish with AnimControl::wait_pending() or even PartBundle::wait_pending(). You can also set an event to be triggered when the animation finishes loading with AnimControl::set_pending_done_event().

Definition at line 247 of file partBundle.cxx.

References PartBundle::do_bind_anim().