Jump to content

JointHinge broken physics


Recommended Posts

Posted

Good evening,

I don't understand what is wrong. The joint is randomly moving:

 Settings for sphere:

image.png.7d9e37428c9115ce2e0e85b80eb93887.pngimage.png.d81a37adbdcbd9e6e2bfb4fb38733574.png

Settings for Cube:

image.png.2690f1507d6cd4d9ccc3b426b866b6f9.pngimage.png.d64aa114989b76e0fe5a9abc2c2675ec.png

I create the jointHinge and press "Fix 0" and it doesn't work properly. How can I fix it?

Posted

Hi, Sevdat!

Can you also sent the shape parameters for both objects? 

image.png

In addition, can you also elaborate on the final result you want to achieve? Such behavior can depends on contradiction between mass/restitution/joint position.

Thanks!

Posted
25 minutes ago, arizmenda said:

Hi, Sevdat!

Can you also sent the shape parameters for both objects? 

image.png

In addition, can you also elaborate on the final result you want to achieve? Such behavior can depends on contradiction between mass/restitution/joint position.

Thanks!

Good morning arizmenda,

This is the shape, but I think I kind of understood what is wrong. Still struggling with it though:

image.png.5a708f10568783815319bc98cd3dd0f3.png This is the sphere, and the box has radius 0.86603

Form what I understood, if the jointHinge is not in the center of the object Axis it will cause problems.

image.png.0c4c2442ec207498686274de949999e7.png

but I can't seem to change where I want the axis to be, because if I change the anchorpoint 0 and 1:

image.thumb.png.cbb013e3a024a61fcdc59f9abe6cb06e.png

the beginning of the blue line isn't at the center anymore and breaks the physics.

 

Posted

If you having difficulties with setting joints up be sure to check the video tutorial about physics:

There is also helpful demo <SDK Folder>\data\samples\joints\hinge_00. You can see how the scene is set up in it.

 

 

Posted
12 minutes ago, arizmenda said:

If you having difficulties with setting joints up be sure to check the video tutorial about physics:

There is also helpful demo <SDK Folder>\data\samples\joints\hinge_00. You can see how the scene is set up in it.

 

Good day arizmenda,

I have watched the tutorial videos multiple times and checked out the demo. I've come across a similar problem in: samples/joints/hinge_01:

When deleting the objectMeshDynamic_545 why does it start going out of control?

 The tutorial video doesn't go in detail how to crate and connect joints together.

 

Posted

Try to increase the iterations parameter to a higher value. Damping should help too, but not in this case, since it already 8

 

 

Posted

Try to modify few more objects in this row. For instance, I changed inerations in these:

image.png

That should work

Posted
32 minutes ago, arizmenda said:

Try to modify few more objects in this row. For instance, I changed inerations in these:

image.png

That should work

Good day arizmenda,

This worked, but it still wobbles left and right slightly. At the very bottom the red and green tile go inside out.

 

 

Posted

Logic is simple here - the more iterations, the less wobbly your structure would be. I modified a couple more objects, and this is the result:

 

 

  • Like 1
Posted (edited)
On 7/22/2024 at 12:36 PM, arizmenda said:

Logic is simple here - the more iterations, the less wobbly your structure would be. I modified a couple more objects, and this is the result: 

 

Good day arizmenda,

I want the jointHinge to either go up or down, but the function of it is fundementally broken. The demo files only show the ideal situations. For example, if a Hinge is created like this it will have broken physics.

image.png.d5f73edbc10138240ba7d300b7b77aa5.png

image.png.089a6a1d7be8cac3afa8916c16c83499.png

How can I fix it? Is my understanding of jointHinge correct? It only changes angle in respect to 1 axis. For example, here it should only rotate around y axis.

Edited by Sevdat
Posted

Hi!

Unforunately, I'm still not quite understand the final result you wish to get. Do you want to rotate objects around axes? Something like this? (Sorry for poor drawnings)

image.png

So far it is hard to say what is going wrong. Can you send us some sample with demonstration of the issue? .zip with your project or whatever you like, so we can check it and say for sure.

Thanks!

Posted
12 minutes ago, arizmenda said:

Hi!

Unforunately, I'm still not quite understand the final result you wish to get. Do you want to rotate objects around axes? Something like this? (Sorry for poor drawnings)

image.png

So far it is hard to say what is going wrong. Can you send us some sample with demonstration of the issue? .zip with your project or whatever you like, so we can check it and say for sure.

