Game Development Community

dev|Pro Game Development Curriculum

GuiObjectView Consolidated

by Ronald J Nelson · 01/29/2006 (3:32 pm) · 47 comments

Download Code File

I am not taking credit for all of this. This is just a consolidation of the following resources that I did and thought it would save others time weeding through it. Please post any other updates you might make to it that improve it so we can all benefit from it.

guiObjectView - Mountable Animated DTS Viewer
GuiObjectView Update
GuiObjectView Update: Lighting Support

Just place the files in your engine\gui\controls folder, add to your build, then compile.
#21
03/23/2006 (8:31 am)
Hi,

Trying to compile this and am getting a long list of errors like this

C:\gamedev\tse\engine\guiObjectView.cc(276): error C2065: 'GL_DEPTH_BUFFER_BIT' : undeclared identifier
C:\gamedev\tse\engine\guiObjectView.cc(276): error C3861: 'glClear': identifier not found, even with argument-dependent lookup
C:\gamedev\tse\engine\guiObjectView.cc(277): error C2065: 'GL_MODELVIEW' : undeclared identifier
C:\gamedev\tse\engine\guiObjectView.cc(277): error C3861: 'glMatrixMode': identifier not found, even with argument-dependent lookup
C:\gamedev\tse\engine\guiObjectView.cc(279): error C2065: 'GL_DEPTH_TEST' : undeclared identifier
C:\gamedev\tse\engine\guiObjectView.cc(279): error C3861: 'glEnable': identifier not found, even with argument-dependent lookup
C:\gamedev\tse\engine\guiObjectView.cc(280): error C2065: 'GL_LEQUAL' : undeclared identifier
C:\gamedev\tse\engine\guiObjectView.cc(280): error C3861: 'glDepthFunc': identifier not found, even with argument-dependent lookup
C:\gamedev\tse\engine\guiObjectView.cc(281): error C2065: 'GL_LIGHTING' : undeclared identifier
C:\gamedev\tse\engine\guiObjectView.cc(281): error C3861: 'glEnable': identifier not found, even with argument-dependent lookup
C:\gamedev\tse\engine\guiObjectView.cc(316): error C3861: 'glPushMatrix': identifier not found, even with argument-dependent lookup
C:\gamedev\tse\engine\guiObjectView.cc(317): error C3861: 'dglMultMatrix': identifier not found, even with argument-dependent lookup
C:\gamedev\tse\engine\guiObjectView.cc(319): error C3861: 'glPopMatrix': identifier not found, even with argument-dependent lookup


Can anybody tell me what might be wrong?

Thanks,

Dave.
#22
03/23/2006 (8:46 am)
Hmm, don't know much about C++, but have tracked this down to apparently one or two missing includes. A couple of other progs that use some of the above variables have the following includes declared.

#ifndef _PLATFORM_H_
#include "platform/platform.h"
#endif
#ifndef _PLATFORMGL_H_
#include "platform/platformGL.h"
#endif

When I include these I get an error telling me that platformwin32\platformGL.h doesn't exist. This is an include in platform/platformGL.h mentioned above.

From this I assume that the objectview thingy uses openGL which is not part of TSE yet, therefore I am screwed?

Thanks,

Dave.
#23
03/29/2006 (6:37 am)
Dave - all of that gl and dgl stuff is no longer relevant in TSE, the functions have each been converted to things such as GFX->pushWorldMatrix();, so check that out.
#24
04/04/2006 (11:54 pm)
I like this control and use it in my system. But I experienced a small flaw:

I use the control in a dialog to display inventory items. When the players weapon in not mounted the guiobjectview will display its object with lighter colors when the player is looking in some special direction. If the player mounts its weapon the effect is gone. Strange ...

