Panda3D
characterJointEffect.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 characterJointEffect.I
10  * @author drose
11  * @date 2006-07-26
12  */
13 
14 /**
15  * Use CharacterJointEffect::make() to construct a new CharacterJointEffect
16  * object.
17  */
18 INLINE CharacterJointEffect::
19 CharacterJointEffect() {
20 }
21 
22 /**
23  * Returns the Character that will get update() called on it when this node's
24  * relative transform is queried, or NULL if there is no such character.
25  */
26 INLINE PT(Character) CharacterJointEffect::
27 get_character() const {
28  return _character.lock();
29 }
30 
31 /**
32  * Returns true if this CharacterJointEffect contains the given Character.
33  * This exists because it is faster to check than get_character() and can even
34  * be called while the Character is destructing.
35  */
36 INLINE bool CharacterJointEffect::
37 matches_character(Character *character) const {
38  // This works because while the Character is destructing, the ref count will
39  // be 0 but was_deleted() will still return false. We cannot construct a
40  // PointerTo to the character (via lock() or otherwise) when the reference
41  // count is 0 since that will cause double deletion.
42  return _character.get_orig() == character && !_character.was_deleted();
43 }
An animated character, with skeleton-morph animation and either soft- skinned or hard-skinned vertice...
Definition: character.h:38