Search Results for

    Show / Hide Table of Contents

    Class PrimitiveModelCache

    Cache for models generated using PrimitiveModelBuilder.

    Inheritance
    object
    IdentifiableObject
    DependencyObject
    AttachableObject
    SceneManager
    PrimitiveModelCache
    Implements
    IDependencyObject
    Inherited Members
    SceneManager.Managers
    SceneManager.Scene
    SceneManager.OnLoaded()
    SceneManager.OnAttached()
    SceneManager.OnActivated()
    SceneManager.Start()
    SceneManager.OnDeactivated()
    SceneManager.OnDestroy()
    AttachableObject.AttachableStateChanged
    AttachableObject.IsEnabled
    AttachableObject.State
    AttachableObject.IsLoaded
    AttachableObject.IsAttached
    AttachableObject.IsActivated
    AttachableObject.IsStarted
    AttachableObject.IsDestroyed
    AttachableObject.ShouldBeActivated
    AttachableObject.Destroy()
    AttachableObject.DependencyBroken()
    DependencyObject.Dependencies
    DependencyObject.OnDependencyRemoved
    IdentifiableObject.Id
    IdentifiableObject.IdHasChanged(Guid)
    Namespace: Evergine.Components.Primitives
    Assembly: Evergine.Components.dll
    Syntax
    public class PrimitiveModelCache : SceneManager, IDependencyObject

    Fields

    graphicsContext

    The graphics context dependency used for model buffer generation.

    Declaration
    [BindService(true)]
    protected GraphicsContext graphicsContext
    Field Value
    Type Description
    GraphicsContext

    Properties

    LoadedModelsCount

    Gets the number of different model instances loaded.

    Declaration
    public int LoadedModelsCount { get; }
    Property Value
    Type Description
    int

    Methods

    LoadOrCreateModel(int, string, Action<PrimitiveModelBuilder>)

    Loads a model from the cache. If the model does not exist, a new one is created.

    Declaration
    public Model LoadOrCreateModel(int primitiveHashCode, string primitiveName, Action<PrimitiveModelBuilder> buildAction)
    Parameters
    Type Name Description
    int primitiveHashCode

    The hash code of the primitive to load.

    string primitiveName

    A string representation of the primitive name.

    Action<PrimitiveModelBuilder> buildAction

    The build action based on PrimitiveModelBuilder.

    Returns
    Type Description
    Model

    The model for the given primitive.

    OnDetach()

    Invoked when the object is detached.

    Declaration
    protected override void OnDetach()
    Overrides
    SceneManager.OnDetach()

    ToString()

    Returns a string that represents the current object.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string that represents the current object.

    Overrides
    object.ToString()

    UnloadModel(int)

    Dereferences the model associated with the primitive hash code from the cache.

    If no other reference exists, the model is disposed.

    Declaration
    public bool UnloadModel(int primitiveHashCode)
    Parameters
    Type Name Description
    int primitiveHashCode

    The hash code of the primitive to unload.

    Returns
    Type Description
    bool

    true if the model was found and unloaded from the cache.

    Implements

    IDependencyObject

    Extension Methods

    ReflectionHelper.GetMemberAssembly(object)
    ReflectionHelper.GetTypeName(object)
    In this article
    Back to top
    Generated by DocFX