Thanks!

Good evening arizmenda,

The drawing represents perfectly what I want to achive. I want to use JointHinge to create a body. Arms, Legs, etc and move it, but in order to do that I need to get JointHinge to work properly.

The current problem:

 Unfortunetly, I can't send the project because I am currently not in russia and the internet here is very slow. Sometimes even sending videos over 7 mb fails.

My plan is to create Unigine joints with meshes created by vertexes and indices that will attach to each other like Bionicle pieces from Lego

image.thumb.jpeg.a758e9294eb9463c5c89298f5794dab1.jpeg

We can then combine it with a neural network to create many different types of pieces and train AI inside unigine based on the bodies it can generate for itself.

I managed to figure out everything except the joint part because it constantly acts irratically.

  • Like 1
Posted (edited)
1 hour ago, arizmenda said:

Hi!

Everything seems to work as intended, take a look. I also attached my settings

image.png

image.png

image.png

Good morning arizmenda,

I have set the same settings as you have, but I'm still facing the same issue. Could it be because I have the project at Floating Point number system? Is your project using Double?

 

Edited by Sevdat
Posted (edited)
4 hours ago, arizmenda said:

Hi!

Everything seems to work as intended, take a look. I also attached my settings

image.png

image.png

image.png

Good day arizmenda,

I also created the project with double precision and it is the same problem. Could it be that when the Engine crashed fatally it broke something in the unigine files?

Just to be clear, I am not trolling. If you have discord I could show you the problem with the hingeJoint or I can upload the project to google drive and give you a link to it.

 image.png.393bb4e862cda1bbc8001dd0af580df1.png

The video is the new one with double precision.

 

Edited by Sevdat
Posted

No, I actually have the same issue, but in a float precision project only. 

Quote

 I can upload the project to google drive and give you a link to it.

Yes, that would be great. This way we can investigate it more thoroughly. If possible, upload the double presision one, please.

Posted
1 hour ago, arizmenda said:

No, I actually have the same issue, but in a float precision project only. 

Yes, that would be great. This way we can investigate it more thoroughly. If possible, upload the double presision one, please.

Good day arizmenda,

I luckily started to upload double precision before I slept. This is the google drive link for double precision. It finished just now:

https://drive.google.com/file/d/1mXqZyIYXRQNti0dokz8ljLAEpNv3zi9u/view?usp=drive_link

If possible I would like to recommend a joint idea:

image.png.d4be81508d6be3c6bf0936628749e17f.png

We use quaternions to decide how we want to rotate. This is a local XYZ axis inside the World axis. If we choose X, every vec3 point will rotate around the local X axis. Technically it behaves a bit like a hingeJoint combined with a ballJoint.

There are gifs and codes to explain here in the project I created: https://github.com/Sevdat/UnityVerticesAI/tree/main/Version4

I was going to create this in Unigine, but didn't know how to join it with Unigine physics so I decided to stick with the existing materials. If I create this joint in Unigine could you guys add it to the engine and connect it to physics? I'll add hierarchy logic too.

  • Like 1
Posted

Hi!

Seems like I found the solution (kind of). I swapped the boxes and changed anchor positions to conformity. 

 

Still, the reason for this behavior is unclear and it doesn't seem to be normal. We will study the problem in more detail.

Thanks for your feedback.

  • Like 1
Posted
On 7/25/2024 at 10:42 AM, arizmenda said:

Hi!

Seems like I found the solution (kind of). I swapped the boxes and changed anchor positions to conformity. 

Still, the reason for this behavior is unclear and it doesn't seem to be normal. We will study the problem in more detail.

Thanks for your feedback.

Good morning arizmenda,

A simple fix would be to use a jointBall with an angle 180 degrees which will act like a jointHinge.

image.png.7a9afc6fc21cb19081d4699274075bdf.png

Is there a way to create custom joints in ungine? I want to implement this idea:

https://github.com/Sevdat/UnityVerticesAI/blob/main/Version4/1_ 1 joint.gif

https://github.com/Sevdat/UnityVerticesAI/blob/main/Version4/2_ 2 joints.gif 

and be able to rotate the joints by defining a rotation axis with quaternions, but I can't get the physics to work.

Posted
On 7/25/2024 at 5:42 AM, arizmenda said:

Seems like I found the solution (kind of). I swapped the boxes and changed anchor positions to conformity. 

Interesting, would that be a bug, maybe?

×
×
  • Create New...