SAM33 / jbox2d

Automatically exported from code.google.com/p/jbox2d
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Make localAnchorA and localAnchorB not be final in RopeJointDef. #49

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In jbox2d-library-2.2.1.1.jar, both localAnchorA and localAnchorB are final 
fields in RopeJointDef, so there is no way to set anchor points for a rope at 
all. This should be changed to non-final fields or allow some way to set them 
somehow. Right now they are filled with hardcoded values in RopeJointDef 
constructor.

Original issue reported on code.google.com by alemnu...@gmail.com on 23 Jul 2013 at 7:44

GoogleCodeExporter commented 8 years ago
You can change them using the _.set(x,y) method, or any other mutable way.  
These, and all other public-faceing inner object variables, are final to ensure 
and encourage less extra object allocation.  Garbage collection can kill the 
performance of this engine :(

Original comment by danielmu...@gmail.com on 23 Jul 2013 at 3:59

GoogleCodeExporter commented 8 years ago
Thanks a lot. You are right, but then the error is RevoluteJointDef, where 
those fields are not final. Thanks!

Original comment by alemnu...@gmail.com on 23 Jul 2013 at 4:39