Class StaticModel
Renders model on the screen.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[ActorContextMenu("New/Model")]
[ActorToolbox("Visuals")]
[Unmanaged]
public class StaticModel : ModelInstanceActor, ISerializable
Constructors
StaticModel()
Properties
BoundsScale
Gets or sets the model bounds scale. It is useful when using Position Offset to animate the vertices of the object outside of its bounds. Increasing the bounds of an object will reduce performance.
Declaration
[EditorOrder(12)]
[EditorDisplay("Model", null)]
[Limit(0F, 10F, 0.1F)]
[Unmanaged]
public float BoundsScale { get; set; }
Property Value
System.Single
|
DrawModes
The draw passes to use for rendering this object.
Declaration
[EditorOrder(15)]
[EditorDisplay("Model", null)]
[Unmanaged]
public DrawPass DrawModes { get; set; }
Property Value
DrawPass
|
ForcedLOD
Gets or sets the model forced Level Of Detail index. Allows to bind the given model LOD to show. Value -1 disables this feature.
Declaration
[EditorOrder(50)]
[Limit(-1F, 100F, 0.1F)]
[EditorDisplay("Model", "Forced LOD")]
[Unmanaged]
public int ForcedLOD { get; set; }
Property Value
System.Int32
|
HasLightmap
Determines whether this model has valid lightmap data.
Declaration
[Unmanaged]
public bool HasLightmap { get; }
Property Value
System.Boolean
|
HasVertexColors
Returns true if model instance is using custom painted vertex colors buffer, otherwise it will use vertex colors from the original asset.
Declaration
[Unmanaged]
public bool HasVertexColors { get; }
Property Value
System.Boolean
|
LODBias
Gets or sets the model Level Of Detail bias value. Allows to increase or decrease rendered model quality.
Declaration
[EditorOrder(40)]
[Limit(-100F, 100F, 0.1F)]
[EditorDisplay("Model", "LOD Bias")]
[Unmanaged]
public int LODBias { get; set; }
Property Value
System.Int32
|
Model
The model asset to draw.
Declaration
[EditorOrder(20)]
[EditorDisplay("Model", null)]
[Unmanaged]
public Model Model { get; set; }
Property Value
Model
|
ScaleInLightmap
Gets or sets the model scale in lightmap (applied to all the meshes).
Declaration
[EditorOrder(10)]
[EditorDisplay("Model", "Scale In Lightmap")]
[Limit(0F, 1000F, 0.1F)]
[Unmanaged]
public float ScaleInLightmap { get; set; }
Property Value
System.Single
|
SortOrder
Gets or sets the model sort order key used when sorting drawable objects during rendering. Use lower values to draw object before others, higher values are rendered later (on top). Can be used to control transparency drawing.
Declaration
[EditorOrder(60)]
[EditorDisplay("Model", null)]
[Unmanaged]
public int SortOrder { get; set; }
Property Value
System.Int32
|
Methods
GetMaterial(Int32, Int32)
Gets the material used to render mesh at given index (overriden by model instance buffer or model default).
Declaration
[Unmanaged]
public MaterialBase GetMaterial(int meshIndex, int lodIndex)
Parameters
System.Int32
meshIndex
The zero-based mesh index. |
System.Int32
lodIndex
The LOD index. |
Returns
MaterialBase
Material or null if not assigned. |
GetVertexColor(Int32, Int32, Int32)
Gets the color of the painter vertex (this model instance).
Declaration
[Unmanaged]
public Color32 GetVertexColor(int lodIndex, int meshIndex, int vertexIndex)
Parameters
System.Int32
lodIndex
The model LOD index. |
System.Int32
meshIndex
The mesh index. |
System.Int32
vertexIndex
The vertex index. |
Returns
Color32
The color of the vertex. |
RemoveLightmap()
Removes the lightmap data from the model.
Declaration
[Unmanaged]
public void RemoveLightmap()
RemoveVertexColors()
Removes the vertex colors buffer from this instance.
Declaration
[Unmanaged]
public void RemoveVertexColors()
SetVertexColor(Int32, Int32, Int32, Color32)
Sets the color of the painter vertex (this model instance).
Declaration
[Unmanaged]
public void SetVertexColor(int lodIndex, int meshIndex, int vertexIndex, Color32 color)
Parameters
System.Int32
lodIndex
The model LOD index. |
System.Int32
meshIndex
The mesh index. |
System.Int32
vertexIndex
The vertex index. |
Color32
color
The color to set. |