Panda3D
Public Member Functions | Static Public Member Functions

CharacterJoint Class Reference

This represents one joint of the character's animation, containing an animating transform matrix. More...

Inheritance diagram for CharacterJoint:
MovingPartMatrix MovingPartACMatrixSwitchType MovingPartBase PartGroup TypedWritableReferenceCount Namable TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

Public Member Functions

 CharacterJoint (Character character, PartBundle root, PartGroup parent, string name, Mat4 const default_value)
bool addLocalTransform (PandaNode node)
 Adds the indicated node to the list of nodes that will be updated each frame with the joint's local transform from its parent.
bool addNetTransform (PandaNode node)
 Adds the indicated node to the list of nodes that will be updated each frame with the joint's net transform from the root.
bool applyControl (PandaNode node)
 Specifies a node to influence this particular joint so that it will always hold the node's transform.
bool applyFreeze (TransformState const transform)
 Freezes this particular joint so that it will always hold the specified transform.
bool applyFreezeMatrix (VBase3 const pos, VBase3 const hpr, VBase3 const scale)
 Freezes this particular joint so that it will always hold the specified transform.
bool applyFreezeScalar (float value)
 Freezes this particular joint so that it will always hold the specified transform.
bool clearForcedChannel ()
 Undoes the effect of a previous call to apply_freeze() or apply_control().
 clearLocalTransforms ()
 Removes all nodes from the list of nodes that will be updated each frame with the joint's local transform from its parent.
 clearName ()
 Resets the Namable's name to empty.
 clearNetTransforms ()
 Removes all nodes from the list of nodes that will be updated each frame with the joint's net transform from the root.
PartGroup copySubgraph ()
 Allocates and returns a new copy of this node and of all of its children.
string encodeToBamStream ()
 Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string.
bool encodeToBamStream (basic_stringchar data, BamWriter writer)
 Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
bool encodeToBamStream (basic_stringchar data)
 Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
PartGroup findChild (string name)
 Returns the first descendant found with the indicated name, or NULL if no such descendant exists.
UpdateSeq getBamModified ()
 Returns the current bam_modified counter.
AnimChannelBase getBound (int n)
 Returns the nth bound channel on this PartGroup.
Character getCharacter ()
 Returns the Character that owns this joint.
PartGroup getChild (int n)
 Returns the nth child of the group.
PartGroup getChildNamed (string name)
 Returns the first child found with the indicated name, or NULL if no such child exists.
list getChildren ()
Mat4 getDefaultValue ()
AnimChannelBase getForcedChannel ()
 Returns the AnimChannelBase that has been forced to this joint by a previous call to apply_freeze() or apply_control(), or NULL if no such channel has been applied.
NodePathCollection getLocalTransforms ()
 Returns a list of the local transforms set for this node.
int getMaxBound ()
 Returns the number of channels that might be bound to this PartGroup.
string getName ()
 getNetTransform (Mat4 transform)
 Copies the joint's current net transform (composed from the root of the character joint hierarchy) into the indicated matrix.
NodePathCollection getNetTransforms ()
 Returns a list of the net transforms set for this node.
int getNumChildren ()
 Returns the number of child nodes of the group.
int getRefCount ()
 Returns the current reference count.
 getTransform (Mat4 transform)
 Copies the joint's current transform into the indicated matrix.
TypeHandle getType ()
int getTypeIndex ()
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
Mat4 getValue ()
bool hasLocalTransform (PandaNode node)
 Returns true if the node is on the list of nodes that will be updated each frame with the joint's local transform from its parent, false otherwise.
bool hasName ()
 Returns true if the Namable has a nonempty name set, false if the name is empty.
bool hasNetTransform (PandaNode node)
 Returns true if the node is on the list of nodes that will be updated each frame with the joint's net transform from the root, false otherwise.
bool isCharacterJoint ()
 Returns true if this part is a CharacterJoint, false otherwise.
