Newton 2.0x Archemedia Open Beta

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Newton 2.0 Archemedia Open Beta

Postby mfdesigner » Sun Feb 08, 2009 7:46 pm

I integrated the latest Newton library from Feb 19th and my application would freeze if the threadCount is set
to anything greater than 1 and when it starts to use multiple cores as seen in the task manager.

I have a vista ultimate and 32 bit app.

And I initialize newton as follows:

OgreNewt::World* nworld = new OgreNewt::World(PhysicsAlloc, PhysicsFree);

char desc[256];
int park = NewtonGetPlatformArchitecture(nworld->getNewtonWorld(), desc);
nworld->setPlatformArchitecture(park);

// set linear solver model for faster simulation
nworld->setSolverModel(4);

// use all threads available
nworld->setThreadCount(4);

// 0 - exact, 1 - speed
nworld->setFrictionModel(1);

// multithread island
NewtonSetMultiThreadSolverOnSingleIsland (nworld->getNewtonWorld(), 1);

Any clue why the simulation would lock up like this?

Thanks,
Steve
mfdesigner
 
Posts: 7
Joined: Sun Feb 08, 2009 7:07 pm

Re: Newton 2.0 Archemedia Open Beta

Postby Dave Gravel » Sun Feb 08, 2009 8:51 pm

maybe you can try to set setPlatformArchitecture to 0.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 800
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Newton 2.0 Archemedia Open Beta

Postby agi_shi » Sun Feb 08, 2009 9:19 pm

Is OgreNewt thread-safe? You need to be careful on contact callbacks, etc. when using multiple threads.
agi_shi
 
Posts: 263
Joined: Fri Aug 17, 2007 6:54 pm

Re: Newton 2.0 Archemedia Open Beta

Postby Julio Jerez » Sun Feb 08, 2009 10:36 pm

mfdesigner wrote:I integrated the latest Newton library from Feb 19th and my application would freeze if the threadCount is set
to anything greater than 1 and when it starts to use multiple cores as seen in the task manager.
I have a vista ultimate and 32 bit app.


I do not have vista 32, but I do have vista 64 Ultimate in my MacPro.
I test the version that was in the server and it crashed, but not because the reason you are saying, but becuase I by mistake link the engine to a third party Pawaaaa that is not quite ready for prime time yet, but tha it will very soon.

anyway I commented out the code that try to recongnize the technology, unfortunally if this technology is not present it simple crash (somethiong I do not really expect but it is out of my control).
It appars that to recognized I need to do so registry Mondo jumbo but I will not polude Newton with any OS specific code, I will make a seperate library and let the end user do the recognition on set up.

anyway I rebuild the libary and test it on my vista system and it seems to work fine.
can you please download it again and see if tha was the problems.

that goes for anyone having a crash specially if they have ATI card on their systems.
Next version will definitlly come wih the new Pawaaa ready for prime time.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 2.0 Archemedia Open Beta

Postby mfdesigner » Mon Feb 09, 2009 1:49 am

agi_shi is correct. The original OgreNewt's transform callback updates the 3D world in a separate thread.
This turns out is not threadsafe in Ogre.

void Body::standardTransformCallback( OgreNewt::Body* me, const Ogre::Quaternion& orient, const Ogre::Vector3& pos, int threadIndex )
{
me->m_node->setOrientation( orient );
me->m_node->setPosition( pos );
}

I changed it to merely issuing a transform request and let the main loop does the actual transfrom.

void Body::standardTransformCallback( OgreNewt::Body* me, const Ogre::Quaternion& orient, const Ogre::Vector3& pos, int threadIndex )
{
OgreNewt::World* world = (OgreNewt::World*)me->getWorld();
if (world)
{
transformRequest req(pos, orient);
world->addTransformRequest(me, req);
}
}

And all is fine now.
There is nothing wrong with Newton 2.0.

Thanks,
Steve
mfdesigner
 
Posts: 7
Joined: Sun Feb 08, 2009 7:07 pm

Re: Newton 2.0 Archemedia Open Beta

Postby melven » Mon Feb 09, 2009 2:32 pm

I have a problem with the convexcast in linux:
Only the first entry in the NewtonWorldConvexCastReturnInfo-list seems to be set correctly...
I allocate the memory for 16 contacts and initialize it with zero. The NewtonWorldConvexCast returns 4 (an example) to
indicate that there are 4 contacts, but the hitBodies in all entries after the first (list[1].m_hitBody ... list[3].m_hitBody) are NULL.

I can check again if I allocated the memory correctly, but that looked ok to me...
melven
 
Posts: 14
Joined: Wed Jun 25, 2008 7:21 am

Re: Newton 2.0 Archemedia Open Beta

