Click or drag to resize
Ab4d.SharpEngine logo

ModelNodeSetMesh Method

SetMesh is a protected method that sets the mesh that is used for this SceneNode. If the previous mesh exists, then it is disposed (except when it was set by the user in MeshModelNode). If the new mesh was not yet initialized and if this scene node was, it calls InitializeDeviceResources method. The method can also set the meshTransform - a transformation that is applied before the SceneNode's Transform is used. This can be used by a derived class to use a shared mesh (for example for box) and then use meshTransform to position and scale the mesh for this instance.

Namespace: Ab4d.SharpEngine.SceneNodes
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
protected void SetMesh(
	Mesh? mesh,
	bool isMeshCreatedHere,
	Transform? meshTransform = null,
	bool notifyChange = true,
	bool clearMeshDirtyFlag = false
)

Parameters

mesh  Mesh
new mesh (can be null)
isMeshCreatedHere  Boolean
when true, then this means that the mesh is created in this SceneNode and this will set the disposeMesh to true and dispose the mesh when this SceneNode is disposed. When the Mesh is created by the user, then isMeshCreatedHere should be set to false.
meshTransform  Transform  (Optional)
optional mesh transformation that is applied before SceneNode's Transform
notifyChange  Boolean  (Optional)
when true (by default) the method calls NotifyChange with MeshChanged flag
clearMeshDirtyFlag  Boolean  (Optional)
when true (false by default) then calling this method clears the MeshDirty flag
Remarks

SetMesh is a protected method that sets the mesh that is used for this SceneNode.

If the previous mesh exists, then it is disposed (except when it was set by the user in MeshModelNode).

If the new mesh was not yet initialized and if this scene node was, it calls InitializeDeviceResources method.

The method can also set the meshTransform - a transformation that is applied before the SceneNode's Transform is used. This can be used by a derived class to use a shared mesh (for example for box) and then use meshTransform to position and scale the mesh for this instance.

See Also