From 5e6a6f3319f0c4c687fe71952ac9ecc17792b83a Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Mon, 10 Jun 2019 20:37:18 -0400
Subject: [PATCH] Fix normal for mesh

---
 Vertex.java  |    2 +-
 cSpring.java |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Vertex.java b/Vertex.java
index 9714028..e81c9e4 100644
--- a/Vertex.java
+++ b/Vertex.java
@@ -122,7 +122,7 @@
 
     public boolean equals(Object o)
     {
-            assert(norm.normalized());
+    // JUNE 2019. norm can be null (e.g. Box)           Grafreed.Assert(norm.normalized());
         //if (true) return false;
 
         Vertex vert = (Vertex) o;
diff --git a/cSpring.java b/cSpring.java
index 9dd6edc..b5d339c 100644
--- a/cSpring.java
+++ b/cSpring.java
@@ -1724,7 +1724,7 @@
             
     //        Phys.matrix.Transform(normal);
             
-            if (position instanceof Vertex)
+            if (position instanceof Vertex && ((Vertex)position).norm != null)
                 ((Vertex)position).norm.set(normal.x,normal.y,normal.z);
         }
 

--
Gitblit v1.6.2