Renamed Vector3 class to KRVector3

KRObjPacker project updated to use KREngine_osx framework rather than having a copy of the files

--HG--
extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%4015
This commit is contained in:
kearwood
2012-03-15 22:57:20 +00:00
parent a9786b80e6
commit bb38ede18e
28 changed files with 136 additions and 130 deletions

View File

@@ -30,7 +30,7 @@
E404C89E136B8E2F00B6C99B /* objpack.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = objpack.1; sourceTree = "<group>"; };
E404C8A4136B901400B6C99B /* KROBJPacker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = KROBJPacker.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
E404C8A5136B901400B6C99B /* KROBJPacker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = KROBJPacker.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
E4BBBBA01512A51200F43B5B /* krengine_osx.framework */ = {isa = PBXFileReference; lastKnownFileType = file; name = krengine_osx.framework; path = ../KREngine/build/Release/krengine_osx.framework; sourceTree = "<group>"; };
E4BBBBA01512A51200F43B5B /* krengine_osx.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = krengine_osx.framework; path = ../KREngine/build/Release/krengine_osx.framework; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -107,7 +107,7 @@
E404C88F136B8E2F00B6C99B /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
LastUpgradeCheck = 0430;
ORGANIZATIONNAME = "Kearwood Software";
};
buildConfigurationList = E404C892136B8E2F00B6C99B /* Build configuration list for PBXProject "objpack" */;
@@ -152,7 +152,7 @@
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = /Users/kearwood/Documents/dev/svn/sarofax/tools/krengine/trunk/KREngine/KREngine/Classes;
HEADER_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 10.6;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
@@ -168,7 +168,7 @@
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = /Users/kearwood/Documents/dev/svn/sarofax/tools/krengine/trunk/KREngine/KREngine/Classes;
HEADER_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 10.6;
SDKROOT = macosx;
};

View File

@@ -40,7 +40,7 @@
#include <vector.h>
#include "KROBJPacker.h"
#import <KRVector3.h>
#import <KREngine_osx/KRVector3.h>
KROBJPacker::KROBJPacker() {
@@ -60,7 +60,7 @@ void KROBJPacker::pack(const char *szPath) {
std::vector<std::string> materials;
Vertex3D *pVertices = NULL;
Vector3D *pNormals = NULL;
KRVector3D *pNormals = NULL;
TexCoord *pTexCoords = NULL;
int *pFaces = NULL;
@@ -155,13 +155,13 @@ void KROBJPacker::pack(const char *szPath) {
cout << " Pass 2 - Populate vertexes and faces\n";
Vertex3D *pVertices = (Vertex3D *)malloc(sizeof(Vertex3D) * cVertices);
Vector3D *pNormals = (Vector3D *)malloc(sizeof(Vector3D) *cNormals);
KRVector3D *pNormals = (KRVector3D *)malloc(sizeof(KRVector3D) *cNormals);
TexCoord *pTexCoords = (TexCoord *)malloc(sizeof(TexCoord) * cTexCoords);
int *pFaces = (int *)malloc(sizeof(int *) * (cFaces + 1));
Vertex3D *pVertice = pVertices;
Vector3D *pNormal = pNormals;
KRVector3D *pNormal = pNormals;
TexCoord *pTexCoord = pTexCoords;
int *pFace = pFaces;
int *pMaterialFaces = pFace++;
@@ -332,7 +332,7 @@ void KROBJPacker::pack(const char *szPath) {
}
if(pFace[iFaceVertex*3+3] >= 0){
Vector3D *pNormal = pNormals + pFace[iFaceVertex*3+3];
KRVector3D *pNormal = pNormals + pFace[iFaceVertex*3+3];
pData->normal.x = pNormal -> x;
pData->normal.y = pNormal -> y;
pData->normal.z = pNormal -> z;
@@ -386,17 +386,17 @@ void KROBJPacker::pack(const char *szPath) {
for(VertexData *pVertex = pStart; pVertex < pEnd; pVertex+=3) {
Vector3 p1(pVertex[0].vertex.x, pVertex[0].vertex.y, pVertex[0].vertex.z);
Vector3 p2(pVertex[1].vertex.x, pVertex[1].vertex.y, pVertex[1].vertex.z);
Vector3 p3(pVertex[2].vertex.x, pVertex[2].vertex.y, pVertex[2].vertex.z);
Vector3 v1 = p2 - p1;
Vector3 v2 = p3 - p1;
KRVector3 p1(pVertex[0].vertex.x, pVertex[0].vertex.y, pVertex[0].vertex.z);
KRVector3 p2(pVertex[1].vertex.x, pVertex[1].vertex.y, pVertex[1].vertex.z);
KRVector3 p3(pVertex[2].vertex.x, pVertex[2].vertex.y, pVertex[2].vertex.z);
KRVector3 v1 = p2 - p1;
KRVector3 v2 = p3 - p1;
// -- Calculate normal --
if(pVertex->normal.x == 0 && pVertex->normal.y == 0 && pVertex->normal.z == 0) {
Vector3 normal = v1.cross( v2 );
KRVector3 normal = v1.cross( v2 );
normal.normalize();
@@ -426,7 +426,7 @@ void KROBJPacker::pack(const char *szPath) {
pVertex[0].tangent.y = coef * ((v1.y * st2.v) + (v2.y * -st1.v));
pVertex[0].tangent.z = coef * ((v1.z * st2.v) + (v2.z * -st1.v));
Vector3 tangent(
KRVector3 tangent(
coef * ((v1.x * st2.v) + (v2.x * -st1.v)),
coef * ((v1.y * st2.v) + (v2.y * -st1.v)),
coef * ((v1.z * st2.v) + (v2.z * -st1.v))

View File

@@ -60,7 +60,7 @@ private:
float x;
float y;
float z;
} Vertex3D, Vector3D;
} Vertex3D, KRVector3D;
typedef struct {
float u;
@@ -69,8 +69,8 @@ private:
typedef struct {
Vertex3D vertex;
Vector3D normal;
Vector3D tangent;
KRVector3D normal;
KRVector3D tangent;
TexCoord texcoord;
} VertexData;
};