bool isExactType (TypeHandle handle)
 Returns true if the current object is the indicated type exactly.
bool isOfType (TypeHandle handle)
 Returns true if the current object is or derives from the indicated type.
PartGroup makeCopy ()
 Allocates and returns a new copy of the node.
 markBamModified ()
 Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams.
 output (ostream out)
 Outputs the Namable.
 outputValue (ostream out)
PyObject reduce (PyObject self)
 This special Python method is implement to provide support for the pickle module.
PyObject reducePersist (PyObject self, PyObject pickler)
 This special Python method is implement to provide support for the pickle module.
 ref ()
 Explicitly increments the reference count.
bool removeLocalTransform (PandaNode node)
 Removes the indicated node from the list of nodes that will be updated each frame with the joint's local transform from its parent.
bool removeNetTransform (PandaNode node)
 Removes the indicated node from the list of nodes that will be updated each frame with the joint's net transform from the root.
 setName (string name)
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus.
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
bool unref ()
 Explicitly decrements the reference count.
 write (ostream out, int indent_level)
 Writes a brief description of the group and all of its descendants.
 writeWithValue (ostream out, int indent_level)
 Writes a brief description of the group, showing its current value, and that of all of its descendants.

Static Public Member Functions

static TypedWritableReferenceCount decodeFromBamStream (string data, BamReader reader)
 Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string.
static TypedWritableReferenceCount decodeFromBamStream (string data)
 Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string.
static TypeHandle getClassType ()

Detailed Description

This represents one joint of the character's animation, containing an animating transform matrix.


Constructor & Destructor Documentation

CharacterJoint ( Character  character,
PartBundle  root,
PartGroup  parent,
string  name,
Mat4 const  default_value 
)

Member Function Documentation

bool addLocalTransform ( PandaNode  node)

Adds the indicated node to the list of nodes that will be updated each frame with the joint's local transform from its parent.

Returns true if the node is successfully added, false if it had already been added.

The Character pointer should be the Character object that owns this joint; this will be used to create a CharacterJointEffect for this node. If it is NULL, no such effect will be created.

A CharacterJointEffect for this joint's Character will automatically be added to the specified node.

bool addNetTransform ( PandaNode  node)

Adds the indicated node to the list of nodes that will be updated each frame with the joint's net transform from the root.

Returns true if the node is successfully added, false if it had already been added.

A CharacterJointEffect for this joint's Character will automatically be added to the specified node.

bool applyControl ( PandaNode  node) [inherited]

Specifies a node to influence this particular joint so that it will always hold the node's transform.

Returns true if this is a joint that can be so controlled, false otherwise.

This is normally only called internally by PartBundle.control_joint(), but you may also call it directly.

bool applyFreeze ( TransformState const  transform) [inherited]

Freezes this particular joint so that it will always hold the specified transform.

Returns true if this is a joint that can be so frozen, false otherwise.

This is normally only called internally by PartBundle.freeze_joint(), but you may also call it directly.

bool applyFreezeMatrix ( VBase3 const  pos,
VBase3 const  hpr,
VBase3 const  scale 
) [inherited]

Freezes this particular joint so that it will always hold the specified transform.

Returns true if this is a joint that can be so frozen, false otherwise.

This is normally only called internally by PartBundle.freeze_joint(), but you may also call it directly.

bool applyFreezeScalar ( float  value) [inherited]

Freezes this particular joint so that it will always hold the specified transform.

Returns true if this is a joint that can be so frozen, false otherwise.

This is normally only called internally by PartBundle.freeze_joint(), but you may also call it directly.

bool clearForcedChannel ( ) [inherited]

Undoes the effect of a previous call to apply_freeze() or apply_control().

Returns true if the joint was modified, false otherwise.

This is normally only called internally by PartBundle.release_joint(), but you may also call it directly.

clearLocalTransforms ( )

Removes all nodes from the list of nodes that will be updated each frame with the joint's local transform from its parent.

