Table of Contents

Class StaticModel

Namespace
LibGFX.Core.GameElements
Assembly
LibGFX.dll

Static model game element

public class StaticModel : GameElement, IIdentifier, IPropertyTable, ISerialization
Inheritance
StaticModel
Implements
Inherited Members

Constructors

StaticModel()

Initializes a new instance of the StaticModel class.

public StaticModel()

StaticModel(string, StaticMeshModel)

Creates a new static model game element

public StaticModel(string name, StaticMeshModel model)

Parameters

name string
model StaticMeshModel

StaticModel(string, Vector3, StaticMeshModel)

Creates a new static model game element Shared models should be used when multiple instances of the same model are needed

public StaticModel(string name, Vector3 position, StaticMeshModel model)

Parameters

name string
position Vector3
model StaticMeshModel

StaticModel(string, Vector3, Vector3, StaticMeshModel)

Creates a new static model game element

public StaticModel(string name, Vector3 position, Vector3 scale, StaticMeshModel model)

Parameters

name string
position Vector3
scale Vector3
model StaticMeshModel

Properties

HasTransparency

Gets a value indicating whether the image contains any transparent pixels.

public override bool HasTransparency { get; }

Property Value

bool

Methods

ComputeAABB()

Computes the axis-aligned bounding box for the static model

public override void ComputeAABB()

Deserialize(JObject, SerializationContext, Func<JObject, bool>)

Deserializes the object from a JSON representation using the specified serialization context.

public override void Deserialize(JObject obj, SerializationContext serializationContext, Func<JObject, bool> callback = null)

Parameters

obj JObject
serializationContext SerializationContext
callback Func<JObject, bool>

Exceptions

Exception

GetMeshes()

Retrieves all meshes contained in the model.

public override Mesh[]? GetMeshes()

Returns

Mesh[]

An array of Mesh objects representing the meshes in the model, or null if no meshes are available. The array will be empty if the model contains no meshes.

GetModel()

Retrieves the static mesh model associated with this instance.

public StaticMeshModel GetModel()

Returns

StaticMeshModel

The StaticMeshModel representing the current static mesh. Returns null if no model is set.

Render(BaseScene, Viewport, IRenderDevice, Camera)

Renders the static model

public override void Render(BaseScene scene, Viewport viewport, IRenderDevice renderer, Camera camera)

Parameters

scene BaseScene
viewport Viewport
renderer IRenderDevice
camera Camera

RenderShadow(BaseScene, Viewport, IRenderDevice)

Renders the static model for shadow mapping

public override void RenderShadow(BaseScene scene, Viewport viewport, IRenderDevice renderer)

Parameters

scene BaseScene
viewport Viewport
renderer IRenderDevice

Serialize(JsonWriter, SerializationContext, Action<JsonWriter>)

Serializes the current object to a JSON representation using the specified serialization context.

public override void Serialize(JsonWriter writer, SerializationContext serializationContext, Action<JsonWriter> callback = null)

Parameters

writer JsonWriter
serializationContext SerializationContext

The context that provides information and settings for the serialization process.

callback Action<JsonWriter>