SimEthereal examples

Figured I would move to new topic for this.

You use java 1.8 @pspeed? I was going to fix some 1.8 stuff.

Also ,

The sigem project has

    compile "com.simsilica:lemur:1.13.0-SNAPSHOT"
    compile "com.simsilica:lemur-proto:1.11.0-SNAPSHOT"

So that project wont build as is unless I remove the SNAPSHOT.

Nvm on the 1.8 stuff, theres some things that are in the libraries themselves that would need to be fixed.

The lemur references in Silicon Gemini (sigem) should probably be updated I guess.

Doing some cleanup from deprecated items.

First part is this PositionTransition3f change in sim-eth-es.

now this looks like,

# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/sim-eth-es/src/main/java/example/es/BodyPosition.java
+++ b/sim-eth-es/src/main/java/example/es/BodyPosition.java
@@ -40,7 +40,7 @@
 import com.jme3.math.Vector3f;
 import com.simsilica.es.EntityComponent;
 import com.simsilica.es.EntityId;
-import com.simsilica.mathd.trans.PositionTransition;
+import com.simsilica.mathd.trans.PositionTransition3f;
 import com.simsilica.mathd.trans.TransitionBuffer;
 
 
@@ -55,14 +55,14 @@
  */
 public final class BodyPosition implements EntityComponent {
     private transient int size;
-    private transient TransitionBuffer<PositionTransition> position;
+    private transient TransitionBuffer<PositionTransition3f> position;
 
     public BodyPosition() {
     }
     
     public BodyPosition( int history ) {
         this.size = (byte)history;
-        this.position = PositionTransition.createBuffer(history);    
+        this.position = PositionTransition3f.createBuffer(history);    
     }
  
     /**
@@ -77,16 +77,16 @@
         }
     }
     
-    public TransitionBuffer<PositionTransition> getBuffer() {
+    public TransitionBuffer<PositionTransition3f> getBuffer() {
         return position;
     }
  
     public void addFrame( long endTime, Vector3f pos, Quaternion quat, boolean visible ) {
-        PositionTransition trans = new PositionTransition(endTime, pos, quat, visible);
+        PositionTransition3f trans = new PositionTransition3f(endTime, pos, quat, visible);
         getBuffer().addTransition(trans);
     }        
  
-    public PositionTransition getFrame( long time ) {
+    public PositionTransition3f getFrame( long time ) {
         return getBuffer().getTransition(time);        
     }

This file,

now looks like this,

# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/sim-eth-es/src/main/java/example/es/BodyPositionCache.java
+++ b/sim-eth-es/src/main/java/example/es/BodyPositionCache.java
@@ -37,15 +37,13 @@
 package example.es;
 
 import com.simsilica.es.EntityId;
-import com.simsilica.mathd.trans.PositionTransition;
+import com.simsilica.mathd.trans.PositionTransition3f;
 import com.simsilica.mathd.trans.TransitionBuffer;
 import java.lang.ref.Reference;
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.WeakReference;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Map;
-import java.util.Set;
 
 /**
  *  BodyPosition components hold a buffer that should be shared
@@ -65,7 +63,7 @@
      *  Keeps track of the weak references that are ready to remove
      *  from our map.
      */
-    private ReferenceQueue<TransitionBuffer<PositionTransition>> refs = new ReferenceQueue<>();
+    private ReferenceQueue<TransitionBuffer<PositionTransition3f>> refs = new ReferenceQueue<>();
  
     /**
      *  A map with weakly referenced values.  We'll clean out the values
@@ -73,20 +71,20 @@
      *  is that garbage hanging around is less bad if no one is requesting
      *  it anyway.
      */
-    private Map<EntityId, WeakReference<TransitionBuffer<PositionTransition>>> map = new HashMap<>();
+    private Map<EntityId, WeakReference<TransitionBuffer<PositionTransition3f>>> map = new HashMap<>();
  
     
-    public static TransitionBuffer<PositionTransition> getBuffer( EntityId id, int size ) {
+    public static TransitionBuffer<PositionTransition3f> getBuffer( EntityId id, int size ) {
         return instance.get(id, size);
     }
  
-    protected synchronized TransitionBuffer<PositionTransition> get( EntityId id, int size ) {
+    protected synchronized TransitionBuffer<PositionTransition3f> get( EntityId id, int size ) {
     
         // See if we've already got one
-        WeakReference<TransitionBuffer<PositionTransition>> result = map.get(id);
+        WeakReference<TransitionBuffer<PositionTransition3f>> result = map.get(id);
         if( result == null || result.get() == null ) {
             // Need to create a new one
-            TransitionBuffer<PositionTransition> buffer = PositionTransition.createBuffer(size);
+            TransitionBuffer<PositionTransition3f> buffer = PositionTransition3f.createBuffer(size);
             result = new WeakReference<>(buffer);
             map.put(id, result);    
         }

This file has only two changes,

# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/sim-eth-es/src/main/java/example/view/HudLabelState.java
+++ b/sim-eth-es/src/main/java/example/view/HudLabelState.java
@@ -36,41 +36,29 @@
 
 package example.view;
 
-import java.util.*;
-import java.util.concurrent.*;
 
 import org.slf4j.*;
 
 import com.jme3.app.Application;
 import com.jme3.app.state.BaseAppState;
-import com.jme3.asset.AssetManager;
 import com.jme3.math.*;
 import com.jme3.renderer.Camera;
-import com.jme3.material.Material;
-import com.jme3.renderer.Camera;
 import com.jme3.scene.*;
-import com.jme3.texture.Texture;
-import com.jme3.util.SafeArrayList;
 
 import com.simsilica.lemur.*;
 import com.simsilica.lemur.style.ElementId;
 
-import com.simsilica.ethereal.EtherealClient;
-import com.simsilica.ethereal.SharedObject;
-import com.simsilica.ethereal.SharedObjectListener;
 import com.simsilica.ethereal.TimeSource; 
 
 import com.simsilica.es.*;
 
-import com.simsilica.mathd.trans.PositionTransition;
+import com.simsilica.mathd.trans.PositionTransition3f;
 import com.simsilica.mathd.trans.TransitionBuffer;
 
 import example.ConnectionState;
 import example.GameSessionState;
 import example.Main;
 import example.es.BodyPosition;
-import example.net.GameSessionListener;
-import example.net.client.GameSessionClientService;
 
 /**
  *  Displays a HUD label for any entity with a BodyPosition and a Name.
@@ -160,7 +148,7 @@
         boolean visible;
         boolean isPlayerEntity;        
         
-        TransitionBuffer<PositionTransition> buffer;
+        TransitionBuffer<PositionTransition3f> buffer;
         
         public LabelHolder( Entity entity ) {
             this.entity = entity;
@@ -216,7 +204,7 @@
             // pull an interpolated value.  To do this, we grab the
             // span of time that contains the time we want.  PositionTransition
             // represents a starting and an ending pos+rot over a span of time.
-            PositionTransition trans = buffer.getTransition(time);
+            PositionTransition3f trans = buffer.getTransition(time);
             if( trans != null ) {
                 Vector3f pos = trans.getPosition(time, true);
                 setVisible(trans.getVisibility(time));       

this file has two changes.

# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/sim-eth-es/src/main/java/example/view/ModelViewState.java
+++ b/sim-eth-es/src/main/java/example/view/ModelViewState.java
@@ -37,7 +37,6 @@
 package example.view;
 
 import java.util.*;
-import java.util.concurrent.*;
 
 import org.slf4j.*;
 
@@ -45,25 +44,16 @@
 import com.jme3.app.state.BaseAppState;
 import com.jme3.asset.AssetManager;
 import com.jme3.math.*;
-import com.jme3.renderer.Camera;
 import com.jme3.material.Material;
-import com.jme3.renderer.Camera;
 import com.jme3.scene.*;
 import com.jme3.scene.shape.*;
 import com.jme3.texture.Texture;
-import com.jme3.util.SafeArrayList;
 
 import com.simsilica.lemur.*;
-import com.simsilica.lemur.style.ElementId;
 
-import com.simsilica.ethereal.EtherealClient;
-import com.simsilica.ethereal.SharedObject;
-import com.simsilica.ethereal.SharedObjectListener;
-import com.simsilica.ethereal.TimeSource; 
-
 import com.simsilica.es.*;
 
-import com.simsilica.mathd.trans.PositionTransition;
+import com.simsilica.mathd.trans.PositionTransition3f;
 import com.simsilica.mathd.trans.TransitionBuffer;
 
 import example.ConnectionState;
@@ -71,8 +61,6 @@
 import example.Main;
 import example.TimeState;
 import example.es.*;
-import example.net.GameSessionListener;
-import example.net.client.GameSessionClientService;
 
 /**
  *  Displays the models for the various physics objects.
@@ -256,7 +244,7 @@
         boolean visible;
         boolean localPlayerShip;
  
-        TransitionBuffer<PositionTransition> buffer;
+        TransitionBuffer<PositionTransition3f> buffer;
         
         public Mob( Entity entity ) {
             this.entity = entity;
@@ -289,7 +277,7 @@
             // pull an interpolated value.  To do this, we grab the
             // span of time that contains the time we want.  PositionTransition
             // represents a starting and an ending pos+rot over a span of time.
-            PositionTransition trans = buffer.getTransition(time);
+            PositionTransition3f trans = buffer.getTransition(time);
             if( trans != null ) {
                 spatial.setLocalTranslation(trans.getPosition(time, true));
                 spatial.setLocalRotation(trans.getRotation(time, true));

I haven’t committed so can reverse if want to leave them as is.

Looks fine to me.

Do you have the ability to commit to this repo and that’s why you didn’t just do a PR?

I’m cool with these kinds of tweaks either way… I was just curious. For small things like this, if you have the ability to commit directly then it’s ok to just make them. They can always be reverted if it’s bad for some reason. Just let me know you’ve done it because I haven’t set up any notifications on these repos.

Yes, I was just following normal procedure to let you know what I am up to.

Yeah, I was just trying to make things easier for you. If you commit changes then just drop a link to the commit here and that’s fine, too.

Unless it’s something controversial or big enough that you worry about wasting time, etc… Then a pre-heads-up is better, I guess.

I do have one question about the gradle.build.

I updated the static statements for these,

so they would always use latest versions.

    compile "com.simsilica:sio2:[1.0,)"
//    compile "com.simsilica:sim-math:1.1.1"  // break sim-ethereal 1.2.1
    compile "com.simsilica:sim-math:[1.0,)"
    compile "com.simsilica:sim-ethereal:[1.0,)"  

or do you want to keep these all static with current versions?

What breaks?

I’m ok with using the wild cards like you have them for these projects. They don’t work well for published maven artifacts but for these demos and stuff will probably save a lot of time.

Thats an artifact from something you were doing I believe.

Im seeing only one error that am about to hunt down and its just about not finding the assetloader. I dont think they are related.

These must of been part of core when you wrote these projects,

    compile "org.jmonkeyengine:jme3-plugins:$jmeVersion"
    compile "org.jmonkeyengine:jme3-blender:$jmeVersion"
    compile "org.jmonkeyengine:jme3-jogg:$jmeVersion"

fixes the assetloader error.

Blender should not be needed in these projects… I don’t think I had sounds either.

I’d be interested to know what exact errors these fix.

18:31:54,078 WARN  [AssetConfig] Cannot find loader com.jme3.scene.plugins.ogre.MeshLoader
18:31:54,079 WARN  [AssetConfig] Cannot find loader com.jme3.scene.plugins.ogre.SkeletonLoader
18:31:54,079 WARN  [AssetConfig] Cannot find loader com.jme3.scene.plugins.ogre.MaterialLoader
18:31:54,080 WARN  [AssetConfig] Cannot find loader com.jme3.scene.plugins.ogre.SceneLoader
18:31:54,080 WARN  [AssetConfig] Cannot find loader com.jme3.scene.plugins.blender.BlenderModelLoader
18:31:54,082 WARN  [AssetConfig] Cannot find loader com.jme3.scene.plugins.fbx.FbxLoader
18:31:54,083 WARN  [AssetConfig] Cannot find loader com.jme3.scene.plugins.gltf.GltfLoader
18:31:54,083 WARN  [AssetConfig] Cannot find loader com.jme3.scene.plugins.gltf.BinLoader
18:31:54,084 WARN  [AssetConfig] Cannot find loader com.jme3.scene.plugins.gltf.GlbLoader
18:31:54,086 WARN  [AssetConfig] Cannot find loader com.jme3.audio.plugins.OGGLoader

I can remove them since warnings. Up to you.

Way back when @nehon did tell me to include the blender loader always, may of been for some other reason like SDK though.

The only model is the spinning logo.

Edit: There is the fighter in simethereal also.

Edit: Only compiler warnings when building so maybe jme should not throw warnings unless the asset is actually there?

Went ahead and just removed the added depends since didnt need.

Pushed the PR.

Those warnings are JME stuff… it has some config file that tries to load them all “just in case”… but it’s dumb. I’m not sure what the right solution is, though.

No reason to suck in dependencies unnecessarily, though. So thanks for removing them.

Edit: merged. Thanks.