/** Clear and reinitialize. Drop any quaternion. */ @Override public void clear() { this.quat = null; this.numVertices = 0; super.clear(); }
private void createTestOutline() { float offset = 0; outlineShape = new OutlineShape(getRenderer().getRenderState().getVertexFactory()); outlineShape.addVertex(0.0f, -10.0f, true); outlineShape.addVertex(15.0f, -10.0f, true); outlineShape.addVertex(10.0f, 5.0f, false); outlineShape.addVertex(15.0f, 10.0f, true); outlineShape.addVertex(6.0f, 15.0f, false); outlineShape.addVertex(5.0f, 8.0f, false); outlineShape.addVertex(0.0f, 10.0f, true); outlineShape.closeLastOutline(true); outlineShape.addEmptyOutline(); outlineShape.addVertex(5.0f, -5.0f, true); outlineShape.addVertex(10.0f, -5.0f, false); outlineShape.addVertex(10.0f, 0.0f, true); outlineShape.addVertex(5.0f, 0.0f, false); outlineShape.closeLastOutline(true); /** Same shape as above but without any off-curve vertices */ offset = 30; outlineShape.addEmptyOutline(); outlineShape.addVertex(offset + 0.0f, -10.0f, true); outlineShape.addVertex(offset + 17.0f, -10.0f, true); outlineShape.addVertex(offset + 11.0f, 5.0f, true); outlineShape.addVertex(offset + 16.0f, 10.0f, true); outlineShape.addVertex(offset + 7.0f, 15.0f, true); outlineShape.addVertex(offset + 6.0f, 8.0f, true); outlineShape.addVertex(offset + 0.0f, 10.0f, true); outlineShape.closeLastOutline(true); outlineShape.addEmptyOutline(); outlineShape.addVertex(offset + 5.0f, 0.0f, true); outlineShape.addVertex(offset + 5.0f, -5.0f, true); outlineShape.addVertex(offset + 10.0f, -5.0f, true); outlineShape.addVertex(offset + 10.0f, 0.0f, true); outlineShape.closeLastOutline(true); region = GLRegion.create(getRenderModes(), null); region.addOutlineShape( outlineShape, null, region.hasColorChannel() ? getRenderer().getRenderState().getColorStatic(new float[4]) : null); }