All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
UnityMeshUploadService.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "VectorMath.h"
7 #include <string>
8 #include <vector>
9 #include "IMeshUploadService.h"
10 #include "Unity.h"
11 #include "UnityCallbacks.h"
12 #include "QuantizedMeshSetChunkReader.h"
13 #include "Collision.h"
14 
15 namespace Eegeo
16 {
17  namespace Unity
18  {
20  {
21  public:
23  const MeshCallbacks& meshCallbacks
24  );
25 
27 
28  void UploadMesh(const void* pVertexData, int numOfVertices, const void* pIndexData, size_t indexDataSize, u32 numOfIndices, const std::string& debugName, const std::string& materialName, const dv3& originEcef) override;
29  void UploadMesh(const Eegeo::IO::ChunkedFileFormat::QuantizedMeshSetChunkReader::QuantizedMeshInfo& meshInfo, const void* pVertexData, const void* pIndexData, const std::string& debugName) override;
30  void UploadMesh(const std::vector<v3>& verts, const std::vector<u16>& triListIndices, const std::string& debugName, const std::string& materialName, const dv3& originEcef) override;
31  void UploadMesh(const Collision::CollisionSubMesh& submesh, const std::string& debugName, const std::string& materialName) override;
32  void DeleteUploadedMesh(const std::string& id) override;
33 
34  void AddMesh(const std::string& name) override;
35  void DeleteMesh(const std::string& name) override;
36 
37  private:
38 
39  Unity::UnpackedMesh* AllocateUnpackedMesh(const Eegeo::IO::ChunkedFileFormat::QuantizedMeshSetChunkReader::QuantizedMeshInfo& meshInfo, const char* meshName);
40  void CopyVerticesToUnpackedMesh(Unity::UnpackedMesh* mesh, const IO::ChunkedFileFormat::QuantizedMeshSetChunkReader::QuantizedMeshInfo& meshInfo, const Rendering::VertexTypes::PackedPositionNormalUvColorVertex* pSourceVertexData, const v3& positionScale, const v2& uvScale);
41  void CopyVerticesToUnpackedMesh(Unity::UnpackedMesh* mesh, const IO::ChunkedFileFormat::QuantizedMeshSetChunkReader::QuantizedMeshInfo& meshInfo, const Rendering::VertexTypes::PackedPositionNormalUvVertex* pSourceVertexData, const v3& positionScale, const v2& uvScale);
42  void CopyVerticesToUnpackedMesh(Unity::UnpackedMesh* mesh, const IO::ChunkedFileFormat::QuantizedMeshSetChunkReader::QuantizedMeshInfo& meshInfo, const Rendering::VertexTypes::PackedDiffuseVertex* pSourceVertexData, const v3& positionScale, const v2& uvScale);
43  void CopyVerticesToUnpackedMesh(Unity::UnpackedMesh* mesh, const IO::ChunkedFileFormat::QuantizedMeshSetChunkReader::QuantizedMeshInfo& meshInfo, const Rendering::VertexTypes::PackedDiffuseUvLightDotColorVertex* pSourceVertexData, const v3& positionScale, const v2& uvScale);
44  void CopyVerticesToUnpackedMesh(Unity::UnpackedMesh* mesh, const IO::ChunkedFileFormat::QuantizedMeshSetChunkReader::QuantizedMeshInfo& meshInfo, const Rendering::VertexTypes::PackedTwoTextureVertex* pSourceVertexData, const v3& positionScale, const v2& uvScale);
45  void CopyIndicesToUnpackedMesh(Unity::UnpackedMesh* mesh, const void* pIndexData, int indexCount);
46 
47  const MeshCallbacks& m_meshCallbacks;
48  };
49  }
50 }
51 
52