.. | .. |
---|
5 | 5 | import java.util.Vector; |
---|
6 | 6 | |
---|
7 | 7 | import javax.media.j3d.Transform3D; |
---|
| 8 | +import javax.media.opengl.GL; |
---|
8 | 9 | import javax.vecmath.Vector3d; |
---|
9 | 10 | |
---|
10 | 11 | import javax.imageio.ImageIO; |
---|
.. | .. |
---|
20 | 21 | static final long serialVersionUID = 5022536242724664900L; |
---|
21 | 22 | |
---|
22 | 23 | ScriptNode scriptnode; |
---|
| 24 | + |
---|
| 25 | + void InitOthers() |
---|
| 26 | + { |
---|
| 27 | + if (projectedVertices == null || projectedVertices.length <= 2) |
---|
| 28 | + { |
---|
| 29 | + projectedVertices = new Object3D.cVector2[3]; |
---|
| 30 | + } |
---|
| 31 | + for (int i = 0; i < 3; i++) |
---|
| 32 | + { |
---|
| 33 | + projectedVertices[i] = new cVector2(); // Others |
---|
| 34 | + } |
---|
| 35 | + projectedVertices[0].x = 100; // bump |
---|
| 36 | + } |
---|
23 | 37 | |
---|
24 | 38 | void MinMax(cVector minima, cVector maxima) |
---|
25 | 39 | { |
---|
.. | .. |
---|
296 | 310 | boolean speedup = false; |
---|
297 | 311 | boolean rewind = false; |
---|
298 | 312 | |
---|
| 313 | + float NORMALPUSH = 0; |
---|
| 314 | + |
---|
299 | 315 | Object3D support; |
---|
300 | 316 | |
---|
301 | 317 | Object3D GetObject() |
---|
.. | .. |
---|
415 | 431 | { |
---|
416 | 432 | Object3D copy = this; |
---|
417 | 433 | |
---|
418 | | - Camera parentcam = CameraPane.theRenderer.manipCamera; |
---|
| 434 | + Camera parentcam = Globals.theRenderer.ManipCamera(); |
---|
419 | 435 | |
---|
420 | | - if (CameraPane.theRenderer.manipCamera == CameraPane.theRenderer.cameras[0]) |
---|
| 436 | + if (Globals.theRenderer.ManipCamera() == Globals.theRenderer.Cameras()[0]) |
---|
421 | 437 | { |
---|
422 | | - parentcam = CameraPane.theRenderer.cameras[1]; |
---|
| 438 | + parentcam = Globals.theRenderer.Cameras()[1]; |
---|
423 | 439 | } |
---|
424 | 440 | |
---|
425 | | - if (CameraPane.theRenderer.manipCamera == CameraPane.theRenderer.cameras[1]) |
---|
| 441 | + if (Globals.theRenderer.ManipCamera() == Globals.theRenderer.Cameras()[1]) |
---|
426 | 442 | { |
---|
427 | | - parentcam = CameraPane.theRenderer.cameras[0]; |
---|
| 443 | + parentcam = Globals.theRenderer.Cameras()[0]; |
---|
428 | 444 | } |
---|
429 | 445 | |
---|
430 | 446 | if (this == parentcam) |
---|
.. | .. |
---|
432 | 448 | //assert(this instanceof Camera); |
---|
433 | 449 | |
---|
434 | 450 | for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
435 | | - LA.xformPos(CameraPane.theRenderer.targetLookAt, parentcam.toParent, CameraPane.theRenderer.targetLookAt); |
---|
| 451 | + LA.xformPos(Globals.theRenderer.TargetLookAt(), parentcam.toParent, Globals.theRenderer.TargetLookAt()); |
---|
436 | 452 | } |
---|
437 | 453 | |
---|
438 | 454 | copy.marked ^= true; |
---|
.. | .. |
---|
452 | 468 | //assert(this instanceof Camera); |
---|
453 | 469 | |
---|
454 | 470 | for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
455 | | - LA.xformPos(CameraPane.theRenderer.targetLookAt, parentcam.fromParent, CameraPane.theRenderer.targetLookAt); |
---|
| 471 | + LA.xformPos(Globals.theRenderer.TargetLookAt(), parentcam.fromParent, Globals.theRenderer.TargetLookAt()); |
---|
456 | 472 | } |
---|
457 | 473 | |
---|
458 | 474 | copy.Touch(); // display list issue |
---|
.. | .. |
---|
587 | 603 | return; |
---|
588 | 604 | } |
---|
589 | 605 | |
---|
590 | | - if (CameraPane.fromscript) |
---|
| 606 | + if (Globals.fromscript) |
---|
591 | 607 | { |
---|
592 | 608 | transformcount = 0; |
---|
593 | 609 | return; |
---|
.. | .. |
---|
745 | 761 | |
---|
746 | 762 | int GetTransformCount() |
---|
747 | 763 | { |
---|
748 | | - // marde pour serialization de Texture |
---|
| 764 | + // patch pour serialization de Texture |
---|
749 | 765 | resetmaxcount(); |
---|
750 | 766 | resettransformcount(); |
---|
751 | 767 | resetstep(); |
---|
.. | .. |
---|
779 | 795 | // factor = CameraPane.STEP; |
---|
780 | 796 | // } |
---|
781 | 797 | |
---|
782 | | - if (marked && CameraPane.isLIVE() && live && CameraPane.drawMode == CameraPane.SHADOW && currentframe != CameraPane.framecount) |
---|
| 798 | + if (marked && Globals.isLIVE() && live && |
---|
| 799 | + //TEMP21aug2018 |
---|
| 800 | + Globals.DrawMode() == iCameraPane.SHADOW && |
---|
| 801 | + currentframe != Globals.framecount) |
---|
783 | 802 | { |
---|
784 | | - currentframe = CameraPane.framecount; |
---|
| 803 | + currentframe = Globals.framecount; |
---|
785 | 804 | |
---|
786 | 805 | // System.err.println("transformcount = " + transformcount); |
---|
787 | 806 | // System.err.println("factor = " + factor); |
---|
.. | .. |
---|
2130 | 2149 | if (/*parent != null &&*/ material == null) |
---|
2131 | 2150 | { |
---|
2132 | 2151 | material = new cMaterial(GetMaterial()); |
---|
2133 | | - if (projectedVertices == null || projectedVertices.length <= 2) |
---|
2134 | | - { |
---|
2135 | | - projectedVertices = new Object3D.cVector2[3]; |
---|
2136 | | - } |
---|
2137 | | - for (int i = 0; i < 3; i++) |
---|
2138 | | - { |
---|
2139 | | - projectedVertices[i] = new cVector2(); // Others |
---|
2140 | | - } |
---|
2141 | | - projectedVertices[0].x = 100; // bump |
---|
| 2152 | + |
---|
| 2153 | + InitOthers(); |
---|
2142 | 2154 | |
---|
2143 | 2155 | if (this instanceof Camera) |
---|
2144 | 2156 | { |
---|
.. | .. |
---|
2894 | 2906 | { |
---|
2895 | 2907 | if (bRep != null) |
---|
2896 | 2908 | { |
---|
2897 | | - bRep.GenUV(); |
---|
| 2909 | + bRep.GenUV(); //1); |
---|
| 2910 | + //bRep.UnfoldUV(); |
---|
2898 | 2911 | Touch(); |
---|
2899 | 2912 | } |
---|
2900 | 2913 | } |
---|
.. | .. |
---|
4161 | 4174 | } |
---|
4162 | 4175 | } |
---|
4163 | 4176 | |
---|
| 4177 | + void RepairShadow() |
---|
| 4178 | + { |
---|
| 4179 | + if (blockloop) |
---|
| 4180 | + return; |
---|
| 4181 | + |
---|
| 4182 | + if (this.material != null) |
---|
| 4183 | + this.InitOthers(); |
---|
| 4184 | + |
---|
| 4185 | + for (int i=0; i<Size(); i++) |
---|
| 4186 | + { |
---|
| 4187 | + blockloop = true; |
---|
| 4188 | + get(i).RepairShadow(); |
---|
| 4189 | + blockloop = false; |
---|
| 4190 | + } |
---|
| 4191 | + } |
---|
| 4192 | + |
---|
4164 | 4193 | void RepairTexture() |
---|
4165 | 4194 | { |
---|
4166 | 4195 | if (this instanceof FileObject || blockloop) |
---|
.. | .. |
---|
4827 | 4856 | return globalTransform; |
---|
4828 | 4857 | } |
---|
4829 | 4858 | |
---|
4830 | | - void PreprocessOcclusion(CameraPane cp) |
---|
| 4859 | + void PreprocessOcclusion(iCameraPane cp) |
---|
4831 | 4860 | { |
---|
4832 | 4861 | /* |
---|
4833 | 4862 | if (AOdone) |
---|
.. | .. |
---|
4974 | 5003 | } else // |
---|
4975 | 5004 | if (editWindow != null) |
---|
4976 | 5005 | { |
---|
4977 | | - editWindow.cameraView.lighttouched = true; |
---|
| 5006 | + //editWindow.cameraView.lighttouched = true; |
---|
| 5007 | + Globals.lighttouched = true; |
---|
4978 | 5008 | } |
---|
4979 | 5009 | } |
---|
4980 | 5010 | |
---|
.. | .. |
---|
5286 | 5316 | } |
---|
5287 | 5317 | } |
---|
5288 | 5318 | |
---|
5289 | | - void draw(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
| 5319 | + void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5290 | 5320 | { |
---|
5291 | 5321 | Draw(display, root, selected, blocked); |
---|
5292 | 5322 | } |
---|
5293 | 5323 | |
---|
5294 | | - static cMaterial[] materialstack = new cMaterial[65536]; |
---|
5295 | | - static boolean[] selectedstack = new boolean[65536]; |
---|
5296 | | - static int materialdepth = 0; |
---|
5297 | | - |
---|
5298 | 5324 | boolean NeedSupport() |
---|
5299 | 5325 | { |
---|
5300 | 5326 | return |
---|
5301 | 5327 | CameraPane.SUPPORT && !CameraPane.movingcamera && link2master && /*live &&*/ support != null |
---|
5302 | 5328 | // PROBLEM with CROWD!! |
---|
5303 | | - && (CameraPane.drawMode == CameraPane.SHADOW || CameraPane.CROWD); |
---|
| 5329 | + && (Globals.DrawMode() == iCameraPane.SHADOW || Globals.CROWD); |
---|
5304 | 5330 | } |
---|
5305 | 5331 | |
---|
| 5332 | + static boolean DEBUG_SELECTION = false; |
---|
5306 | 5333 | |
---|
5307 | | - void Draw(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
| 5334 | + void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5308 | 5335 | { |
---|
5309 | 5336 | Invariants(); // june 2013 |
---|
5310 | 5337 | |
---|
.. | .. |
---|
5313 | 5340 | // System.err.println("Draw " + this + " Frame # " + ((Mocap)((Merge)support).object).frame); |
---|
5314 | 5341 | } |
---|
5315 | 5342 | |
---|
5316 | | - if (display.drawMode == CameraPane.SELECTION && |
---|
| 5343 | + if (display.DrawMode() == iCameraPane.SELECTION && |
---|
5317 | 5344 | hide) |
---|
5318 | 5345 | return; |
---|
5319 | 5346 | |
---|
.. | .. |
---|
5332 | 5359 | if (this instanceof Checker) |
---|
5333 | 5360 | return; |
---|
5334 | 5361 | |
---|
5335 | | - if (display.drawMode == display.SHADOW && PASSTEST) |
---|
| 5362 | + if (display.DrawMode() == display.SHADOW && PASSTEST) |
---|
5336 | 5363 | return; |
---|
5337 | 5364 | |
---|
5338 | 5365 | if (count <= 0) |
---|
.. | .. |
---|
5340 | 5367 | return; |
---|
5341 | 5368 | } |
---|
5342 | 5369 | |
---|
5343 | | - if ((//display.drawMode == CameraPane.SHADOW || |
---|
5344 | | - display.drawMode == CameraPane.SELECTION || CameraPane.DEBUG_SELECTION) && HasTransparency()) |
---|
| 5370 | + if ((//display.DrawMode() == CameraPane.SHADOW || |
---|
| 5371 | + display.DrawMode() == iCameraPane.SELECTION || display.IsDebugSelection()) && HasTransparency()) |
---|
5345 | 5372 | { |
---|
5346 | 5373 | return; |
---|
5347 | 5374 | } |
---|
5348 | 5375 | |
---|
5349 | | - javax.media.opengl.GL gl = display.GetGL(); |
---|
| 5376 | + //javax.media.opengl.GL gl = display.GetGL(); |
---|
5350 | 5377 | |
---|
5351 | 5378 | /* |
---|
5352 | 5379 | if (touched) |
---|
.. | .. |
---|
5382 | 5409 | |
---|
5383 | 5410 | boolean compiled = false; |
---|
5384 | 5411 | |
---|
5385 | | - boolean selectmode = display.drawMode == display.SELECTION || CameraPane.DEBUG_SELECTION; |
---|
| 5412 | + boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5386 | 5413 | |
---|
5387 | | - if (!selectmode && //display.drawMode != display.SELECTION && |
---|
| 5414 | + if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5388 | 5415 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
5389 | 5416 | { |
---|
5390 | | - display.lighttouched = true; |
---|
| 5417 | + Globals.lighttouched = true; |
---|
5391 | 5418 | } // all panes... |
---|
5392 | | - //if (usecalllists && display.drawMode != display.SELECTION && display.drawMode != display.SHADOW && |
---|
5393 | | - if (bRep != null && usecalllists && !selectmode && // june 2013 display.drawMode != display.SHADOW && |
---|
| 5419 | + //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW && |
---|
| 5420 | + if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW && |
---|
5394 | 5421 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
5395 | 5422 | { |
---|
5396 | 5423 | if (!(this instanceof Composite)) |
---|
.. | .. |
---|
5398 | 5425 | //if (displaylist == -1 && usecalllists) |
---|
5399 | 5426 | if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013 |
---|
5400 | 5427 | { |
---|
5401 | | - bRep.displaylist = gl.glGenLists(1); |
---|
| 5428 | + bRep.displaylist = display.GenList(); |
---|
5402 | 5429 | assert(bRep.displaylist != 0); |
---|
5403 | 5430 | // System.err.println("glGenLists: " + bRep.displaylist + " for " + this); |
---|
5404 | 5431 | //System.out.println("\tgen list " + list); |
---|
.. | .. |
---|
5410 | 5437 | if (usecalllists) |
---|
5411 | 5438 | { |
---|
5412 | 5439 | // System.err.println("new list " + bRep.displaylist + " for " + this); |
---|
5413 | | - gl.glNewList(bRep.displaylist, gl.GL_COMPILE); //_AND_EXECUTE); |
---|
| 5440 | + display.NewList(bRep.displaylist); |
---|
5414 | 5441 | } |
---|
| 5442 | + |
---|
5415 | 5443 | CallList(display, root, selected, blocked); |
---|
| 5444 | + |
---|
5416 | 5445 | // compiled = true; |
---|
5417 | 5446 | if (usecalllists) |
---|
5418 | 5447 | { |
---|
5419 | 5448 | // System.err.println("end list " + bRep.displaylist + " for " + this); |
---|
5420 | | - gl.glEndList(); |
---|
| 5449 | + display.EndList(); |
---|
5421 | 5450 | } |
---|
5422 | 5451 | //gl.glDrawBuffer(gl.GL_BACK); |
---|
5423 | 5452 | // XXX touched = false; |
---|
5424 | | - display.lighttouched = true; // all panes... |
---|
| 5453 | + Globals.lighttouched = true; // all panes... |
---|
5425 | 5454 | } |
---|
5426 | 5455 | |
---|
5427 | 5456 | touched = GetBRep() == null; // this instanceof Composite || this instanceof FileObject; // false; |
---|
.. | .. |
---|
5460 | 5489 | |
---|
5461 | 5490 | // frustum culling |
---|
5462 | 5491 | if (CameraPane.FRUSTUM && !blocked && !IsInfinite() && GetBRep() != null // && GetBRep().VertexCount() != 1260 // default grid |
---|
5463 | | - && display.drawMode != CameraPane.SELECTION) |
---|
| 5492 | + && display.DrawMode() != iCameraPane.SELECTION) |
---|
5464 | 5493 | { |
---|
5465 | | - if (display.drawMode == CameraPane.SHADOW) |
---|
| 5494 | + if (display.DrawMode() == iCameraPane.SHADOW) |
---|
5466 | 5495 | { |
---|
5467 | 5496 | if (!link2master // tricky to cull in shadow mode. |
---|
5468 | | - && GetBRep().FrustumCull(this, gl, display.lightCamera, true)) |
---|
| 5497 | + && GetBRep().FrustumCull(this, null, display.LightCamera(), true)) |
---|
5469 | 5498 | { |
---|
5470 | 5499 | //System.out.print("CULLED"); |
---|
5471 | 5500 | culled = true; |
---|
.. | .. |
---|
5473 | 5502 | } |
---|
5474 | 5503 | else |
---|
5475 | 5504 | //GetBRep().getBounds(v0, v1, this); |
---|
5476 | | - if (GetBRep().FrustumCull(this, gl, display.renderCamera, false)) |
---|
| 5505 | + if (GetBRep().FrustumCull(this, null, display.RenderCamera(), false)) |
---|
5477 | 5506 | culled = true; |
---|
5478 | 5507 | |
---|
5479 | 5508 | // LA.xformPos(v0, display.renderCamera.toScreen, v0); |
---|
.. | .. |
---|
5509 | 5538 | |
---|
5510 | 5539 | |
---|
5511 | 5540 | if (!culled) |
---|
5512 | | - if (display.drawMode == display.SELECTION || CameraPane.DEBUG_SELECTION) |
---|
| 5541 | + if (display.DrawMode() == display.SELECTION || display.IsDebugSelection()) |
---|
5513 | 5542 | { |
---|
5514 | 5543 | if (GetBRep() != null) |
---|
5515 | 5544 | { |
---|
5516 | | - CameraPane.NextIndex(this, gl); |
---|
| 5545 | + display.NextIndex(); |
---|
5517 | 5546 | // vertex color conflict : gl.glCallList(list); |
---|
5518 | 5547 | DrawNode(display, root, selected); |
---|
5519 | 5548 | if (this instanceof BezierPatch) |
---|
.. | .. |
---|
5535 | 5564 | color[2] /= 2; |
---|
5536 | 5565 | gl.glMaterialfv(gl.GL_BACK, gl.GL_AMBIENT_AND_DIFFUSE, color, 0); |
---|
5537 | 5566 | */ |
---|
5538 | | - if (material != null) |
---|
5539 | | - { |
---|
5540 | | - materialstack[materialdepth] = material; |
---|
5541 | | - selectedstack[materialdepth] = selected; |
---|
5542 | | - cStatic.objectstack[materialdepth++] = this; |
---|
5543 | | - //System.out.println("material " + material); |
---|
5544 | | - //Applet3D.tracein(this, selected); |
---|
5545 | | - display.vector2buffer = projectedVertices; |
---|
5546 | | - if (this instanceof Camera) |
---|
5547 | | - { |
---|
5548 | | - display.options1[0] = material.shift; |
---|
5549 | | - //System.out.println("shift " + material.shift); |
---|
5550 | | - display.options1[1] = material.lightarea; |
---|
5551 | | - display.options1[2] = material.shadowbias; |
---|
5552 | | - display.options1[3] = material.aniso; |
---|
5553 | | - display.options1[4] = material.anisoV; |
---|
5554 | | - display.options2[0] = material.opacity; |
---|
5555 | | - display.options2[1] = material.diffuse; |
---|
5556 | | - display.options2[2] = material.factor; |
---|
5557 | | - |
---|
5558 | | - cColor.HSBtoRGB(material.color, material.modulation, 1, display.options3); |
---|
5559 | | - display.options4[0] = material.cameralight/0.2f; |
---|
5560 | | - display.options4[1] = material.subsurface; |
---|
5561 | | - display.options4[2] = material.sheen; |
---|
5562 | | - |
---|
5563 | | - // if (display.CURRENTANTIALIAS > 0) |
---|
5564 | | - // display.options3[3] /= 4; |
---|
5565 | | - |
---|
5566 | | - /* |
---|
5567 | | - System.out.println("Focus = " + display.options1[0]); |
---|
5568 | | - System.out.println("Aperture = " + display.options1[1]); |
---|
5569 | | - System.out.println("ShadowBlur = " + display.options1[2]); |
---|
5570 | | - System.out.println("Antialiasing = " + display.options1[3]); |
---|
5571 | | - System.out.println("Fog = " + display.options2[0]); |
---|
5572 | | - System.out.println("Intensity = " + display.options2[1]); |
---|
5573 | | - System.out.println("Elevation = " + display.options2[2]); |
---|
5574 | | - /**/ |
---|
5575 | | - } else |
---|
5576 | | - { |
---|
5577 | | - material.Draw(display, selected); |
---|
5578 | | - } |
---|
5579 | | - } else |
---|
5580 | | - { |
---|
5581 | | - if (selected && CameraPane.flash) |
---|
5582 | | - { |
---|
5583 | | - display.modelParams4[1] = 100; |
---|
5584 | | - gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 4, display.modelParams4, 0); |
---|
5585 | | - } |
---|
5586 | | - } |
---|
| 5567 | + display.PushMaterial(this, selected); |
---|
5587 | 5568 | |
---|
5588 | 5569 | //System.out.println("call list " + list); |
---|
5589 | 5570 | //System.out.println(); |
---|
.. | .. |
---|
5618 | 5599 | |
---|
5619 | 5600 | // System.err.println("glCallList: " + bRep.displaylist + " for " + this); |
---|
5620 | 5601 | assert(bRep.displaylist != 0); |
---|
5621 | | - gl.glCallList(bRep.displaylist); |
---|
| 5602 | + display.CallList(bRep.displaylist); |
---|
5622 | 5603 | // june 2013 drawSelf(display, root, selected); |
---|
5623 | 5604 | } |
---|
5624 | 5605 | } |
---|
5625 | 5606 | } |
---|
5626 | 5607 | |
---|
5627 | 5608 | display.ReleaseTextures(tex); |
---|
5628 | | - |
---|
5629 | | - //if (parent != null && parent.GetMaterial() != null) |
---|
5630 | | - // parent.GetMaterial().Draw(display, parent.IsSelected(this)); |
---|
5631 | | - if (material != null) |
---|
5632 | | - { |
---|
5633 | | - materialdepth -= 1; |
---|
5634 | | - if (materialdepth > 0) |
---|
5635 | | - { |
---|
5636 | | - display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
5637 | | - materialstack[materialdepth - 1].Draw(display, selectedstack[materialdepth - 1]); |
---|
5638 | | - } |
---|
5639 | | - //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???"); |
---|
5640 | | - } else if (selected && CameraPane.flash && GetMaterial() != null) |
---|
5641 | | - { |
---|
5642 | | - display.modelParams4[1] = GetMaterial().cameralight; |
---|
5643 | | - gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 4, display.modelParams4, 0); |
---|
5644 | | - } |
---|
| 5609 | + |
---|
| 5610 | + display.PopMaterial(this, selected); |
---|
5645 | 5611 | } |
---|
5646 | 5612 | |
---|
5647 | 5613 | if (this instanceof Texture || this instanceof TextureNode) |
---|
.. | .. |
---|
5683 | 5649 | // resetMasterNode(); |
---|
5684 | 5650 | } |
---|
5685 | 5651 | |
---|
5686 | | - void CallList(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
| 5652 | + void CallList(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5687 | 5653 | { |
---|
5688 | 5654 | if (GetBRep() == null) |
---|
5689 | 5655 | { |
---|
.. | .. |
---|
5766 | 5732 | boolean flipV = false; // true; |
---|
5767 | 5733 | int texres = 0; // 0 = low, 1 = normal, 2 = high res texture |
---|
5768 | 5734 | |
---|
5769 | | - void drawSelf(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
| 5735 | + void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5770 | 5736 | { |
---|
5771 | 5737 | if (hide) |
---|
5772 | 5738 | return; |
---|
.. | .. |
---|
5825 | 5791 | // // ??????????????????????????? Touch(); |
---|
5826 | 5792 | // } |
---|
5827 | 5793 | |
---|
5828 | | - if (material != null) |
---|
5829 | | - { |
---|
5830 | | - materialstack[materialdepth] = material; |
---|
5831 | | - selectedstack[materialdepth] = selected; |
---|
5832 | | - cStatic.objectstack[materialdepth++] = this; |
---|
5833 | | - //System.out.println("material " + material); |
---|
5834 | | - //Applet3D.tracein("selected ", selected); |
---|
5835 | | - display.vector2buffer = projectedVertices; |
---|
5836 | | - material.Draw(display, selected); |
---|
5837 | | - } |
---|
| 5794 | +display.PushMaterial2(this, selected); |
---|
5838 | 5795 | |
---|
5839 | 5796 | Object3D child; |
---|
5840 | 5797 | boolean sel; |
---|
.. | .. |
---|
5886 | 5843 | */ |
---|
5887 | 5844 | //depth += 1; |
---|
5888 | 5845 | |
---|
5889 | | - if (material != null) |
---|
5890 | | - { |
---|
5891 | | - materialdepth -= 1; |
---|
5892 | | - if (materialdepth > 0) |
---|
5893 | | - { |
---|
5894 | | - display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices; |
---|
5895 | | - materialstack[materialdepth - 1].Draw(display, selectedstack[materialdepth - 1]); |
---|
5896 | | - } |
---|
5897 | | - //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???"); |
---|
5898 | | - //else |
---|
5899 | | - //material.Draw(display, false); |
---|
5900 | | - } |
---|
5901 | | - |
---|
| 5846 | +display.PopMaterial2(this); |
---|
5902 | 5847 | /* |
---|
5903 | 5848 | display.ReleaseTextures(tex); |
---|
5904 | 5849 | */ |
---|
.. | .. |
---|
5909 | 5854 | |
---|
5910 | 5855 | //static cVector min,max; |
---|
5911 | 5856 | |
---|
5912 | | - void DrawNode(CameraPane display, Object3D /*Composite*/ root, boolean selected) |
---|
| 5857 | + void DrawNode(iCameraPane display, Object3D /*Composite*/ root, boolean selected) |
---|
5913 | 5858 | { |
---|
5914 | | - if (display.drawMode == display.SHADOW && projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000) |
---|
| 5859 | + if (display.DrawMode() == display.SHADOW && projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000) |
---|
5915 | 5860 | return; // no shadow for transparent objects |
---|
5916 | 5861 | |
---|
5917 | 5862 | if (hide) |
---|
.. | .. |
---|
5954 | 5899 | return; |
---|
5955 | 5900 | } |
---|
5956 | 5901 | |
---|
| 5902 | + //bRep.GenUV(1/material.diffuseness); |
---|
5957 | 5903 | // bRep.lock = true; |
---|
5958 | 5904 | |
---|
5959 | | - javax.media.opengl.GL gl = display.GetGL(); |
---|
| 5905 | + //javax.media.opengl.GL gl = display.GetGL(); |
---|
5960 | 5906 | |
---|
5961 | | - if (CameraPane.BOXMODE) // || CameraPane.movingcamera) |
---|
| 5907 | + if (CameraPane.BOXMODE && !selected) // || CameraPane.movingcamera) |
---|
5962 | 5908 | { |
---|
5963 | 5909 | int fc = bRep.FaceCount(); |
---|
5964 | 5910 | int vc = bRep.VertexCount(); |
---|
.. | .. |
---|
5973 | 5919 | |
---|
5974 | 5920 | bRep.getMinMax(min, max, 100); |
---|
5975 | 5921 | |
---|
5976 | | - gl.glBegin(gl.GL_LINES); |
---|
5977 | | - |
---|
5978 | | - gl.glVertex3d(min.x, min.y, min.z); |
---|
5979 | | - gl.glVertex3d(min.x, min.y, max.z); |
---|
5980 | | - gl.glVertex3d(min.x, min.y, min.z); |
---|
5981 | | - gl.glVertex3d(min.x, max.y, min.z); |
---|
5982 | | - gl.glVertex3d(min.x, min.y, min.z); |
---|
5983 | | - gl.glVertex3d(max.x, min.y, min.z); |
---|
5984 | | - |
---|
5985 | | - gl.glVertex3d(max.x, max.y, max.z); |
---|
5986 | | - gl.glVertex3d(min.x, max.y, max.z); |
---|
5987 | | - gl.glVertex3d(max.x, max.y, max.z); |
---|
5988 | | - gl.glVertex3d(max.x, min.y, max.z); |
---|
5989 | | - gl.glVertex3d(max.x, max.y, max.z); |
---|
5990 | | - gl.glVertex3d(max.x, max.y, min.z); |
---|
5991 | | - |
---|
5992 | | - gl.glEnd(); |
---|
| 5922 | + display.DrawBox(min, max); |
---|
5993 | 5923 | |
---|
5994 | 5924 | return; |
---|
5995 | 5925 | } |
---|
.. | .. |
---|
6033 | 5963 | { |
---|
6034 | 5964 | //throw new Error(); |
---|
6035 | 5965 | |
---|
6036 | | - boolean selectmode = display.drawMode == display.SELECTION || CameraPane.DEBUG_SELECTION; |
---|
| 5966 | + boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
6037 | 5967 | |
---|
6038 | 5968 | int[] strips = bRep.getRawIndices(); |
---|
6039 | 5969 | |
---|
.. | .. |
---|
6043 | 5973 | new Exception().printStackTrace(); |
---|
6044 | 5974 | return; |
---|
6045 | 5975 | } |
---|
6046 | | - |
---|
6047 | | - // TRIANGLE STRIP ARRAY |
---|
6048 | | - if (bRep.trimmed) |
---|
6049 | | - { |
---|
6050 | | - float[] v = bRep.getRawVertices(); |
---|
6051 | | - float[] n = bRep.getRawNormals(); |
---|
6052 | | - float[] c = bRep.getRawColors(); |
---|
6053 | | - float[] uv = bRep.getRawUVMap(); |
---|
6054 | | - |
---|
6055 | | - int count2 = 0; |
---|
6056 | | - int count3 = 0; |
---|
6057 | | - |
---|
6058 | | - if (n.length > 0) |
---|
6059 | | - { |
---|
6060 | | - for (int i = 0; i < strips.length; i++) |
---|
6061 | | - { |
---|
6062 | | - gl.glBegin(gl.GL_TRIANGLE_STRIP); |
---|
6063 | | - |
---|
6064 | | - /* |
---|
6065 | | - boolean locked = false; |
---|
6066 | | - float eps = 0.1f; |
---|
6067 | | - boolean wrap = CameraPane.UVWRAP; // true; // UV WRAP TEXTURE ISSUE: true = artifacts, false = nice |
---|
6068 | | - |
---|
6069 | | - int dot = 0; |
---|
6070 | | - |
---|
6071 | | - if ((dot&1) == 0) |
---|
6072 | | - dot |= (Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) ? 3 : 1; |
---|
6073 | | - |
---|
6074 | | - if (wrap || (dot&2) != 0) // Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) |
---|
6075 | | - gl.glTexCoord2f((float) qv.s, (float) qv.t); |
---|
6076 | | - else |
---|
6077 | | - { |
---|
6078 | | - locked = true; |
---|
6079 | | - gl.glTexCoord2f((float) pv.s, (float) pv.t); |
---|
6080 | | - } |
---|
6081 | | - //System.out.println("vertexq = " + qv.x + ", " + qv.y + ", " + qv.z); |
---|
6082 | | - gl.glVertex3f((float) qv.x, (float) qv.y, (float) qv.z); |
---|
6083 | | - if (hasnorm) |
---|
6084 | | - { |
---|
6085 | | - //System.out.println("normalr = " + rv.norm.x + ", " + rv.norm.y + ", " + rv.norm.z); |
---|
6086 | | - gl.glNormal3f((float) rv.norm.x, (float) rv.norm.y, (float) rv.norm.z); |
---|
6087 | | - } |
---|
6088 | | - |
---|
6089 | | - if ((dot&4) == 0) |
---|
6090 | | - dot |= (Math.abs(rv.s - pv.s) < eps && Math.abs(rv.t - pv.t) < eps) ? 12 : 4; |
---|
6091 | | - |
---|
6092 | | - if (wrap || !locked && (dot&8) != 0) |
---|
6093 | | - gl.glTexCoord2f((float) rv.s, (float) rv.t); |
---|
6094 | | - else |
---|
6095 | | - gl.glTexCoord2f((float) pv.s, (float) pv.t); |
---|
6096 | | - |
---|
6097 | | - f.dot = dot; |
---|
6098 | | - */ |
---|
6099 | | - |
---|
6100 | | - if (!selectmode) |
---|
6101 | | - { |
---|
6102 | | - if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0) |
---|
6103 | | - { |
---|
6104 | | - gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]); |
---|
6105 | | - } else |
---|
6106 | | - { |
---|
6107 | | - gl.glNormal3f(0, 0, 1); |
---|
6108 | | - } |
---|
6109 | | - |
---|
6110 | | - if (c != null) |
---|
6111 | | - //System.out.println("glcolor = " + c[count3] + ", " + c[count3+1] + ", " + c[count3+2]); |
---|
6112 | | - { |
---|
6113 | | - gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1); |
---|
6114 | | - } |
---|
6115 | | - } |
---|
6116 | | - if (flipV) |
---|
6117 | | - gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
6118 | | - else |
---|
6119 | | - gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
6120 | | - //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]); |
---|
6121 | | - gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
6122 | | - |
---|
6123 | | - count2 += 2; |
---|
6124 | | - count3 += 3; |
---|
6125 | | - if (!selectmode) |
---|
6126 | | - { |
---|
6127 | | - if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0) |
---|
6128 | | - { |
---|
6129 | | - gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]); |
---|
6130 | | - } else |
---|
6131 | | - { |
---|
6132 | | - gl.glNormal3f(0, 0, 1); |
---|
6133 | | - } |
---|
6134 | | - if (c != null) |
---|
6135 | | - { |
---|
6136 | | - gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1); |
---|
6137 | | - } |
---|
6138 | | - } |
---|
6139 | | - if (flipV) |
---|
6140 | | - gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
6141 | | - else |
---|
6142 | | - gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
6143 | | - //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]); |
---|
6144 | | - gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
6145 | | - |
---|
6146 | | - count2 += 2; |
---|
6147 | | - count3 += 3; |
---|
6148 | | - for (int j = 0; j < strips[i] - 2; j++) |
---|
6149 | | - { |
---|
6150 | | - //gl.glTexCoord2d(...); |
---|
6151 | | - if (!selectmode) |
---|
6152 | | - { |
---|
6153 | | - if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0) |
---|
6154 | | - { |
---|
6155 | | - gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]); |
---|
6156 | | - } else |
---|
6157 | | - { |
---|
6158 | | - gl.glNormal3f(0, 0, 1); |
---|
6159 | | - } |
---|
6160 | | - if (c != null) |
---|
6161 | | - { |
---|
6162 | | - gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1); |
---|
6163 | | - } |
---|
6164 | | - } |
---|
6165 | | - |
---|
6166 | | - if (flipV) |
---|
6167 | | - gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
6168 | | - else |
---|
6169 | | - gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
6170 | | - //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]); |
---|
6171 | | - gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
6172 | | - count2 += 2; |
---|
6173 | | - count3 += 3; |
---|
6174 | | - } |
---|
6175 | | - |
---|
6176 | | - gl.glEnd(); |
---|
6177 | | - } |
---|
6178 | | - } |
---|
6179 | | - |
---|
6180 | | - assert count3 == v.length; |
---|
6181 | | - } |
---|
6182 | | - else // !trimmed |
---|
6183 | | - { |
---|
6184 | | - int count = 0; |
---|
6185 | | - for (int i = 0; i < strips.length; i++) |
---|
6186 | | - { |
---|
6187 | | - gl.glBegin(gl.GL_TRIANGLE_STRIP); |
---|
6188 | | - |
---|
6189 | | - Vertex p = bRep.GetVertex(bRep.indices[count++]); |
---|
6190 | | - Vertex q = bRep.GetVertex(bRep.indices[count++]); |
---|
6191 | | - |
---|
6192 | | - drawVertex(gl, p, selectmode); |
---|
6193 | | - drawVertex(gl, q, selectmode); |
---|
6194 | | - |
---|
6195 | | - for (int j = 0; j < strips[i] - 2; j++) |
---|
6196 | | - { |
---|
6197 | | - Vertex r = bRep.GetVertex(bRep.indices[count++]); |
---|
6198 | | - |
---|
6199 | | -// if (j%2 == 0) |
---|
6200 | | -// drawFace(p, q, r, display, null); |
---|
6201 | | -// else |
---|
6202 | | -// drawFace(p, r, q, display, null); |
---|
6203 | | - |
---|
6204 | | -// p = q; |
---|
6205 | | -// q = r; |
---|
6206 | | - drawVertex(gl, r, selectmode); |
---|
6207 | | - } |
---|
6208 | | - |
---|
6209 | | - gl.glEnd(); |
---|
6210 | | - } |
---|
6211 | | - } |
---|
| 5976 | + |
---|
| 5977 | + display.DrawGeometry(bRep, flipV, selectmode); |
---|
6212 | 5978 | } else // catch (Error e) |
---|
6213 | 5979 | { |
---|
6214 | 5980 | // TRIANGLE ARRAY |
---|
6215 | 5981 | if (IsOpaque()) // Static()) |
---|
6216 | 5982 | { |
---|
6217 | | - gl.glBegin(gl.GL_TRIANGLES); |
---|
| 5983 | + display.StartTriangles(); |
---|
6218 | 5984 | int facecount = bRep.FaceCount(); |
---|
6219 | 5985 | for (int i = 0; i < facecount; i++) |
---|
6220 | 5986 | { |
---|
.. | .. |
---|
6277 | 6043 | // // r.norm.dot(v3) > -0.5) |
---|
6278 | 6044 | // // continue; |
---|
6279 | 6045 | |
---|
6280 | | - drawFace(p, q, r, display, face); |
---|
| 6046 | + display.DrawFace(this, p, q, r, face); |
---|
6281 | 6047 | } |
---|
6282 | | - gl.glEnd(); |
---|
| 6048 | + display.EndTriangles(); |
---|
6283 | 6049 | } |
---|
6284 | 6050 | else |
---|
6285 | 6051 | { |
---|
.. | .. |
---|
6308 | 6074 | //System.out.println("SORT"); |
---|
6309 | 6075 | |
---|
6310 | 6076 | java.util.Arrays.sort(facescompare); |
---|
6311 | | - |
---|
6312 | | - gl.glBegin(gl.GL_TRIANGLES); |
---|
| 6077 | + |
---|
| 6078 | + display.StartTriangles(); |
---|
6313 | 6079 | for (int i = 0; i < facecount; i++) |
---|
6314 | 6080 | { |
---|
6315 | 6081 | Face face = bRep.GetFace(facescompare[i].index); |
---|
.. | .. |
---|
6321 | 6087 | Vertex q = bRep.GetVertex(face.q); |
---|
6322 | 6088 | Vertex r = bRep.GetVertex(face.r); |
---|
6323 | 6089 | |
---|
6324 | | - drawFace(p, q, r, display, face); |
---|
| 6090 | + display.DrawFace(this, p, q, r, face); |
---|
6325 | 6091 | } |
---|
6326 | | - gl.glEnd(); |
---|
| 6092 | + display.EndTriangles(); |
---|
6327 | 6093 | } |
---|
6328 | 6094 | |
---|
6329 | 6095 | if (false) // live && support != null && support.bRep != null) // debug weights |
---|
6330 | 6096 | { |
---|
| 6097 | + /* |
---|
6331 | 6098 | gl.glDisable(gl.GL_LIGHTING); |
---|
6332 | 6099 | float[] colorV = new float[3]; |
---|
6333 | 6100 | |
---|
.. | .. |
---|
6406 | 6173 | // gl.glEnd(); |
---|
6407 | 6174 | } |
---|
6408 | 6175 | } |
---|
| 6176 | + */ |
---|
6409 | 6177 | } |
---|
6410 | 6178 | } |
---|
6411 | 6179 | |
---|
.. | .. |
---|
6450 | 6218 | center.add(r); |
---|
6451 | 6219 | center.mul(1.0/3); |
---|
6452 | 6220 | |
---|
6453 | | - center.sub(CameraPane.theRenderer.eyeCamera.location); |
---|
| 6221 | + center.sub(Globals.theRenderer.EyeCamera().location); |
---|
6454 | 6222 | |
---|
6455 | 6223 | distance = center.dot(center); |
---|
6456 | 6224 | } |
---|
.. | .. |
---|
6461 | 6229 | |
---|
6462 | 6230 | transient FaceCompare[] facescompare = null; |
---|
6463 | 6231 | |
---|
6464 | | - void SetColor(CameraPane display, Vertex p0) |
---|
6465 | | - { |
---|
6466 | | - if (display.RENDERPROGRAM == 0) |
---|
6467 | | - { |
---|
6468 | | - float r = 0; |
---|
6469 | | - if (bRep != null) |
---|
6470 | | - { |
---|
6471 | | - if (bRep.stripified) |
---|
6472 | | - { |
---|
6473 | | - r = 1; |
---|
6474 | | - } |
---|
6475 | | - } |
---|
6476 | | - float g = 0; |
---|
6477 | | - if (bRep != null) |
---|
6478 | | - { |
---|
6479 | | - if (bRep.trimmed) |
---|
6480 | | - { |
---|
6481 | | - g = 1; |
---|
6482 | | - } |
---|
6483 | | - } |
---|
6484 | | - float b = 0; |
---|
6485 | | - if (support != null && link2master) |
---|
6486 | | - { |
---|
6487 | | - b = 1; |
---|
6488 | | - } |
---|
6489 | | - display.GetGL().glColor3f(r*p0.AO, g*p0.AO, b*p0.AO); |
---|
6490 | | - return; |
---|
6491 | | - } |
---|
6492 | | - |
---|
6493 | | - if (display.drawMode != CameraPane.SHADOW) |
---|
6494 | | - return; |
---|
6495 | | - |
---|
6496 | | - javax.media.opengl.GL gl = display.GetGL(); |
---|
6497 | | -// if (true) return; |
---|
6498 | | -// float ao = p.AO; |
---|
6499 | | -// |
---|
6500 | | -// // if (ao == 0 && !bRep.AOdone) // transient problem! |
---|
6501 | | -// // ao = 1; |
---|
6502 | | -// |
---|
6503 | | -// gl.glColor4f(ao, ao, ao, 1); |
---|
6504 | | - |
---|
6505 | | -// CameraPane.selectedpoint. |
---|
6506 | | -// getAverage(cStatic.point1, true); |
---|
6507 | | - if (CameraPane.pointflow == null) // !random) // live) |
---|
6508 | | - { |
---|
6509 | | - return; |
---|
6510 | | - } |
---|
6511 | | - |
---|
6512 | | - cStatic.point1.set(0,0,0); |
---|
6513 | | - LA.xformPos(cStatic.point1, CameraPane.selectedpoint.toParent, cStatic.point1); |
---|
6514 | | - |
---|
6515 | | - cStatic.point1.sub(p0); |
---|
6516 | | - |
---|
6517 | | - |
---|
6518 | | -// if (marked && (p0.vertexlinks == null || support == null || support.bRep == null)) // no position delta? |
---|
6519 | | -// { |
---|
6520 | | -// return; |
---|
6521 | | -// } |
---|
6522 | | - |
---|
6523 | | - //if (true) |
---|
6524 | | - if (cStatic.point1.dot(cStatic.point1) > 0.000001) |
---|
6525 | | - { |
---|
6526 | | - return; |
---|
6527 | | - } |
---|
6528 | | - |
---|
6529 | | - float[] colorV = new float[3]; |
---|
6530 | | - |
---|
6531 | | - if (false) // marked) |
---|
6532 | | - { |
---|
6533 | | - // debug rigging weights |
---|
6534 | | - for (int object = 0; object < p0.vertexlinks.length; object++) |
---|
6535 | | - { |
---|
6536 | | - float weight = p0.weights[object] / p0.totalweight; |
---|
6537 | | - |
---|
6538 | | - // if (weight < 0.1) |
---|
6539 | | - // { |
---|
6540 | | - // assert(weight == 0); |
---|
6541 | | - // continue; |
---|
6542 | | - // } |
---|
6543 | | - |
---|
6544 | | - if (p0.vertexlinks[object] == -1) |
---|
6545 | | - continue; |
---|
6546 | | - |
---|
6547 | | - Vertex q = support.bRep.GetVertex(p0.vertexlinks[object]); |
---|
6548 | | - |
---|
6549 | | - int color = //1 << object; // |
---|
6550 | | - //p.vertexlinks.length; |
---|
6551 | | - support.bRep.supports[p0.closestsupport].links[object]; |
---|
6552 | | - colorV[2] += (color & 1) * weight; |
---|
6553 | | - colorV[1] += ((color & 2) >> 1) * weight; |
---|
6554 | | - colorV[0] += ((color & 4) >> 2) * weight; |
---|
6555 | | - } |
---|
6556 | | - } |
---|
6557 | | - else |
---|
6558 | | - { |
---|
6559 | | - if (drawingstarted) |
---|
6560 | | - { |
---|
6561 | | - // find next point |
---|
6562 | | - if (bRep.GetVertex(0).faceindices == null) |
---|
6563 | | - { |
---|
6564 | | - bRep.InitFaceIndices(); |
---|
6565 | | - } |
---|
6566 | | - |
---|
6567 | | - double ymin = p0.y; |
---|
6568 | | - |
---|
6569 | | - Vertex newp = p0; |
---|
6570 | | - |
---|
6571 | | - for (int fii = 0; fii < p0.faceindices.length; fii++) |
---|
6572 | | - { |
---|
6573 | | - int fi = p0.faceindices[fii]; |
---|
6574 | | - |
---|
6575 | | - if (fi == -1) |
---|
6576 | | - break; |
---|
6577 | | - |
---|
6578 | | - Face f = bRep.GetFace(fi); |
---|
6579 | | - |
---|
6580 | | - Vertex p = bRep.GetVertex(f.p); |
---|
6581 | | - Vertex q = bRep.GetVertex(f.q); |
---|
6582 | | - Vertex r = bRep.GetVertex(f.r); |
---|
6583 | | - |
---|
6584 | | - int swap = (int)(Math.random()*3); |
---|
6585 | | - |
---|
6586 | | -// for (int s=swap; --s>=0;) |
---|
6587 | | -// { |
---|
6588 | | -// Vertex t = p; |
---|
6589 | | -// p = q; |
---|
6590 | | -// q = r; |
---|
6591 | | -// r = t; |
---|
6592 | | -// } |
---|
6593 | | - if (ymin > p.y) |
---|
6594 | | - { |
---|
6595 | | - ymin = p.y; |
---|
6596 | | - newp = p; |
---|
6597 | | -// break; |
---|
6598 | | - } |
---|
6599 | | - if (ymin > q.y) |
---|
6600 | | - { |
---|
6601 | | - ymin = q.y; |
---|
6602 | | - newp = q; |
---|
6603 | | -// break; |
---|
6604 | | - } |
---|
6605 | | - if (ymin > r.y) |
---|
6606 | | - { |
---|
6607 | | - ymin = r.y; |
---|
6608 | | - newp = r; |
---|
6609 | | -// break; |
---|
6610 | | - } |
---|
6611 | | - } |
---|
6612 | | - |
---|
6613 | | - CameraPane.selectedpoint.toParent[3][0] = newp.x; |
---|
6614 | | - CameraPane.selectedpoint.toParent[3][1] = newp.y; |
---|
6615 | | - CameraPane.selectedpoint.toParent[3][2] = newp.z; |
---|
6616 | | - |
---|
6617 | | - drawingstarted = false; |
---|
6618 | | - |
---|
6619 | | - // return; |
---|
6620 | | - } |
---|
6621 | | - |
---|
6622 | | - if (false) // CameraPane.DRAW |
---|
6623 | | - { |
---|
6624 | | - p0.AO = colorV[0] = 2; |
---|
6625 | | - colorV[1] = 2; |
---|
6626 | | - colorV[2] = 2; |
---|
6627 | | - } |
---|
6628 | | - |
---|
6629 | | - CameraPane.pointflow.add(p0); |
---|
6630 | | - CameraPane.pointflow.Touch(); |
---|
6631 | | - } |
---|
6632 | | - |
---|
6633 | | -// gl.glColor3f(colorV[0], colorV[1], colorV[2]); |
---|
6634 | | -// gl.glMaterialfv(gl.GL_FRONT, gl.GL_DIFFUSE, colorV, 0); |
---|
6635 | | -// gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0); |
---|
6636 | | - } |
---|
6637 | | - |
---|
6638 | 6232 | void Print(Vertex v) |
---|
6639 | 6233 | { |
---|
6640 | 6234 | //System.err.println("(" + v.x + ", " + v.y + ", " + v.z + ")"); |
---|
6641 | 6235 | } |
---|
6642 | 6236 | |
---|
6643 | | - void drawVertex(javax.media.opengl.GL gl, Vertex pv, boolean selectmode) |
---|
6644 | | - { |
---|
6645 | | - if (!selectmode) |
---|
6646 | | - { |
---|
6647 | | - gl.glNormal3f((float) pv.norm.x, (float) pv.norm.y, (float) pv.norm.z); |
---|
6648 | | - gl.glColor4f(pv.AO, pv.AO, pv.AO, 1); |
---|
6649 | | - |
---|
6650 | | - if (flipV) |
---|
6651 | | - gl.glTexCoord2f((float) pv.s, 1-(float) pv.t); |
---|
6652 | | - else |
---|
6653 | | - gl.glTexCoord2f((float) pv.s, (float) pv.t); |
---|
6654 | | - } |
---|
6655 | | - |
---|
6656 | | - gl.glVertex3f((float) pv.x, (float) pv.y, (float) pv.z); |
---|
6657 | | - } |
---|
6658 | | - |
---|
6659 | | - void drawFace(Vertex pv, Vertex qv, Vertex rv, |
---|
6660 | | - CameraPane display, Face face) |
---|
6661 | | - { |
---|
6662 | | - if (pv.y == -10000 || |
---|
6663 | | - qv.y == -10000 || |
---|
6664 | | - rv.y == -10000) |
---|
6665 | | - return; |
---|
6666 | | - |
---|
6667 | | -// float b = f.nbiterations & 1; |
---|
6668 | | -// float g = (f.nbiterations>>1) & 1; |
---|
6669 | | -// float r = (f.nbiterations>>2) & 1; |
---|
6670 | | -// |
---|
6671 | | -// //if (f.weight == 10000) |
---|
6672 | | -// //{ |
---|
6673 | | -// // r = 1; g = b = 0; |
---|
6674 | | -// //} |
---|
6675 | | -// //else |
---|
6676 | | -// //{ |
---|
6677 | | -// // assert(f.weight < 10000); |
---|
6678 | | -// r = g = b = (float)bRep.FaceWeight(f)*100; |
---|
6679 | | -// if (r<0) |
---|
6680 | | -// assert(r>=0); |
---|
6681 | | -// //} |
---|
6682 | | - |
---|
6683 | | - javax.media.opengl.GL gl = display.GetGL(); |
---|
6684 | | - |
---|
6685 | | - boolean selectmode = display.drawMode == display.SELECTION || CameraPane.DEBUG_SELECTION; |
---|
6686 | | - |
---|
6687 | | - //System.out.println("p = " + pv + "; q = " + qv + "; r = " + rv); |
---|
6688 | | - if (!selectmode) // display.drawMode != display.SELECTION) // && display.drawMode != display.SHADOW) // (attributes & FILL) != 0) |
---|
6689 | | - { |
---|
6690 | | - //gl.glBegin(gl.GL_TRIANGLES); |
---|
6691 | | - boolean hasnorm = pv.norm != null; // && (pv.norm.x != 0 || pv.norm.y != 0 || pv.norm.z != 0); |
---|
6692 | | - if (!hasnorm) |
---|
6693 | | - { |
---|
6694 | | - // System.out.println("FUCK!!"); |
---|
6695 | | - LA.vecSub(pv/*.pos*/, qv/*.pos*/, v0); |
---|
6696 | | - LA.vecSub(pv/*.pos*/, rv/*.pos*/, v1); |
---|
6697 | | - LA.vecCross(v0, v1, v2); |
---|
6698 | | - LA.vecNormalize(v2); |
---|
6699 | | - gl.glNormal3f((float) v2.x, (float) v2.y, (float) v2.z); |
---|
6700 | | - } |
---|
6701 | | - |
---|
6702 | | - if (hasnorm) |
---|
6703 | | - { |
---|
6704 | | -// if (!pv.norm.normalized()) |
---|
6705 | | -// assert(pv.norm.normalized()); |
---|
6706 | | - |
---|
6707 | | - //System.out.println("normalp = " + pv.norm.x + ", " + pv.norm.y + ", " + pv.norm.z); |
---|
6708 | | - gl.glNormal3f((float) pv.norm.x, (float) pv.norm.y, (float) pv.norm.z); |
---|
6709 | | - } |
---|
6710 | | - gl.glColor4f(pv.AO, pv.AO, pv.AO, 1); |
---|
6711 | | - SetColor(display, pv); |
---|
6712 | | - //gl.glColor4f(r, g, b, 1); |
---|
6713 | | - //gl.glColor4f(pv.boundary, pv.boundary, pv.boundary, 1); |
---|
6714 | | - if (flipV) |
---|
6715 | | - gl.glTexCoord2f((float) pv.s, 1-(float) pv.t); |
---|
6716 | | - else |
---|
6717 | | - gl.glTexCoord2f((float) pv.s, (float) pv.t); |
---|
6718 | | - //System.out.println("vertexp = " + pv.x + ", " + pv.y + ", " + pv.z); |
---|
6719 | | - gl.glVertex3f((float) pv./*pos.*/x, (float) pv./*pos.*/y, (float) pv./*pos.*/z); |
---|
6720 | | -// Print(pv); |
---|
6721 | | - if (hasnorm) |
---|
6722 | | - { |
---|
6723 | | -// assert(qv.norm.normalized()); |
---|
6724 | | - //System.out.println("normalq = " + qv.norm.x + ", " + qv.norm.y + ", " + qv.norm.z); |
---|
6725 | | - gl.glNormal3f((float) qv.norm.x, (float) qv.norm.y, (float) qv.norm.z); |
---|
6726 | | - } |
---|
6727 | | - //System.out.println("vertexq = " + qv.s + ", " + qv.t); |
---|
6728 | | - // boolean locked = false; |
---|
6729 | | - // float eps = 0.1f; |
---|
6730 | | - // boolean wrap = CameraPane.UVWRAP; // true; // UV WRAP TEXTURE ISSUE: true = artifacts, false = nice |
---|
6731 | | - |
---|
6732 | | - // int dot = 0; //*/ (int)f.dot; |
---|
6733 | | - |
---|
6734 | | - // if ((dot&1) == 0) |
---|
6735 | | - // dot |= (Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) ? 3 : 1; |
---|
6736 | | - |
---|
6737 | | - // if (wrap || (dot&2) != 0) // Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) |
---|
6738 | | - if (flipV) |
---|
6739 | | - gl.glTexCoord2f((float) qv.s, 1-(float) qv.t); |
---|
6740 | | - else |
---|
6741 | | - gl.glTexCoord2f((float) qv.s, (float) qv.t); |
---|
6742 | | - // else |
---|
6743 | | - // { |
---|
6744 | | - // locked = true; |
---|
6745 | | - // gl.glTexCoord2f((float) pv.s, (float) pv.t); |
---|
6746 | | - // } |
---|
6747 | | - gl.glColor4f(qv.AO, qv.AO, qv.AO, 1); |
---|
6748 | | - SetColor(display, qv); |
---|
6749 | | - //gl.glColor4f(r, g, b, 1); |
---|
6750 | | - //gl.glColor4f(qv.boundary, qv.boundary, qv.boundary, 1); |
---|
6751 | | - //System.out.println("vertexq = " + qv.x + ", " + qv.y + ", " + qv.z); |
---|
6752 | | - gl.glVertex3f((float) qv./*pos.*/x, (float) qv./*pos.*/y, (float) qv./*pos.*/z); |
---|
6753 | | -// Print(qv); |
---|
6754 | | - if (hasnorm) |
---|
6755 | | - { |
---|
6756 | | -// assert(rv.norm.normalized()); |
---|
6757 | | - //System.out.println("normalr = " + rv.norm.x + ", " + rv.norm.y + ", " + rv.norm.z); |
---|
6758 | | - gl.glNormal3f((float) rv.norm.x, (float) rv.norm.y, (float) rv.norm.z); |
---|
6759 | | - } |
---|
6760 | | - |
---|
6761 | | - // if ((dot&4) == 0) |
---|
6762 | | - // dot |= (Math.abs(rv.s - pv.s) < eps && Math.abs(rv.t - pv.t) < eps) ? 12 : 4; |
---|
6763 | | - |
---|
6764 | | - // if (wrap || !locked && (dot&8) != 0) |
---|
6765 | | - if (flipV) |
---|
6766 | | - gl.glTexCoord2f((float) rv.s, 1-(float) rv.t); |
---|
6767 | | - else |
---|
6768 | | - gl.glTexCoord2f((float) rv.s, (float) rv.t); |
---|
6769 | | - // else |
---|
6770 | | - // gl.glTexCoord2f((float) pv.s, (float) pv.t); |
---|
6771 | | - |
---|
6772 | | - // f.dot = dot; |
---|
6773 | | - |
---|
6774 | | - gl.glColor4f(rv.AO, rv.AO, rv.AO, 1); |
---|
6775 | | - SetColor(display, rv); |
---|
6776 | | - //gl.glColor4f(r, g, b, 1); |
---|
6777 | | - //gl.glColor4f(rv.boundary, rv.boundary, rv.boundary, 1); |
---|
6778 | | - //System.out.println("vertexr = " + rv.x + ", " + rv.y + ", " + rv.z); |
---|
6779 | | - gl.glVertex3f((float) rv./*pos.*/x, (float) rv./*pos.*/y, (float) rv./*pos.*/z); |
---|
6780 | | -// Print(rv); |
---|
6781 | | - //gl.glEnd(); |
---|
6782 | | - } |
---|
6783 | | - else |
---|
6784 | | - { |
---|
6785 | | - gl.glVertex3f((float) pv.x, (float) pv.y, (float) pv.z); |
---|
6786 | | - gl.glVertex3f((float) qv.x, (float) qv.y, (float) qv.z); |
---|
6787 | | - gl.glVertex3f((float) rv.x, (float) rv.y, (float) rv.z); |
---|
6788 | | - |
---|
6789 | | - } |
---|
6790 | | - |
---|
6791 | | - if (false) // (attributes & WIREFRAME) != 0) |
---|
6792 | | - { |
---|
6793 | | - gl.glDisable(gl.GL_LIGHTING); |
---|
6794 | | - |
---|
6795 | | - gl.glBegin(gl.GL_LINE_LOOP); |
---|
6796 | | - gl.glVertex3d(pv./*pos.*/x, pv./*pos.*/y, pv./*pos.*/z); |
---|
6797 | | - gl.glVertex3d(qv./*pos.*/x, qv./*pos.*/y, qv./*pos.*/z); |
---|
6798 | | - gl.glVertex3d(rv./*pos.*/x, rv./*pos.*/y, rv./*pos.*/z); |
---|
6799 | | - gl.glEnd(); |
---|
6800 | | - |
---|
6801 | | - gl.glEnable(gl.GL_LIGHTING); |
---|
6802 | | - } |
---|
6803 | | - } |
---|
6804 | | - |
---|
6805 | 6237 | void drawSelf(ClickInfo info, int level, boolean select) |
---|
6806 | 6238 | { |
---|
6807 | 6239 | if (bRep == null) |
---|
.. | .. |
---|
7373 | 6805 | int spotw = spot.x + spot.width; |
---|
7374 | 6806 | int spoth = spot.y + spot.height; |
---|
7375 | 6807 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7376 | | - if (CameraPane.Xmin > spot.x) |
---|
7377 | | - { |
---|
7378 | | - CameraPane.Xmin = spot.x; |
---|
7379 | | - } |
---|
7380 | | - if (CameraPane.Xmax < spotw) |
---|
7381 | | - { |
---|
7382 | | - CameraPane.Xmax = spotw; |
---|
7383 | | - } |
---|
7384 | | - if (CameraPane.Ymin > spot.y) |
---|
7385 | | - { |
---|
7386 | | - CameraPane.Ymin = spot.y; |
---|
7387 | | - } |
---|
7388 | | - if (CameraPane.Ymax < spoth) |
---|
7389 | | - { |
---|
7390 | | - CameraPane.Ymax = spoth; |
---|
7391 | | - } |
---|
| 6808 | +// if (CameraPane.Xmin > spot.x) |
---|
| 6809 | +// { |
---|
| 6810 | +// CameraPane.Xmin = spot.x; |
---|
| 6811 | +// } |
---|
| 6812 | +// if (CameraPane.Xmax < spotw) |
---|
| 6813 | +// { |
---|
| 6814 | +// CameraPane.Xmax = spotw; |
---|
| 6815 | +// } |
---|
| 6816 | +// if (CameraPane.Ymin > spot.y) |
---|
| 6817 | +// { |
---|
| 6818 | +// CameraPane.Ymin = spot.y; |
---|
| 6819 | +// } |
---|
| 6820 | +// if (CameraPane.Ymax < spoth) |
---|
| 6821 | +// { |
---|
| 6822 | +// CameraPane.Ymax = spoth; |
---|
| 6823 | +// } |
---|
7392 | 6824 | spot.translate(32, 32); |
---|
7393 | 6825 | spotw = spot.x + spot.width; |
---|
7394 | 6826 | spoth = spot.y + spot.height; |
---|
7395 | 6827 | info.g.setColor(Color.blue); |
---|
7396 | 6828 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7397 | | - if (CameraPane.Xmin > spot.x) |
---|
7398 | | - { |
---|
7399 | | - CameraPane.Xmin = spot.x; |
---|
7400 | | - } |
---|
7401 | | - if (CameraPane.Xmax < spotw) |
---|
7402 | | - { |
---|
7403 | | - CameraPane.Xmax = spotw; |
---|
7404 | | - } |
---|
7405 | | - if (CameraPane.Ymin > spot.y) |
---|
7406 | | - { |
---|
7407 | | - CameraPane.Ymin = spot.y; |
---|
7408 | | - } |
---|
7409 | | - if (CameraPane.Ymax < spoth) |
---|
7410 | | - { |
---|
7411 | | - CameraPane.Ymax = spoth; |
---|
7412 | | - } |
---|
| 6829 | +// if (CameraPane.Xmin > spot.x) |
---|
| 6830 | +// { |
---|
| 6831 | +// CameraPane.Xmin = spot.x; |
---|
| 6832 | +// } |
---|
| 6833 | +// if (CameraPane.Xmax < spotw) |
---|
| 6834 | +// { |
---|
| 6835 | +// CameraPane.Xmax = spotw; |
---|
| 6836 | +// } |
---|
| 6837 | +// if (CameraPane.Ymin > spot.y) |
---|
| 6838 | +// { |
---|
| 6839 | +// CameraPane.Ymin = spot.y; |
---|
| 6840 | +// } |
---|
| 6841 | +// if (CameraPane.Ymax < spoth) |
---|
| 6842 | +// { |
---|
| 6843 | +// CameraPane.Ymax = spoth; |
---|
| 6844 | +// } |
---|
7413 | 6845 | info.g.drawLine(spotw, spoth, spotw, spoth - 15); |
---|
7414 | 6846 | info.g.drawLine(spotw, spoth, spotw - 15, spoth); |
---|
7415 | 6847 | spot.translate(0, -32); |
---|
7416 | 6848 | info.g.setColor(Color.green); |
---|
7417 | 6849 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7418 | | - if (CameraPane.Xmin > spot.x) |
---|
7419 | | - { |
---|
7420 | | - CameraPane.Xmin = spot.x; |
---|
7421 | | - } |
---|
7422 | | - if (CameraPane.Xmax < spotw) |
---|
7423 | | - { |
---|
7424 | | - CameraPane.Xmax = spotw; |
---|
7425 | | - } |
---|
7426 | | - if (CameraPane.Ymin > spot.y) |
---|
7427 | | - { |
---|
7428 | | - CameraPane.Ymin = spot.y; |
---|
7429 | | - } |
---|
7430 | | - if (CameraPane.Ymax < spoth) |
---|
7431 | | - { |
---|
7432 | | - CameraPane.Ymax = spoth; |
---|
7433 | | - } |
---|
| 6850 | +// if (CameraPane.Xmin > spot.x) |
---|
| 6851 | +// { |
---|
| 6852 | +// CameraPane.Xmin = spot.x; |
---|
| 6853 | +// } |
---|
| 6854 | +// if (CameraPane.Xmax < spotw) |
---|
| 6855 | +// { |
---|
| 6856 | +// CameraPane.Xmax = spotw; |
---|
| 6857 | +// } |
---|
| 6858 | +// if (CameraPane.Ymin > spot.y) |
---|
| 6859 | +// { |
---|
| 6860 | +// CameraPane.Ymin = spot.y; |
---|
| 6861 | +// } |
---|
| 6862 | +// if (CameraPane.Ymax < spoth) |
---|
| 6863 | +// { |
---|
| 6864 | +// CameraPane.Ymax = spoth; |
---|
| 6865 | +// } |
---|
7434 | 6866 | info.g.drawArc(boundary.x, boundary.y, |
---|
7435 | 6867 | boundary.width, boundary.height, 0, 360); |
---|
7436 | 6868 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
7437 | | - if (CameraPane.Xmin > boundary.x) |
---|
7438 | | - { |
---|
7439 | | - CameraPane.Xmin = boundary.x; |
---|
7440 | | - } |
---|
7441 | | - if (CameraPane.Xmax < boundary.x + boundary.width) |
---|
7442 | | - { |
---|
7443 | | - CameraPane.Xmax = boundary.x + boundary.width; |
---|
7444 | | - } |
---|
7445 | | - if (CameraPane.Ymin > boundary.y) |
---|
7446 | | - { |
---|
7447 | | - CameraPane.Ymin = boundary.y; |
---|
7448 | | - } |
---|
7449 | | - if (CameraPane.Ymax < boundary.y + boundary.height) |
---|
7450 | | - { |
---|
7451 | | - CameraPane.Ymax = boundary.y + boundary.height; |
---|
7452 | | - } |
---|
| 6869 | +// if (CameraPane.Xmin > boundary.x) |
---|
| 6870 | +// { |
---|
| 6871 | +// CameraPane.Xmin = boundary.x; |
---|
| 6872 | +// } |
---|
| 6873 | +// if (CameraPane.Xmax < boundary.x + boundary.width) |
---|
| 6874 | +// { |
---|
| 6875 | +// CameraPane.Xmax = boundary.x + boundary.width; |
---|
| 6876 | +// } |
---|
| 6877 | +// if (CameraPane.Ymin > boundary.y) |
---|
| 6878 | +// { |
---|
| 6879 | +// CameraPane.Ymin = boundary.y; |
---|
| 6880 | +// } |
---|
| 6881 | +// if (CameraPane.Ymax < boundary.y + boundary.height) |
---|
| 6882 | +// { |
---|
| 6883 | +// CameraPane.Ymax = boundary.y + boundary.height; |
---|
| 6884 | +// } |
---|
7453 | 6885 | return; |
---|
7454 | 6886 | } |
---|
7455 | 6887 | } |
---|
.. | .. |
---|
7552 | 6984 | |
---|
7553 | 6985 | case hitCenter: // Translate |
---|
7554 | 6986 | |
---|
7555 | | - scale *= 0.05f * info.pane.theRenderer.renderCamera.Distance(); |
---|
| 6987 | + scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance(); |
---|
7556 | 6988 | |
---|
7557 | 6989 | if (modified) |
---|
7558 | 6990 | { |
---|
.. | .. |
---|
7600 | 7032 | } |
---|
7601 | 7033 | LA.xformDir(up, ClickInfo.matbuffer, up); |
---|
7602 | 7034 | // if (!CameraPane.LOCALTRANSFORM) |
---|
7603 | | - LA.xformDir(up, info.pane.theRenderer.renderCamera.toScreen, up); |
---|
| 7035 | + LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up); |
---|
7604 | 7036 | LA.xformDir(info.camera.away, ClickInfo.matbuffer, away); |
---|
7605 | 7037 | // if (!CameraPane.LOCALTRANSFORM) |
---|
7606 | | - LA.xformDir(away, info.pane.theRenderer.renderCamera.toScreen, away); |
---|
| 7038 | + LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away); |
---|
7607 | 7039 | //LA.vecCross(up, cVector.Z, right2); |
---|
7608 | 7040 | |
---|
7609 | 7041 | cVector delta = LA.newVector(info.x - startX, startY - info.y, 0); |
---|
.. | .. |
---|
7661 | 7093 | } |
---|
7662 | 7094 | /**/ |
---|
7663 | 7095 | |
---|
7664 | | - switch (info.pane.renderCamera.viewCode) |
---|
| 7096 | + switch (info.pane.RenderCamera().viewCode) |
---|
7665 | 7097 | { |
---|
7666 | 7098 | case 1: // '\001' |
---|
7667 | 7099 | LA.matZRotate(toParent, angle); |
---|
.. | .. |
---|
7717 | 7149 | } |
---|
7718 | 7150 | /**/ |
---|
7719 | 7151 | |
---|
7720 | | - switch (info.pane.renderCamera.viewCode) |
---|
| 7152 | + switch (info.pane.RenderCamera().viewCode) |
---|
7721 | 7153 | { |
---|
7722 | 7154 | case 3: // '\001' |
---|
7723 | 7155 | if (modified) |
---|
.. | .. |
---|
8163 | 7595 | { |
---|
8164 | 7596 | Object3D targ = this; |
---|
8165 | 7597 | |
---|
| 7598 | + targ.NORMALPUSH = obj.NORMALPUSH; |
---|
| 7599 | + |
---|
8166 | 7600 | if (obj.material != null) |
---|
8167 | 7601 | { |
---|
8168 | 7602 | if ((mask&MATERIAL)!=0) // ==(COLOR|MATERIAL)) |
---|