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)
Resource holding data about a 3D Model.
Namespace: Visual3D.Graphics3DAssembly: Visual3D.Engine (in Visual3D.Engine.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
| C# | Visual Basic |
[SerializableAttribute] public class Model : MediaAsset, IFixedAttributeProvider, IDynamicAttributeProvider, IHyperlinkBehaviorProvider, ILinkedEntity, IModelContainer, IDesignModified, ICloneable, IComponentOwner, IDisposable, IHasNameID, INamed, IOwned, IAttachmentSite
<SerializableAttribute> _ Public Class Model _ Inherits MediaAsset _ Implements IFixedAttributeProvider, IDynamicAttributeProvider, IHyperlinkBehaviorProvider, ILinkedEntity, _ IModelContainer, IDesignModified, ICloneable, IComponentOwner, IDisposable, _ IHasNameID, INamed, IOwned, IAttachmentSite
Members
| All Members | Constructors | Fields | Properties | Methods | Events |
| Member | Description | |
|---|---|---|
| Model()()()() | Initializes a new instance of the Model class | |
| Model(String) | Initializes a new instance of the Model class | |
| _defaultExtension | ||
| ActorsUsedBy | Used in lieu of tedious Event Handlers for each possible event. The Model is smart enough to know how to notify the SceneObjects
of important changes. | |
| AddBoneAssignment(BoneVertexAssignment) |
Assigns a vertex to a bone with a given weight, for skeletal animation.
| |
| AddMountPoint(MountPoint) | Attach given MountPoint to this model. Will replace existing MountPoint
with same name if such one exists. | |
| AllowAttachingAnyComponent | ||
| AnimationCustomShader | ||
| Animations | ||
| AnimationType | ||
| AnimationWindShader | ||
| AreAnyPartsAdjusted | ||
| 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.) | |
| BoneVertexAssignments | Returns mapping between bones of Skeleton and vertices of the model. | |
| BoundingBox | Gets/Sets a current bounding box of this model in local space. | |
| BoundingBoxChanged | Fires in response to changes of the bounding box of this model. | |
| BoundingSphereRadius | Bounding sphere radius from this model in local coordinates. | |
| BuildTangentVectors()()()() | Builds tangent space vectors required for accurate bump mapping. | |
| CameraFocusOffset | ||
| CanInstancingBeUsed()()()() | ||
| CanUnload()()()() | (Overrides MediaAssetCanUnload()()()().) | |
| Clone()()()() | ||
| 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.) | |
| ConvertBoundingBoxToString(BoundingBox) | Returns string representation of BoundingBox feasible to display in multiline text boxes. | |
| CreateActor()()()() | ||
| CreateDefaultActor | ||
| CreateFromPart(Model, Int32) | ||
| CreateFromParts(String, array<ModelPart>[]()[][]) | ||
| CreateIdentity()()()() | (Inherited from Registered.) | |
| CreateIdentityList()()()() | (Inherited from Registered.) | |
| CreateIndexData(IndexData, array<Int32>[]()[][], Int32, Boolean) | Now permits iBufData to be longer than indexCount.
| |
| CreateInstance(Boolean) | Creates an instance or non-inheriting duplicate of this asset. (Inherited from Asset.) | |
| CreateModelPart()()()() | Creates a new ModelPart. | |
| CreateModelPart(String) | ||
| CreateService<(Of <<'(TService>)>>)()()()() | (Inherited from ComponentBase.) | |
| CreateVertexBuffer(String, array<VertexPositionNormalTexture>[]()[][], VertexData) | Now permits vData to be longer than VertexCount.
| |
| CustomSkeleton | ||
| DefaultActor | ||
| DefaultActorType | ||
| DefaultIdleAnimationNameID | ||
| DetachedFromOwner(IComponentOwner) | (Inherited from EntityComponent.) | |
| DisableAllInstancing | ||
| DisableInstancingForHighestQuality | ||
| Dispose()()()() | (Inherited from ComponentBase.) | |
| Disposed | (Inherited from ComponentBase.) | |
| Empty | ||
| EnsureAlreadyRegistered(Actor) | ||
| EnsureReadyForUse()()()() | ||
| FailedToLoad |
Indicates that last attempt to load asset was failed.
| |
| ForEachPart(Action<(Of <<'(ModelPart>)>>)) | ||
| ForEachPart<(Of <<'(T>)>>)(Func<(Of <<'(ModelPart, T>)>>)) | ||
| ForFirstPart<(Of <<'(TProperty>)>>)(Func<(Of <<'(ModelPart, TProperty>)>>)) | ||
| GenerateHeightMap(SceneObject, Single, Quaternion) | ||
| GenerateLODGeometry()()()() | ||
| GenerateLODGeometry(Int32) | ||
| GeometryBaseLOD | ||
| GetActorsUsingInCurrentScene()()()() | ||
| GetAnimation(String) | ||
| GetBoundingBox(IEnumerable<(Of <<'(ActorPart>)>>), Boolean) | Returns summary bounding box of the given actor parts, taking or not actor's
transformation in account. | |
| GetBoundingBoxFromParts(BoundingBox%) | ||
| GetContent()()()() | (Overrides MediaAssetGetContent()()()().) | |
| GetLodLevel(Int32) | Gets the LOD level at the specified index or null if LOD doesn't exist on the
given level. | |
| GetModelIndices()()()() | Returns all model indices as flat array. May return null if
indices are not used. | |
| GetModelIndices(Int32) | Returns indices for specified model part. May return null if
indices are not used.
***** TODO: MEMORY FRAGMENTATION *****
| |
| GetModelPN()()()() | Returns all model vertex positions (POSITION, NORMAL vertex element)
as flat array of VertexPositionNormalTexture's.
***** TODO: MEMORY FRAGMENTATION *****
| |
| GetModelPNT()()()() | Returns all model vertex positions (POSITION, NORMAL, TEXCOORD vertex element)
as flat array of VertexPositionNormalTexture's.
***** TODO: MEMORY FRAGMENTATION *****
| |
| GetModelPrimitiveType()()()() | Returns primitive type used to render model (TriangleList for most models). | |
| GetModelVertices(Boolean) | Returns all model vertex positions (POSITION vertex element)
as flat array of Vector3's. "transformToModelSpace=true" => Local transforms are applied.
***** TODO: MEMORY FRAGMENTATION *****
| |
| GetModelVertices(Int32) | Returns vertex positions (POSITION vertex element)
for specified model part as flat array of Vector3's.
***** TODO: MEMORY FRAGMENTATION *****
| |
| GetMorphTarget(String, Int32, Boolean) | ||
| GetMountPoint(String) | Retrieve existing MountPoint of this model by it's name. May return null
if named mount point is not found. | |
| GetOwnedMaterial(String) | ||
| GetPolygonCount(ModelPart) | ||
| GetPolygonCount(ModelPart, Int32) | ||
| GetPrimitiveType(ModelPart) | ||
| GetPrimitiveType(ModelPart, Int32) | ||
| GetService<(Of <<'(TService>)>>)()()()() | (Inherited from ComponentBase.) | |
| GetService<(Of <<'(TService>)>>)(TService%) | (Inherited from ComponentBase.) | |
| GetSharedModelIndices()()()() | ***** TODO: MEMORY FRAGMENTATION *****
| |
| GetSharedModelVertices()()()() | Returns all shared model vertex positions (POSITION vertex element)
as flat array of Vector3's.
***** TODO: MEMORY FRAGMENTATION *****
| |
| GetVertexAnimation(String, Boolean) | ||
| GetVertexCount(ModelPart) | ||
| GetVertexCount(ModelPart, Int32) | ||
| GetVertexDataByTrackHandle(Int32) | Gets a vertex data element based on a morph animation track handle, where vertex data is for model part at index of handle-1, or shared vertex data if handle is 0. | |
| GetVertexDataByTrackHandle(Int32, Int32) | Gets a vertex data element based on a morph animation track handle, where vertex data is for model part at index of handle-1, or shared vertex data if handle is 0. | |
| Handle | (Inherited from Registered.) | |
| HasAnimation(String) | ||
| HasAnySkeleton | ||
| HasBoneAssignments | Gets/Sets if Model has associated Bone Assignments. | |
| HasComponents | (Inherited from ComponentBase.) | |
| HasHandle | (Inherited from Registered.) | |
| HasName | (Inherited from EntityComponent.) | |
| HasOwner<(Of <<'(TOwner>)>>)(IOwned) | (Inherited from EntityExtensions.) | |
| HasOwner<(Of <<'(TOwner>)>>)(IOwned, TOwner%) | (Inherited from EntityExtensions.) | |
| HasOwner<(Of <<'(TOwner>)>>)(IOwned, TOwner%, Boolean) | (Inherited from EntityExtensions.) | |
| HasPart(Func<(Of <<'(ModelPart, Boolean>)>>)) | ||
| HasPart(Func<(Of <<'(ModelPart, Boolean>)>>), ModelPart%) | ||
| HasParts | ||
| HasPartSpecificVertexData | ||
| HasPrototype | Gets if a prototype has been specified to inherit instance data from. (Inherited from Asset.) | |
| HasScope | (Inherited from Registered.) | |
| HasSkeleton | Determines whether or not this model has a skeleton associated with it. | |
| HasTangentVectors | Returns true if TANGENT data is found in this model. | |
| 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.) | |
| IdleAnimationNameID | Default Animation ID that will execute when in "Idle" state. | |
| Impostors | ||
| 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.) | |
| InitializeLoader()()()() |
Initializes a loader for models
| |
| IsBoundingBoxCustom | ||
| IsCustomizedAfterImport | ||
| 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.) | |
| IsEmpty | ||
| IsInitialized | Gets if this entity is currently in an initialized (and non-disposed) state. (Inherited from Asset.) | |
| IsManuallyDefined | Defines whether this model is to be loaded from a resource, or created manually at runtime. | |
| IsModified | ||
| IsPrototype | (Inherited from Asset.) | |
| IsPrototypeSettingsUIEnabled | ||
| IsPrototypeUpdateEnabled | ||
| 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.) | |
| IsValid | ||
| LevelOfDetailBias | ||
| Loaded | Fires in response to (re)loading a model from source file. | |
| LodLevelCount | Gets the current number of Lod levels associated with this model. | |
| LodLevels | Returns the list of LOD levels of this model. If you modify this
list, call GenerateLODGeometry method to apply your changes to model geometry. | |
| MainMaterial | ||
| MergeParts()()()() | Attempts to merge model parts into less number of larger parts.
Depending on whether or not it was succesful, returns actual number of
parts which have been removed from the model. | |
| MergeParts(IEnumerable<(Of <<'(ModelPart>)>>)) | Attempts to merge model parts into less number of larger parts.
Depending on whether or not it was succesful, returns actual number of
parts which have been removed from the model. | |
| MinimumActorCountForBatching | ||
| ModelParts | List of parts of this Model. | |
| Morpher | Gets or creates the definer of vertex animations, including morph target (pose) and baked vertex keyframe animations. | |
| MountPoints | Gets the mount point collection. | |
| Name | (Inherited from EntityComponent.) | |
| NameID | (Inherited from EntityComponent.) | |
| NotifyModelUsage(Actor, Boolean, Boolean) | ||
| ObjectType | ||
| OnlyInstanceForMainScene | ||
| OnMemberwiseClone()()()() | (Inherited from ComponentBase.) | |
| OwnerActivated(IComponentOwner) | (Inherited from EntityComponent.) | |
| OwnerDeactivated(IComponentOwner) | (Inherited from EntityComponent.) | |
| OwnerOf<(Of <<'(TOwner>)>>)()()()() | (Inherited from Registered.) | |
| PhysicsSettings | ||
| 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.) | |
| ProcessUpwardFacingEdges(Model..::..VertexNormalAction, Quaternion, Vector3, Single) | ||
| ProcessVertices(VertexElementUsage, Model..::..VertexAction4) |
Process all vertices of a selected channel with a given function
| |
| ProcessVertices3(VertexElementUsage, Model..::..VertexAction3) | ||
| Prototype | Gets or sets the prototype, if specified, from which this asset inherits instance data. (Inherited from Asset.) | |
| ReloadAndSaveToCache(Boolean, Boolean) |
This method performs following actions:
1. Checks whether source file for model exists and if not - doesn't re-import from source file
2. If forceImport==false, imports the model from original file *only if* it haven't cached file or it's outdated
3. If forceImport==true, imports the model from original file for model nevertheless of it's date
4. Depending on saveToCache, either saves the model to cached file or not
| |
| RemoveMountPoint(String) | Remove named mount point from this model. Does nothing if that mount point
does not belong to this model. | |
| RemoveMountPoint(MountPoint) | Remove given mount point from this model. Does nothing if that mount point
does not belong to this model. | |
| Save()()()() |
Saves model to cached file
| |
| SaveModel | ||
| Scale(Single) | Adjusts Scale of all model parts uniformly by the specified 'scale'. | |
| Scope | (Inherited from Registered.) | |
| SetFixedAttributes(RuntimeAttributeDictionary) | Classes that implement this method should fill in the specified dictionary with
RuntimeAttribute's for a list of properties. This method will only ever be called
once for a given type.
| |
| SharedVertexData | Gets/Sets the shared VertexData for this model. | |
| ShouldBeInstancing | ||
| ShouldInstancingBeUsed(Actor) | ||
| Size | ||
| Skeleton | Gets/sets the skeleton currently bound to this model. | |
| SkeletonName | Get/Sets the name of the skeleton which will be bound to this model. | |
| SkeletonSkinBoneCount | ||
| SourceFile | Gets/Sets the source file for this program. (Inherited from Asset.) | |
| SourceFormat | ||
| SpatialAdjustment | Adjustment applied to all Model Parts uniformly (in addition to separete Model Part adjustments made in addition to this. | |
| Split(Model, Plane) | ||
| StorageModule | (Inherited from Registered.) | |
| ToString()()()() | (Inherited from ComponentBase.) | |
| UniqueName | (Inherited from Registered.) | |
| UpdateBoundingBoxFromModelParts()()()() | Force update of BoundingBoxFromModelParts property. If the current
BoundingBox was equal to old value of BoundingBoxFromModelParts, new BoundingBox
will also be updated to new value. | |
| UpdateBoundingBoxFromModelParts(Boolean) | Force update of BoundingBoxFromModelParts property. If the current
BoundingBox was equal to old value of BoundingBoxFromModelParts, new BoundingBox
will also be updated to new value. | |
| UseCustomPrototype | ||
| UseSharedIndices | ||
| UsesMorphAnimation | ||
| UsesSkinnedAnimation | ||
| VertexAnimationContainer | Legacy. Use Morpher property instead. Gets or creates the definer of vertex animations, including morph target (pose) and baked vertex keyframe animations. | |
| VertexDatas | ||
| VisualObjectInEditor |
Gets or sets the Actor currently being shown in Model Editor or Entity Editor to visualize this model.
| |
| WriteDebugDescription()()()() | ||
| WriteDebugDescription(TextWriter) |
Remarks
This class holds the data used to represent a discrete
3-dimensional object. Model data usually contains more
than just vertices and triangle information; it also
includes references to materials (and the faces which use them),
level-of-detail reduction information, convex hull definition,
skeleton/bones information, keyframe animation etc.
However, it is important to note the emphasis on the word
'discrete' here. This class does not cover the large-scale
sprawling geometry found in level / terrain data.
Multiple world objects can (indeed should) be created from a
single model object - see the Entity class for more info.
The model object will have it's own default
material properties, but potentially each world instance may
wish to customize the materials from the original. When the object
is instantiated into a scene node, the model material properties
will be taken by default but may be changed. These properties
are actually held at the ModelPart level since a single model may
have parts with different materials.
As described above, because the model may have sections of differing
material properties, a model is inherently a compound contruct,
consisting of one or more ModelPart objects.
However, it strongly 'owns' it's ModelParts such that they
are loaded / unloaded at the same time. This is contrary to
the approach taken to hierarchically related (but loosely owned)
scene nodes, where data is loaded / unloaded separately. Note
also that model sub-sections (when used in an instantiated object)
share the same scene node as the parent.
Inheritance Hierarchy
System..::..Object
Visual3D.EntityModel..::..ComponentBase
Visual3D.EntityModel..::..EntityComponent
Visual3D..::..Registered
Visual3D..::..Asset
MediaAsset
Visual3D.Graphics3D..::..Model
Visual3D.EntityModel..::..ComponentBase
Visual3D.EntityModel..::..EntityComponent
Visual3D..::..Registered
Visual3D..::..Asset
MediaAsset
Visual3D.Graphics3D..::..Model