Search Results for

    Show / Hide Table of Contents

    Class ModelInstanceActor

    Base class for actor types that use ModelInstanceEntries for mesh rendering.

    Inheritance
    System.Object
    Object
    SceneObject
    Actor
    ModelInstanceActor
    AnimatedModel
    SplineModel
    StaticModel
    Implements
    ISerializable
    Inherited Members
    Actor.SetLayerRecursive(Int32)
    Actor.SetLayerNameRecursive(String)
    Actor.HasTag()
    Actor.HasTag(Tag)
    Actor.HasTag(String)
    Actor.AddTag(Tag)
    Actor.AddTagRecursive(Tag)
    Actor.RemoveTag(Tag)
    Actor.SetParent(Actor, Boolean, Boolean)
    Actor.GetChild(Int32)
    Actor.GetChild(String)
    Actor.GetChild(Type)
    Actor.GetChildren(Type)
    Actor.DestroyChildren(Single)
    Actor.GetScript(Int32)
    Actor.GetScript(Type)
    Actor.GetScripts(Type)
    Actor.AddMovement(Vector3)
    Actor.AddMovement(Vector3, Quaternion)
    Actor.GetWorldToLocalMatrix(Matrix)
    Actor.GetLocalToWorldMatrix(Matrix)
    Actor.OnDebugDraw()
    Actor.OnDebugDrawSelected()
    Actor.GetPrefabRoot()
    Actor.FindActor(String)
    Actor.FindActor(Type, Boolean)
    Actor.FindActor(Type, String)
    Actor.FindActor(Type, Tag, Boolean)
    Actor.FindScript(Type)
    Actor.HasActorInHierarchy(Actor)
    Actor.HasActorInChildren(Actor)
    Actor.IntersectsItself(Ray, Single, Vector3)
    Actor.Intersects(Ray, Single, Vector3)
    Actor.LookAt(Vector3)
    Actor.LookAt(Vector3, Vector3)
    Actor.LookingAt(Vector3)
    Actor.LookingAt(Vector3, Vector3)
    Actor.ToBytes(Actor[])
    Actor.FromBytes(Byte[])
    Actor.FromBytes(Byte[], Dictionary<Guid, Guid>)
    Actor.TryGetSerializedObjectsIds(Byte[])
    Actor.ToJson()
    Actor.FromJson(String)
    Actor.Clone()
    Actor.OnEnable()
    Actor.OnDisable()
    Actor.OnParentChanged()
    Actor.OnTransformChanged()
    Actor.OnActiveChanged()
    Actor.OnActiveInTreeChanged()
    Actor.OnOrderInParentChanged()
    Actor.OnStaticFlagsChanged()
    Actor.OnLayerChanged()
    Actor.OnBeginPlay()
    Actor.OnEndPlay()
    Actor.AddStaticFlags(StaticFlags)
    Actor.RemoveStaticFlags(StaticFlags)
    Actor.SetStaticFlag(StaticFlags, Boolean)
    Actor.HasStaticFlag(StaticFlags)
    Actor.ResetLocalTransform()
    Actor.AddChild(Type)
    Actor.AddChild<T>()
    Actor.GetChild<T>()
    Actor.TryGetChild<T>(T)
    Actor.GetOrAddChild<T>()
    Actor.AddScript(Type)
    Actor.AddScript<T>()
    Actor.GetScript<T>()
    Actor.TryGetScript<T>(T)
    Actor.FindScript<T>()
    Actor.FindActor<T>(Boolean)
    Actor.FindActor<T>(String)
    Actor.FindActor<T>(Tag, Boolean)
    Actor.GetChildren<T>()
    Actor.GetScripts<T>()
    Actor.RotateAround(Vector3, Vector3, Single, Boolean)
    Actor.ToString()
    Actor.Children
    Actor.Tags
    Actor.Layer
    Actor.Name
    Actor.IsActive
    Actor.StaticFlags
    Actor.PerInstanceRandom
    Actor.LocalPosition
    Actor.LocalOrientation
    Actor.LocalScale
    Actor.Sphere
    Actor.Box
    Actor.BoxWithChildren
    Actor.EditorBox
    Actor.EditorBoxChildren
    Actor.HasContentLoaded
    Actor.IsPrefabRoot
    Actor.IsStatic
    Actor.IsTransformStatic
    Actor.WorldToLocalMatrix
    Actor.LocalToWorldMatrix
    SceneObject.SetParent(Actor, Boolean)
    SceneObject.LinkPrefab(Guid, Guid)
    SceneObject.BreakPrefabLink()
    SceneObject.GetNamePath(Char)
    SceneObject.IsDuringPlay
    SceneObject.HasParent
    SceneObject.HasPrefabLink
    SceneObject.PrefabID
    SceneObject.PrefabObjectID
    Object.__unmanagedPtr
    Object.__internalId
    Object.Finalize()
    Object.As<T>()
    Object.NewValue(Type)
    Object.New(String)
    Object.Find<T>(Guid, Boolean)
    Object.Find(Guid, Type, Boolean)
    Object.TryFind<T>(Guid)
    Object.TryFind(Guid, Type)
    Object.Destroy(Object, Single)
    Object.DestroyNow(Object)
    Object.Destroy<T>(T, Single)
    Object.Equals(Object)
    Object.GetUnmanagedPtr(Object)
    Object.GetUnmanagedInterface(Object, Type)
    Object.FromUnmanagedPtr(IntPtr)
    Object.MapObjectID(Guid)
    Object.RemapObjectID(Guid)
    Object.GetHashCode()
    Object.ID
    Object.TypeName
    Namespace: FlaxEngine
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [Unmanaged]
    public abstract class ModelInstanceActor : Actor, ISerializable

    Constructors

    ModelInstanceActor()

    Initializes a new instance of the ModelInstanceActor.

    Declaration
    protected ModelInstanceActor()

    Properties

    Entries

    Gets or sets the model entries collection. Each entry contains data how to render meshes using this entry (transformation, material, shadows casting, etc.).

    Declaration
    [Serialize]
    [EditorOrder(1000)]
    [EditorDisplay("Entries", "__inline__")]
    [Collection(CanReorderItems = false, NotNullItems = true, CanResize = false, Spacing = 10F)]
    [Unmanaged]
    public ModelInstanceEntry[] Entries { get; set; }
    Property Value
    ModelInstanceEntry[]

    MaterialSlots

    Gets the material slots array set on the asset (eg. model or skinned model asset).

    Declaration
    [Unmanaged]
    public MaterialSlot[] MaterialSlots { get; }
    Property Value
    MaterialSlot[]

    Methods

    CreateAndSetVirtualMaterialInstance(Int32)

    Utility to crate a new virtual Material Instance asset, set its parent to the currently applied material, and assign it to the entry. Can be used to modify the material parameters from code.

    Declaration
    [Unmanaged]
    public MaterialInstance CreateAndSetVirtualMaterialInstance(int entryIndex)
    Parameters
    System.Int32 entryIndex

    The material slot entry index.

    Returns
    MaterialInstance

    The created virtual material instance.

    GetMaterial(Int32)

    Gets the material used to draw the meshes which are assigned to that slot (set in Entries or model's default).

    Declaration
    [Unmanaged]
    public MaterialBase GetMaterial(int entryIndex)
    Parameters
    System.Int32 entryIndex

    The material slot entry index.

    Returns
    MaterialBase

    IntersectsEntry(ref Ray, out Single, out Vector3, out Int32)

    Determines if there is an intersection between the model actor mesh entry and a ray. If mesh data is available on the CPU performs exact intersection check with the geometry. Otherwise performs simple BoundingBox vs Ray test. For more efficient collisions detection and ray casting use physics.

    Declaration
    [Unmanaged]
    public virtual bool IntersectsEntry(ref Ray ray, out float distance, out Vector3 normal, out int entryIndex)
    Parameters
    Ray ray

    The ray to test.

    System.Single distance

    When the method completes and returns true, contains the distance of the intersection (if any valid).

    Vector3 normal

    When the method completes, contains the intersection surface normal vector (if any valid).

    System.Int32 entryIndex

    When the method completes, contains the intersection entry index (if any valid).

    Returns
    System.Boolean

    True if the actor is intersected by the ray, otherwise false.

    IntersectsEntry(Int32, ref Ray, out Single, out Vector3)

    Determines if there is an intersection between the model actor mesh entry and a ray. If mesh data is available on the CPU performs exact intersection check with the geometry. Otherwise performs simple BoundingBox vs Ray test. For more efficient collisions detection and ray casting use physics.

    Declaration
    [Unmanaged]
    public virtual bool IntersectsEntry(int entryIndex, ref Ray ray, out float distance, out Vector3 normal)
    Parameters
    System.Int32 entryIndex

    The material slot entry index to test.

    Ray ray

    The ray to test.

    System.Single distance

    When the method completes and returns true, contains the distance of the intersection (if any valid).

    Vector3 normal

    When the method completes, contains the intersection surface normal vector (if any valid).

    Returns
    System.Boolean

    True if the actor is intersected by the ray, otherwise false.

    SetMaterial(Int32, MaterialBase)

    Sets the material to the entry slot. Can be used to override the material of the meshes using this slot.

    Declaration
    [Unmanaged]
    public void SetMaterial(int entryIndex, MaterialBase material)
    Parameters
    System.Int32 entryIndex

    The material slot entry index.

    MaterialBase material

    The material to set.

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.RawClone<T>(T)

    See Also

    Actor
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat