From 60cec91731a350fe67e9b5ffe7a00d70e9026314 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Thu, 22 Aug 2019 22:45:00 -0400
Subject: [PATCH] Min shader.

---
 Object3D.java |  101 +++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 87 insertions(+), 14 deletions(-)

diff --git a/Object3D.java b/Object3D.java
index c1e3334..3c575b0 100644
--- a/Object3D.java
+++ b/Object3D.java
@@ -271,6 +271,50 @@
 //        
 //        return null;
 //    }
+    
+    transient boolean tag;
+
+    void TagObjects(Object3D o, boolean tag)
+    {
+        if (blockloop)
+            return;
+
+        o.tag = tag;
+        
+        if (o == this)
+            return;
+        
+        blockloop = true;
+
+        for (int i=0; i<Size(); i++)
+        {
+            get(i).TagObjects(o, tag);
+        }
+        
+        blockloop = false;
+    }
+
+    boolean HasTags()
+    {
+        if (blockloop)
+            return false;
+
+        blockloop = true;
+
+        boolean hasTags = false;
+        
+        for (int i=0; i<Size(); i++)
+        {
+            hasTags |= get(i).tag || get(i).HasTags();
+            
+            if (hasTags)
+                break;
+        }
+        
+        blockloop = false;
+        
+        return hasTags;
+    }
 
     void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
     {
@@ -643,7 +687,7 @@
         {
             if (maxcount != 1)
             {
-                new Exception().printStackTrace();
+                //new Exception().printStackTrace();
             }
             
             toParentMarked = LA.newMatrix();
@@ -2325,11 +2369,6 @@
             
             InitOthers();
             
-            if (this instanceof Camera)
-            {
-                material.shift = 90;
-            }
-
             material.multiply = multiply;
             
             if (multiply)
@@ -3578,15 +3617,47 @@
 
     void ClearMaterials()
     {
+        if (blockloop)
+            return;
+        
+        blockloop = true;
+        
         ClearMaterial();
-        for (int i = 0; i < size(); i++)
+        for (int i = 0; i < Size(); i++)
         {
-            Object3D child = (Object3D) reserve(i);
+            Object3D child = (Object3D) get(i);
             if (child == null)
                 continue;
             child.ClearMaterials();
-            release(i);
         }
+        
+        blockloop = false;
+    }
+    
+    void ClearVersionList()
+    {
+        this.versionlist = null;
+        this.versionindex = -1;
+        this.versiontable = null;
+    }
+    
+    void ClearVersions()
+    {
+        if (blockloop)
+            return;
+        
+        blockloop = true;
+        
+        ClearVersionList();
+        for (int i = 0; i < Size(); i++)
+        {
+            Object3D child = (Object3D) get(i);
+            if (child == null)
+                continue;
+            child.ClearVersions();
+        }
+        
+        blockloop = false;
     }
     
     void FlipV(boolean flip)
@@ -7640,7 +7711,9 @@
                 
                 scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance();
                 
-                if (modified || opposite)
+                // Modified could snap
+                if (//modified ||
+                        opposite)
                 {
                     //assert(false);
                             /*
@@ -7734,7 +7807,7 @@
 
                 if (modified)
                 {
-                    // Rotate 90 degrees
+                    // Rotate 45 degrees
                     angle /= (Math.PI / 4);
                     angle = Math.floor(angle + 0.5);
                     angle *= (Math.PI / 4);
@@ -7820,7 +7893,7 @@
                     case 3: // '\001'
                         if (modified || opposite)
                         {
-                            if (modified && opposite)
+                            if (modified) // && opposite)
                                 LA.matScale(toParent, totalScale, totalScale, totalScale);
                             else
                             //LA.matScale(toParent, 1, hScale, vScale);
@@ -7836,7 +7909,7 @@
                     case 2: // '\002'
                         if (modified || opposite)
                         {
-                            if (modified && opposite)
+                            if (modified) // && opposite)
                                 LA.matScale(toParent, totalScale, totalScale, totalScale);
                             else
                                 //LA.matScale(toParent, hScale, 1, vScale);
@@ -7850,7 +7923,7 @@
                     case 1: // '\003'
                         if (modified || opposite)
                         {
-                            if (modified && opposite)
+                            if (modified) // && opposite)
                                 LA.matScale(toParent, totalScale, totalScale, totalScale);
                             else
                                 //LA.matScale(toParent, hScale, vScale, 1);

--
Gitblit v1.6.2