public BagOfBalls(double sizeInMeters, String name, List<AppearanceDefinition> appearances, GraphicType graphicType, YoVariableRegistry parentRegistry, YoGraphicsListRegistry yoGraphicsListRegistry) { YoVariableRegistry registry = new YoVariableRegistry(name + "Balls"); for (int i = 0; i < appearances.size(); i++) { YoFramePoint3D yoFramePoint = new YoFramePoint3D(name + i, "", worldFrame, registry); YoGraphicPosition newPosition; if (graphicType != null) newPosition = new YoGraphicPosition(name + i, yoFramePoint, sizeInMeters, appearances.get(i), graphicType); else newPosition = new YoGraphicPosition(name + i, yoFramePoint, sizeInMeters, appearances.get(i)); yoGraphicPositions.add(newPosition); } index = 0; registerYoGraphics(name, registry, parentRegistry, yoGraphicsListRegistry); if (graphicType != null) registerArtifacts(name, yoGraphicsListRegistry); parentRegistry.addChild(registry); }