Newton 4.00

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Newton 4.00

Postby Lax » Mon Sep 14, 2020 12:38 pm

Sounds really great! That will be tons of work!
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: Newton 4.00

Postby Julio Jerez » Mon Sep 14, 2020 6:21 pm

No is not that much work, it basically given the old engine a dealler tuneup.
Cleaning old legacy and adding more direct algorithm.
Over the years the engine has accumulated too many intermidiate passes just to keep old functionality.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 4.00

Postby misho » Tue Sep 15, 2020 12:32 am

Awesome stuff - REALLY looking forward to it!

While you're at it - would you consider de-coupling display engine from the demoSandbox stuff? What I mean is, it would be great if there was a flag or define that would not include GL graphics stuff and just illustrate how to set up the universal game physics loop?

When I put together my sim, I set everything up as in DemoEntityManager, but since I have my own display engine, I had to go around and yank out all the visual display stuff (meshes, cameras, etc). In the course of doing so, I made a few assumptions ("nah, I won't need this" kind :roll: ) and on some of them, I failed, which is now biting me in the bum. If you remember, I had problems with time dilation/compression which I narrowed down on some functionality I tossed out because I thought I wasn't going to need it. I have a task ahead of me to re-arrange my code to conform better to DemoEntityManager, and was wondering if the demo code can be made so that we have an option of using a demo visual display, or rely on using our own.
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: Newton 4.00

Postby Slick » Wed Sep 16, 2020 8:17 am

Let us know when it gets to the point of being complete enough that we can try using it.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: Newton 4.00

Postby Julio Jerez » Fri Sep 25, 2020 11:23 am

misho wrote:Awesome stuff - REALLY looking forward to it!

While you're at it - would you consider de-coupling display engine from the demoSandbox stuff? What I mean is, it would be great if there was a flag or define that would not include GL graphics stuff and just illustrate how to set up the universal game physics loop?

On this, yes you are quite correct.
This has confused many people over the years, and I do not blame them. In fact as time pass, the engine ha become more and more intertwined with the graphics.

To solve that, we now do not have hand made projects in visual studio. We only have the cmake script.
This let the user select what functionality to use.
For example the user can select to make a single library or separate libraries.
Single library is the default and is like Newton 1.5 where there is one header and one library to link.

In can also make static or shared libraries.
There will be three demos.
One is called test with not graphics and will set a very simply physics loop with the most basic features.
There is the ndSambox, similar to the existing demo but will not have any user demo just Newton demos.
Those two are in now.
Later there well be two user demos with graphics.
One will be using glut and that one will be use to add demos features in open gl.
The other will be using direct 11.

All this is configurable in c make for example you can select nd test and you get only the engine with the most basic demo.
But if you are a directx guy, you select the directx demo only and you get a clean buil with only direct x demos.

Other optinal functionality are or will be.
multi or single threaded witch is now a full feature.
All other functionality are also selectable.
For example the player controller
The vehicle vehicle
Profiler
The different solvers,
Etc
all be selectable from cmake to get we you need.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 4.00

Postby Slick » Fri Sep 25, 2020 2:16 pm

Yep looking forward to try it all. Currently using latest git 3.14.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: Newton 4.00

Postby Bird » Fri Oct 02, 2020 7:02 pm

I figure it's too early to try but I couldn't resist. I love how little code I had to write to get this much up and running. :)

https://youtu.be/BkkIRpySA7Y
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: Newton 4.00

Postby Julio Jerez » Fri Oct 02, 2020 7:27 pm

Yes that's part of the focus on 4.00
it will be better documented and far more object oriented.
all test so far show superiority vs 3.14
now that we have the base core, I am moving on to advance funtionality. ther was too much legacy on 3.14 that accumulated for many years.

another features of 4.00 is that all the core functionality is exposed. as oposed to 3.14 that teh c interface shielded the user from the core.
are you trying it? that video look quite nice.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 4.00

Postby Bird » Fri Oct 02, 2020 7:59 pm

Great I'm really looking forward to 4.0 development. I definitely like the new design so far.

Yes, I made the video using the latest 4.0 from github. Not sure if you're ready for feedback yet but one thing I noticed that seemed odd is that just adding a simple box to the scene generates a stream of over 100 alloc and free calls.

Code: Select all
// memory allocation for Newton
static void* PhysicsAlloc (size_t sizeInBytes)
{
    LOG (DBUG) << "allocate " << sizeInBytes;
    void* const ptr = malloc (sizeInBytes);
    return ptr;
}

// memory free use by the engine
static void PhysicsFree (void* ptr)
{
    LOG (DBUG) << "free";
    free (ptr);
}
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: Newton 4.00

Postby Julio Jerez » Fri Oct 02, 2020 8:23 pm

Yes, this can be the case.
The engine create pool, that need to be seeded when a new kind of chunk in created.
Essentially it will grow to about .5 meg.
After that, the memory should increase very conservative.

One difference with 3.14 is that 3.14 cache internal reusable data.
This is nice, but used to cause problems with some specific users.
This also prevents some user from extending the engine.
Now any advance user can make his or her own custom Collison shapes just like joints.

The shep caching is now an end app responsibility.

App should indeed cache shapes, because shapes contains a edge list data structure which use a reasoble amoinformation.

Not not worry too much about that unless if the pattern continues.

Finally, memory is one of the things for Newton four that is more relaxed. This is because memory is the cheapest commodity on any compute.
Even cell phone come with several gigs of ram.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 4.00

Postby Julio Jerez » Fri Oct 02, 2020 8:25 pm

The part you should monitor is if ther are too many allocation once it enter the simulation loop.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 4.00

Postby Julio Jerez » Tue Oct 06, 2020 11:17 pm

Dave these is are the setting for making a dll

Untitled.png
Untitled.png (40.61 KiB) Viewed 11418 times
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 4.00

Postby Dave Gravel » Wed Oct 07, 2020 1:12 am

Yes thanks Julio I have get it compiled.
The new dll exporting method with class export is harder to use with pascal.
It's not impossible but a lot harder and complex to implement and maintain.

If you don't use the old newton dll export method with pointers,
I need to see if I remake the whole thing with interface objects.
Or if I remake a personal wrapper in c++ for exports functions and class with pointers method.
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 4.00

Postby JernejL » Wed Oct 07, 2020 7:28 am

Dave Gravel wrote:Yes thanks Julio I have get it compiled.
The new dll exporting method with class export is harder to use with pascal.
It's not impossible but a lot harder and complex to implement and maintain.

If you don't use the old newton dll export method with pointers,
I need to see if I remake the whole thing with interface objects.
Or if I remake a personal wrapper in c++ for exports functions and class with pointers method.


We will need to create some kind of a wrapper, i'm not sure if a wrapper in c++ would be needed due to CRT libraries - as you cant create an instance of object from pascal side without something allocating the object..

how are callbacks implemented? do callbacks now require a instance of class with a needed method?
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Newton 4.00

Postby Dave Gravel » Wed Oct 07, 2020 2:36 pm

I think if Julio make a C interface similar to newton 3.14 dll it can become a lot easier to use with pascal.
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.

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 52 guests