|
bjennison
|
 |
« on: March 15, 2010, 04:24:17 PM » |
|
Anyone else having a problem with this? I have what I thought was a straightforward piece of code...
If InpEng.IsKeyPressed(MTV3D65.CONST_TV_KEY.TV_KEY_0) Then Physics.SetBodyLinearVelocity(dTank.pBodyId, New TV_3DVECTOR(0, 0, 2)) End If
What I thought this would do was move my object at a constant velocity of 2 along the Z axis, provided I was pressing the 0 key.
Well, it works for a little bit...and then I get this error, after like 2-3 seconds.
TestApp.vshost.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
Any ideas?
|
|
|
|
|
Logged
|
|
|
|
WEst
Customers
Community Member
    
Posts: 945
Daniel Martinek
|
 |
« Reply #1 on: March 15, 2010, 04:26:47 PM » |
|
This sounds quite strange, try setting Physics.SetThreadCount(1) maybe there is some multithreading problem.
|
|
|
|
|
Logged
|
Greetings
Daniel Martinek Technical Director 23 Volts
|
|
|
xavram
Community Member

Posts: 525
|
 |
« Reply #2 on: March 15, 2010, 04:39:58 PM » |
|
Lol, that wasn't good...when I set it to 1 (it was set to 4), I get "Attempted to read or write protected memory" on Physics.SimulateFixedStep(TimeElapsed * 0.003, 0.3).
I set it to 2 instead and the previous error happened again.
I swear, every time I start to think I'm getting a grip on Physics and can actually start to use it for something, seems like one bizzare thing after another pops up!
|
|
|
|
|
Logged
|
|
|
|
xavram
Community Member

Posts: 525
|
 |
« Reply #3 on: March 15, 2010, 04:42:00 PM » |
|
Now that's intereseting...I commented out these lines...
Physics.SetThreadCount(4) Physics.SetMaxEventCount(256)
And now it seems to work fine. Can anyone explain that?
|
|
|
|
|
Logged
|
|
|
|
WEst
Customers
Community Member
    
Posts: 945
Daniel Martinek
|
 |
« Reply #4 on: March 15, 2010, 04:42:49 PM » |
|
I know there was a bug in the physics engine that would cause these types of errors, but I think Sylvain already fixed it some time ago, are you using the newest version of the engine? Maybe there are still some threading problems left after all.
|
|
|
|
|
Logged
|
Greetings
Daniel Martinek Technical Director 23 Volts
|
|
|
xavram
Community Member

Posts: 525
|
 |
« Reply #5 on: March 15, 2010, 05:54:15 PM » |
|
Yes, I know I'm using the latest version of the engine, just downloaded it like 3 days ago.
|
|
|
|
|
Logged
|
|
|
|
|
SylvainTV
|
 |
« Reply #6 on: March 20, 2010, 08:50:06 AM » |
|
As usual, if you could post here a small demo of this problem, that will help me to fix the bug.
|
|
|
|
|
Logged
|
|
|
|
xavram
Community Member

Posts: 525
|
 |
« Reply #7 on: March 22, 2010, 09:44:16 AM » |
|
i'll see if I can re-create it in a smaller project Syl, its tied up a huge amount of spaghetti code right now.
|
|
|
|
|
Logged
|
|
|
|
|
asia
|
 |
« Reply #8 on: March 22, 2010, 10:02:38 AM » |
|
mmh! I love spaghetti! 
|
|
|
|
|
Logged
|
Fabio Musmeci ENEA CR Casaccia Via Anguillarese 301 00060 Rome Italy musmeci@enea.it+39 3333934898 Learning to live better on a smaller footprint..
|
|
|
|