Tabnine Logo
PointLight.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.badlogic.gdx.graphics.g3d.environment.PointLight
constructor

Best Java code snippets using com.badlogic.gdx.graphics.g3d.environment.PointLight.<init> (Showing top 7 results out of 315)

origin: libgdx/libgdx

@Override
public void create () {
  super.create();
  environment.clear();
  environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.2f, 0.2f, 0.2f, 1.0f));
  environment.add(dirLight = new DirectionalLight().set(0.8f, 0.2f, 0.2f, -1f, -2f, -0.5f));
  environment.add(pointLight = new PointLight().set(0.2f, 0.8f, 0.2f, 0f, 0f, 0f, 100f));
  ModelBuilder mb = new ModelBuilder();
  lightModel = mb.createSphere(1, 1, 1, 10, 10, new Material(ColorAttribute.createDiffuse(1, 1, 1, 1)), Usage.Position);
  lightModel.nodes.get(0).parts.get(0).setRenderable(pLight = new Renderable());
}
origin: libgdx/libgdx

protected void randomizeLights () {
  int pointLights = MathUtils.random(5);
  int directionalLights = MathUtils.random(5);
  DefaultShader.Config config = new Config();
  config.numDirectionalLights = directionalLights;
  config.numPointLights = pointLights;
  config.numSpotLights = 0;
  modelBatch.dispose();
  modelBatch = new ModelBatch(new DefaultShaderProvider(config));
  environment = new Environment();
  environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1.f));
  for (int i = 0; i < pointLights; i++) {
    environment.add(new PointLight().set(randomColor(), randomPosition(), MathUtils.random(10f)));
  }
  for (int i = 0; i < directionalLights; i++) {
    environment.add(new DirectionalLight().set(randomColor(), randomPosition()));
  }
}
origin: libgdx/libgdx

this.pointLights = new PointLight[lighting && config.numPointLights > 0 ? config.numPointLights : 0];
for (int i = 0; i < pointLights.length; i++)
  pointLights[i] = new PointLight();
this.spotLights = new SpotLight[lighting && config.numSpotLights > 0 ? config.numSpotLights : 0];
for (int i = 0; i < spotLights.length; i++)
origin: libgdx/libgdx

this.pointLights = new PointLight[lighting && config.numPointLights > 0 ? config.numPointLights : 0];
for (int i = 0; i < pointLights.length; i++)
  pointLights[i] = new PointLight();
this.spotLights = new SpotLight[lighting && config.numSpotLights > 0 ? config.numSpotLights : 0];
for (int i = 0; i < spotLights.length; i++)
origin: bladecoder/bladecoder-adventure-engine

private void createEnvirontment() {
  environment = new Environment();
  // environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.8f,
  // 0.8f, 0.8f, 1f));
  // environment.add(new DirectionalLight().set(1f, 1f, 1f, 1f, -1f,
  // -1f));
  if (celLight == null) {
    Node n = null;
    if (currentSource != null)
      n = ((ModelCacheEntry) currentSource).modelInstance.getNode(celLightName);
    if (n != null) {
      celLight = new PointLight().set(1f, 1f, 1f, n.translation, 1f);
    } else {
      celLight = new PointLight().set(1f, 1f, 1f, 0.5f, 1f, 1f, 1f);
    }
  }
  environment.add(celLight);
  if (renderShadow) {
    shadowEnvironment = new Environment();
    shadowEnvironment.add(shadowLight);
    shadowEnvironment.shadowMap = shadowLight;
  }
}
origin: jsjolund/GdxDemo3D

private void spawnLight(BlenderLight bLight) {
  Vector3 direction = new Vector3(V3_DOWN);
  direction.rotate(Vector3.X, bLight.rotation.x);
  direction.rotate(Vector3.Z, bLight.rotation.z);
  direction.rotate(Vector3.Y, bLight.rotation.y);
  // TODO: Don't know how to map lamp intensity in blender to libgdx correctly
  float intensity = bLight.lamp_energy;
  float cutoffAngle = bLight.lamp_falloff;
  float exponent = 1;
  if (bLight.type.equals("PointLamp")) {
    BaseLight<?> light = new PointLight().set(
        bLight.lamp_color.r, bLight.lamp_color.g, bLight.lamp_color.b,
        bLight.position, bLight.lamp_energy);
    lights.add(light);
  } else if (bLight.type.equals("SpotLamp")) {
    BaseLight<?> light = new SpotLight().set(bLight.lamp_color, bLight.position,
        direction, intensity, cutoffAngle, exponent);
    lights.add(light);
  } else if (bLight.type.equals("SunLamp")) {
    BaseLight<?> light = new DirectionalLight().set(
        bLight.lamp_color.r,
        bLight.lamp_color.g,
        bLight.lamp_color.b,
        direction.x, direction.y, direction.z);
    lights.add(light);
    shadowCameraDirection.set(direction);
  }
}
origin: com.badlogicgames.gdx/gdx

this.pointLights = new PointLight[lighting && config.numPointLights > 0 ? config.numPointLights : 0];
for (int i = 0; i < pointLights.length; i++)
  pointLights[i] = new PointLight();
this.spotLights = new SpotLight[lighting && config.numSpotLights > 0 ? config.numSpotLights : 0];
for (int i = 0; i < spotLights.length; i++)
com.badlogic.gdx.graphics.g3d.environmentPointLight<init>

Popular methods of PointLight

  • set
  • equals

Popular in Java

  • Finding current android device location
  • onRequestPermissionsResult (Fragment)
  • requestLocationUpdates (LocationManager)
  • getContentResolver (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now