We are currently trying to add a feature in our Editor.
we want to add physical entities to the scene but the problem is that when we move the Dynamic entities manually it craps out as soon as it
intersects any bounding volume. (as it should be, our physic time goes from 0.3ms to about 50ms when that happens)
So i tried converting the entity to Kinematic, and it works fine, but there are no events generated if the kinematic entity intersects another bounding volume.
The difficult way for me now would be to implement a quick intersect test that checks out all possible collisions.
before i do anything like that (which would inevitably lead to my brain dying) i would like to know if there is an easier way around this problem.
it would be nice if when collision is detected the Entity just stops moving.
Is there any way i can manually move a Dynamic Entity without it to compenetrate?
manually moving Kinematic Entity collision detection
Re: manually moving Kinematic Entity collision detection
First thing's first- that should not happen. Some shenanigans are occurring if it becomes orders of magnitude more expensive because of a single collision.we want to add physical entities to the scene but the problem is that when we move the Dynamic entities manually it craps out as soon as it
intersects any bounding volume. (as it should be, our physic time goes from 0.3ms to about 50ms when that happens)
What are the other bounding volumes? Are they static meshes or other kinematic entities? Static objects and kinematic entities belong to the same CollisionGroup by default which has a CollisionRule defined with itself to avoid creating any pairs. You can change this if you want. Check out the collision rules documentation for more information.So i tried converting the entity to Kinematic, and it works fine, but there are no events generated if the kinematic entity intersects another bounding volume.
Keep in mind, if your access pattern is more similar to polling checks than events, you can also use the entity.CollisionInformation.Pairs collection. This stores every pair the entity is currently involved in. Every Pair also has a Contacts collection.
Using teleportation (by setting Position, Orientation, or the equivalent properties) will inevitably put entities into penetrating states with other entities. Dynamic entities will seek to get out of penetrating states by using penetration correction, which pushes the entities apart. If one entity in the pair is kinematic, then only the dynamic will move away.it would be nice if when collision is detected the Entity just stops moving.
Is there any way i can manually move a Dynamic Entity without it to compenetrate?
Using a more physical control method that operates on velocities will keep the entity from inevitably getting into penetrating states. The SingleEntityLinear/AngularMotor is another way; they apply physical impulses to keep the entities at the goal states.
If teleportation is required due to the editor's behavior, you might want to teleport the object, run the Space.Update(), check for collisions, and if it fails, undo the movement. If there are performance reasons why you do not want to run a full timestep when it gets moved, you can also query the location using something like the CharacterController's QueryManager.
If you want to freeze objects, you can make them kinematic using entity.BecomeKinematic. This wipes out any stored physical data like mass and the inertia tensor though, so if you want speedy re-dynamicification, it's a good idea to store the physical data and give it to the BecomeDynamic method when it gets called.
These suggestions might be a little off the mark since I don't know exactly how the editor works or what the goals truly are, so take them with a grain of salt.

Re: manually moving Kinematic Entity collision detection
It helped me alot. things got a lot more clear now =)
edit: btw physics time goes up when dynamic intersects static meshes or kinematic. (our ground model for example)
my coworker(arcades, he made some posts here) also just told me that we are using our threadManager for bepu. could that be an issue?
edit: btw physics time goes up when dynamic intersects static meshes or kinematic. (our ground model for example)
my coworker(arcades, he made some posts here) also just told me that we are using our threadManager for bepu. could that be an issue?
Re: manually moving Kinematic Entity collision detection
I found out the problem. someone forgot to instantiate the mass variable, and it was trying to create a dynamic entity with mass having "infinite" as value.
Now, i just need to find the guy who did it and think of a suitable punishment for him =)
Now, i just need to find the guy who did it and think of a suitable punishment for him =)