|Anonymous | Login | Signup for a new account||2020-01-20 07:43 PST|
|Main | My View | View Issues | Change Log | Roadmap | Summary | My Account|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0007218||opensim||[REGION] Physics Engines||public||2014-06-15 11:36||2017-08-15 13:01|
|Product Version||master (dev code)|
|Target Version||Fixed in Version|
|Summary||0007218: [Bullet] Delay processing script collision events|
|Description||Since changing from ODE to Bullet physics we have been having problems with simulated projectiles. |
Using ODE there were issues as well, I had to make some changes in llRezObject because when a projectile was rezzed, it dropped to the floor due to gravity before the impulse was applied. Basically too much was happening between rezzing and applying force which caused bullets to be impractical. Note that it works ok on an empty server, but when there is a slight load on the server it showed the above effect.
But that's not the issue I'm reporting here, although i think the cause of this issue is probably similar. Since changing to bulletsim, the projectile fires as before, but when it hits a target, the scripts collision event does not fire immediately. It rolls off the target hits the wall behind, rolls along that for a few seconds and then eventually the collision even is fired. This basically means that the projectile says its hit the wrong target even tho it hit that target first, it just didn't detect that collision. I think this is because the projectile hits the target before the script is setup and running. This was never an issue with ODE.
|Tags||No tags attached.|
|Git Revision or version number|
|Run Mode||Grid (1 Region per Sim)|
|Environment||Mono / Linux64|
I now think that I was wrong in thinking the problem is scripts not having time to start up before the projectile collides. This is because I added a script to the target to shout out when it was hit. If the projectile does not detect the collision, the target doesn't either. If it was just a case of the projectiles script not being ready, the target would still detect the collision.
Some other strange behavior also shows up. In the code after the projectile is rezzed but before the force is applied to fire it, if i place a 3 second thread sleep, it will usually work.
The biggest clue i found is when setting the projectile to physical after its rezed (Done in code, not the script). Calling SOG.ScriptSetPhysicsStatus(true) too soon after rezzing and the projectile stays fixed and does not move when the force is applied, setting it just before the force is applied, makes it move but not detect the collision. But setting it some where between seems to work more often.
The strangest thing of all, twice when the projectile rezzed and was not moved by the applied force, i deleted the prim (right in front of me) and both the prim and the target which was 13m away shouted out they detected a collision!?
Also i forgot to mention that setting the prims restitution to zero helped make collisions detected more often. I think that a lot of the problem is caused when the prim bounces off so fast that it is not in contact with the target long enough to detect.
Unfortunately, I don't know much about BulletSim internals yet, but just to check, are you using the option that allows the physics part to run in a separate thread from the main scene loop?
I'm also wondering if this could be connected with http://opensimulator.org/mantis/view.php?id=7132 [^] in any way though it sounds like a different problem.
Yes, right now im using bullet on its own thread, but i also had the same issue with running on the same thread.
I reported this some time ago. http://opensimulator.org/mantis/view.php?id=6496 [^]
From what I have "guessed" from looking at the Bullet forums it could be a problem with how collision events are handled in Bullet since the engine is seeing there was a collision and allowing the bullet to bounce off but is not actually registering an event up to BulletSim.
|Missed collisions can be a problem in SL too. It is quite possible to send an AV through a wall if you move it fast enough, you are through before physics has seen the collision, lower velocities and longer bullets is the usual solution there. more chance of the physics engine looking at the objects/AVs while theor position gives rise to a collision.|
|I suggest taking a new look at this with current master, recent changes seem to have fixed this problem.|
|2014-06-15 11:36||AliciaRaven||New Issue|
|2014-06-22 22:51||AliciaRaven||Note Added: 0026355|
|2014-06-22 22:56||AliciaRaven||Note Added: 0026356|
|2014-06-27 15:09||justincc||Note Added: 0026399|
|2014-06-27 15:10||AliciaRaven||Note Added: 0026400|
|2014-06-27 15:58||vegaslon||Note Added: 0026403|
|2014-06-27 16:07||justincc||Relationship added||related to 0006496|
|2014-06-29 16:56||Talun||Note Added: 0026413|
|2017-08-15 13:01||vegaslon||Note Added: 0032253|
|Copyright © 2000 - 2012 MantisBT Group|