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 Julio Jerez » Wed Aug 28, 2013 4:50 pm

Slick wrote:One more thought. The debug libraries don't have a _d extension. Was this intentional?

No, it was not, I could not figure out how to make the debug lib name to have that _d posfix.
I think I know now, but I forget to make tha change

My only suggestion would be on the final lib file paths. Some are under paths called "source" etc. A little cleanup maybe calling the path extension "lib" instead. The core and package libraries are in different "package" or "corelib" paths which is possibly intended. Anyway I will use this nice new build environment. See the attached pic for what I mean.

can you make a patch?


Another thought. These are all .lib there are no .dll builds.

I think is teh oethe way, it buidl the DLLs, I have not added teh libs yet.
These is te hfirsr pass at using CMake, It iwll improved with time and as I learn more features of CMake.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: New Wrapper for the Ogre Engine

Postby Slick » Wed Aug 28, 2013 7:52 pm

I looked at the CMAKE files but I have never set up CMAKE before.

I suspect that one of the entries to change would be: set (corePath ${PROJECT_SOURCE_DIR}/coreLibrary_300/source)

As far as bug fixes - definite progress has been made. I am still using my dll based setup and was able to bump wheels after the latest SVN update. So it looks like my build might be ok.
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 » Mon Sep 09, 2013 4:20 pm

I don't see much on the material interface. Is the wrapper going to expand to handle this? For example NewtonBodySetMaterialGroupID(const NewtonBody* const bodyPtr, int id) is not in the wrapper. I can try and add some of these in but I want to understand if the wrapper is supposed to be very thin and mixed with direct newton calls.
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 » Mon Sep 09, 2013 4:56 pm

yes it will, I has slow down becaise some issue with scaling that I need to solve in teh engine.
but yest the material will be completed.

and yes the wrapper sopd no have any direct call to Newton C api. Th epeoite are provided in case soem funtionality is no expoesed, but ideally
the wraperr should provide all needed funtionality.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: New Wrapper for the Ogre Engine

Postby Slick » Mon Sep 16, 2013 7:52 pm

When you get a chance to work more on this I am ready to test. I can't set up materials, contactcallbacks etc.
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 Chooka » Sun Sep 29, 2013 2:44 am

