Eamonn Boyle
08/19/2020, 10:42 AMval BAT_WIDTH = 8
Other File
private val batGeometry = BoxGeometry(BAT_WIDTH, 1.0, 1.0)
The BAT_WIDTH here is undefined. I can get around the issue by putting my constants in a singleton object, but worried about initialisation order generally now. Any docs on this or anyone know how it works?
The generated JS seems to be,
var batGeometry;
...
var BAT_WIDTH;
...
batGeometry = new BoxGeometry(BAT_WIDTH, 1.0, 1.0);
...
BAT_WIDTH = 8;
turansky
08/19/2020, 11:54 AMturansky
08/19/2020, 11:54 AMandylamax
08/19/2020, 5:05 PMval BAT_WIDTH get() = 8
Sometimes I don't need getters, as I don't need recomputations to happend. I do endup resoting to lazy
private val batGeometry by lazy {BoxGeometry(BAT_WIDTH,1.0,1.0)}