Weird behaviour with raycasted setup & extern systems #102
Replies: 5 comments 7 replies
-
I understand what is happening here, but I am not sure of the reason. The vehicle and ragdoll are initially in separate islands, running in different threads. When they get close to one another, their AABB intersect and they're moved into a single island. In the case where you have multiple ragdolls, whose AABBs are apparently intersecting (thus meaning they're in the same island), when the car approaches one ragdoll, it is transported into that same island and the island it was in is destroyed. Remember that each island has their own private registry. The process of moving an entity from one island to another involves making a copy of all of its components in the local registry and sending it over to the other registry, that's why you need to register the external components explicitly or else it wouldn't know what components to copy. What must be happening is that the external components are not being copied so they're lost and the view you're iterating in the external system is empty. I don't understand why they're not being copied. I will have to investigate if any recent changes I made broke anything. All the weird behavior you're seeing is being caused by this "small" failure. I get it that it can be difficult to understand what is happening without a deeper knowledge about how the multi threaded physics is setup, where any slight mistake can lead to situations where the behavior cannot be explained by physics alone. |
Beta Was this translation helpful? Give feedback.
-
I have discovered the reason behind this issue with the vehicle suddenly dropping to the floor. One issue is that the ray was intersecting the car itself so it was basically applying the same force in opposite directions to the car (thus nullifying it) and then nothing happens. To fix that I have added a filter to the The other issue is that the AABB of the vehicle was not necessarily intersecting the AABB of the terrain or plane or ragdoll since it's floating due to the ray forces. That would cause the entities to not be placed in the same island then raycasts would be missed because raycasts in an external system only consider the entities that are in the island where it's running at the given moment. To fix that I have added a new componnet Here you can find an example of a hovering rigid body which is similar to what you're doing with a raycast vehicle https://github.com/xissburg/edyn-testbed/blob/master/client/src/hover.cpp Hope this helps. Cheers! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions