|
|
@ -29,13 +29,11 @@ |
|
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
package jme3test.model; |
|
|
|
package jme3test.model; |
|
|
|
|
|
|
|
|
|
|
|
import com.jme3.app.SimpleApplication; |
|
|
|
import com.jme3.app.SimpleApplication; |
|
|
|
import com.jme3.light.PointLight; |
|
|
|
import com.jme3.light.PointLight; |
|
|
|
import com.jme3.light.DirectionalLight; |
|
|
|
import com.jme3.light.DirectionalLight; |
|
|
|
import com.jme3.material.Material; |
|
|
|
|
|
|
|
import com.jme3.math.Vector3f; |
|
|
|
import com.jme3.math.Vector3f; |
|
|
|
import com.jme3.math.ColorRGBA; |
|
|
|
import com.jme3.math.ColorRGBA; |
|
|
|
import com.jme3.math.FastMath; |
|
|
|
import com.jme3.math.FastMath; |
|
|
@ -43,8 +41,7 @@ import com.jme3.scene.Spatial; |
|
|
|
import com.jme3.scene.Geometry; |
|
|
|
import com.jme3.scene.Geometry; |
|
|
|
import com.jme3.scene.shape.Sphere; |
|
|
|
import com.jme3.scene.shape.Sphere; |
|
|
|
|
|
|
|
|
|
|
|
public class TestOgreLoading extends SimpleApplication |
|
|
|
public class TestOgreLoading extends SimpleApplication { |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float angle1; |
|
|
|
float angle1; |
|
|
|
float angle2; |
|
|
|
float angle2; |
|
|
@ -53,15 +50,12 @@ public class TestOgreLoading extends SimpleApplication |
|
|
|
Spatial lightMdl; |
|
|
|
Spatial lightMdl; |
|
|
|
Spatial lightMd2; |
|
|
|
Spatial lightMd2; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
public static void main(String[] args) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
TestOgreLoading app = new TestOgreLoading(); |
|
|
|
TestOgreLoading app = new TestOgreLoading(); |
|
|
|
app.start(); |
|
|
|
app.start(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void simpleInitApp() |
|
|
|
public void simpleInitApp() { |
|
|
|
{ |
|
|
|
|
|
|
|
// PointLight pl = new PointLight();
|
|
|
|
// PointLight pl = new PointLight();
|
|
|
|
// pl.setPosition(new Vector3f(10, 10, -10));
|
|
|
|
// pl.setPosition(new Vector3f(10, 10, -10));
|
|
|
|
// rootNode.addLight(pl);
|
|
|
|
// rootNode.addLight(pl);
|
|
|
@ -75,11 +69,11 @@ public class TestOgreLoading extends SimpleApplication |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f)); |
|
|
|
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f)); |
|
|
|
lightMdl.setMaterial( (Material) assetManager.loadAsset("Common/Materials/RedColor.j3m")); |
|
|
|
lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m")); |
|
|
|
rootNode.attachChild(lightMdl); |
|
|
|
rootNode.attachChild(lightMdl); |
|
|
|
|
|
|
|
|
|
|
|
lightMd2 = new Geometry("Light", new Sphere(10, 10, 0.1f)); |
|
|
|
lightMd2 = new Geometry("Light", new Sphere(10, 10, 0.1f)); |
|
|
|
lightMd2.setMaterial( (Material) assetManager.loadAsset("Common/Materials/WhiteColor.j3m")); |
|
|
|
lightMd2.setMaterial(assetManager.loadMaterial("Common/Materials/WhiteColor.j3m")); |
|
|
|
rootNode.attachChild(lightMd2); |
|
|
|
rootNode.attachChild(lightMd2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -101,10 +95,8 @@ public class TestOgreLoading extends SimpleApplication |
|
|
|
rootNode.attachChild(elephant); |
|
|
|
rootNode.attachChild(elephant); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void simpleUpdate(float tpf) |
|
|
|
public void simpleUpdate(float tpf) { |
|
|
|
{ |
|
|
|
|
|
|
|
angle1 += tpf * 0.25f; |
|
|
|
angle1 += tpf * 0.25f; |
|
|
|
angle1 %= FastMath.TWO_PI; |
|
|
|
angle1 %= FastMath.TWO_PI; |
|
|
|
|
|
|
|
|
|
|
|