New Wrapper for the Ogre Engine

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: New Wrapper for the Ogre Engine

Postby Slick » Tue Aug 27, 2013 1:10 am

Julio Jerez wrote:Ok if you update,

you can call function

void OgreNewtonWorld::SetConcurrentUpdateMode (false);
void OgreNewtonWorld::SetNumberOfThreads (1);

and that will set the engine to run in single thread and synchronous, see if this say anything about the crash.

Mean time, can you tell me what you did, so that I can try that in the demo?


I will try it tomorrow hopefully. I am guessing the assert was from non thread safe memory use but I don't know for sure. I'll try single thread and we will see. Release mode got through spawns without crashing debug hit the assert.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: New Wrapper for the Ogre Engine

Postby Julio Jerez » Tue Aug 27, 2013 1:07 pm

Slick wrote:I made my own class based on the forklift but just used the wheels. I spawned multiple classes and as the wheels from different vehicles roll into each other it crashes.

remember that vehicle class is only paractical for slwo moving vehicles.

those are not tires modeled with the equation that govern a ruber tire. They only model what is call a bicycle model.
Julio Jerez
Moderator
Moderator
 
Posts: 12478
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: New Wrapper for the Ogre Engine

Postby Slick » Tue Aug 27, 2013 1:42 pm

Yep I am just experimenting with the low speed for now. It still shouldn't crash. I'll try and establish today hopefully if it is my code or not.

It will be interesting to try the other vehicle when it makes it into the wrapper.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: New Wrapper for the Ogre Engine

Postby Julio Jerez » Tue Aug 27, 2013 1:45 pm

yes I agree, it should not crash under any circustance.
like calling those functions after creation the ogreNetwopn world, will make more clear to debug.

I have not tried placing multple vehicle, I will chekc if that is a problem.
Julio Jerez
Moderator
Moderator
 
Posts: 12478
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: New Wrapper for the Ogre Engine

Postby Slick » Tue Aug 27, 2013 2:20 pm

The m_physicsWorld->SetNumberOfThreads (1); function does not appear to be checked into SVN.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: New Wrapper for the Ogre Engine

Postby Julio Jerez » Tue Aug 27, 2013 2:31 pm

you need to sync Newton and build ..\newton-dynamics\packages\projects\visualStudio_2008_dll

I tryied to put a secund vehicle in the code, but I run into the same problem that I had before
Code: Select all
// load articulated ForkLift
ForkliftPhysicsModel* const forkLift = new ForkliftPhysicsModel(this, "forklift.scene", raycaster.m_contact + Vector3 (0.0f, 0.5f, 10.0f));
m_player = forkLift->m_rootBody;

// this will fail because the dotscene can only load a file once. this is bcause ogre sceneNode can only have unique names
new ForkliftPhysicsModel(this, "forklift.scene", raycaster.m_contact + Vector3 (5.0f, 0.5f, 10.0f));


which is that Ogre does not allow to load a mesh more that one, each node has a unique name so the dot scene can not load teh same file more than once.
How people deal with that In Ogre?
Julio Jerez
Moderator
Moderator
 
Posts: 12478
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: New Wrapper for the Ogre Engine

Postby Slick » Tue Aug 27, 2013 2:41 pm

I don't use dotscene I create my scenes in code and use makename type functions like you do.

I was just trying to add a 2nd forklift to see if the problem was my code or not and hit the same problem. Probably the dotscene needs a 2nd definition of a forklift although like I said I normally create scenes in code.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: New Wrapper for the Ogre Engine

Postby Slick » Tue Aug 27, 2013 3:07 pm

Updating Newton I am getting a few unresolved externals:

Code: Select all
CustomInputManager::PreUpdate(


is one. I'm checking if it's something I did or is there some unchecked in code?
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: New Wrapper for the Ogre Engine

Postby Slick » Tue Aug 27, 2013 3:53 pm

I worked it out. I had created my own VS 2010 project and needed to add CustomInputmanager to dJointlibrary.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: New Wrapper for the Ogre Engine

Postby Slick » Tue Aug 27, 2013 3:55 pm

The wheel on wheel crash is happening here:

Code: Select all
bool TestMask (int id) const
      {
         int index;
         int shift;
         GetAddress (id, index, shift);
         dLong bit = 1;
         return (m_mask[index] & (bit << shift)) ? true : false;
      }


It crashes on the return (m_mask[index] & (bit << shift)) ? true : false; line

Code: Select all
bool CustomArticulatedTransformController::SelfCollisionTest (const dSkeletonBone* const bone0, const dSkeletonBone* const bone1) const
{
   int id1 = int (bone1 - m_bones);
   bool state = bone0->m_bitField.TestMask(id1);
   return state;
}


This is after a very quick test.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: New Wrapper for the Ogre Engine

Postby Julio Jerez » Tue Aug 27, 2013 4:34 pm

Code: Select all
bool CustomArticulatedTransformController::SelfCollisionTest (const dSkeletonBone* const bone0, const dSkeletonBone* const bone1) const
{
   int id1 = int (bone1 - m_bones);
   bool state = bone0->m_bitField.TestMask(id1);
   return state;
}


Oh I see, it looks like there is a bug on the calling function not on thet function.
bone0 and bone1 most be member o fteh same class, and it looks liek it is calling with bone form different classes
show me the stack trace, that's where the bug is.

I sodulprobably add some sanoty check that vladica if teh tow bone belong to the class
Julio Jerez
Moderator
Moderator
 
Posts: 12478
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: New Wrapper for the Ogre Engine

Postby Julio Jerez » Tue Aug 27, 2013 4:39 pm

ok I added a sanoty check, teh funtio looks liek this now.
Code: Select all
bool CustomArticulatedTransformController::SelfCollisionTest (const dSkeletonBone* const bone0, const dSkeletonBone* const bone1) const
{
   dAssert (bone0->m_myController == this);
   dAssert (bone1->m_myController == this);
   int id1 = int (bone1 - m_bones);
   bool state = bone0->m_bitField.TestMask(id1);
   return state;
}


please synck again.

This does not fixed it is just a test to see if the bug is because it is try to test bones for diffrent containes.
Julio Jerez
Moderator
Moderator
 
Posts: 12478
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: New Wrapper for the Ogre Engine

Postby Slick » Tue Aug 27, 2013 5:07 pm

I synched.

Now I am getting this in debug build before I get to rendering. Release runs but crashes when wheels hit.

8-27-2013 2-04-44 PM.png
8-27-2013 2-04-44 PM.png (51.36 KiB) Viewed 8662 times
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: New Wrapper for the Ogre Engine

Postby Julio Jerez » Tue Aug 27, 2013 6:36 pm

that's some really really wrong there. you must have some mixed library.
are you using static link?

are those object craeted form a newton updtae?
whne the crash happen see if there is a Netwon therad also running.

before you start creation object call this funtions. this will make sure that there is not a newton update in progress.

GetPhysics()->WaitForUpdateToFinish();
Julio Jerez
Moderator
Moderator
 
Posts: 12478
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: New Wrapper for the Ogre Engine

Postby Slick » Tue Aug 27, 2013 6:49 pm

I am not using static link and don't think I have mixed libraries but I will check.

I did just hit an assert:

8-27-2013 3-46-53 PM.png
8-27-2013 3-46-53 PM.png (24.68 KiB) Viewed 8652 times
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron