Class ModelComponentExtensions
 Namespace
 Stride.CommunityToolkit.Engine
 Assembly
 Stride.CommunityToolkit.dll
public static class ModelComponentExtensions
 Inheritance

ModelComponentExtensions
Methods
GetMeshHWL(ModelComponent)
Calculates the height, width, and length of the model represented by the ModelComponent.
public static Vector3 GetMeshHWL(this ModelComponent modelComponent)
Parameters
modelComponent
ModelComponentThe ModelComponent whose model dimensions are to be calculated.
Returns
 Vector3
A Vector3 representing the height, width, and length of the model.
Remarks
The dimensions are calculated based on the model's bounding box. The returned Vector3 contains the height (Yaxis), width (Xaxis), and length (Zaxis) of the bounding box.
GetMeshHeight(ModelComponent)
Calculates the height of the model represented by the ModelComponent.
public static float GetMeshHeight(this ModelComponent modelComponent)
Parameters
modelComponent
ModelComponentThe ModelComponent whose model height is to be calculated.
Returns
 float
The height of the model along the Yaxis.
Remarks
The height is calculated based on the model's bounding box, which encompasses its maximum extent in 3D space.
GetMeshVerticesAndIndices(ModelComponent, IGame)
Retrieves the vertices and indices from the ModelComponent's mesh data.
public static (List<Vector3> vertices, List<int> indices) GetMeshVerticesAndIndices(this ModelComponent model, IGame game)
Parameters
model
ModelComponentThe ModelComponent from which to extract mesh data.
game
IGameThe game instance, used to access graphics context for data extraction.
Returns
 (List<Vector3> vertices, List<int> indices)
A tuple containing two lists: the first list holds the vertices (as Vector3), and the second list holds the indices (as int).
Remarks
This method extracts raw vertex and index data from the meshes in the provided ModelComponent. It's useful for operations that require direct access to mesh data, such as custom rendering, collision detection, or physics simulations. Note that this method extracts combined vertex and index data from all meshes in the ModelComponent.