Game Development Community

Polysoup resource comple problems

by Mike Rowley · in Torque Game Engine · 10/14/2007 (8:13 am) · 9 replies

I followed the instructions for the 1.5 version of the resource. I compiled opcode with no problem.

I then, took the resulting lib file and added it to torqueDemo.

Clean solution
Build Torque Demo

Errors:
tsSortedMesh.cc
..\engine\ts\tsSortedMesh.cc(57) : error C2065: 'tDiffuse' : undeclared identifier
..\engine\ts\tsSortedMesh.cc(57) : error C3861: 'getUVs': identifier not found
..\engine\ts\tsSortedMesh.cc(66) : error C2039: 'lightMapMethod' : is not a member of 'TSShapeInstance::RenderData'
        ../engine\ts/tsShapeInstance.h(492) : see declaration of 'TSShapeInstance::RenderData'
..\engine\ts\tsSortedMesh.cc(66) : error C2039: 'LIGHT_MAP_MULTI' : is not a member of 'TSShapeInstance'
        ../engine\ts/tsShapeInstance.h(75) : see declaration of 'TSShapeInstance'
..\engine\ts\tsSortedMesh.cc(66) : error C2065: 'LIGHT_MAP_MULTI' : undeclared identifier
..\engine\ts\tsSortedMesh.cc(69) : error C2065: 'tLightmap' : undeclared identifier
..\engine\ts\tsSortedMesh.cc(69) : error C3861: 'getUVs': identifier not found
..\engine\ts\tsSortedMesh.cc(70) : error C2039: 'lightMapTE' : is not a member of 'TSShapeInstance::RenderData'
        ../engine\ts/tsShapeInstance.h(492) : see declaration of 'TSShapeInstance::RenderData'
tsShapeOldRead.cc
tsShapeInstance.cc
tsShapeConstruct.cc
Generating Code...
Compiling...
tsShapeAlloc.cc
tsShape.cc
..\engine\ts\tsShape.cc(871) : error C2039: 'getUVs' : is not a member of 'TSMesh'
        ../engine\ts/tsMesh.h(81) : see declaration of 'TSMesh'
..\engine\ts\tsShape.cc(871) : error C2039: 'tDiffuse' : is not a member of 'TSMesh'
        ../engine\ts/tsMesh.h(81) : see declaration of 'TSMesh'
..\engine\ts\tsShape.cc(871) : error C2065: 'tDiffuse' : undeclared identifier
..\engine\ts\tsShape.cc(915) : error C2039: 'getUVs' : is not a member of 'TSMesh'
        ../engine\ts/tsMesh.h(81) : see declaration of 'TSMesh'
..\engine\ts\tsShape.cc(915) : error C2039: 'tDiffuse' : is not a member of 'TSMesh'
        ../engine\ts/tsMesh.h(81) : see declaration of 'TSMesh'
..\engine\ts\tsShape.cc(1025) : error C2039: 'getUVs' : is not a member of 'TSSkinMesh'
        ../engine\ts/tsMesh.h(276) : see declaration of 'TSSkinMesh'
..\engine\ts\tsShape.cc(1025) : error C2039: 'tDiffuse' : is not a member of 'TSMesh'
        ../engine\ts/tsMesh.h(81) : see declaration of 'TSMesh'
tsPartInstance.cc
..\engine\ts\tsPartInstance.cc(227) : error C2039: 'twoPassLightMap' : is not a member of 'TSShapeInstance'
        ../engine\ts/tsShapeInstance.h(75) : see declaration of 'TSShapeInstance'
..\engine\ts\tsPartInstance.cc(330) : error C2039: 'initLightMapMaterials' : is not a member of 'TSMesh'
        ../engine\ts/tsMesh.h(81) : see declaration of 'TSMesh'
..\engine\ts\tsPartInstance.cc(330) : error C3861: 'initLightMapMaterials': identifier not found
..\engine\ts\tsPartInstance.cc(335) : error C2039: 'renderLightMap' : is not a member of 'TSShapeInstance::MeshObjectInstance'
        ../engine\ts/tsShapeInstance.h(134) : see declaration of 'TSShapeInstance::MeshObjectInstance'
..\engine\ts\tsPartInstance.cc(342) : error C2039: 'resetLightMapMaterials' : is not a member of 'TSMesh'
        ../engine\ts/tsMesh.h(81) : see declaration of 'TSMesh'
..\engine\ts\tsPartInstance.cc(342) : error C3861: 'resetLightMapMaterials': identifier not found
tsMesh.cc

I know what the error means, but don't understand why I'm getting it.

Edit to add link to build log:
3dcentral.net/error/BuildLog.htm

#1
10/14/2007 (9:21 am)
Been researching this. I have found that the code base for 1.5 and 1.5.2 are quite a bit different.
I'm still a noob when it comes to coding, so I'm a bit over my head here.

In tsShapeInstance.cc

// OPCODE_POLYSOUP!
bool TSShapeInstance::MeshObjectInstance::castRayOpcode( S32 objectDetail, const Point3F & start, const Point3F & end, RayInfo *info )
{
   TSMesh * mesh = getMesh(objectDetail);
   if (mesh && visible>0.01f)
      return mesh->castRayOpcode(start, end, info);
   return false;
}
// OPCODE_POLYSOUP!