clearName ( ) [inherited]

Resets the Namable's name to empty.

Reimplemented in AsyncTask.

clearNetTransforms ( )

Removes all nodes from the list of nodes that will be updated each frame with the joint's net transform from the root.

PartGroup copySubgraph ( ) [inherited]

Allocates and returns a new copy of this node and of all of its children.

static TypedWritableReferenceCount decodeFromBamStream ( string  data,
BamReader  reader 
) [static, inherited]

Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string.

Returns NULL on error.

This method is intended to replace decode_raw_from_bam_stream() when you know the stream in question returns an object of type TypedWritableReferenceCount, allowing for easier reference count management. Note that the caller is still responsible for maintaining the reference count on the return value.

static TypedWritableReferenceCount decodeFromBamStream ( string  data) [static, inherited]

Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string.

Returns NULL on error.

This method is intended to replace decode_raw_from_bam_stream() when you know the stream in question returns an object of type TypedWritableReferenceCount, allowing for easier reference count management. Note that the caller is still responsible for maintaining the reference count on the return value.

string encodeToBamStream ( ) [inherited]

Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string.

Returns empty string on failure.

This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.

bool encodeToBamStream ( basic_stringchar  data,
BamWriter  writer 
) [inherited]

Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.

Returns true on success, false on failure.

This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.

bool encodeToBamStream ( basic_stringchar  data) [inherited]

Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.

Returns true on success, false on failure.

This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.

PartGroup findChild ( string  name) [inherited]

Returns the first descendant found with the indicated name, or NULL if no such descendant exists.

This method searches the entire graph beginning at this PartGroup; see also get_child_named().

UpdateSeq getBamModified ( ) [inherited]

Returns the current bam_modified counter.

This counter is normally incremented automatically whenever the object is modified.

AnimChannelBase getBound ( int  n) [inherited]

Returns the nth bound channel on this PartGroup.

n can be determined by iterating from 0 to one less than get_max_bound(); or n might be AnimControl.get_channel_index().

This will return NULL if there is no channel bound on the indicated index. It is an error to call this if n is less than zero or greater than or equal to get_max_bound().

Character getCharacter ( )

Returns the Character that owns this joint.

PartGroup getChild ( int  n) [inherited]

Returns the nth child of the group.

PartGroup getChildNamed ( string  name) [inherited]

Returns the first child found with the indicated name, or NULL if no such child exists.

This method searches only the children of this particular PartGroup; it does not recursively search the entire graph. See also find_child().

list getChildren ( ) [inherited]
static TypeHandle getClassType ( ) [static]

Reimplemented from MovingPartMatrix.

Mat4 getDefaultValue ( ) [inherited]
AnimChannelBase getForcedChannel ( ) [inherited]

Returns the AnimChannelBase that has been forced to this joint by a previous call to apply_freeze() or apply_control(), or NULL if no such channel has been applied.

NodePathCollection getLocalTransforms ( )

Returns a list of the local transforms set for this node.

Note that this returns a list of NodePaths, even though the local transforms are actually a list of PandaNodes.

int getMaxBound ( ) [inherited]

Returns the number of channels that might be bound to this PartGroup.

This might not be the actual number of channels, since there might be holes in the list; it is one more than the index number of the highest bound channel. Thus, it is called get_max_bound() instead of get_num_bound().

string getName ( ) [inherited]

Reimplemented in DynamicTextFont.

getNetTransform ( Mat4  transform)

Copies the joint's current net transform (composed from the root of the character joint hierarchy) into the indicated matrix.

NodePathCollection getNetTransforms ( )

Returns a list of the net transforms set for this node.

Note that this returns a list of NodePaths, even though the net transforms are actually a list of PandaNodes.

int getNumChildren ( ) [inherited]

Returns the number of child nodes of the group.

int getRefCount ( ) [inherited]

Returns the current reference count.

getTransform ( Mat4  transform)

Copies the joint's current transform into the indicated matrix.

