// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com) // This file is part of the "Nazara Engine - Utility module" // For conditions of distribution and use, see copyright notice in Config.hpp #include #include #include namespace Nz { SkeletalMesh::SkeletalMesh(std::shared_ptr vertexBuffer, std::shared_ptr indexBuffer) : m_aabb(Nz::Boxf::Zero()), m_indexBuffer(std::move(indexBuffer)), m_vertexBuffer(std::move(vertexBuffer)) { NazaraAssert(m_vertexBuffer, "Invalid vertex buffer"); } const Boxf& SkeletalMesh::GetAABB() const { return m_aabb; } AnimationType SkeletalMesh::GetAnimationType() const { return AnimationType::Skeletal; } const std::shared_ptr& SkeletalMesh::GetIndexBuffer() const { return m_indexBuffer; } const std::shared_ptr& SkeletalMesh::GetVertexBuffer() const { return m_vertexBuffer; } UInt32 SkeletalMesh::GetVertexCount() const { return m_vertexBuffer->GetVertexCount(); } bool SkeletalMesh::IsAnimated() const { return true; } bool SkeletalMesh::IsValid() const { return m_vertexBuffer != nullptr; } void SkeletalMesh::SetAABB(const Boxf& aabb) { m_aabb = aabb; OnSubMeshInvalidateAABB(this); } void SkeletalMesh::SetIndexBuffer(std::shared_ptr indexBuffer) { m_indexBuffer = std::move(indexBuffer); } }