Changeset View
Changeset View
Standalone View
Standalone View
source/renderer/MikktspaceWrap.h
Show All 12 Lines | |||||
* | * | ||||
* You should have received a copy of the GNU General Public License | * You should have received a copy of the GNU General Public License | ||||
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | ||||
*/ | */ | ||||
#ifndef INCLUDED_MIKKWRAP | #ifndef INCLUDED_MIKKWRAP | ||||
#define INCLUDED_MIKKWRAP | #define INCLUDED_MIKKWRAP | ||||
#include "graphics/Model.h" | #include "graphics/MeshManager.h" | ||||
#include "graphics/ModelDef.h" | #include "graphics/ModelDef.h" | ||||
vladislavbelov: I think this include isn't needed as it's forward declared in the `MeshManager.h`. | |||||
Done Inline ActionsInteresting theory, but doesn't work Severity Code Description Project File Line Suppression State Error C2065 'face': undeclared identifier graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 83 Error C2065 'face': undeclared identifier graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 84 Error C2065 'face': undeclared identifier graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 97 Error C2065 'face': undeclared identifier graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 98 Error C2039 'GetFaces': is not a member of 'std::shared_ptr<CModelDef>' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 83 Error C2039 'GetFaces': is not a member of 'std::shared_ptr<CModelDef>' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 97 Error C2039 'GetNumFaces': is not a member of 'std::shared_ptr<CModelDef>' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 49 Error C2039 'GetNumUVsPerVertex': is not a member of 'std::shared_ptr<CModelDef>' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 124 Error C3861 'GetVertex': identifier not found graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 60 Error C3861 'GetVertex': identifier not found graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 71 Error C2039 'GetVertex': is not a member of 'MikkTSpace' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 137 Error C3646 'GetVertex': unknown override specifier (compiling source file ..\..\..\source\renderer\MikktspaceWrap.cpp) graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.h 73 Error C2039 'GetVertices': is not a member of 'std::shared_ptr<CModelDef>' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 84 Error C2039 'GetVertices': is not a member of 'std::shared_ptr<CModelDef>' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 98 Error C2530 'n': references must be initialized graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 105 Error C2530 'normal': references must be initialized graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 71 Error C2530 'p': references must be initialized graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 100 Error C2530 'position': references must be initialized graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 60 Error C2065 'v': undeclared identifier graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 84 Error C2065 'v': undeclared identifier graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 87 Error C2065 'v': undeclared identifier graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 88 Error C2065 'vertex': undeclared identifier graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 98 Error C2065 'vertex': undeclared identifier graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 100 Error C2065 'vertex': undeclared identifier graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 105 Error C2065 'vertex': undeclared identifier graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 119 Error C2065 'vertex': undeclared identifier graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 120 Error C2065 'vertex': undeclared identifier graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 127 Error C2065 'vertex': undeclared identifier graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 128 Error C2447 '{': missing function header (old-style formal list?) graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 138 Error (active) E0020 identifier "SModelFace" is undefined graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 83 Error (active) E0020 identifier "SModelFace" is undefined graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 97 Error (active) E0020 identifier "SModelFace" is undefined graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 140 Error (active) E0020 identifier "SModelVertex" is undefined graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 84 Error (active) E0020 identifier "SModelVertex" is undefined graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 98 Error (active) E0020 identifier "SModelVertex" is undefined graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 137 Error (active) E0020 identifier "SModelVertex" is undefined graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.h 73 Error (active) E0070 incomplete type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 62 Error (active) E0070 incomplete type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 63 Error (active) E0070 incomplete type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 64 Error (active) E0070 incomplete type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 73 Error (active) E0070 incomplete type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 74 Error (active) E0070 incomplete type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 75 Error (active) E0070 incomplete type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 101 Error (active) E0070 incomplete type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 102 Error (active) E0070 incomplete type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 103 Error (active) E0070 incomplete type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 106 Error (active) E0070 incomplete type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 107 Error (active) E0070 incomplete type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 108 Error C2228 left of '.m_Blend' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 119 Error C2228 left of '.m_Blend' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 120 Error C2228 left of '.m_Bone' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 119 Error C2228 left of '.m_Coords' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 60 Error C2228 left of '.m_Coords' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 100 Error C2228 left of '.m_Norm' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 71 Error C2228 left of '.m_Norm' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 105 Error C2228 left of '.m_UVs' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 87 Error C2228 left of '.m_UVs' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 88 Error C2228 left of '.m_UVs' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 127 Error C2228 left of '.m_UVs' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 128 Error C2228 left of '.m_Verts' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 84 Error C2228 left of '.m_Verts' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 98 Error C2228 left of '.m_Weight' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 120 Error C2228 left of '.X' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 62 Error C2228 left of '.X' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 73 Error C2228 left of '.X' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 101 Error C2228 left of '.X' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 106 Error C2228 left of '.Y' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 63 Error C2228 left of '.Y' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 74 Error C2228 left of '.Y' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 102 Error C2228 left of '.Y' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 107 Error C2228 left of '.Z' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 64 Error C2228 left of '.Z' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 75 Error C2228 left of '.Z' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 103 Error C2228 left of '.Z' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 108 Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 83 Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 84 Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 97 Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 98 Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 137 Error (active) E0393 pointer to incomplete class type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 49 Error (active) E0393 pointer to incomplete class type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 83 Error (active) E0393 pointer to incomplete class type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 84 Error (active) E0393 pointer to incomplete class type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 97 Error (active) E0393 pointer to incomplete class type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 98 Error (active) E0393 pointer to incomplete class type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 124 Error (active) E0393 pointer to incomplete class type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 140 Error (active) E0393 pointer to incomplete class type is not allowed graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 141 Error C2059 syntax error: 'const' (compiling source file ..\..\..\source\renderer\MikktspaceWrap.cpp) graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.h 73 Error C2143 syntax error: missing ';' before '&' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 83 Error C2143 syntax error: missing ';' before '&' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 84 Error C2143 syntax error: missing ';' before '&' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 97 Error C2143 syntax error: missing ';' before '&' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 98 Error C2143 syntax error: missing ';' before '{' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 138 Error C2146 syntax error: missing ';' before identifier 'GetVertex' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 137 Error C2238 unexpected token(s) preceding ';' (compiling source file ..\..\..\source\renderer\MikktspaceWrap.cpp) graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.h 73 Error C2027 use of undefined type 'CModelDef' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 49 Error C2027 use of undefined type 'CModelDef' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 83 Error C2027 use of undefined type 'CModelDef' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 84 Error C2027 use of undefined type 'CModelDef' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 97 Error C2027 use of undefined type 'CModelDef' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 98 Error C2027 use of undefined type 'CModelDef' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 124 Error C2027 use of undefined type 'CVector3D' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 62 Error C2027 use of undefined type 'CVector3D' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 63 Error C2027 use of undefined type 'CVector3D' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 64 Error C2027 use of undefined type 'CVector3D' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 73 Error C2027 use of undefined type 'CVector3D' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 74 Error C2027 use of undefined type 'CVector3D' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 75 Error C2027 use of undefined type 'CVector3D' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 101 Error C2027 use of undefined type 'CVector3D' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 102 Error C2027 use of undefined type 'CVector3D' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 103 Error C2027 use of undefined type 'CVector3D' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 106 Error C2027 use of undefined type 'CVector3D' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 107 Error C2027 use of undefined type 'CVector3D' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 108 Stan: Interesting theory, but doesn't work
```lang=js… | |||||
Not Done Inline ActionsI meant it isn't needed here but needed in the implementation (.cpp). vladislavbelov: I meant it isn't needed here but needed in the implementation (`.cpp`). | |||||
Done Inline ActionsIn cpp this doesn't work #include "renderer/MikktspaceWrap.h" #include "graphics/ModelDef.h" but this does, so I guess it can stay in the .h #include "graphics/ModelDef.h" #include "renderer/MikktspaceWrap.h" Stan: In cpp
this doesn't work
```
#include "renderer/MikktspaceWrap.h"
#include "graphics/ModelDef. | |||||
Not Done Inline ActionsWhat is an error? vladislavbelov: What is an error? | |||||
Done Inline ActionsSeverity Code Description Project File Line Suppression State Error C3861 'GetUserDataFromContext': identifier not found graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 141 Error C3861 'GetVertex': identifier not found graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 62 Error C3861 'GetVertex': identifier not found graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 73 Error C2039 'GetVertex': is not a member of 'MikkTSpace' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 139 Error C3646 'GetVertex': unknown override specifier graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.h 73 Error C2248 'MikkTSpace::m_Model': cannot access private member declared in class 'MikkTSpace' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 142 Error C2248 'MikkTSpace::m_Model': cannot access private member declared in class 'MikkTSpace' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 143 Error C2530 'normal': references must be initialized graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 73 Error C2530 'position': references must be initialized graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 62 Error C2228 left of '.m_Coords' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 62 Error C2228 left of '.m_Norm' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 73 Error C2059 syntax error: 'const' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.h 73 Error C2238 unexpected token(s) preceding ';' graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.h 73 Error C2228 left of '.m_Norm' must have class/struct/union graphics C:\Dev\OSS\0ad-git\source\renderer\MikktspaceWrap.cpp 73 Stan: ```
Severity Code Description Project File Line Suppression State… | |||||
#include "third_party/mikktspace/mikktspace.h" | #include "third_party/mikktspace/mikktspace.h" | ||||
#include <vector> | #include <vector> | ||||
class CVector3D; | class CVector3D; | ||||
class MikkTSpace | class MikkTSpace | ||||
{ | { | ||||
public: | public: | ||||
MikkTSpace(const CModelDefPtr& m, std::vector<float>& v, bool gpuSkinning); | MikkTSpace(const CModelDefPtr& m, std::vector<float>& v, bool gpuSkinning); | ||||
void Generate(); | void Generate(); | ||||
private: | private: | ||||
SMikkTSpaceInterface m_Interface; | SMikkTSpaceInterface m_Interface; | ||||
SMikkTSpaceContext m_Context; | SMikkTSpaceContext m_Context; | ||||
const CModelDefPtr& m_Model; | const CModelDefPtr& m_Model; | ||||
Done Inline ActionsWhy? vladislavbelov: Why? | |||||
Done Inline ActionsCan't forward declare From MeshManager.h class CModelDef; typedef std::shared_ptr<CModelDef> CModelDefPtr; Stan: Can't forward declare
From MeshManager.h
```lang=cpp
class CModelDef;
typedef std… | |||||
Done Inline ActionsI mean why not: #include "graphics/MeshManager.h" #include "third_party/mikktspace/mikktspace.h" #include <vector> class CVector3D; class MikkTSpace { public: MikkTSpace(const CModelDefPtr& m, std::vector<float>& v, bool gpuSkinning); // ... }; vladislavbelov: I mean why not:
```lang=cpp
#include "graphics/MeshManager.h"
#include… | |||||
Done Inline ActionsAh could work I guess I don't remember. Stan: Ah could work I guess I don't remember. | |||||
std::vector<float>& m_NewVertices; | std::vector<float>& m_NewVertices; | ||||
bool m_GpuSkinning; | bool m_GpuSkinning; | ||||
/** | /** | ||||
* @param[in] pContext - Pointer to the MikkTSpace context. | * @param[in] pContext - Pointer to the MikkTSpace context. | ||||
* @returns - the number of faces (triangles/quads) on the mesh to be processed. | * @returns - the number of faces (triangles/quads) on the mesh to be processed. | ||||
*/ | */ | ||||
static int GetNumFaces(const SMikkTSpaceContext *pContext); | static int GetNumFaces(const SMikkTSpaceContext* pContext); | ||||
/** | /** | ||||
* @param[in] pContext - Pointer to the MikkTSpace context. | * @param[in] pContext - Pointer to the MikkTSpace context. | ||||
* @param[in] iFace - Number in the range { 0, 1, ..., getNumFaces() - 1 }. | * @param[in] iFace - Number in the range { 0, 1, ..., getNumFaces() - 1 }. | ||||
* @returns - the number of faces (triangles/quads) on the mesh to be processed. | * @returns - the number of faces (triangles/quads) on the mesh to be processed. | ||||
*/ | */ | ||||
static int GetNumVerticesOfFace(const SMikkTSpaceContext *pContext, const int iFace); | static int GetNumVerticesOfFace(const SMikkTSpaceContext* pContext, const int iFace); | ||||
/** | /** | ||||
* @param[in] pContext - Pointer to the MikkTSpace context. | * @param[in] pContext - Pointer to the MikkTSpace context. | ||||
* @returns - The MikkTSpace. | * @returns - The MikkTSpace. | ||||
*/ | */ | ||||
static MikkTSpace* GetUserDataFromContext(const SMikkTSpaceContext *pContext); | static MikkTSpace* GetUserDataFromContext(const SMikkTSpaceContext* pContext); | ||||
/** | /** | ||||
* @param[in] pContext - Pointer to the MikkTSpace context. | * @param[in] pContext - Pointer to the MikkTSpace context. | ||||
* @param[in] iFace - Number in the range { 0, 1, ..., getNumFaces() - 1 }. | * @param[in] iFace - Number in the range { 0, 1, ..., getNumFaces() - 1 }. | ||||
* @param[in] iVert - Number in the range { 0, 1, 2 } for triangles and { 0, 1, 2, 3 } for quads. | * @param[in] iVert - Number in the range { 0, 1, 2 } for triangles and { 0, 1, 2, 3 } for quads. | ||||
* @returns - The MikkTSpace. | * @returns - The MikkTSpace. | ||||
*/ | */ | ||||
static SModelVertex GetVertex(const SMikkTSpaceContext *pContext, const int iFace, const int iVert); | static SModelVertex GetVertex(const SMikkTSpaceContext* pContext, const int iFace, const int iVert); | ||||
/** | /** | ||||
* @param[in] pContext - Pointer to the MikkTSpace context. | * @param[in] pContext - Pointer to the MikkTSpace context. | ||||
* @param[out] fvPosOut - The array containing the face. | * @param[out] fvPosOut - The array containing the face. | ||||
* @param[in] iFace - Number in the range { 0, 1, ..., getNumFaces() - 1 }. | * @param[in] iFace - Number in the range { 0, 1, ..., getNumFaces() - 1 }. | ||||
* @param[in] iVert - Number in the range { 0, 1, 2 } for triangles and { 0, 1, 2, 3 } for quads. | * @param[in] iVert - Number in the range { 0, 1, 2 } for triangles and { 0, 1, 2, 3 } for quads. | ||||
*/ | */ | ||||
static void GetPosition(const SMikkTSpaceContext *pContext, | static void GetPosition(const SMikkTSpaceContext* pContext, | ||||
float fvPosOut[3], const int iFace, const int iVert); | float* fvPosOut, const int iFace, const int iVert); | ||||
/** | /** | ||||
* @param[in] pContext - Pointer to the MikkTSpace context. | * @param[in] pContext - Pointer to the MikkTSpace context. | ||||
* @param[out] fvNormOut iVert - The array containing the normal. | * @param[out] fvNormOut iVert - The array containing the normal. | ||||
* @param[in] iFace - Number in the range { 0, 1, ..., getNumFaces() - 1 }. | * @param[in] iFace - Number in the range { 0, 1, ..., getNumFaces() - 1 }. | ||||
* @param[in] iVert - Number in the range { 0, 1, 2 } for triangles and { 0, 1, 2, 3 } for quads. | * @param[in] iVert - Number in the range { 0, 1, 2 } for triangles and { 0, 1, 2, 3 } for quads. | ||||
*/ | */ | ||||
static void GetNormal(const SMikkTSpaceContext *pContext, | static void GetNormal(const SMikkTSpaceContext* pContext, | ||||
float fvNormOut[3], const int iFace, const int iVert); | float* fvNormOut, const int iFace, const int iVert); | ||||
/** | /** | ||||
* @param[in] pContext - Pointer to the MikkTSpace context. | * @param[in] pContext - Pointer to the MikkTSpace context. | ||||
* @param[out] fvTexcOut iVert - Array containing the UV. | * @param[out] fvTexcOut iVert - Array containing the UV. | ||||
* @param[in] iFace - Number in the range { 0, 1, ..., getNumFaces() - 1 }. | * @param[in] iFace - Number in the range { 0, 1, ..., getNumFaces() - 1 }. | ||||
* @param[in] iVert - Number in the range { 0, 1, 2 } for triangles and { 0, 1, 2, 3 } for quads. | * @param[in] iVert - Number in the range { 0, 1, 2 } for triangles and { 0, 1, 2, 3 } for quads. | ||||
*/ | */ | ||||
static void GetTexCoord(const SMikkTSpaceContext *pContext, | static void GetTexCoord(const SMikkTSpaceContext* pContext, | ||||
float fvTexcOut[2], const int iFace, const int iVert); | float* fvTexcOut, const int iFace, const int iVert); | ||||
/** | /** | ||||
* @brief This function is used to return tangent space results to the application. | * @brief This function is used to return tangent space results to the application. | ||||
* For normal maps it is sufficient to use the following simplified version of the bitangent which is generated at pixel/vertex level. | * For normal maps it is sufficient to use the following simplified version of the bitangent which is generated at pixel/vertex level. | ||||
* fSign = bIsOrientationPreserving ? 1.0f : (-1.0f); | * fSign = bIsOrientationPreserving ? 1.0f : (-1.0f); | ||||
* bitangent = fSign * cross(vN, tangent); | * bitangent = fSign * cross(vN, tangent); | ||||
* @param[in] pContext - Pointer to the MikkTSpace context. | * @param[in] pContext - Pointer to the MikkTSpace context. | ||||
* @param[in] fvTangent - fvTangent - The tangent vector. | * @param[in] fvTangent - fvTangent - The tangent vector. | ||||
* @param[in] fvBiTangent - The "real" bitangent vector. Not be perpendicular to fvTangent. However, both are perpendicular to the vertex normal. | * @param[in] fvBiTangent - The "real" bitangent vector. Not be perpendicular to fvTangent. However, both are perpendicular to the vertex normal. | ||||
* @param[in] fMagS - magniture of the fvTangent vector. | * @param[in] fMagS - magniture of the fvTangent vector. | ||||
* @param[in] fMagT - magniture of the fvBiTangent vector. | * @param[in] fMagT - magniture of the fvBiTangent vector. | ||||
* @param[in] bIsOrientationPreserving - Whether the orientation should be preserved. | * @param[in] bIsOrientationPreserving - Whether the orientation should be preserved. | ||||
* @param[in] iFace - Number in the range {0,1,2} for triangles and {0,1,2,3} for quads. | * @param[in] iFace - Number in the range {0,1,2} for triangles and {0,1,2,3} for quads. | ||||
* @param[in] iVert - Array containing the position vector of the face. | * @param[in] iVert - Array containing the position vector of the face. | ||||
*/ | */ | ||||
static void SetTSpace(const SMikkTSpaceContext * pContext, const float fvTangent[], | static void SetTSpace(const SMikkTSpaceContext* pContext, const float* fvTangent, | ||||
const float UNUSED(fvBiTangent)[], const float UNUSED(fMagS), const float UNUSED(fMagT), | const float* UNUSED(fvBiTangent), const float UNUSED(fMagS), const float UNUSED(fMagT), | ||||
const tbool bIsOrientationPreserving, const int iFace, const int iVert); | const tbool bIsOrientationPreserving, const int iFace, const int iVert); | ||||
}; | }; | ||||
#endif // INCLUDED_MIKKWRAP | #endif // INCLUDED_MIKKWRAP |
Wildfire Games · Phabricator
I think this include isn't needed as it's forward declared in the MeshManager.h.