But in 1.5.2 I have:
void TSShapeInstance::MeshObjectInstance::renderLightMap(S32 objectDetail, TSMaterialList * materials)
{
   if (visible>0.01f)
   {
      TSMesh * mesh = getMesh(objectDetail);
      if (mesh && mesh->getFlags(TSMesh::HasLightTexture))
      {
         MatrixF * transform = getTransform();
         if (transform != TSShapeInstance::smRenderData.currentTransform)
         {
            if (TSShapeInstance::smRenderData.currentTransform)
               glPopMatrix();
            if (transform)
            {
               glPushMatrix();
               dglMultMatrix(transform);
            }
            TSShapeInstance::smRenderData.currentTransform = transform;
         }

         if (TSShapeInstance::smRenderData.balloonShape)
         {
            glPushMatrix();
            F32 & bv = TSShapeInstance::smRenderData.balloonValue;
            glScalef(bv,bv,bv);
         }
         mesh->renderLightMap(frame,matFrame,materials);
         if (TSShapeInstance::smRenderData.balloonShape)
            glPopMatrix();
      }
   }
}

I'm missing the lightmap information, thus the error messages.
I don't know how to merge these. Anyone have an idea?
#2
10/14/2007 (10:12 am)
Those last 2 Methods/Functions arent the same.
Stay out of renderLightMap ;)

Edit: See in bold.. oops
#3
10/14/2007 (4:31 pm)
I just used WinMerge to merge all polysoup specific changes into my project about 2 days ago. There is some stuff that you don't need so you must be careful.


If I have time after work tonight I'll see if I can separate out the changes and post them.
#4
10/14/2007 (6:15 pm)
Thankyou Brian.

Edit to add:

After replacing all the files with the originals, then using winmerge to manually add all the opcode changes, I'm getting closer.

3dcentral.net/error/BuildLog1.htm

I must have eather:
1. added code not needed
2. Missed some code.

I'll be rechecking again tomorrow.
There have been some major changes between 1.5 and 1.5.2
#5
10/15/2007 (3:16 am)
Okay, here is a small Patch file that will make the changes that I made.

I make no guarantee that this will work or that it will even patch correctly. This is the first .patch I've made in over ten years.

Regardless I hope this helps you.

Link here
#6
10/16/2007 (1:55 pm)
Thanks Brian. I've never been able to use a patch before, but I have learned how to read them. I'll compare the changes in the patch with the files I've changed and see if I missed anything. :-)
Thanks for your help.
#7
10/16/2007 (6:52 pm)
If I ever get this working, it will definately make things easier for the next person. :/

Here we go. All my errors are in "game/tsStatic.cc"

[u]line number[/u]--Code
814   // For a tetrahedron this is pretty easy... first
815   // convert everything into world space.
816   Point3F tverts[4];
817   mat.mulP(verts[0], &tverts[0]);
818   mat.mulP(verts[1], &tverts[1]);
819   mat.mulP(verts[2], &tverts[2]);
820   mat.mulP(verts[3], &tverts[3]);

The error message:
tsStatic.cc
..\engine\game\tsStatic.cc(817) : error C2143: syntax error : missing ';' before '.'
..\engine\game\tsStatic.cc(817) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
..\engine\game\tsStatic.cc(818) : error C2143: syntax error : missing ';' before '.'
..\engine\game\tsStatic.cc(818) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
..\engine\game\tsStatic.cc(818) : error C2086: 'int mat' : redefinition
        ..\engine\game\tsStatic.cc(817) : see declaration of 'mat'
..\engine\game\tsStatic.cc(819) : error C2143: syntax error : missing ';' before '.'
..\engine\game\tsStatic.cc(819) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
..\engine\game\tsStatic.cc(819) : error C2086: 'int mat' : redefinition
        ..\engine\game\tsStatic.cc(817) : see declaration of 'mat'
..\engine\game\tsStatic.cc(820) : error C2143: syntax error : missing ';' before '.'
..\engine\game\tsStatic.cc(820) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
..\engine\game\tsStatic.cc(820) : error C2086: 'int mat' : redefinition
        ..\engine\game\tsStatic.cc(817) : see declaration of 'mat'
And it keeps going like this from here.

I have no clue what this is on about. There isn't supposed to be a ; before the .
Plus, I didn't touch this code. I did, however, get rid of allllllll the other errors. I'm lost with this one tho.
#8
10/17/2007 (4:10 am)
What is the definition of the function. When you get an error you need to consider all the code around it as well..

Mine looks like this:
void TSStaticPolysoupConvex::getFeatures(const MatrixF& mat,const VectorF& n, ConvexFeature* cf)

I bet yours is the funky version I noticed somewhere that commented out a const.

Also make sure the definition in the class header matches the above.
#9
10/18/2007 (4:47 pm)
Thankyou. That fixed it. It is now compiling without errors. :-)

For anyone using 1.5.2 that doesn't want to have to go thru what I did, you can you can download the 1.5.2 files here. You will still need to download the other files from this site tho to get it to work.
Ben, if you would like to add this folder to your download, have at it. :)