Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007218opensim[REGION] Physics Enginespublic2014-06-15 11:362017-08-15 13:01
ReporterAliciaRaven 
Assigned To 
PriorityhighSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Versionmaster (dev code) 
Target VersionFixed in Version 
Summary0007218: [Bullet] Delay processing script collision events
DescriptionSince 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.
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (1 Region per Sim)
Physics EngineBulletSim
Script Engine
EnvironmentMono / Linux64
Mono Version3.6
Viewer
Attached Files

- Relationships
related to 0006496closedRobert Adams BulletSim -- Collision events not being activated all the time when prims collide with bullets. 

-  Notes
(0026355)
AliciaRaven (manager)
2014-06-22 22:51

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!?
(0026356)
AliciaRaven (manager)
2014-06-22 22:56

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.

Thanks
(0026399)
justincc (administrator)
2014-06-27 15:09

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.
(0026400)
AliciaRaven (manager)
2014-06-27 15:10

Yes, right now im using bullet on its own thread, but i also had the same issue with running on the same thread.

Thanks
(0026403)
vegaslon (reporter)
2014-06-27 15:58

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.
(0026413)
Talun (manager)
2014-06-29 16:56

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.
(0032253)
vegaslon (reporter)
2017-08-15 13:01

I suggest taking a new look at this with current master, recent changes seem to have fixed this problem.

- Issue History
Date Modified Username Field Change
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
Powered by Mantis Bugtracker