Copyright 2012 Mobialia
http://www.mobialia.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to ...
If you think the Android project jmini3d listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package jmini3d;
/*fromwww.java2s.com*/import java.util.ArrayList;
import jmini3d.light.Light;
publicclass Scene {
publicint shaderKey = -1;
public Camera camera = new Camera();
public ArrayList<Object3d> children = new ArrayList<Object3d>();
public ArrayList<Object3d> hud = new ArrayList<Object3d>();
public ArrayList<Light> lights = new ArrayList<Light>();
public ArrayList<Object> unload = new ArrayList<Object>();
public Color4 backgroundColor = new Color4(0, 0, 0, 255);
int width = -1, height = -1;
public Color4 getBackgroundColor() {
return backgroundColor;
}
publicvoid addLight(Light l) {
lights.add(l);
shaderKey = -1;
}
publicvoid addChild(Object3d o) {
if (children.contains(o)) {
return;
}
children.add(o);
}
publicvoid removeChild(Object3d o) {
if (children.contains(o)) {
children.remove(o);
}
}
publicvoid addHudElement(Object3d o) {
if (hud.contains(o)) {
return;
}
hud.add(o);
}
public Camera getCamera() {
return camera;
}
publicvoid unload(Object obj) {
unload.add(obj);
}
publicvoid reset() {
children.clear();
hud.clear();
unload.clear();
lights.clear();
}
publicvoid setViewPort(int width, int height) {
if (this.width != width || this.height != height) {
this.width = width;
this.height = height;
camera.setWidth(width);
camera.setHeight(height);
onViewPortChanged(width, height);
}
}
publicvoid onViewPortChanged(int width, int height) {
}
}