TypeHandle getType ( ) [inherited]

Reimplemented in AnimChannelBase.

int getTypeIndex ( ) [inherited]

Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

This is equivalent to get_type().get_index().

Mat4 getValue ( ) [inherited]
bool hasLocalTransform ( PandaNode  node)

Returns true if the node is on the list of nodes that will be updated each frame with the joint's local transform from its parent, false otherwise.

bool hasName ( ) [inherited]

Returns true if the Namable has a nonempty name set, false if the name is empty.

bool hasNetTransform ( PandaNode  node)

Returns true if the node is on the list of nodes that will be updated each frame with the joint's net transform from the root, false otherwise.

bool isCharacterJoint ( ) [inherited]

Returns true if this part is a CharacterJoint, false otherwise.

This is a tiny optimization over is_of_type(CharacterType.get_class_type()).

bool isExactType ( TypeHandle  handle) [inherited]

Returns true if the current object is the indicated type exactly.

bool isOfType ( TypeHandle  handle) [inherited]

Returns true if the current object is or derives from the indicated type.

PartGroup makeCopy ( ) [inherited]

Allocates and returns a new copy of the node.

Children are not copied, but see copy_subgraph().

markBamModified ( ) [inherited]

Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams.

This should normally not need to be called by user code; it should be called internally when the object has been changed in a way that legitimately requires its retransmission to any connected clients.

output ( ostream  out) [inherited]

Outputs the Namable.

This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.

Reimplemented in PandaNode, MouseWatcherRegion, TextNode, AdaptiveLru, SimpleLru, AsyncTask, Material, AsyncTaskChain, AsyncTaskManager, Thread, CollisionTraverser, PartBundle, AnimGroup, AnimControl, PandaLoader, LightNode, and LightLensNode.

outputValue ( ostream  out) [inherited]
PyObject reduce ( PyObject  self) [inherited]

This special Python method is implement to provide support for the pickle module.

This hooks into the native pickle and cPickle modules, but it cannot properly handle self-referential BAM objects.

PyObject reducePersist ( PyObject  self,
PyObject  pickler 
) [inherited]

This special Python method is implement to provide support for the pickle module.

This is similar to __reduce__, but it provides additional support for the missing persistent-state object needed to properly support self-referential BAM objects written to the pickle stream. This hooks into the pickle and cPickle modules implemented in direct/src/stdpy.

ref ( ) [inherited]

Explicitly increments the reference count.

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

bool removeLocalTransform ( PandaNode  node)

Removes the indicated node from the list of nodes that will be updated each frame with the joint's local transform from its parent.

Returns true if the node is successfully removed, false if it was not on the list.

If the node has a CharacterJointEffect that matches this joint's Character, it will be cleared.

bool removeNetTransform ( PandaNode  node)

Removes the indicated node from the list of nodes that will be updated each frame with the joint's net transform from the root.

Returns true if the node is successfully removed, false if it was not on the list.

If the node has a CharacterJointEffect that matches this joint's Character, it will be cleared.

setName ( string  name) [inherited]

Reimplemented in PGItem, and AsyncTask.

bool testRefCountIntegrity ( ) [inherited]

Does some easy checks to make sure that the reference count isn't completely bogus.

Returns true if ok, false otherwise.

Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.

bool testRefCountNonzero ( ) [inherited]

Does some easy checks to make sure that the reference count isn't zero, or completely bogus.

Returns true if ok, false otherwise.

bool unref ( ) [inherited]

Explicitly decrements the reference count.

Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete().

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

The return value is true if the new reference count is nonzero, false if it is zero.

Reimplemented in GeomVertexArrayFormat, and GeomVertexFormat.

write ( ostream  out,
int  indent_level 
) [inherited]

Writes a brief description of the group and all of its descendants.

writeWithValue ( ostream  out,
int  indent_level 
) [inherited]

Writes a brief description of the group, showing its current value, and that of all of its descendants.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties