Add MeshDeformation utility for generic meshes vertices morphing (eg. via Blend Shapes or Cloth)
This commit is contained in:
@@ -16,6 +16,7 @@ API_CLASS(NoSpawn) class FLAXENGINE_API SkinnedModelLOD : public ScriptingObject
|
||||
friend SkinnedModel;
|
||||
private:
|
||||
SkinnedModel* _model = nullptr;
|
||||
int32 _lodIndex = 0;
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
@@ -28,10 +29,22 @@ public:
|
||||
/// </summary>
|
||||
API_FIELD(ReadOnly) Array<SkinnedMesh> Meshes;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the model LOD index.
|
||||
/// </summary>
|
||||
API_PROPERTY() FORCE_INLINE int32 GetLODIndex() const
|
||||
{
|
||||
return _lodIndex;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether any mesh has been initialized.
|
||||
/// </summary>
|
||||
bool HasAnyMeshInitialized() const;
|
||||
bool HasAnyMeshInitialized() const
|
||||
{
|
||||
// Note: we initialize all meshes at once so the last one can be used to check it.
|
||||
return Meshes.HasItems() && Meshes.Last().IsInitialized();
|
||||
}
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
@@ -81,6 +94,14 @@ public:
|
||||
/// <returns>Bounding box</returns>
|
||||
BoundingBox GetBox(const Matrix& world) const;
|
||||
|
||||
/// <summary>
|
||||
/// Get model bounding box in transformed world.
|
||||
/// </summary>
|
||||
/// <param name="transform">The instance transformation.</param>
|
||||
/// <param name="deformation">The meshes deformation container (optional).</param>
|
||||
/// <returns>Bounding box</returns>
|
||||
BoundingBox GetBox(const Transform& transform, const MeshDeformation* deformation = nullptr) const;
|
||||
|
||||
/// <summary>
|
||||
/// Get model bounding box in transformed world for given instance buffer for only one mesh
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user