If a prim changes size or shape, add actor to _parent_scene.actor_name_map with new prim_geom key, as the old one becomes invalid.

This resolves http://opensimulator.org/mantis/view.php?id=5603 where changing size or shape would stop collision_start being fired in a running script.
In both this and existing code we are not removing old actors from actor_name_map when the existing prim_geom is removed, which leads to a small memory leak over time.
This needs to be fixed.
bulletsim
Justin Clark-Casey (justincc) 2011-08-01 05:34:02 +01:00
parent 2102964826
commit dfa2f7d715
1 changed files with 4 additions and 1 deletions

View File

@ -1481,7 +1481,7 @@ Console.WriteLine("changeadd 1");
} }
_parent_scene.geom_name_map[prim_geom] = this.Name; _parent_scene.geom_name_map[prim_geom] = this.Name;
_parent_scene.actor_name_map[prim_geom] = (PhysicsActor)this; _parent_scene.actor_name_map[prim_geom] = this;
changeSelectedStatus(timestep); changeSelectedStatus(timestep);
@ -1991,6 +1991,7 @@ Console.WriteLine(" JointCreateFixed");
} }
_parent_scene.geom_name_map[prim_geom] = oldname; _parent_scene.geom_name_map[prim_geom] = oldname;
_parent_scene.actor_name_map[prim_geom] = this;
changeSelectedStatus(timestamp); changeSelectedStatus(timestamp);
if (childPrim) if (childPrim)
@ -2095,7 +2096,9 @@ Console.WriteLine(" JointCreateFixed");
d.BodyEnable(Body); d.BodyEnable(Body);
} }
} }
_parent_scene.geom_name_map[prim_geom] = oldname; _parent_scene.geom_name_map[prim_geom] = oldname;
_parent_scene.actor_name_map[prim_geom] = this;
changeSelectedStatus(timestamp); changeSelectedStatus(timestamp);
if (childPrim) if (childPrim)