More power to JointLibrary

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: More power to JointLibrary

Postby Julio Jerez » Tue Jan 05, 2010 6:24 pm

PJani wrote:I think collada will do it just great!

kallaspriit wrote:I'm sure Collada support for OgreNewt would be great but I am currently probably too busy to be of much help.

That's ok I will do most of teh preliminary framework to get teh ball rolling, plus the code will be reusabel for oteh game engien as well.
The inportan part is the we agree.
I put some more work on the exporter I beleive it will be finish tonight and then I will make the OgreNewt Importer righ away.
I think I will be ready to put anoteh update by friday, if nothing hurrendous happens.

I took a detiour from the vehicle bace is drive me crasy to have to put together pieces but hand,

but as soon as I get the expert/importer ready, I will add a new Demo to OgreNewt called Demo_ColladaSceneLoader when all theso lever will be loaded and save from the GUI,
this we people will see hwo the Plugin can be use for final Games as long as the can export legitimate 1.4.1 collad compliance files for any package.
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: More power to JointLibrary

Postby PJani » Fri Jan 08, 2010 10:43 am

Hy, how is ogrenewt progressing?

Anyway today i have physics exam in 3h hours. :)
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: More power to JointLibrary

Postby Julio Jerez » Fri Jan 08, 2010 2:53 pm

It is going well, I had tow week off for tyeh christmas break and since I did no go any where, I spend teh tiem workin on OgreNewt revamping.
Unfortunally I am back to my 9 to 6 regular job and I can no put too many hour, so I am back to teh regulrt week end schedule

the project is going well I has the Collada descrete mesh conveter and I was working of the Skin modifier, I am hoping to get that going this week end and put a new update for GreNewt.

Good luck in your physics exam. :mrgreen:
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: More power to JointLibrary

Postby PJani » Mon Jan 11, 2010 11:06 am

Hmm i am trying to use debugger, but i get crash access voilation and VC++ shows me this location in OgreNewt_Tools.cpp
i dont know what im doing wrong i inited debugger.
Code: Select all
        Ogre::Vector3 CollisionSupportVertex( const OgreNewt::CollisionPtr& col, const Ogre::Vector3& dir )
        {
            Ogre::Vector3 ret;

            NewtonCollisionSupportVertex( col->getNewtonCollision(), &dir.x, &ret.x ); //<<---------- crash is reported here :?
            return ret;
        }
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: More power to JointLibrary

Postby kallaspriit » Mon Jan 11, 2010 11:19 am

Should work, have you recompiled after new version and dropped in the right dll?
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: More power to JointLibrary

Postby PJani » Mon Jan 11, 2010 11:49 am

Yes i changed .dll i recompiled OgreNewt but still the same.

Edit...
i know it will sound stupid but...
...just for test i added this to CollisionSupportVertex code and i get crash here...
Code: Select all
         const NewtonCollision* nc = col->getNewtonCollision();
      
         NewtonCollisionInfoRecord* collisionInfo=NULL;

         NewtonCollisionGetInfo (nc,collisionInfo);/////////////CRASH!

         std::cout << "COLISSON: " << (*collisionInfo).m_collisionType << "\n";

Code: Select all
        Ogre::Vector3 CollisionSupportVertex( const OgreNewt::CollisionPtr& col, const Ogre::Vector3& dir )
        {
            Ogre::Vector3 ret;

         float vec[3]; float retv[3];
         vec[0]=dir.x;
         vec[1]=dir.y;
         vec[2]=dir.z;

   
         
         const NewtonCollision* nc = col->getNewtonCollision();
      
         NewtonCollisionInfoRecord* collisionInfo=NULL;

         NewtonCollisionGetInfo (nc,collisionInfo);

         std::cout << "COLISSON: " << (*collisionInfo).m_collisionType << "\n";

                                    NewtonCollisionSupportVertex(nc , vec, retv );
   

         return Ogre::Vector3(retv[0],retv[1],retv[2]);
        }
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: More power to JointLibrary

Postby PJani » Mon Jan 11, 2010 12:18 pm

now i tried on every single body to call body.getAABB() and i get the same crash every single time. which is pointing on NewtonCollisionSupportVertex!!!!!

im thinking...does this make sense but...every time i create collision after OgreNewt::Body is created i delete collision and as it seems till now was working fine.

edit: now i tried without deleting collision and i have the same *.
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: More power to JointLibrary