Postby Julio Jerez » Mon Feb 09, 2009 2:44 pm

yes tha bug was in all version, I made the mistake of using a data structure with the newr function like convex cast, and now I am suffering the data aligment problems.
I fixed it on the PC by copying data member by menber, but it si still a problems on 64 bit system with pointer being different size, also on linux, and PowerPC macs.

I will put a linux build tonight witeh fix.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 2.0 Archemedia Open Beta

Postby melven » Mon Feb 09, 2009 2:48 pm

nice ;-)
thanks and no hurry!
melven
 
Posts: 14
Joined: Wed Jun 25, 2008 7:21 am

Re: Newton 2.0 Archemedia Open Beta

Postby predaeus » Fri Feb 13, 2009 8:44 am

looking forward to those updates :D

I've seen someone mention a release number but I can't find it in the packages. Can we please have some easy method to see if a package was updated?
The date on the post with the links does never change and your posts mentioning updates are usually hidden around here :-/
predaeus
 
Posts: 19
Joined: Wed Jan 21, 2009 10:49 am

Re: Newton 2.0 Archemedia Open Beta

Postby VeT » Sun Feb 15, 2009 9:06 am

hm, he is right :)
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am

Re: Newton 2.0 Archemedia Open Beta

Postby Miguel » Sun Feb 22, 2009 6:53 pm

Not a bug, but a limitation in the sample code that might slow someone down a bit.

If your installation is very deep in directory structures I would recomend you increase the TextureEntry struct member m_textureName from 128 to 2048. under TargaToOpenGL.cpp since that's the allocated size for fullPathName.

Maybe texture paths should be relative to the executable anyways
Miguel
 
Posts: 2
Joined: Mon Feb 16, 2009 5:27 pm

Re: Newton 2.0 Archemedia Open Beta

Postby Julio Jerez » Sun Feb 22, 2009 8:59 pm

Good obsevation
that can actually case a crash on Mac OS10 systems
I am changing it to this

Code: Select all
#define TERXTURE_PATH_NAME_SIZE 2048

struct TextureEntry
{
      GLuint m_textureID;
      char m_textureName[TERXTURE_PATH_NAME_SIZE];
};
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 2.0 Archemedia Open Beta

Postby Miguel » Sun Feb 22, 2009 10:52 pm

Since I'm at it, how about a fix for the Jengas.cpp?

On line 140 of Jengas.cpp

I added the following code to put the other 2 missing pieces on each row:
Code: Select all
         CreateGenericSolid (system.m_world, &system, mass, matrix, blockBoxSize, _BOX_PRIMITIVE, defaultMaterialID);
         matrix.m_posit += matrix.m_front.Scale (blockBoxSize.m_x + gap); 
         CreateGenericSolid (system.m_world, &system, mass, matrix, blockBoxSize, _BOX_PRIMITIVE, defaultMaterialID);


The resulting loop on line 137 will end-up like this:
Code: Select all
      for (j = 0; j < 1; j ++) {
         CreateGenericSolid (system.m_world, &system, mass, matrix, blockBoxSize, _BOX_PRIMITIVE, defaultMaterialID);
         matrix.m_posit += matrix.m_front.Scale (blockBoxSize.m_x + gap); 
         CreateGenericSolid (system.m_world, &system, mass, matrix, blockBoxSize, _BOX_PRIMITIVE, defaultMaterialID);
         matrix.m_posit += matrix.m_front.Scale (blockBoxSize.m_x + gap); 
         CreateGenericSolid (system.m_world, &system, mass, matrix, blockBoxSize, _BOX_PRIMITIVE, defaultMaterialID);
      }


This will create 3 total pieces per row

Edit: This is in the windows code base
Miguel
 
Posts: 2
Joined: Mon Feb 16, 2009 5:27 pm

Re: Newton 2.0 Archemedia Open Beta

Postby Julio Jerez » Mon Feb 23, 2009 8:37 am

I was doing an experiment and I used the Jenga demo for that, I forgot to change it back, thanks for the warning
basically this loop
Code: Select all
      for (j = 0; j < 1; j ++) {
         CreateGenericSolid (system.m_world, &system, mass, matrix, blockBoxSize, _BOX_PRIMITIVE, defaultMaterialID);
         matrix.m_posit += matrix.m_front.Scale (blockBoxSize.m_x + gap); 
      }


the count should got to 3, and that will fix it.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 2.0 Archemedia Open Beta

Postby Aphex » Thu Feb 26, 2009 5:05 pm

Get a chance to look at releasing a double precision (VS7) custom joints dll Julio? :twisted:
Aphex
 
Posts: 144
Joined: Fri Jun 18, 2004 6:08 am
Location: UK

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 14 guests

cron