Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008010opensim[REGION] Physics Enginespublic2016-08-26 16:332020-02-13 13:47
ReporterKayaker Magic 
Assigned ToRobert Adams 
PlatformOSGridOperating SystemOpenSim 0.9Operating System Version0.9.0.0 Dev OSgr
Product Version 
Target VersionFixed in Version0.9.0.1 
Summary0008010: BulletSim does not always call collision events on collisions
DescriptionIn Mantis 8009 I reported that sometimes a small object passes through a larger one without generating collision events. Sometimes they do generate collision events. There is a third behavior that happens often: The bullet object bounces off the target object but does not generate any collision events in either object. Since it does bounce off, the collision is being detected, it is just not being reported to the scripts by calling the events.
Steps To ReproduceTo see this problem, put the target script below into a 4x0.5x4 meter box and name the box target. Put the bullet script into a 1x0.1x0.1 box. Mark the bullet physical and temporary and name it bullet. Put the bullet prim and the bullet script in a gun prim. Point the +x axis of the gun at the target and click it to fire. The distance and angle of the gun to target makes things fail at different rates. So move the gun around and try again until you see failures. With a 1 meter bullet you will see all three behavors: sometimes the bullet flies through with no collisions, sometimes it collides correctly, and sometimes it bounces off without generating any collisions (until it falls down to the ground and gets a land_collision_start).
Additional Information  //target script
//put this in any prim, it tells you when it gets collision events
    collision_start(integer num)
        llOwnerSay("collision start name="+llDetectedName(0));
    collision(integer num)
        llOwnerSay("collision name="+llDetectedName(0));
    collision_end(integer num)
        llOwnerSay("collision end name="+llDetectedName(0));

//bullet script
//put this in a prim, mark the prim as PHYSICAL and TEMPORARY
//put the resulting prim in the inventory of a gun
    collision_start(integer num)
        llOwnerSay("start hit="+llDetectedName(0));
    land_collision_start(vector pos)
        llOwnerSay("land pos="+(string)pos);

//gun script
//put this script and a bullet in in a small (less than 0.5m tall) object
//when you click it, it fires a bullet in the local +X direction, so turn to aim with the build tools
//Don't wear this object, think of it as a cannon
        llSetText("touch to fire",<1,0,0>,1.0);
    touch(integer num)
        llRezObject(llGetInventoryName(INVENTORY_OBJECT,0), //rez the first object in inventory
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (1 Region per Sim)
Physics EngineBulletSim
Script Engine
EnvironmentMono / Linux64
Mono Version3.0
Attached Files

- Relationships

-  Notes
Robert Adams (administrator)
2016-10-02 15:25

First of all, thanks for the wonderful reproduction setup -- this problem was easy to duplicate. That said, I don't have a fix yet.

The problem with passing through the target is that the bullets are small (0.1x0.1x0.1) which is below some the default collision thresholds set for BulletSim. Using a bigger bullet (like 0.5x0.5x0.5) stops the passing through. I'll have to play with parameter settings to see if there is a region setting that works for the smaller bullets.

The bouncing off with no collision problem is a head scratcher. I originally thought the problem was that the collision event was not getting passed to the script engine. Looking that the physics logs, though, confirms that the bullet is bouncing off the target but no collision even is being reported by the Bullet engine. Should not be possible.

I twiddled the single sided mesh option as well as other parameters to try and enable the collision reporting with no effect. Even more odd is that sometimes the bullet bounces off and sometimes the collision is correctly reported. Makes me think there is some edge case in collision manifold computation.

Anyway, I will continue looking into this bug but don't have a resolution yet.
Robert Adams (administrator)
2017-08-14 18:55

I found that BulletSim was not checking for collisions on all the simulation substeps. I have an updated version of BulletSim on the 'BulletSim2017' branch in the source repository. I'm concerned about performance so I will be testing before merging it into master.

But that fix fixes this problem and a lot of tunneling (physical objects going through) problems.
aiaustin (developer)
2020-02-12 00:36
edited on: 2020-02-12 01:35

Robert, did this fix make its way into dev master?

Robert Adams (administrator)
2020-02-13 09:10

Yes. This branch and these changes were merged into Master on September 5, 2017 (commit 921e3ceb09b04693d8241e27666d08c721efb82b).
aiaustin (developer)
2020-02-13 13:47

Thanks for confirming that Robert. Issue closed as “fixed” from

- Issue History
Date Modified Username Field Change
2016-08-26 16:33 Kayaker Magic New Issue
2016-09-27 11:38 Robert Adams Assigned To => Robert Adams
2016-09-27 11:38 Robert Adams Status new => assigned
2016-10-02 15:25 Robert Adams Note Added: 0031174
2017-08-14 18:55 Robert Adams Note Added: 0032250
2020-02-12 00:36 aiaustin Note Added: 0036207
2020-02-12 01:35 aiaustin Note Edited: 0036207 View Revisions
2020-02-13 09:10 Robert Adams Note Added: 0036212
2020-02-13 13:47 aiaustin Note Added: 0036213
2020-02-13 13:47 aiaustin Status assigned => resolved
2020-02-13 13:47 aiaustin Fixed in Version =>
2020-02-13 13:47 aiaustin Resolution open => fixed
2020-02-13 13:47 aiaustin Status resolved => closed

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker