Enabling Bodies

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Enabling Bodies

Postby Markus » Sat Nov 05, 2011 5:19 pm

Just wanted to let you know that I tried the solver fix with my domino simulation. What I see is that everything is running much faster (not in terms of performance, but the dominos fall faster), which is good because I set the gravity to a higher value to get the same result. I do not see any instability.
Markus
 
Posts: 52
Joined: Sat Mar 19, 2011 6:31 am

Re: Enabling Bodies

Postby Julio Jerez » Sat Nov 05, 2011 5:24 pm

excellent. yes that was a bad bug. I see it is paying off right away. :mrgreen:
now you can set gravity to normal value as it should be.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Enabling Bodies

Postby Julio Jerez » Sun Nov 06, 2011 6:02 pm

Ok sweenie I just completed the conversion of the exact solver to core 300 .
now the default is eh exac solver again.

but not for long for core 300 I am thinking to make the defalk teh iterativer solver.
one o fth ereaosn teh exact solve wsa teh defual in core 300 was that velocity bug, bu that the solev is better, so we can make default.
that way there isless explaing to do for casual users that try an dget turnb off bu teh defaults on teh engine.

I tested the forklift demo and it seems to work fine, if you test it please let me knwo what you find.
I also play a litle with your raycast car, I love hwo it can make poewer slides, it is awesome. :mrgreen:

now I am going to add the Joint feature that allow to select the solver for an island with bilateral joints. that way we will get the best of everything. :mrgreen:

core 300 start to be frightening? :twisted:
something very rare you see, it is getting faster and more acurate at the same time. :evil: :twisted: :D :idea: :arrow: :P :mrgreen:
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Enabling Bodies

Postby Julio Jerez » Sun Nov 06, 2011 8:33 pm

this i how teh new funtion look like

Code: Select all
// Name: NewtonUserJointSetSolver
// Set the type of solve to use with this joint when thee solver mode is set to iterative
//
// Parameters:
// *const NewtonJoint* *joint - pointer to the joint.
// *int* solver - solve mode, 1 selcet exact solver, 0 selct iterative solver
// *int* maxContactJoints - select teh maxsimun numbet of contact joint that will select the exact solver
void NewtonUserJointSetSolver (const NewtonJoint* const joint, int solver, int maxContactJoints)


when exact mode the function has not effect,
when iterative solve is selcted it sole the isalnd using teh exat solve oinly if there ar efewrr than maxContactJoints contact in it.
it is not the default.

for example say you make a rag doll, an teh doll has 20 joint, if you sy I will allow 5 contact joints.
then if the doll is walking it will have maybe twe contact, so it will use exact solve, bu if teh doll fall on teh float an each peic hi the floor it will probably not matter if it si acuare of not.
same for any other contration.
it can be set at will at run time to the app can do small controll.

remember to test the forklift you explicity have to set the solver mode to eaxct since it is iterative by default.


if you have time maybe you can recompile the demo to claiingteh funtion on teh joint bu usin eh ieterative solver, that way I do not have to hack my version to continue the work.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Enabling Bodies

Postby Sweenie » Mon Nov 07, 2011 4:13 am

You work really fast. :)

Unfortunately it doesn't seem my forklift wants to choose the exact solver though. :(
Maybe I'm doing it wrong...

[EDIT]
Oh, wait... :mrgreen: ... haha, just realized you haven't implemented the function yet.
You have just declared the function but it doesn't actually do anything yet. :)
[/EDIT]

I've set it up like this...
NewtonSetSolverModel(nWorld, 1);

and then for the lifter joint and the wheel joints
NewtonUserJointSetSolver(joint, 1, 15);

You can redownload the same demo again...
http://www.svenberra.net/testcore300.zip
Sweenie
 
Posts: 503
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Enabling Bodies

Postby Julio Jerez » Mon Nov 07, 2011 6:47 am

has you change the control keys in the new demo. The fork lift aparatus does no move now, but if I copy the new DLL into eh old demo it still works

I do get the call to set the smart solver selection for each joint, but the controls are gone.

I am impelnetion teh function now.
it is not just a flags, it requires one extra pass on the set of island to separate those into two set. an each set is dispache to the apropriate solver type.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Enabling Bodies

Postby Sweenie » Mon Nov 07, 2011 7:53 am

oops, seems I put the wrong input config into that demo. :roll:
Either download again or copy the file input.cfg under the folder Data\Engine from the previous demo.

Or just add these entries to the file, just below the other keyboard bindings.
Code: Select all
bind "Q" %lowr;
bind "E" %rais;
bind "R" %tltu;
bind "F" %tltd;
Sweenie
 
Posts: 503
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Enabling Bodies

Postby Julio Jerez » Mon Nov 07, 2011 9:02 am

Ok It is done, check it out try using diffrent number of contat limit. for exampelk you have 15,
I move around and I coe not get a place were is hit taht many, but if you put more object then you cna see if it switches, It thonk is does but I did not test it.
if it does you will see is as the vehicle lossing its snapiness. :D


now I need to complete the simd version of the exact solver, this becoem imprtant now since it will be use more together with the iterative solve.
also I will complet eth paraller exact solver, which becume is even more import fo rereformance.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Enabling Bodies