julio how are you going with this? i'm having a horrible time trying to build any of your projects, i'm using visual studio 2012 x64(probably i shouldn't expect the latest tools to work straight away but it's 2013 and i'm not going back to vs2008). i have every faith in your engine and the wrapper but i feel your cmake build projects need an overhaul. i appreciate the time and effort you have put into the project but it's a huge task and shouldn't be left to only one person. however others won't know where to look in your engine as well as you would to be able to make it compatible with systems like ogre. i hope to be able to assist you. as i mentioned your build system seems to be an obstacle right now. we can't really test anything for you until that part is a little more idiot proof.
Chooka
 
Posts: 10
Joined: Fri Dec 10, 2010 8:48 pm

Re: New Wrapper for the Ogre Engine

Postby Slick » Thu Oct 17, 2013 9:19 pm

Is the wrapper still on the list of things to do? I can hack away at implementing missing pieces but it won't be as good.
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 » Fri Oct 18, 2013 7:11 am

Oh you can hack away.

I still nee to add the material, and some destructions.
I am bringing the Open Scene Graph version to the same level, so that I can avoid bias on the dNewton class toward one graphics engine

the osgnewton version is here: http://osgnewton.googlecode.com/svn/trunk/
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: New Wrapper for the Ogre Engine

Postby Slick » Thu Oct 31, 2013 12:03 pm

I am going to try and add to the wrapper because it is not useable in its current form. You can presently put some objects in the world but you can't do much with them.

What is missing? Is it the material interface and contact callback stuff or is there more?
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 » Thu Oct 31, 2013 1:48 pm

the material is missing yet, but the contact call backs are there, the demos are using them

these are the callbacks,
Code: Select all
class OgreNewtonWorld: public dNewton
{
...
CNEWTON_API virtual bool OnBodiesAABBOverlap (const dNewtonBody* const body0, const dNewtonBody* const body1, int threadIndex) const
CNEWTON_API virtual bool OnCompoundSubCollisionAABBOverlap (const dNewtonBody* const body0, const dNewtonCollision* const subShape0,
CNEWTON_API virtual void OnContactProcess (dNewtonContactMaterial* const contactMaterial, dFloat timestep, int threadIndex) const;
}



the class OgreNewtonExample has three example of them
what is messing is the settig o fmaterial, whic I have no tioem to do yet. I am bringgin teh open Scen graph wraper upt teh same level of thiose wraper,
I maybe this weeken will add the impelmentation of class dNewtonContactMaterial so that Material paramets can be set properlly.
basically it si ery simple jsu puplate the calls with values, and add teh call so that teh newton matrsil is upate in the call backs.
I will finish teh exampel tshi weekend.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: New Wrapper for the Ogre Engine

Postby Slick » Thu Oct 31, 2013 2:09 pm

Oh I didn't realize the contacts were there. So is the only missing piece the material system? What about joints are they all there?
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 » Thu Oct 31, 2013 3:01 pm

all joints are in, yes. the material class is also impmnethed,


the only thing that that need to be complenetd is this:
dNewtonMaterial need the phsyic smareail propirtoes, liek frution, restitione etc.

this is tha class.
Code: Select all
class dNewtonMaterial: virtual public dNewtonAlloc
{
   public:
   dNewtonMaterial(dLong mask = -1)
      :dNewtonAlloc()
      ,m_collisionMask (mask)
   {
   }

   virtual ~dNewtonMaterial()
   {
   }

   dLong m_collisionMask;

// here we add
// float restituion,
// float staticfriction
 // float keneticfriction
// etc

};


that class is a supe base class for all collision shapes.

then I nee to add soem inteface funtion to class dNewtonContactMaterial
so far I have only added this whi I use in teh forl lift demo
Code: Select all
class dNewtonContactMaterial
{
   public:
   dNewtonContactMaterial(void* const materialHandle)
      :m_materialHandle(materialHandle)
   {
   }

   CNEWTON_API dNewtonBody* GetBody0 () const;
   CNEWTON_API dNewtonBody* GetBody1 () const;

   CNEWTON_API void* GetFirstContact() const;
   CNEWTON_API void* GetNextContact(void* const contact) const;

   CNEWTON_API void RotateTangentDirections (const void* contact, const dFloat* const directionVector);

// here we add funton for setting teh maniforld marterial properties
// void SetKineticFriction(const void* contact, float friction);
// void SetDynamicsFriction(const void* contact, float friction);
//...



   private:
   void* m_materialHandle;
};


Then is it just a matter of in the contact clllback, read the collision materials ad make the call to set the matrial properties.
here is hwo si i is now

Code: Select all
void dNewton::OnContactProcess (const NewtonJoint* const contactJoint, dFloat timestep, int threadIndex)
{
   NewtonBody* const body = NewtonJointGetBody0 (contactJoint);
   dNewton* const world = (dNewton*) NewtonWorldGetUserData(NewtonBodyGetWorld (body));

//   NewtonBody* const body = NewtonJointGetBody0(contactJoint);
   for (void* contact = NewtonContactJointGetFirstContact (contactJoint); contact; contact = NewtonContactJointGetNextContact (contactJoint, contact)) {

//      dFloat speed;
//      dVector point;
//      dVector normal;   
//      dVector dir0;   
//      dVector dir1;   
//      dVector force;
      NewtonMaterial* const material = NewtonContactGetMaterial (contact);
      NewtonMaterialSetContactFrictionCoef (material, 1.0f, 1.0f, 0);
      NewtonMaterialSetContactFrictionCoef (material, 1.0f, 1.0f, 1);
/*
      NewtonMaterialGetContactForce (material, body, &force.m_x);
      NewtonMaterialGetContactPositionAndNormal (material, body, &point.m_x, &normal.m_x);
      NewtonMaterialGetContactTangentDirections (material, body, &dir0.m_x, &dir1.m_x);
      speed = NewtonMaterialGetContactNormalSpeed(material);


      //speed = NewtonMaterialGetContactNormalSpeed(material);
      // play sound base of the contact speed.
      //
*/
   }

   dNewtonContactMaterial contactMaterial ((void*)contactJoint);
   world->OnContactProcess (&contactMaterial, timestep, threadIndex);
}



bascially jsut leke in Newton the contac material is a local variable, in CNewton, dNewtonContactMaterial si also a local variable.
the funtion call teh egine OnContactCallback. and OnContactCallback call the derive On contacCallback wit teh poiet to teh bodies, and the shapes.
by adding more funtions to dNewtonContactMaterial teh highet lever can set material parameter on teh contact joint.
putting all tother is not more than a dozen line of code. I will complete so more funtionality thsi satuday.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: New Wrapper for the Ogre Engine

Postby Slick » Mon Nov 04, 2013 8:35 pm

These look like changes to Newton source directly. I don't know if there are related changes to the wrapper too - I would guess yes.

Please advise when you have had time to look at this.
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 » Mon Nov 04, 2013 8:44 pm

No, I thionk that there is no need to make any low level change.

Ca you list which materail you need most urgent, I can add thsoe quietlle tonighm ad you can add all teh rest that you need.
It is just a tidisoe exposint funtioality form teh latrial intefaces fo teh Cnewton calss, but I agree I have noi added a clear sampel for how to do it

I will add teh mst commpun, like friction, and restitution, you cna add therest as you need them.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: New Wrapper for the Ogre Engine

Postby Slick » Mon Nov 04, 2013 9:15 pm

Anything is good and I will test. I need to get the material ID's so I can check which bodies are hit. I am interested in friction testing. I hope that is enough info.
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 8 guests