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 » Fri Dec 20, 2013 10:17 pm

what part you commented out? it should not crash anywhere
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 » Sat Dec 21, 2013 2:30 am

I had to comment out the UV parsing. Try creating a meshptr just by loading a mesh using std filesystem calls as if you are not going to render it. I think maybe an active renderer is normally needed. I have been doing it without rendering for a while but the upgrade to the latest Ogrenewton had me struggling again. These are meshes that I also use to render in another app so the meshes are good. It is not having a live renderer active in Ogre that seems to create the problem.

I had to comment out:

Code: Select all
 const VertexElement* const uvElem = v_decl->findElementBySemantic(VES_TEXTURE_COORDINATES);
                HardwareVertexBufferSharedPtr uvPtr = v_data->vertexBufferBinding->getBuffer(uvElem->getSource());
                dNewtonScopeBuffer<Vector3> uvs (uvPtr->getNumVertices());
                {
                        int size = uvPtr->getVertexSize();
                        int offset = vertexElem->getOffset() / sizeof (float);
                        unsigned char* const ptr = static_cast<unsigned char*> (uvPtr->lock(HardwareBuffer::HBL_READ_ONLY));
                        for (int i = 0; i < uvs.GetElementsCount(); i ++) {
                                float* data;
                                uvElem->baseVertexPointerToElement(ptr + i * size, &data);
                                uvs[i] = Vector3 (data[offset + 0], data[offset + 1], 0.0f);
                        }
                        uvPtr->unlock();
                }


and set
Code: Select all
poly_verts[j][7] = uvs[idx].x;
                                poly_verts[j][8] = uvs[idx].y;



to 0.0f. I can't be sure yet if it worked as desired but it didn't crash. I don't need UV's and it seemed to work. I'd like a cleaner solution but that's the best I can do so far.
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 » Sat Dec 21, 2013 8:45 am

ok if you sync both newtonSDK and ogrenewton, it should be good now.
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 » Sat Dec 21, 2013 1:07 pm

Great I'll give it a try later. I think the issue is if you don't plan on rendering the UV's maybe aren't available in the hardware buffer? It's a bit more low level than I normally look.
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 » Sat Dec 21, 2013 1:34 pm

maybe, if that the case then the buffer will return NULL, I simple test for that
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 Crashy » Mon Mar 19, 2018 6:05 am

Hi,
I've spotted a small bug in the OgreNewt wrapper. I'm not sure if it's already fixed as I haven't updated my newton repository for a while.

The issue is visible when building in 64 bits mode with gcc.
In OgreNewtonMesh.cpp, function OgreNewtonMesh::ParseEntity, lines 282 and 287, if the index buffer is using 32 bit indices, the pointer is casted to "unsigned long *".

The problem is that with gcc, the size of unsigned long is 64 bits when building in 64 bit mode, and not 32 bits (as it is with visual studio)

The type u_int32 should be used instead, as it's guaranteed to be the same size on all platforms.

Thanks
Crashy
 
Posts: 101
Joined: Fri Dec 03, 2010 6:30 am

Re: New Wrapper for the Ogre Engine

Postby Lax » Tue Mar 20, 2018 6:29 am

Hi,

is ogrenewton still somewhere available? The links do not work anymore.
I've got Newton3.0 and Ogre2.1 working (calling it OgreNewt3.0). Maybe someone is interested in OgreNewt3.0?

I would like to take a look at ogrenewton wrapper, to see if I could improve some things.

Regards
Lax
Please support SecondEarthTechnicBase built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd17-5ff5-40a0-ac6f-44b97b79be62
Image
Lax
 
Posts: 165
Joined: Sat Jan 08, 2011 8:24 am

Re: New Wrapper for the Ogre Engine

Postby JernejL » Wed Mar 21, 2018 5:43 am

lax, see ogre section here: http://newtondynamics.com/wiki/index.ph ... ntegration

i'm not totally sure which version is up to date, but i think walaber is probably the one stil updating it?
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: New Wrapper for the Ogre Engine

Postby Lax » Wed Mar 21, 2018 1:41 pm

Hi JernejL,

walaber abandoned OgreNewt years ago. In the Ogre forum, there is no OgreNewt anymore since they removed the addons section.

Regards
Lax
Please support SecondEarthTechnicBase built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd17-5ff5-40a0-ac6f-44b97b79be62
Image
Lax
 
Posts: 165
Joined: Sat Jan 08, 2011 8:24 am

Re: New Wrapper for the Ogre Engine

Postby Dave Gravel » Wed Mar 21, 2018 2:38 pm

I have already use Ogre+Newton here without any wrapper and it work pretty good.
It's not really more complex to use.

You can see my old work with newton and ogre on youtube just to search :
OrionX3D, Ogre3D 2.1b, Newton Dynamics 3.14

Edited: I can try to see in the week-end if I find my old code in my old hdd.
I'm not so sure if I have it again in backup.
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: New Wrapper for the Ogre Engine

Postby Dave Gravel » Wed Mar 21, 2018 5:22 pm

Maybe you have some luck, my old hdd work again hehe.
I have find this code, maybe it can help you or other users to make something fun with ogre.

MY OLD OGRE CODE:
https://www.mediafire.com/file/l1xanfqvoqgpdtm/OLD_Ogre_2015_Dave_Gravel.zip

You can find two old vehicle demo too in the zip.
All the codes is in the zip about the vehicle, raycast and multibody.
I remember to have start to implement ragdoll and fractures and some others features.
It's not all full implemented, many parts is only old tests.

I continue to search, maybe I have a better version for it.
I have many old hdd with old projects, I let's know if I find something better.
I don't remember if it is my last test or if I have do a other one after.

Sorry if it is not the most clean code exemple.
Have Fun! :oops:
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: New Wrapper for the Ogre Engine

Postby Lax » Fri Mar 23, 2018 5:32 pm

Hi Dave,

thanks for your code! I will take a look at it.

I've got OgreNewt with newton3.x working. Just wanted to know if there is another wrapper of Ogre and newton, which maybe has some features, that are missing in OgreNewt.

Regards
Lax
Please support SecondEarthTechnicBase built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd17-5ff5-40a0-ac6f-44b97b79be62
Image
Lax
 
Posts: 165
Joined: Sat Jan 08, 2011 8:24 am

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 21 guests