When using Stacks i have found a situation where the top cubes of the stack don't wake up when those under them have moved.
I am using the Solver Model with 4 as with 1 to 3 the stack falls apart. With it set to 0 it looks right. Above 4 gives the same results as 4 with cubes floating. There are 1,000 cubes in the scene each with a mass of 0.1 and a -9.8 gravity applied. Everything else uses the default settings (Materials/etc).
for L := 0 to High(FCubes) do if (((L div 5) mod 5)*3-6 = 0) or (((L mod 5)*3-6) = 0) then FCubes[L] := MakeCube(Vector3fMake(((L div 5) mod 5)*1-2,(L div 25)*4-4+200, (L mod 5)*1-2)) else FCubes[L] := MakeCube(Vector3fMake(((L div 5) mod 5)*3-6,(L div 25)*1-4, (L mod 5)*3-6));
wow, that's really bad, I have being making changes to the place where sleep is check. but I did no thing I check that in.
basically the change I made is that apply force no longer change the sleep state of the body. this is because vehicle, apply force form a listener and that cause the vehicle to keep awaked all the time. Please open up file dgBroadphase and see if you have function: SleepingStateKernel that is the new code that does eh checking, It looks as if has a bad bug, and think the island is sleeping. I will add that scrip you posted to the box stacking demo to test the code, that's a real bad bug. thank for the report.
is that list piece of code sniped all that I need to reproduce that scene?
procedure TDN_Cube.CreateNewton; var Collision : NewtonCollision; M : TMatrix; begin M := IdentityHmgMatrix; Collision := NewtonCreateBox(FWorld,FSize.X,FSize.Y,FSize.Z,0,@M); CreateBody(Collision); NewtonDestroyCollision(Collision); end;
procedure TDN_Object.CreateBody(Collision : NewtonCollision); begin FBody := NewtonCreateDynamicBody(FWorld,Collision,@FMatrix); NewtonBodySetUserData(FBody,Self);
With the following app you can see it in action, press 1 to view the right scene. - O3_2016-02-18.rar
this is even better, I can debug the dll form there, only one problem, It is full screen with excluse mouse, so I can no take control of the screen of the mouse after I launch it, is the a widow mode? I do see the bug I can not step out to attach the debugger after I launch.
Julio Jerez wrote:Please open up file dgBroadphase and see if you have function: SleepingStateKernel that is the new code that does eh checking, It looks as if has a bad bug, and think the island is sleeping.
Oh wait a minute, I think I checked code with a bug, when compared wit my local version I had that change made, but I did no check in because I was make other vehicle changed. I committed now please sync and try again before I start debug you app.
I am no sure if this fixed the bug, probably not, it is just so that we are using the same version of newton.
There will be no mouse when the mouse is over its window but it won't take over the mouse. It will also only use up 1/4th of the screen now (Its a borderless window, you can't move it but you can put things in front of it).
EDIT: Saw your post after posting this. I will re-download and build the dll.
With the following app you can see it in action, press 1 to view the right scene. - O3_2016-02-18.rar
that is the application that reproduced the bug, I can debug the Newton dll there if the application does no take control of the mouse. basically I can tap out and attach the debugger and them I can set break point in the newton DLL. but is not possible if the mouse is looked to the application. also we need the same DLL,
this is why I ask you to sync and build the latter Newton from Github and if the mouse can be unlocked. I this there is a windows key code for that by I do no remember.
Ok I narrow down but is no fixed yet, the good new is that is not what I did lately. I will fix tonight, thanks for testing this, this bug I might have introduce a while back and not one saw it. what you are seeing in the result of 3.14 which is more stable and try to keep the stack up, but for some reason the island is no notified when the bottom is pulled out. as I go further back in time I see that the bug does no show up because the stack never go to sleep before the falling object hit the so they are already alive. it should be easy to fix as soon I add the code to identify the moment is happens.