multiple tree collision issues

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

multiple tree collision issues

Postby collerblade » Sat Mar 02, 2019 6:04 pm

hello julio,
i may found a bug for you. I switched to the latest (19-03-01) newton yesterday. Previously i was using a year old version (with the old version everything works fine).
Symptoms:
- If we have multiple tree collision in the scene, the first one does NOT works.
- Sometime i just fall through, sometime doesnt, but worldraycast doesnt hits the mesh.
- After a while it just kicks in, and starts to work. Like nothing happend. This is very strange.
- It is very unpredictable. Sometime 2 objects fall through and the third one stops, and behaves normally, while worldraycast got nothing, and the 4th one falls through again.
- No matther if i set the optimize flag or not. Behaves the same.

Am i dreaming? Is someone else experienced this?

I tried release and debug x64 version on windows. Compiled with vs2017. I got the same result with separated dll or with static linking.

Thank you for your time.
collerblade
 
Posts: 88
Joined: Mon Apr 05, 2010 12:09 pm

Re: multiple tree collision issues

Postby Julio Jerez » Sun Mar 03, 2019 7:09 am

I do not know what could that be, I have seen weird behaviors on other demos but I have not test it.
Is possible there is a bug I am unaware, all I can check is that my test are working.
Do you have a test case.

I am re enabling the dscene so the scenes can be export independent of the physic engine so that they can be import in the sandbox demo for debugging.

Can you use the decent to export a scene with problems?
Julio Jerez
Moderator
Moderator
 
Posts: 10994
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: multiple tree collision issues

Postby collerblade » Sun Mar 10, 2019 2:44 pm

Im back!
I was away this week, sorry for that.

The situation changed a bit. If there is only one (!!) tree-collision, the worldraycast doesnt hit it at all. Sometimes moveable rigid bodies also fall through.
I exported the collision data for you.

https://drive.google.com/open?id=14dRCe ... QJXrvx8E3n

In my scene there are nothing, just this collision, with a body with zero mass. The collision has no scale nor transformation matrix applied to it. Same for the body.
I raycasting it (with newtonworldraycast), and it has no hits at all.
If i place a cube or anything else into the scene, the raycast hits them instantly, but not the tree collision.

Can you confirm this issue to me?

Thanks
collerblade
 
Posts: 88
Joined: Mon Apr 05, 2010 12:09 pm

Re: multiple tree collision issues

Postby Julio Jerez » Mon Mar 11, 2019 10:38 am

that file is binary, I do no knwo hwo to read that.
if is a newton serialization is unlikely I will be able to load it either
there is a way to save a scene if a binary format using teh dScene library
this is how

Code: Select all
void ExportScene (NewtonWorld* const world, const char* const name)
{
   char fileName[2048];
   dGetWorkingFileName(name, fileName);

   MakeViualMesh context (world);
   dScene testScene (world);
   testScene.NewtonWorldToScene (world, &context);
   testScene.Serialize (fileName);
}


this will save the scene to an ngd file, that you can them load in teh newton sandbox using the menu option file->Open

then you can try is it work on the newton sandbox as you expect, you can do teh ray and check collsion. If that fail you can then send me the xml file.

you need to sync to get latest because the open file option was not implemented, I just added.
Julio Jerez
Moderator
Moderator
 
Posts: 10994
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: multiple tree collision issues

Postby collerblade » Mon Mar 11, 2019 6:18 pm

why cant you load a newton collision serialization file?
collerblade
 
Posts: 88
Joined: Mon Apr 05, 2010 12:09 pm

Re: multiple tree collision issues

Postby Julio Jerez » Mon Mar 11, 2019 7:20 pm

I did not know it was a newton serialization.
But there has been so many changes that I am not sure if serialization is still working, all it takes is.

I'M try tonigh, but I do not have high hopes it will load.
I would enable the menu option that way, it it fail you can save it again and reload it in the sandbox before you send it.

Binary serialization is not meant to be a data transport format, is very fragile.
Julio Jerez
Moderator
Moderator
 
Posts: 10994
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: multiple tree collision issues

Postby Julio Jerez » Tue Mar 12, 2019 8:16 am

ok I just enabled serialization and deserialization, and as I suspected I can not read the file you sent me.

This is because serialization is not meant to be a file format, Is for a particular application using an specific version to speed up scene creation.
Basically a sterilized file can be considered a blue print for an model that can be loaded very fast.

In any case all you have to do now is this:

-Sync to later version
-in your application serialize the scene by calling call function
NewtonSerializeToFile(m_world, name, NULL, NULL);

-you can see if I can be loaded in the Newton Sandbox before you send it to me.
in the sand box is the operation File->Deserialize

in fact if the scene loads in the sand box, you can inspect it by look the wire frame, and try the ray cast.

