Game Development Community

ODEScript and TGEA 1.0.3 - linker errors

by Andy Hawkins · in Torque Game Engine Advanced · 05/12/2008 (8:28 am) · 32 replies

So I've been using this resource but not matter what lib I use I still get linker errors.

In this resource garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=11767 the author says to generate my own ode.lib and use that - which I did.

I still get these errors...
ode.lib(convex.obj) : error LNK2005: "void * __cdecl operator new(unsigned int,void *)" (??2@YAPAXIPAX@Z) already defined in winMemory.obj
MSVCRT.lib(MSVCR90.dll) : error LNK2005: _strstr already defined in LIBCMT.lib(strstr.obj)
MSVCRT.lib(MSVCR90.dll) : error LNK2005: _strchr already defined in LIBCMT.lib(strchr.obj)
MSVCRT.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
MSVCRT.lib(MSVCR90.dll) : error LNK2005: _realloc already defined in LIBCMT.lib(realloc.obj)
... etc
I've built ode.lib version 0.9 and added the include folder under 0.9. I've also added ode.lib to the Linker | Input | Additional Dependencies.

I'm using Visual C++ Express 2008 which might be the problem, but 0.9 is the latest version of ode I can find.

Any help would be GREATLY appreciated.
Page«First 1 2 Next»
#21
05/15/2008 (3:22 pm)
I'm using TGEA 1.0.3 - so I can't use polysoup - I will try what you mention above when I get back into my "Last Crusade Of The Physics Grail" this weekend.
#22
05/17/2008 (12:30 am)
Quote:Maybe I should just port to TGEA 1.7
That won't help, you'll run into exactly the same problems (at least I just have them).

Quote:I'm using TGEA 1.0.3 - so I can't use polysoup
It's possible (polysoup with 1.0.3).

We had the oderocks mod running with one of the TGEA versions we were working with so far. I thought it was 1.0.3 but I'm not sure and it might have been 1.0.1. We've never done our own ODE stuff, just added the ODEscript resource and tried the oderocks mod to see if it works. That was about 1 year ago and I'm afraid that almost everything we did in that time didn't survive.

Anyways, now I've started to get it running with 1.7 and last night I found out what Gary mentioned above:
Quote:1) The ODEShape/tdBody relationship isn't set up
I'll try to get more information within the next days.

Btw I found two typos in the scripts:

NormalMultipler should be NormalMultiplier in physicsdefaults.cs line 59 and physicsui.cs line 62.

Stefan
#23
05/17/2008 (1:27 am)
Cool thanks for the tip - and please do let me know how you progress, especially with resolving the tdBody issue. I can't even tell if it works or not.
#24
05/18/2008 (3:30 am)
First I want to say thanks to Gary for helping me with this on IRC :)

Here's what I found out so far (everything happens in the ODEShape class):

doCollisionStuff() is never called because this statement in processTick() always fails (odeobjODE is always NULL):

if(worldsimODE == NULL || contactgroupODE == NULL || [b]odeobjODE == NULL[/b])

odeobjODE should be set in onStaticModified()

odeobjODE = dynamic_cast<tdBody *>(Sim::findObject(odeobj));

but we never get there because

if(0 != odeobj)

constantly fails before. That's strange because it should be set from script like this for example in newrock():

%obj.odeobj = %odeobj;

Sounds like there's something wrong in ODEShape::packUpdate() and/or unpackUpdate().

Now it looks like the ghost index of the tdBody is never transmitted because odeobjODE is still NULL in packUpdate():

if(odeobj > 0) {
		[b]if(NULL != odeobjODE) {[/b]
			cid = conn->getGhostIndex((NetObject *)odeobjODE);

As a result, odeobj isn't set in unpackUpdate() and without this, there's no chance to get odeobjODE set (see above).... o_O

Chicken or egg... egg or chicken... odeobj and odeobjODE... odeobjODE and odeobj... :)

@Andy
If you want to toggle the GUIs, just replace the existing functions with this code:

function togglePhysicsUI( %val )
{
	if( !%val ) {
	   if(PhysicsDlg.isAwake())
	      Canvas.popDialog(PhysicsDlg);
      else
         Canvas.pushDialog(PhysicsDlg);
	}
}

function togglePhysicsPresetsUI( %val )
{
	if( !%val ) {
	   if(PhysicsPresets.isAwake())
	      Canvas.popDialog(PhysicsPresets);
      else
         Canvas.pushDialog(PhysicsPresets);
	}
}
#25
05/18/2008 (5:01 am)
@Stephan - thanks for info.

So have you found a solution or just more issues?
#26
05/18/2008 (5:20 am)
No solution yet, I'll continue tonight.
#27
05/20/2008 (8:49 am)
I'm not able to find out why the odeobj isn't set in ODEShape::onStaticModified() where it should be set (at least that's what I think should happen). From script view, everything seems to be perfect though:

This is what happens when I add an ODE object:
ODEShape 3998 added to simulation with ode [b]body 4000[/b]

==>3998.dump();
Member Fields:
  canSaveDynamicFields = "1"
  contactgroup = "3689"
  dataBlock = "ODEBoulderData"
  disablecollisions = "0"
  Enabled = "1"
  ignorewater = "0"
  nameTag = ""
  [b]odeobj = "4000"[/b]
  parentGroup = "MissionCleanup"
  position = "430 127 85.3116"
  rotation = "1 0 0 0"
  scale = "1 1 1"
  worldsim = "3690"

Why is odeobj 0 in the ODEShape instance? Any idea? Looks like I'm stuck and need help with this.

Stefan
#28
05/20/2008 (4:38 pm)
Your guess is as good as mine. Unfortunately the way ODEScript works is only known to Gary as it's an extension of ODE. I have no idea how to troubleshoot it.
#29
05/20/2008 (4:55 pm)
I thought the way it works is actually pretty clear. Most of the objects directly map ODE calls onto Torquescript - tdBody is a dBody, tdWorld is a dWorld, and the functions take the same parameters.

ODEShape is just a shapeBase-derived object reappropriating code mainly from rigidShape, and used to create the contact points for tdbodys

I was shooting for simple when I came up with the idea...

Gary (-;
#30
05/25/2008 (1:52 am)
Yep I can see that you've done that - but before I got stuck into using ODEScript I had to make sure the default install worked. It doesn't in TGEA 1.0.3, so my plan is to try it in TGE and work up from there.

Thanks for your efforts Gary, nice to know you're out there for support :)
#31
05/25/2008 (2:22 am)
Good luck Andy and please give us some feedback.
#32
05/25/2008 (7:11 pm)
Lemme know how it goes :-D

Gary (-;
Page«First 1 2 Next»