use of ilargia.egdx.logicbricks.component.scene.CConeLight in project Entitas-Java by Rubentxu.
the class SceneEntity method replaceCConeLight.
public SceneEntity replaceCConeLight(int raysNum, Color color, float distance, Vector2 position, float directionDegree, float coneDegree) {
CConeLight component = (CConeLight) recoverComponent(SceneComponentsLookup.CConeLight);
if (component == null) {
component = new CConeLight(raysNum, color, distance, position, directionDegree, coneDegree);
} else {
component.raysNum = raysNum;
component.color = color;
component.distance = distance;
component.position = position;
component.directionDegree = directionDegree;
component.coneDegree = coneDegree;
component.light = null;
}
replaceComponent(SceneComponentsLookup.CConeLight, component);
return this;
}
use of ilargia.egdx.logicbricks.component.scene.CConeLight in project Entitas-Java by Rubentxu.
the class SceneEntity method addCConeLight.
public SceneEntity addCConeLight(int raysNum, Color color, float distance, Vector2 position, float directionDegree, float coneDegree) {
CConeLight component = (CConeLight) recoverComponent(SceneComponentsLookup.CConeLight);
if (component == null) {
component = new CConeLight(raysNum, color, distance, position, directionDegree, coneDegree);
} else {
component.raysNum = raysNum;
component.color = color;
component.distance = distance;
component.position = position;
component.directionDegree = directionDegree;
component.coneDegree = coneDegree;
component.light = null;
}
addComponent(SceneComponentsLookup.CConeLight, component);
return this;
}
use of ilargia.egdx.logicbricks.component.scene.CConeLight in project Entitas-Java by Rubentxu.
the class SceneManagerGDX method initialize.
@Override
public void initialize() {
if (engine.getManager(PhysicsManagerGDX.class) == null)
throw new EntitasException("SceneManagerGDX", "SceneManagerGDX needs load PhysicsManagerGDX on the engine");
physics = engine.getManager(PhysicsManagerGDX.class);
rayHandler = new RayHandler(physics.getPhysics());
PreferencesManagerGDX preferences = engine.getManager(PreferencesManagerGDX.class);
rayHandler.setAmbientLight(preferences.AMBIENT_LIGHT);
rayHandler.setBlur(preferences.BLUR);
rayHandler.setCulling(preferences.CULLING);
rayHandler.setGammaCorrection(preferences.GAMMA_CORRECTION);
rayHandler.setBlurNum(preferences.BLUR_NUM);
rayHandler.setShadows(preferences.SHADOWS);
rayHandler.useDiffuseLight(preferences.USE_DIFFUSE_LIGHT);
//rayHandler.update();
AssetsManagerGDX assetsManager = engine.getManager(AssetsManagerGDX.class);
for (EntityFactory factory : entityFactories.values()) {
factory.loadAssets(engine);
}
assetsManager.finishLoading();
addLightFactory(PointLight.class, (SceneManager sceneManager, IComponent c) -> {
CPointLight component = (CPointLight) c;
return new PointLight(rayHandler, component.raysNum, component.color, component.distance, component.position.x, component.position.y);
});
addLightFactory(DirectionalLight.class, (SceneManager sceneManager, IComponent c) -> {
LogManagerGDX.debug("SceneManager", "create directional ligth");
CDirectionalLight component = (CDirectionalLight) c;
return new DirectionalLight(rayHandler, component.raysNum, component.color, component.direcction);
});
addLightFactory(ChainLight.class, (SceneManager sceneManager, IComponent c) -> {
LogManagerGDX.debug("SceneManager", "create ChainLight");
CChainLight component = (CChainLight) c;
return new ChainLight(rayHandler, component.raysNum, component.color, component.distance, component.rayDirecction, component.chain);
});
addLightFactory(ConeLight.class, (SceneManager sceneManager, IComponent c) -> {
LogManagerGDX.debug("SceneManager", "create ConeLight");
CConeLight component = (CConeLight) c;
return new ConeLight(rayHandler, component.raysNum, component.color, component.distance, component.position.x, component.position.y, component.directionDegree, component.coneDegree);
});
}
Aggregations