An animated character, with skeleton-morph animation and either soft-skinned or hard-skinned vertices. More...
Public Member Functions | |
Character (string name) | |
clearLodAnimation () | |
Undoes the effect of a recent call to set_lod_animation(). | |
CharacterJoint | findJoint (string name) |
Returns a pointer to the joint with the given name, if there is such a joint, or NULL if there is no such joint. | |
CharacterSlider | findSlider (string name) |
Returns a pointer to the slider with the given name, if there is such a slider, or NULL if there is no such slider. | |
forceUpdate () | |
Recalculates the character even if we think it doesn't need it. | |
CharacterJointBundle | getBundle (int i) |
mergeBundles (PartBundle old_bundle, PartBundle other_bundle) | |
Merges old_bundle with new_bundle. | |
mergeBundles (PartBundleHandle old_bundle_handle, PartBundleHandle other_bundle_handle) | |
Merges old_bundle_handle->get_bundle() with new_bundle. | |
setLodAnimation (Point3 const center, float far_distance, float near_distance, float delay_factor) | |
Activates a special mode in which the character animates less frequently as it gets further from the camera. | |
update () | |
Recalculates the Character's joints and vertices for the current frame. | |
updateToNow () | |
Advances the character's frame to the current time, and then calls update(). | |
writeParts (ostream out) | |
Writes a list of the Character's joints and sliders, in their hierchical structure, to the indicated output stream. | |
writePartValues (ostream out) | |
Writes a list of the Character's joints and sliders, along with each current position, in their hierchical structure, to the indicated output stream. | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
An animated character, with skeleton-morph animation and either soft-skinned or hard-skinned vertices.
Character | ( | string | name | ) |
Undoes the effect of a recent call to set_lod_animation().
Henceforth, the character will animate every frame, regardless of its distance from the camera.
CharacterJoint findJoint | ( | string | name | ) |
Returns a pointer to the joint with the given name, if there is such a joint, or NULL if there is no such joint.
This will not return a pointer to a slider.
CharacterSlider findSlider | ( | string | name | ) |
Returns a pointer to the slider with the given name, if there is such a slider, or NULL if there is no such slider.
This will not return a pointer to a joint.
forceUpdate | ( | ) |
Recalculates the character even if we think it doesn't need it.
Reimplemented from PartBundleNode.
static TypeHandle getClassType | ( | ) | [static] |
Reimplemented from PartBundleNode.
mergeBundles | ( | PartBundle | old_bundle, |
PartBundle | other_bundle | ||
) |
Merges old_bundle with new_bundle.
old_bundle must be one of the PartBundles within this node. At the end of this call, the old_bundle pointer within this node will be replaced with the new_bundle pointer, and all geometry within this node will be updated to reference new_bundle.
This method is deprecated. Use the newer version of this method, below.
mergeBundles | ( | PartBundleHandle | old_bundle_handle, |
PartBundleHandle | other_bundle_handle | ||
) |
Merges old_bundle_handle->get_bundle() with new_bundle.
old_bundle_handle must be one of the PartBundleHandle within this node. At the end of this call, the bundle pointer within the old_bundle_handle will be replaced with that within the new_bundle_handle pointer, and all geometry within this node will be updated to reference new_bundle.
Normally, this is called when the two bundles have the same, or nearly the same, hierarchies. In this case, new_bundle will simply be assigned over the old_bundle position. However, if any joints are present in one bundle or the other, new_bundle will be modified to contain the union of all joints.
The geometry below this node is also updated to reference new_bundle, instead of the original old_bundle.
This method is intended to unify two different models that share a common skeleton, for instance, different LOD's of the same model.
setLodAnimation | ( | Point3 const | center, |
float | far_distance, | ||
float | near_distance, | ||
float | delay_factor | ||
) |
Activates a special mode in which the character animates less frequently as it gets further from the camera.
This is intended as a simple optimization to minimize the effort of computing animation for lots of characters that may not necessarily be very important to animate every frame.
If the character is closer to the camera than near_distance, then it is animated its normal rate, every frame. If the character is exactly far_distance away, it is animated only every delay_factor seconds (which should be a number greater than 0). If the character is between near_distance and far_distance, its animation rate is linearly interpolated according to its distance between the two. The interpolation function continues beyond far_distance, so that the character is animated increasingly less frequently as it gets farther away.
The distance calculations are made from center, which is a fixed point relative to the character node, to the camera's lod center or cull center node (or to the camera node itself).
If multiple cameras are viewing the character in any given frame, the closest one counts.
update | ( | ) |
Recalculates the Character's joints and vertices for the current frame.
Normally this is performed automatically during the render and need not be called explicitly.
updateToNow | ( | ) |
writeParts | ( | ostream | out | ) |
Writes a list of the Character's joints and sliders, in their hierchical structure, to the indicated output stream.
writePartValues | ( | ostream | out | ) |
Writes a list of the Character's joints and sliders, along with each current position, in their hierchical structure, to the indicated output stream.