Postby PJani » Mon Jan 11, 2010 2:38 pm

Noupe can not find problem. still crashing, but i can reproduce crash...

this works fine...
Code: Select all
   OgreNewt::CollisionPtr col = new OgreNewt::CollisionPrimitives::Capsule(w,0.5,2.0,0,Ogre::Quaternion(Ogre::Degree(90),Ogre::Vector3::UNIT_X)); //create collision...


   PhysicBody::PhysicBodyTemplate pbtmpl(80,false,Ogre::Vector3::ZERO,false,false,col); //some internal things dont mind

   Ogre::SceneManager* sceneManager = woman->getSceneGeometryManager()->getSceneManager(); //some internal things dont mind

   SceneGeometry* sg = woman->getSceneGeometryManager()->createMesh(ss.str(),&tmpl,pos); //some internal things dont mind
   PhysicBody* pb = woman->getPhysicManager()->createBody(sg,&pbtmpl); //some internal things dont mind

   std::cout << (pb->getOgreNewtBody())->getAABB() << "\n"; //IF THIS IS HERE EVERYTHING IS FINE
   delete col; //here i realse collision

but this crashes...
Code: Select all
   OgreNewt::CollisionPtr col = new OgreNewt::CollisionPrimitives::Capsule(w,0.5,2.0,0,Ogre::Quaternion(Ogre::Degree(90),Ogre::Vector3::UNIT_X)); //create collision...


   PhysicBody::PhysicBodyTemplate pbtmpl(80,false,Ogre::Vector3::ZERO,false,false,col); //some internal things dont mind

   Ogre::SceneManager* sceneManager = woman->getSceneGeometryManager()->getSceneManager(); //some internal things dont mind

   SceneGeometry* sg = woman->getSceneGeometryManager()->createMesh(ss.str(),&tmpl,pos); //some internal things dont mind
   PhysicBody* pb = woman->getPhysicManager()->createBody(sg,&pbtmpl); //some internal things dont mind

   
   delete col; //here i realse collision
            std::cout << (pb->getOgreNewtBody())->getAABB() << "\n"; //IF THIS IS HERE this crashes...
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: More power to JointLibrary

Postby Julio Jerez » Mon Jan 11, 2010 8:34 pm

if you use a smart pointer like
OgreNewt::CollisionPtr col = new OgreNewt::CollisionPrimitives::Capsule

then you should not delete the object,

this is wrong
delete col
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: More power to JointLibrary

Postby PJani » Tue Jan 12, 2010 7:45 am

the problem is i dont use smart pointers, i disabled them with preprocessor flag.
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: More power to JointLibrary

Postby PJani » Wed Jan 13, 2010 6:21 am

Now i delete collision every time i delete body now is fine, but i dont know if is ok in aspect of memory leaks...
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: More power to JointLibrary

Postby Stucuk » Wed Jan 13, 2010 3:58 pm

PJani wrote:Now i delete collision every time i delete body now is fine, but i dont know if is ok in aspect of memory leaks...


For Delphi there is memory managers you can download which can give you a report when the application ends of what has been leaked. Isn't there something like that for C++?
User avatar
Stucuk
 
Posts: 801
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

Re: More power to JointLibrary

Postby PJani » Wed Jan 13, 2010 4:50 pm

Stucuk wrote:
PJani wrote:Now i delete collision every time i delete body now is fine, but i dont know if is ok in aspect of memory leaks...


For Delphi there is memory managers you can download which can give you a report when the application ends of what has been leaked. Isn't there something like that for C++?


Hmm there is one microsoft library in windows which you have to include and link to, and gives you report at the end, but i dont know how to use it. On linux i was using valgrid which was great, now on windows i am totaly in dark about memory problems. It would be very interesting to check for memory leaks after 12 months of blind work. :)
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: More power to JointLibrary

Postby PJani » Wed Jan 13, 2010 5:02 pm

I some how managed to get sample off that code and... i have...khm.......654 memory leaks :) *.

and it seems that other libraries have memory leaks to... CEGUI, Ogre...
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: More power to JointLibrary

Postby Stucuk » Thu Jan 14, 2010 5:08 am

It is funny how stuff done by even the "Professionals" have memory leaks. There are quite a few of Borlands own components which leak memory and they invented Delphi...
User avatar
Stucuk
 
Posts: 801
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron