Visual3D Game EngineAPI Documentation for XNA, C#, VB, and .NET
Assembly: Visual3D.Engine (in Visual3D.Engine.dll) Version: 1.0.0.0 (1.0.0.0)
A collection of Bone objects used to animate a skinned model.
Namespace: Visual3D.Graphics3D.AnimationsAssembly: Visual3D.Engine (in Visual3D.Engine.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
| C# | Visual Basic |
[SerializableAttribute] public class Skeleton : MediaAsset, INeverSavedAsComponent
<SerializableAttribute> _ Public Class Skeleton _ Inherits MediaAsset _ Implements INeverSavedAsComponent
Members
| All Members | Constructors | Fields | Properties | Methods | Events |
| Member | Description | |
|---|---|---|
| Skeleton()()()() | Initializes a new instance of the Skeleton class | |
| Skeleton(String) | Initializes a new instance of the Skeleton class | |
| Skeleton(Skeleton) | Initializes a new instance of the Skeleton class | |
| ActorOwner | ||
| AddAnimation(AnimationDefinition, Boolean) | ||
| AddAnimations(IEnumerable<(Of <<'(AnimationDefinition>)>>), Boolean) | ||
| AnimationCount |
Gets the number of animations associated with this skeleton.
| |
| AnimationList | ||
| AssetID | (Inherited from Registered.) | |
| AssetInfo | (Inherited from Registered.) | |
| AssetOwner | Gets or sets the owner to which this asset belongs and is a member of. (Inherited from Asset.) | |
| AttachedToOwner(IComponentOwner) | (Inherited from EntityComponent.) | |
| BaseAsset | (Inherited from Registered.) | |
| Blending | Gets/Sets the animation blending mode which this skeleton will use. | |
| BoneCount | Gets the number of bones in this skeleton. | |
| BoneCountIncludingNonSkinned | Gets the number of bones in this skeleton, including non-skinned (grouping/parent) bones. | |
| Bones | ||
| ComponentOwner | Owner of this component (contained in it's ".Components" container). (Inherited from EntityComponent.) | |
| Components | Components that are attached to this Entity. (Inherited from ComponentBase.) | |
| ComponentsForGlobalSceneFolders | (Inherited from ComponentBase.) | |
| Context | Defines the Owner of this component as well as the role (i.e. 'slot') that this component fulfills. (Inherited from ComponentBase.) | |
| CreateAnimation(String, Single) |
Creates a new Animation object for animating this skeleton.
| |
| CreateBone()()()() |
Creates a brand new Bone owned by this Skeleton.
| |
| CreateBone(Int32) |
Creates a brand new Bone owned by this Skeleton.
| |
| CreateBone(String) |
Creates a brand new Bone owned by this Skeleton.
| |
| CreateBone(String, Int32) |
Creates a brand new Bone owned by this Skeleton.
| |
| CreateIdentity()()()() | (Inherited from Registered.) | |
| CreateIdentityList()()()() | (Inherited from Registered.) | |
| CreateInstance(Boolean) | Creates an instance or non-inheriting duplicate of this asset. (Inherited from Asset.) | |
| CreateService<(Of <<'(TService>)>>)()()()() | (Inherited from ComponentBase.) | |
| CreateUniqueBoneHandle()()()() | ||
| CreateUniqueBoneName()()()() | ||
| DefaultBlendingTechnique | ||
| DetachedFromOwner(IComponentOwner) | (Inherited from EntityComponent.) | |
| Dispose()()()() | (Inherited from ComponentBase.) | |
| Disposed | (Inherited from ComponentBase.) | |
| EnsureCanEdit()()()() | ||
| EnsureCanEdit(Boolean) | ||
| EnsureRootBoneExists()()()() | ||
| GetBone(Int32) | Gets a bone by its index. | |
| GetBone(NameID) | Gets a bone by its name. | |
| GetContent()()()() | (Overrides MediaAssetGetContent()()()().) | |
| GetRootBone(Int32) | Gets the root bone at the specified index. | |
| GetService<(Of <<'(TService>)>>)()()()() | (Inherited from ComponentBase.) | |
| GetService<(Of <<'(TService>)>>)(TService%) | (Inherited from ComponentBase.) | |
| Handle | (Inherited from Registered.) | |
| HasComponents | (Inherited from ComponentBase.) | |
| HasHandle | (Inherited from Registered.) | |
| HasName | (Inherited from EntityComponent.) | |
| HasPrototype | Gets if a prototype has been specified to inherit instance data from. (Inherited from Asset.) | |
| HasScope | (Inherited from Registered.) | |
| HasUniqueName | Gets if a UniqueName is specified to identify this asset with respect to its owner's other members. (Inherited from Registered.) | |
| ID | (Inherited from Registered.) | |
| IDChanged | (Inherited from Registered.) | |
| Initialize()()()() | Initializes the asset so that it might be prepared for use.
By default, PrepareForUse() is called from this method as well. (Inherited from Asset.) | |
| InvalidateAnimationState()()()() | ||
| IsAnimationBeingApplied | Indicates if an animation is being applied to this skeleton right now. | |
| IsDeserialized | Indicates if Instance was created by Deserialization. (Inherited from ComponentBase.) | |
| IsDisposed | Indicates if resource has been disposed. (Inherited from Asset.) | |
| IsDisposing | Indicates if resource is in process of Disposing but not fully disposed. (Inherited from Asset.) | |
| IsInitialized | Gets if this entity is currently in an initialized (and non-disposed) state. (Inherited from Asset.) | |
| IsInstance | ||
| IsModelSkeleton | ||
| IsPrototype | (Inherited from Asset.) | |
| IsReadyForUse | Gets/sets if asset is ready to be used.
Can be set to 'true' in class constructor in order to skip Preparation logic. (Inherited from Asset.) | |
| IsSaved | Indicates if the component is to be Saved when the owning context is saved
(e.g. for components in your scene, this controls whether or not they are saved to the scene file when the scene is saved).
Typically objects are 'Saved', unless they are transient to be programmatically created each time. (Inherited from ComponentBase.) | |
| IsSavedOnCreatingInstance | (Inherited from Asset.) | |
| IsSharedByModels |
Gets if this is a generic Skeleton registered as an asset independent of any specific model, so that it can be shared between models, or at least exported, imported, and edited separately from the model geometry.
| |
| MaxBoneCount | Maximum total available bone matrices that are available during blending. | |
| ModelOwner | ||
| ModelSkeleton | Reference to the master Skeleton. | |
| Name | (Inherited from EntityComponent.) | |
| NameID | (Inherited from EntityComponent.) | |
| OnMemberwiseClone()()()() | (Inherited from ComponentBase.) | |
| OwnerActivated(IComponentOwner) | (Inherited from EntityComponent.) | |
| OwnerDeactivated(IComponentOwner) | (Inherited from EntityComponent.) | |
| OwnerOf<(Of <<'(TOwner>)>>)()()()() | (Inherited from Registered.) | |
| PrepareForUse()()()() | Attempts to prepare asset for use. To be sure, check "IsReadyForUse"
after calling this method to ensure it's really ready for use before using it. (Inherited from Asset.) | |
| Prototype | Gets or sets the prototype, if specified, from which this asset inherits instance data. (Inherited from Asset.) | |
| Reset()()()() |
Resets the position and orientation of all bones in this skeleton to their original binding position.
| |
| Reset(Boolean) |
Resets the position and orientation of all bones in this skeleton to their original binding position.
| |
| RootBone | Gets the root bone of the skeleton. | |
| RootBoneCount | Gets the number of root bones in this skeleton. | |
| RootBones | ||
| Scope | (Inherited from Registered.) | |
| SetAnimationState(AnimationSet) | Applies the currently running Animations to this Skeleton (blends them). | |
| SetBindingPose()()()() |
Sets the current position / orientation to be the 'binding pose' ie the layout in which
bones were originally bound to a model.
| |
| SkinnedBoneCount | Gets the number of skinned bones which have vertices assigned. Currently, this is the total number of bones, skipping non-skinned bones is only supported currently for Collada .dae models which use CustomSkeleton instead, but don't support animation blending. | |
| SourceFile | Gets/Sets the source file for this program. (Inherited from Asset.) | |
| StorageModule | (Inherited from Registered.) | |
| ToString()()()() | (Overrides ComponentBase..::..ToString()()()().) | |
| UniqueName | (Inherited from Registered.) | |
| UpdateTransforms(Boolean) |
Updates all the derived transforms in the skeleton.
| |
| WriteDiagnosticsInformation(String) |
Remarks
Skeletal animation works by having a collection of 'bones' which are
actually just joints with a position and orientation, arranged in a tree structure.
For example, the wrist joint is a child of the elbow joint, which in turn is a
child of the shoulder joint. Rotating the shoulder automatically moves the elbow
and wrist as well due to this hierarchy.
So how does this animate a model? Well every vertex in a model is assigned to one or more
bones which affects it's position when the bone is moved. If a vertex is assigned to
more than one bone, then weights must be assigned to determine how much each bone affects
the vertex (actually a weight of 1.0 is used for single bone assignments).
Weighted vertex assignments are especially useful around the joints themselves
to avoid 'pinching' of the model in this region.
Therefore by moving the skeleton using preset animations, we can animate the model. The
advantage of using skeletal animation is that you store less animation data, especially
as vertex counts increase. In addition, you are able to blend multiple animations together
(e.g. walking and looking around, running and shooting) and provide smooth transitions
between animations without incurring as much of an overhead as would be involved if you
did this on the core vertex data.
Skeleton definitions are loaded from datafiles, namely the .xsf file format. They
are loaded on demand, especially when referenced by a Model.
Inheritance Hierarchy
System..::..Object
Visual3D.EntityModel..::..ComponentBase
Visual3D.EntityModel..::..EntityComponent
Visual3D..::..Registered
Visual3D..::..Asset
MediaAsset
Visual3D.Graphics3D.Animations..::..Skeleton
Visual3D.EntityModel..::..ComponentBase
Visual3D.EntityModel..::..EntityComponent
Visual3D..::..Registered
Visual3D..::..Asset
MediaAsset
Visual3D.Graphics3D.Animations..::..Skeleton