@Override protected Object clone() { ColoringAttributesRetained cr = (ColoringAttributesRetained)super.clone(); cr.color = new Color3f(color); // shadeModel is copied in super.clone() return cr; }
@Override protected Object clone() { TextureUnitStateRetained tr = (TextureUnitStateRetained)super.clone(); // the cloned object is used for RenderBin only. // In most cases, it will duplicate all attributes in the RenderBin // so that updating a mirror object in one level will not affect the // entire structure of the RenderBin, but will affect only those bins // that got affected by the modified mirror object if (this.texAttrs != null) tr.texAttrs = (TextureAttributesRetained)this.texAttrs.clone(); if (this.texGen != null) tr.texGen = (TexCoordGenerationRetained)this.texGen.clone(); return tr; }
@Override protected Object clone() { TextureAttributesRetained tr = (TextureAttributesRetained)super.clone(); tr.transform = new Transform3D(transform); tr.textureBlendColor = new Color4f(textureBlendColor); if (textureColorTable != null) { tr.textureColorTable = new int[textureColorTable.length]; System.arraycopy(textureColorTable, 0, tr.textureColorTable, 0, textureColorTable.length); } else { tr.textureColorTable = null; } // clone the combine mode attributes if (combineRgbSrc != null) { tr.combineRgbSrc = new int[3]; tr.combineAlphaSrc = new int[3]; tr.combineRgbFcn = new int[3]; tr.combineAlphaFcn = new int[3]; for (int i = 0; i < 3; i++) { tr.combineRgbSrc[i] = combineRgbSrc[i]; tr.combineAlphaSrc[i] = combineAlphaSrc[i]; tr.combineRgbFcn[i] = combineRgbFcn[i]; tr.combineAlphaFcn[i] = combineAlphaFcn[i]; } } // other attributes are copied in super.clone() return tr; }
@Override protected Object clone() { TexCoordGenerationRetained tr = (TexCoordGenerationRetained)super.clone(); tr.planeS = new Vector4f(planeS); tr.planeT = new Vector4f(planeT); tr.planeR = new Vector4f(planeR); // other attributes is copied in super.clone() return tr; }
@Override protected Object clone() { MaterialRetained mr = (MaterialRetained)super.clone(); // color can't share the same reference mr.ambientColor = new Color3f(ambientColor); mr.emissiveColor = new Color3f(emissiveColor); mr.diffuseColor = new Color3f(diffuseColor); mr.specularColor = new Color3f(specularColor); // other attributes are copy by clone() automatically return mr; }