sorry about that problem, but serialization was likely to be broken afte so must time is was not looked at.
Julio Jerez
Moderator
Moderator
 
Posts: 10994
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: multiple tree collision issues

Postby collerblade » Wed Mar 13, 2019 6:42 am

ok, i will recompile newton dll in the weekend and try the serialization again with NewtonSerializeToFile.
Meanwhile i can send you triangle list, or just wait for the weekend.
collerblade
 
Posts: 88
Joined: Mon Apr 05, 2010 12:09 pm

Re: multiple tree collision issues

Postby Julio Jerez » Wed Mar 13, 2019 7:40 am

not use the serialization,
also are you using quaternion? that is one thing that changed about a month ago.

quat are not mapped to a x, y, z, w instead of a q0, q1, q2, q3
w = cos(angle/2) is teh last element as oppose to before that q0 = cos(angle/2) was tha first element.

please make sure you make that chnage on your engine. My guess that is the problem.
Julio Jerez
Moderator
Moderator
 
Posts: 10994
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: multiple tree collision issues

Postby Julio Jerez » Wed Mar 13, 2019 3:19 pm

you may want to read this topic, I believe this is your issue too.
viewtopic.php?f=12&t=9386
Julio Jerez
Moderator
Moderator
 
Posts: 10994
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: multiple tree collision issues

Postby collerblade » Wed Mar 13, 2019 4:35 pm

hi,
thanks for the tips.
Yes, i'm using newtonbodygetrotation, but i realized the quaternion changes long time ago (at the first day i updated to the latest version) . All bodies works fine, except tree collisions. So i dont think the problem would be quaternions.
I will download the newest version at the weekend, and try again.
collerblade
 
Posts: 88
Joined: Mon Apr 05, 2010 12:09 pm

Re: multiple tree collision issues

Postby collerblade » Sun Mar 17, 2019 1:31 pm

hello again,
i downloaded and built the latest version of newton (usign vs2017 for windows). And the problem still exists. Here is my scene file (exported with NewtonSerializeToFile):
https://drive.google.com/open?id=1xRRLU ... ZpydCNSxnI
While the newtonraycast hits the primitives, it does not hit the treecollision. But if i remove all of the other primitive bodies, then the raycast works for the tree-collision.
Please try it out.
I can supply demo if you need it.
I tried to remove all of my newton functions to see which does the effect, but come up empty. If there is another body, the tree collision stops working (in raycast), but if there is another tree collision, then only one of them fails, and the other one works. This depends on the order of creation.
Looks like a bug to me, or both of my D compilers is bad, and my old code (witch works 100% with old newton version) is also bad or i dont know what a hack is goin on here....
collerblade
 
Posts: 88
Joined: Mon Apr 05, 2010 12:09 pm

Re: multiple tree collision issues

Postby Julio Jerez » Sun Mar 17, 2019 2:36 pm

Ok I loaded on teh SDK, and I see a terrain, a box, a cone, a convex hull and a sphere

IO can right click on the terrain and navigate around is there are place that you identify whe the ray case fail? I do not see any.
as I understood you said there are few terrain pieces but I only see a single terrain file when I zoon out.

are you saying that the ray case fail on the piece of terrain?
Julio Jerez
Moderator
Moderator
 
Posts: 10994
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: multiple tree collision issues

Postby Julio Jerez » Sun Mar 17, 2019 3:23 pm

I just added a new menu option "show ray cast hit point"

if you sync then you should be able to load your serialized scene in the sandbox, enable that option and click on the places you think the bug is, everywhere you click it will display a red dot.
not showing the dot means you can expose the bug.

I click in many places and I did not see a failure once. so I am not sure how else debug this.
in fact the scene does not even has more than one collision tree.
Julio Jerez
Moderator
Moderator
 
Posts: 10994
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: multiple tree collision issues

Postby collerblade » Wed Mar 20, 2019 12:03 pm

hi, im back again

Ok I loaded on teh SDK, and I see a terrain, a box, a cone, a convex hull and a sphere

That is correct. I minimzed the scene, to only see the error.

can right click on the terrain and navigate around is there are place that you identify whe the ray case fail?

To me, it fails all the time all angle all position and distance. Only the other objects are hit.


im away from home again, so i cant compile c++ right now. So i cant test, but i belive you that there isnt any error on your side.
But the question is: why isnt working for me? What kind of newton call can i do legaly to produce this behaviour? Only newtonraycast prefilter. And i dont using that. So what the heck could happen here?
Last edited by collerblade on Wed Mar 20, 2019 12:25 pm, edited 1 time in total.
collerblade
 
Posts: 88
Joined: Mon Apr 05, 2010 12:09 pm

Next

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 1 guest