Postby Julio Jerez » Mon Nov 07, 2011 9:19 am

sweenie here is one preposition.

since you are using a game engine that has lot of feaurtes, would you like to set a fremework demo for the softtbody feature.
I am thinkmg to start that now. and it will help me if the test is alredy made. setting up demos is the part that take more of my time because fo making assest and setion of graphics command and other stuff.
what do you think.
does C4 had support for that kind of stuff, predecuda mesh that are gennerate by other llibraies?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Enabling Bodies

Postby Sweenie » Mon Nov 07, 2011 10:39 am

Well, I could try. :)

I know C4 supports building and modifying custom meshes in realtime, I haven't tried it myself yet though so I'm not really sure how
complicated it is. :roll:

predecuda mesh

Sorry but do you mean a precomputed mesh, or some kind of Nvidia Cuda-stuff here? :oops:
Sweenie
 
Posts: 503
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Enabling Bodies

Postby Julio Jerez » Mon Nov 07, 2011 10:56 am

Sweenie wrote:Sorry but do you mean a precomputed mesh, or some kind of Nvidia Cuda-stuff here? :oops:

sorry, I meant dynamically generated proceduar meshes. Soem engien impos some limitation on that because they wnat to have everythong using harware VertexBuffers.
No tha we will not cover that, but for nwo let us simply the implemnation.

The CUDA stuff, when I get to that I beleiev I will go fo the Intel OpenCL. Nvidea has very extrange ideas of what a General poupuse CPU should be.
They do no liste to dvelepen sugestion, tehy do wha teh wan to do, and whe you get with cuda is a CPU that can ole you lot of Mul and ADD but is terribel when you have to do sequencial programmin.
on top of that, they so not support 64 and 32 bit on teh same system (I ask several time and they do not even respond)
Each new card render teh previus useless, and you end up with a prliferation fo hardere check and conditan comiplations.
all in aLL cuda is not what people thinh it is.

The CPU are catching on with GPU, now tha teh have wide vector capbilityes, Intel AVX is awesome and AMD is following, and they have a OpenCL driver for it.
I like that better because it is more General. I never liek teh idea of rendering thg Physics and Nvdiea seem to go more and more that route forgetting that
CPUs are suppost to simply programming, not making more complex.


On teh soft body:
I will provide the complete interface. here is a pseudo code of the interface I am planning for this

Code: Select all
// here you take mesh and you past teh face, eh UV, teh textote and all teh infomation
NewtonMesh* mesh = CreateMesh()

// her etha soft body is created
NewtonParticleBody* softBody = CreateSoftBody( mesh );



then after each physics update for each softbody you do somethomg liek this

for each Soft body ()
    NewtonParticleBody* softBody = body(i)
    if (bodyAABB is visible) {
           // a soft node is a NetwonMesh so it will us eteh same inteface of teh Mesh to get the renderable part
           vertexArray = GetVertxList(vertexArray)

           //here is tha Grapheenge part tha submin teh betbuffer or whate it uses
            GameEngineDynamicsBuffer(vertexArray )   
 
          SofbodyBeginMesh();
               //
               for (int material = softBosyGetMatrial(); material; NetMatraisl()) {
                      SoftBodyGetMesh IndexList();
                      //  here is the mat tha subimt teh index buffer an dteh matrail
                       GameEngienMaterial(material )
                      GameEngineDyamicIndexBuffer (indexArray);

                      GameEngineSubmintForrenderin(...)
           }
            SofbodyEndMesh();
     }


I will start with the shape matching softbodes, bu the I will add Cloth (really nice), and preasure bodies

you part is to make teh test demo usin teh ineface afte I adde to the Newton, H file.
any simple mesh would do to start maybe a simple cube, a simple sphere, for teh develoment and then with move to more complex shapes.
do you think you could do that?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Enabling Bodies

Postby Sweenie » Mon Nov 07, 2011 12:04 pm

you part is to make teh test demo usin teh ineface afte I adde to the Newton, H file.
any simple mesh would do to start maybe a simple cube, a simple sphere, for teh develoment and then with move to more complex shapes.
do you think you could do that?


I sure would like to give it a try. :)
As i said I've never tried that part of C4 before but we could start simple as you said and see how it goes.
Sweenie
 
Posts: 503
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Enabling Bodies

Postby JoeJ » Fri Nov 11, 2011 2:14 pm

I'd like to try out the solver bugfix.
I've a situation where i need 3 angular constraints for powered ragdoll joints.
It shows up that while this is stable, it produces slower motion than using a single constraint.
Maybe the fix helps here too.

I'm still on 2.29. So what do i need to do to get the fix?
Using svn 3.00 version and compile myself? Will that include the fix?
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Enabling Bodies

Postby Markus » Fri Nov 11, 2011 7:42 pm

JoeJ wrote:Using svn 3.00 version and compile myself? Will that include the fix?


The fix is in core200 (svn), too.
Markus
 
Posts: 52
Joined: Sat Mar 19, 2011 6:31 am

Re: Enabling Bodies

Postby Julio Jerez » Sat Nov 12, 2011 12:34 am

JoeJ are you using the iterative solver for your project?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest