Former-commit-id: 5e8a6fe1d39919f583d6ec52c3a6441ea16db0d1 [formerly 6013fccf81504ad739456c6bf2a0f32f51cd0976] [formerly 6eca34e7eb539427281a09520652f6b63a09d2ef [formerly 42f25260bb808235785af682cc8227be5ced64dd]] Former-commit-id: 82fd5b55a89ae15950b1bae4164fc93f4761edf9 [formerly 7be9e16acf53f75829a6ef00cea4aca8032820de] Former-commit-id: f96d5a14ced9e7aa0a16c63c0a9c467d752ecf05
64 lines
1.6 KiB
C++
64 lines
1.6 KiB
C++
// Copyright (C) 2015 Jérôme Leclercq
|
|
// This file is part of the "Nazara Engine - Utility module"
|
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
|
|
|
#pragma once
|
|
|
|
#ifndef NAZARA_SUBMESH_HPP
|
|
#define NAZARA_SUBMESH_HPP
|
|
|
|
#include <Nazara/Prerequesites.hpp>
|
|
#include <Nazara/Core/ObjectRef.hpp>
|
|
#include <Nazara/Core/RefCounted.hpp>
|
|
#include <Nazara/Math/Box.hpp>
|
|
#include <Nazara/Utility/Enums.hpp>
|
|
#include <Nazara/Utility/IndexBuffer.hpp>
|
|
#include <Nazara/Utility/VertexBuffer.hpp>
|
|
#include <Nazara/Utility/VertexDeclaration.hpp>
|
|
|
|
namespace Nz
|
|
{
|
|
class Mesh;
|
|
class SubMesh;
|
|
|
|
using SubMeshConstRef = ObjectRef<const SubMesh>;
|
|
using SubMeshRef = ObjectRef<SubMesh>;
|
|
|
|
class NAZARA_UTILITY_API SubMesh : public RefCounted
|
|
{
|
|
friend Mesh;
|
|
|
|
public:
|
|
SubMesh(const Mesh* parent);
|
|
virtual ~SubMesh();
|
|
|
|
void GenerateNormals();
|
|
void GenerateNormalsAndTangents();
|
|
void GenerateTangents();
|
|
|
|
virtual const Boxf& GetAABB() const = 0;
|
|
virtual AnimationType GetAnimationType() const = 0;
|
|
virtual const IndexBuffer* GetIndexBuffer() const = 0;
|
|
UInt32 GetMaterialIndex() const;
|
|
const Mesh* GetParent() const;
|
|
PrimitiveMode GetPrimitiveMode() const;
|
|
UInt32 GetTriangleCount() const;
|
|
virtual UInt32 GetVertexCount() const = 0;
|
|
|
|
virtual bool IsAnimated() const = 0;
|
|
|
|
void SetMaterialIndex(UInt32 matIndex);
|
|
void SetPrimitiveMode(PrimitiveMode mode);
|
|
|
|
// Signals:
|
|
NazaraSignal(OnSubMeshRelease, const SubMesh* /*subMesh*/);
|
|
|
|
protected:
|
|
PrimitiveMode m_primitiveMode;
|
|
const Mesh* m_parent;
|
|
UInt32 m_matIndex;
|
|
};
|
|
}
|
|
|
|
#endif // NAZARA_SUBMESH_HPP
|