/* 118 */ if (nio) {
/* 119 */ J3DBuffer buf = ((GeometryArray)this.node).getColorRefBuffer();
/* 120 */ switch (BufferWrapper.getBufferType(buf)) {
/* */ case 2:
/* 122 */ out.writeInt(1);
/* 123 */ ByteBufferWrapper bb = new ByteBufferWrapper(buf);
/* 124 */ byte[] bytes = new byte[bb.limit()];
/* 125 */ bb.position(0);
/* 126 */ bb.get(bytes);
/* 127 */ out.writeInt(bytes.length);
/* 128 */ out.write(bytes);
/* */
/* 130 */ break;
/* */ case 3:
/* 132 */ out.writeInt(2);
/* 133 */ FloatBufferWrapper bb = new FloatBufferWrapper(buf);
/* 134 */ float[] floats = new float[bb.limit()];
/* 135 */ bb.position(0);
/* 136 */ bb.get(floats);
/* 137 */ writeFloatArray(out, floats);
/* */
/* 139 */ break;
/* */ case 0:
/* 141 */ out.writeInt(0);
/* */ case 1:
/* */ }
/* */ }
/* 145 */ else if (((GeometryArray)this.node).getColorRef4f() != null) {
/* 146 */ out.writeInt(8);
/* 147 */ Color4f[] colors = ((GeometryArray)this.node).getColorRef4f();
/* 148 */ float[] data = new float[colors.length * 4];
/* 149 */ for (int i = 0; i < colors.length; i++) {
/* 150 */ data[(i * 4 + 0)] = colors[i].x;
/* 151 */ data[(i * 4 + 1)] = colors[i].y;
/* 152 */ data[(i * 4 + 2)] = colors[i].z;
/* 153 */ data[(i * 4 + 3)] = colors[i].w;
/* */ }
/* 155 */ writeFloatArray(out, data);
/* 156 */ } else if (((GeometryArray)this.node).getColorRefFloat() != null) {
/* 157 */ out.writeInt(2);
/* 158 */ writeFloatArray(out, ((GeometryArray)this.node).getColorRefFloat());
/* 159 */ } else if (((GeometryArray)this.node).getColorRefByte() != null) {
/* 160 */ out.writeInt(1);
/* 161 */ byte[] colors = ((GeometryArray)this.node).getColorRefByte();
/* 162 */ out.writeInt(colors.length);
/* 163 */ out.write(colors);
/* 164 */ } else if (((GeometryArray)this.node).getColorRef4b() != null) {
/* 165 */ out.writeInt(5);
/* 166 */ Color4b[] colors = ((GeometryArray)this.node).getColorRef4b();
/* 167 */ out.writeInt(colors.length);
/* 168 */ byte[] data = new byte[colors.length * 4];
/* 169 */ for (int i = 0; i < colors.length; i++) {
/* 170 */ data[(i * 4 + 0)] = colors[i].x;
/* 171 */ data[(i * 4 + 1)] = colors[i].y;
/* 172 */ data[(i * 4 + 2)] = colors[i].z;
/* 173 */ data[(i * 4 + 3)] = colors[i].w;
/* */ }
/* 175 */ out.write(data); } else {
/* 176 */ out.writeInt(0);
/* */ }
/* */ } else { byte[] colors = new byte[this.vertexCount * 4];
/* 179 */ ((GeometryArray)this.node).getColors(0, colors);
/* 180 */ out.write(colors); }
/* */ }
/* 182 */ else if ((this.vertexFormat & 0x4) == 4)
/* */ {
/* 184 */ if (byRef) {
/* 185 */ if (!(this.node instanceof IndexedGeometryArray)) {
/* 186 */ out.writeInt(((GeometryArray)this.node).getInitialColorIndex());
/* */ }
/* */
/* 189 */ if (nio) {
/* 190 */ J3DBuffer buf = ((GeometryArray)this.node).getColorRefBuffer();
/* 191 */ switch (BufferWrapper.getBufferType(buf)) {
/* */ case 2:
/* 193 */ out.writeInt(1);
/* 194 */ ByteBufferWrapper bb = new ByteBufferWrapper(buf);
/* 195 */ byte[] bytes = new byte[bb.limit()];
/* 196 */ bb.position(0);
/* 197 */ bb.get(bytes);
/* 198 */ out.writeInt(bytes.length);
/* 199 */ out.write(bytes);
/* */
/* 201 */ break;
/* */ case 3:
/* 203 */ out.writeInt(2);
/* 204 */ FloatBufferWrapper bb = new FloatBufferWrapper(buf);
/* 205 */ float[] floats = new float[bb.limit()];
/* 206 */ bb.position(0);
/* 207 */ bb.get(floats);
/* 208 */ writeFloatArray(out, floats);
/* */
/* 210 */ break;
/* */ case 0:
/* 212 */ out.writeInt(0);
/* */ case 1:
/* */ }
/* */ }
/* 216 */ else if (((GeometryArray)this.node).getColorRef3f() != null) {
/* 217 */ out.writeInt(7);
/* 218 */ Color3f[] colors = ((GeometryArray)this.node).getColorRef3f();
/* 219 */ float[] data = new float[colors.length * 3];
/* 220 */ for (int i = 0; i < colors.length; i++) {
/* 221 */ data[(i * 3 + 0)] = colors[i].x;
/* 222 */ data[(i * 3 + 1)] = colors[i].y;
/* 223 */ data[(i * 3 + 2)] = colors[i].z;
/* */ }
/* 225 */ writeFloatArray(out, data);
/* 226 */ } else if (((GeometryArray)this.node).getColorRefFloat() != null) {
/* 227 */ out.writeInt(2);
/* 228 */ writeFloatArray(out, ((GeometryArray)this.node).getColorRefFloat());
/* 229 */ } else if (((GeometryArray)this.node).getColorRefByte() != null) {
/* 230 */ out.writeInt(1);
/* 231 */ byte[] colors = ((GeometryArray)this.node).getColorRefByte();
/* 232 */ out.writeInt(colors.length);
/* 233 */ out.write(colors);
/* 234 */ } else if (((GeometryArray)this.node).getColorRef3b() != null) {
/* 235 */ out.writeInt(4);
/* 236 */ Color3b[] colors = ((GeometryArray)this.node).getColorRef3b();
/* 237 */ out.writeInt(colors.length);
/* 238 */ byte[] data = new byte[colors.length * 3];
/* 239 */ for (int i = 0; i < colors.length; i++) {
/* 240 */ data[(i * 3 + 0)] = colors[i].x;
/* 241 */ data[(i * 3 + 1)] = colors[i].y;
/* 242 */ data[(i * 3 + 2)] = colors[i].z;
/* */ }
/* 244 */ out.write(data); } else {
/* 245 */ out.writeInt(0);
/* */ }
/* */ } else { byte[] colors3 = new byte[this.vertexCount * 3];
/* 248 */ ((GeometryArray)this.node).getColors(0, colors3);
/* 249 */ out.write(colors3);
/* */ }
/* */
/* */ }
/* */
/* 254 */ if ((this.vertexFormat & 0x1) != 0)
/* */ {
/* 256 */ if (byRef) {
/* 257 */ if (!(this.node instanceof IndexedGeometryArray)) {
/* 258 */ out.writeInt(((GeometryArray)this.node).getInitialCoordIndex());
/* */ }
/* */
/* 261 */ if (nio) {
/* 262 */ J3DBuffer buf = ((GeometryArray)this.node).getCoordRefBuffer();
/* 263 */ switch (BufferWrapper.getBufferType(buf)) {
/* */ case 3:
/* 265 */ out.writeInt(2);
/* 266 */ FloatBufferWrapper bb = new FloatBufferWrapper(buf);
/* 267 */ float[] floats = new float[bb.limit()];
/* 268 */ bb.position(0);
/* 269 */ bb.get(floats);
/* 270 */ writeFloatArray(out, floats);
/* */
/* 272 */ break;
/* */ case 4:
/* 274 */ out.writeInt(3);
/* 275 */ DoubleBufferWrapper bb = new DoubleBufferWrapper(buf);
/* 276 */ double[] doubles = new double[bb.limit()];
/* 277 */ bb.position(0);
/* 278 */ bb.get(doubles);
/* 279 */ writeDoubleArray(out, doubles);
/* */
/* 281 */ break;
/* */ case 0:
/* 283 */ out.writeInt(0);
/* */ case 1:
/* */ case 2:
/* */ }
/* 287 */ } else if (((GeometryArray)this.node).getCoordRef3f() != null) {
/* 288 */ out.writeInt(7);
/* 289 */ Point3f[] coords = ((GeometryArray)this.node).getCoordRef3f();
/* 290 */ float[] data = new float[coords.length * 3];
/* 291 */ for (int i = 0; i < coords.length; i++) {
/* 292 */ data[(i * 3 + 0)] = coords[i].x;
/* 293 */ data[(i * 3 + 1)] = coords[i].y;
/* 294 */ data[(i * 3 + 2)] = coords[i].z;
/* */ }
/* 296 */ writeFloatArray(out, data);
/* 297 */ } else if (((GeometryArray)this.node).getCoordRef3d() != null) {
/* 298 */ out.writeInt(10);
/* 299 */ Point3d[] coords = ((GeometryArray)this.node).getCoordRef3d();
/* 300 */ double[] data = new double[coords.length * 3];
/* 301 */ for (int i = 0; i < coords.length; i++) {
/* 302 */ data[(i * 3 + 0)] = coords[i].x;
/* 303 */ data[(i * 3 + 1)] = coords[i].y;
/* 304 */ data[(i * 3 + 2)] = coords[i].z;
/* */ }
/* 306 */ writeDoubleArray(out, data);
/* 307 */ } else if (((GeometryArray)this.node).getCoordRefFloat() != null) {
/* 308 */ out.writeInt(2);
/* 309 */ writeFloatArray(out, ((GeometryArray)this.node).getCoordRefFloat());
/* 310 */ } else if (((GeometryArray)this.node).getCoordRefDouble() != null) {
/* 311 */ out.writeInt(3);
/* 312 */ writeDoubleArray(out, ((GeometryArray)this.node).getCoordRefDouble()); } else {
/* 313 */ out.writeInt(0);
/* */ }
/* */ } else { float[] points = new float[this.vertexCount * 3];
/* 316 */ ((GeometryArray)this.node).getCoordinates(0, points);
/* 317 */ writeFloatArray(out, points);
/* */ }
/* */ }
/* */
/* 321 */ if ((this.vertexFormat & 0x2) != 0)
/* */ {
/* 323 */ if (byRef) {
/* 324 */ if (!(this.node instanceof IndexedGeometryArray)) {
/* 325 */ out.writeInt(((GeometryArray)this.node).getInitialNormalIndex());
/* */ }
/* */
/* 328 */ if (nio) {
/* 329 */ J3DBuffer buf = ((GeometryArray)this.node).getNormalRefBuffer();
/* 330 */ if (BufferWrapper.getBufferType(buf) == 0) {
/* 331 */ out.writeInt(0);
/* */ } else {
/* 333 */ out.writeInt(2);
/* 334 */ FloatBufferWrapper bb = new FloatBufferWrapper(buf);
/* 335 */ float[] floats = new float[bb.limit()];
/* 336 */ bb.position(0);
/* 337 */ bb.get(floats);
/* 338 */ writeFloatArray(out, floats);
/* */ }
/* 340 */ } else if (((GeometryArray)this.node).getNormalRef3f() != null) {
/* 341 */ out.writeInt(7);
/* 342 */ Vector3f[] norms = ((GeometryArray)this.node).getNormalRef3f();
/* 343 */ float[] data = new float[norms.length * 3];
/* 344 */ for (int i = 0; i < norms.length; i++) {
/* 345 */ data[(i * 3 + 0)] = norms[i].x;
/* 346 */ data[(i * 3 + 1)] = norms[i].y;
/* 347 */ data[(i * 3 + 2)] = norms[i].z;
/* */ }
/* 349 */ writeFloatArray(out, data);
/* 350 */ } else if (((GeometryArray)this.node).getNormalRefFloat() != null) {
/* 351 */ out.writeInt(2);
/* 352 */ writeFloatArray(out, ((GeometryArray)this.node).getNormalRefFloat()); } else {
/* 353 */ out.writeInt(0);
/* */ }
/* */ } else { float[] normals = new float[this.vertexCount * 3];
/* 356 */ ((GeometryArray)this.node).getNormals(0, normals);
/* 357 */ writeFloatArray(out, normals);
/* */ }
/* */ }
/* */
/* 361 */ if ((this.vertexFormat & 0x20) != 0)
/* */ {
/* 363 */ for (int set = 0; set < this.texCoordSetCount; set++)
/* 364 */ if (byRef) {
/* 365 */ if (!(this.node instanceof IndexedGeometryArray)) {
/* 366 */ out.writeInt(((GeometryArray)this.node).getInitialTexCoordIndex(set));
/* */ }
/* */
/* 369 */ if (nio) {
/* 370 */ J3DBuffer buf = ((GeometryArray)this.node).getTexCoordRefBuffer(set);
/* 371 */ if (BufferWrapper.getBufferType(buf) == 0) {
/* 372 */ out.writeInt(0);
/* */ } else {
/* 374 */ out.writeInt(2);
/* 375 */ FloatBufferWrapper bb = new FloatBufferWrapper(buf);
/* 376 */ float[] floats = new float[bb.limit()];
/* 377 */ bb.position(0);
/* 378 */ bb.get(floats);
/* 379 */ writeFloatArray(out, floats);
/* */ }
/* 381 */ } else if (((GeometryArray)this.node).getTexCoordRef2f(set) != null) {
/* 382 */ out.writeInt(6);
/* 383 */ TexCoord2f[] tcoords = ((GeometryArray)this.node).getTexCoordRef2f(set);
/* 384 */ float[] data = new float[tcoords.length * 2];
/* 385 */ for (int i = 0; i < tcoords.length; i++) {
/* 386 */ data[(i * 2 + 0)] = tcoords[i].x;
/* 387 */ data[(i * 2 + 1)] = tcoords[i].y;
/* */ }
/* 389 */ writeFloatArray(out, data);
/* 390 */ } else if (((GeometryArray)this.node).getTexCoordRefFloat(set) != null) {
/* 391 */ out.writeInt(2);
/* 392 */ writeFloatArray(out, ((GeometryArray)this.node).getTexCoordRefFloat(set)); } else {
/* 393 */ out.writeInt(0);
/* */ }
/* */ } else { float[] textureCoords = new float[this.vertexCount * 2];
/* 396 */ ((GeometryArray)this.node).getTextureCoordinates(set, 0, textureCoords);
/* 397 */ writeFloatArray(out, textureCoords);
/* */ }
/* */ }
/* 400 */ else if ((this.vertexFormat & 0x40) != 0)
/* */ {
/* 402 */ for (int set = 0; set < this.texCoordSetCount; set++)
/* 403 */ if (byRef) {
/* 404 */ if (!(this.node instanceof IndexedGeometryArray)) {
/* 405 */ out.writeInt(((GeometryArray)this.node).getInitialTexCoordIndex(set));
/* */ }
/* */
/* 408 */ if (nio) {
/* 409 */ J3DBuffer buf = ((GeometryArray)this.node).getTexCoordRefBuffer(set);
/* 410 */ if (BufferWrapper.getBufferType(buf) == 0) {
/* 411 */ out.writeInt(0);
/* */ } else {
/* 413 */ out.writeInt(2);
/* 414 */ FloatBufferWrapper bb = new FloatBufferWrapper(buf);
/* 415 */ float[] floats = new float[bb.limit()];
/* 416 */ bb.position(0);
/* 417 */ bb.get(floats);
/* 418 */ writeFloatArray(out, floats);
/* */ }
/* 420 */ } else if (((GeometryArray)this.node).getTexCoordRef3f(set) != null) {
/* 421 */ out.writeInt(7);
/* 422 */ TexCoord3f[] tcoords = ((GeometryArray)this.node).getTexCoordRef3f(set);
/* 423 */ float[] data = new float[tcoords.length * 3];
/* 424 */ for (int i = 0; i < tcoords.length; i++) {
/* 425 */ data[(i * 3 + 0)] = tcoords[i].x;
/* 426 */ data[(i * 3 + 1)] = tcoords[i].y;
/* 427 */ data[(i * 3 + 2)] = tcoords[i].z;
/* */ }
/* 429 */ writeFloatArray(out, data);
/* 430 */ } else if (((GeometryArray)this.node).getTexCoordRefFloat(set) != null) {
/* 431 */ out.writeInt(2);
/* 432 */ writeFloatArray(out, ((GeometryArray)this.node).getTexCoordRefFloat(set)); } else {
/* 433 */ out.writeInt(0);
/* */ }
/* */ } else { float[] textureCoords = new float[this.vertexCount * 3];
/* 436 */ ((GeometryArray)this.node).getTextureCoordinates(set, 0, textureCoords);
/* 437 */ writeFloatArray(out, textureCoords);
/* */ }
/* */ }
/* 440 */ else if ((this.vertexFormat & 0x400) != 0)
/* */ {
/* 442 */ for (int set = 0; set < this.texCoordSetCount; set++)
/* 443 */ if (byRef) {
/* 444 */ if (!(this.node instanceof IndexedGeometryArray)) {
/* 445 */ out.writeInt(((GeometryArray)this.node).getInitialTexCoordIndex(set));
/* */ }
/* */
/* 448 */ if (nio) {
/* 449 */ J3DBuffer buf = ((GeometryArray)this.node).getTexCoordRefBuffer(set);
/* 450 */ if (BufferWrapper.getBufferType(buf) == 0) {
/* 451 */ out.writeInt(0);
/* */ } else {
/* 453 */ out.writeInt(2);
/* 454 */ FloatBufferWrapper bb = new FloatBufferWrapper(buf);
/* 455 */ float[] floats = new float[bb.limit()];
/* 456 */ bb.position(0);
/* 457 */ bb.get(floats);
/* 458 */ writeFloatArray(out, floats);
/* */ }
/* */ }
/* 461 */ else if (((GeometryArray)this.node).getTexCoordRefFloat(set) != null) {
/* 462 */ out.writeInt(2);