@nehon said:
We could make the Material final.... but we don't really like the idea of forbidding something. (we had a looong discussion about readonly attributes once...)
I really prefer that things are not declared final. It just means that when someone decides to alter the behaviour, they will have to resort to work arounds (hacks) to achieve the desired behaviour.
I, myself, deal alot with material properties in my work. ( working in haptics, where an object besides it's visual material, also has a material describing dynamic and static friction and stiffness and such ). I can understand why you are tempted to associate physical parameters it to the visual material, but I think it would make more sense to associate it to the geometry. And geometry has a method you could use for such things, via. UserData, using setUserData() and getUserData()... So you could use Geometry.setUserData("stiffness", 50f ); Or do as I do and include it in your own SurfaceMaterial class, that you assign to Geometry using .setUserData. ( Remeber that to use setUserData the object has to extend Savable )..