Browse Source

Geometry constructor with material. (#2113)

* Geometry constructor with material.

* Geometry constructor with material.
llzen44 2 years ago
parent
commit
c9d10eb6ff
1 changed files with 12 additions and 0 deletions
  1. 12 0
      jme3-core/src/main/java/com/jme3/scene/Geometry.java

+ 12 - 0
jme3-core/src/main/java/com/jme3/scene/Geometry.java

@@ -136,6 +136,18 @@ public class Geometry extends Spatial {
         this.mesh = mesh;
         this.mesh = mesh;
     }
     }
 
 
+    /**
+     * Create a geometry node with mesh data and material.
+     *
+     * @param name The name of this geometry
+     * @param mesh The mesh data for this geometry
+     * @param material The material for this geometry
+     */
+    public Geometry(String name, Mesh mesh, Material material) {
+        this(name, mesh);
+        setMaterial(material);
+    }
+
     @Override
     @Override
     public boolean checkCulling(Camera cam) {
     public boolean checkCulling(Camera cam) {
         if (isGrouped()) {
         if (isGrouped()) {