use of org.rajawali3d.renderer.AFrameTask in project Rajawali by Rajawali.
the class Scene method setSkybox.
/**
* Creates a skybox with the specified 6 {@link Bitmap} textures.
*
* @param bitmaps {@link Bitmap} array containing the cube map textures.
*/
public boolean setSkybox(Bitmap[] bitmaps) {
final AFrameTask task = new AFrameTask() {
@Override
protected void doTask() {
for (int i = 0, j = mCameras.size(); i < j; ++i) mCameras.get(i).setFarPlane(1000);
}
};
final Cube skybox = new Cube(700, true);
final CubeMapTexture texture = new CubeMapTexture("bitmap_skybox", bitmaps);
texture.isSkyTexture(true);
final Material material = new Material();
material.setColorInfluence(0);
try {
material.addTexture(texture);
} catch (TextureException e) {
RajLog.e(e.getMessage());
}
skybox.setMaterial(material);
synchronized (mNextCameraLock) {
mNextSkybox = skybox;
}
return internalOfferTask(task);
}
use of org.rajawali3d.renderer.AFrameTask in project Rajawali by Rajawali.
the class Scene method removeLight.
/**
* Requests the removal of a light from the scene.
*
* @param light {@link ALight} child to be removed.
* @return boolean True if the child was successfully queued for removal.
*/
public boolean removeLight(final ALight light) {
final AFrameTask task = new AFrameTask() {
@Override
protected void doTask() {
mLights.remove(light);
mLightsDirty = true;
}
};
return internalOfferTask(task);
}
use of org.rajawali3d.renderer.AFrameTask in project Rajawali by Rajawali.
the class Scene method addLight.
/**
* Requests the addition of a light to the scene. The light
* will be added to the end of the list.
*
* @param light {@link ALight} to be added.
* @return True if the light was successfully queued for addition.
*/
public boolean addLight(final ALight light) {
final AFrameTask task = new AFrameTask() {
@Override
protected void doTask() {
mLights.add(light);
mLightsDirty = true;
}
};
return internalOfferTask(task);
}
Aggregations