Exact description for reproduction:
- Take clean TGE 1.4.0 with guiobjectview and display an object in a dialog
- Umount player weapon (or just don't give him one by uncommenting the according lines in game.cs)
- Bring up the dialog with your guiobjectview
- Turn your view while looking horizontally. At some point the displayed object will render with strangely faded colors. It could have a coincidence with ligthing, perhaps it is the direction with the sun in your back.
- Try the same with mounted weapon. The effect is gone.

Has anyone seen this effect before? I'll try to investigate this but any help would be welcome.


-- Kai.
#25
04/06/2006 (1:32 am)
Any idea why meshes disappear when the window goes off the edge of the screen then comes back?

Well, I ended up constraining it to the PlayGUI anyway so it doesnt go offscreen. (I was just playing around with 3d locking target reticules, and made one an objectview window for the heck of it).
#26
04/07/2006 (12:48 pm)
hi, I am trying to mount, but no matter where I set the mount point, the weapon always get mounted between my character's feet, any idea? maybe someone can explain in depth the arguments mountObject is taking. thanks
PlayerView.mountObject("weapon","weapon.dts","","player.dts","Bip01",0);
#27
04/11/2006 (8:41 am)
Matt H, thanks very much for your reply. I've been sidetracked with other things, sorry for not responding sooner.

Are you saying that I need to go through the resource changing all GL* refs to GFX refs of the same name?

Thanks,

Dave.
#28
04/15/2006 (4:39 pm)
Can we get some documentation of all the commands available to us with this resource?
#29
06/01/2006 (3:24 am)
Hi, I want to mount more than 1 object to the same mount point on the base object.

Existing code (in GuiObjectView::loadObject)

// Check to see if something is already mounted to this object's mountPoint ...
for (S32 i=0; i<33; i++) {
   if (mMeshObjects.mMesh[i].parentNode == pNode && mMeshObjects.mMesh[i].parentIndex == pIndex || dStrcmp(mMeshObjects.mMesh[i].name, name) == 0) {
      Con::printf("Unloading object %s at %s", mMeshObjects.mMesh[i].name, nodeName);
      mMeshObjects.unLoad(i);
   }
}

doesn't allow this, it replaces the already mounted obj with the 2nd obj. I tried commenting off mMeshObjects.unLoad(i) and it seems to allow the 2nd obj to be mounted correctly.

Would like to verify with all if this change is ok and wouldn't get me into problems later.
Thanks.
#30
06/04/2006 (11:14 pm)
noob question but how do you
Just place the files in your engine\gui\controls folder
do this part =====> add to your build,
then compile.
#31
06/05/2006 (8:36 am)
What compiler are you using? Usually you open up the solution either in the VS6 or VS7 folders and they navigate the TorqueDemo project to those folders, right click, add files, then go to build in the top menu and select rebuild solution.
#32
08/01/2006 (4:34 am)
Is there a way to go through all the Loaded FlyingVehicle Datablocks and using the shapes declared in there?
I would like to click on a next button, and load it from the Datablock. Any help would be appreciated.
#33
08/31/2006 (6:50 am)
I compiled GuiObjectView Consolidated resource..
And i am not fully undestand what comman line options i shuld use

for example :

// Script function handling for "setObject"
ConsoleMethod( GuiObjectView, setObject, void, 6, 6, "ObjectView.setObject(name, model, skin, lod)" )

What is mean -- name, model, skin, lod --- in what format
i should write??
#34
09/21/2006 (6:25 am)
Any working port of this to TSE exist yet?
#35
10/25/2006 (6:14 pm)
I don't know the right functions to replace these "gl" calls to otherwise I would have one ported already. To the best of my knowledge you replace "dgl(FunctionName)" with "GFX->(functionName)" but there are some other functions in there that have me scratching at my head. So far the least amount of errors I can get this code to give me in TSE 1.4 is 9. If you want the output that the compiler is giving me just ask, but if there is no real interest to get this ported over then my efforts are done.
#36
11/01/2006 (1:35 pm)
TGE 1.5 compile errors :

Error 1 error C2039: 'setMaxGLLights' : is not a member of 'LightManager' c:\Torque\Felswourne\engine\gui\controls\guiObjectView.cc 290
Error 2 error C2039: 'addLight' : is not a member of 'LightManager' c:\Torque\Felswourne\engine\gui\controls\guiObjectView.cc 291
Error 3 error C2039: 'installGLLights' : is not a member of 'LightManager' c:\Torque\Felswourne\engine\gui\controls\guiObjectView.cc 292
Error 4 error C2039: 'uninstallGLLights' : is not a member of 'LightManager' c:\Torque\Felswourne\engine\gui\controls\guiObjectView.cc 330
Error 5 error C2039: 'removeLight' : is not a member of 'LightManager' c:\Torque\Felswourne\engine\gui\controls\guiObjectView.cc 331

I am going to look through the new light manager code now to try and get this to work.
#37
12/01/2006 (8:57 am)
We've got it compiling in TSE 4.1 and ported over (Erik Madison's work) but the shapes never get rendered. I traced it as far back as seeing the meshes get added to the renderinstmgr's MESH bin, and lost the trace in the mRenderBins[i]->render line, because the render function is virtual.

If anyone can help with a tidbit of direction as to where to look for the bin rendering, it would be greatly appreciated, and we *will* release a finished guiObjectView for TSE back to the community.
#38
12/06/2006 (1:18 pm)
has anyone ported this to 1.5?

i would love to use this but i am getting lots of compile errors:
#39
12/06/2006 (1:44 pm)
i compiled it without the light code and tried to use it like this:

new GuiObjectView(ModelGui) {
         profile = "GuiButtonProfile";
         horizSizing = "right";
         vertSizing = "bottom";
         position = "0 0";
         extent = "232 199";
         minExtent = "8 8";
         visible = "1";
         modal = "0";
          helpTag = "0";
         };

function LoginScreen::onWake(%this){
 ModelGui.setObject("Block", "./rifleman.dts","./rifleman_skin.jpg", "");
}

all i am getting is: Error: Unable to load: ./rifleman.dts

can soemone please push me in the right direction?:-)
#40
02/07/2007 (6:19 am)
Does anyone have a working TGEA version of this?