[issue] ConstraintDrawer.Remove() method do nothing

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
JusTiCe8
Posts: 52
Joined: Mon Jun 01, 2015 9:02 am

[issue] ConstraintDrawer.Remove() method do nothing

Post by JusTiCe8 »

Hi Norbo,

in LineDrawer class, the remove method doesn't work:

Code: Select all

var lineDisplayObject = displayObjects[i] as LineDisplayObject<T>;
if (lineDisplayObject != null && lineDisplayObject.LineObject.Equals(o))
despite displayObjects is not null, the resulting cast (not sure of the desired goal here) in lineDisplayObject is always null (at least in my tests), so lines are actually not removed.

Included in patches and sources for both DemoGame (add LineDrawer to demo constructor + a few change in demo order, some unrelated) and RobotArmDemo to show the issue. Enable constraints display, press 0 on the numpad and see what happened, moving arms part could also show it ore obviously.
Attachments
linedrawer-issue-demo.zip
patch and modified RobotArmDemo codes.
(9.12 KiB) Downloaded 259 times
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: [issue] ConstraintDrawer.Remove() method do nothing

Post by Norbo »

There was a bug in the handling of SolverGroups in the remover. It should be fixed now (though I'll admit I didn't do much testing). Thanks for the report!
JusTiCe8
Posts: 52
Joined: Mon Jun 01, 2015 9:02 am

Re: [issue] ConstraintDrawer.Remove() method do nothing

Post by JusTiCe8 »

Thanks for your time and the superquick fix ;). I didn't test it yet too, I'll tell you if it's not ok or found any issue.

EDIT: tested on my own code, it's ok.
Post Reply