当前位置: 首页>>代码示例>>Java>>正文


Java PointLight.setRadius方法代码示例

本文整理汇总了Java中com.jme3.light.PointLight.setRadius方法的典型用法代码示例。如果您正苦于以下问题:Java PointLight.setRadius方法的具体用法?Java PointLight.setRadius怎么用?Java PointLight.setRadius使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.light.PointLight的用法示例。


在下文中一共展示了PointLight.setRadius方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: activate

import com.jme3.light.PointLight; //导入方法依赖的package包/类
@Override
public void activate(Player player) {
	if (!isPlaced) return;
	isActive = !isActive;

	if (isActive) {
		light = new PointLight();
		light.setColor(lightColor);
		light.setRadius(lightRadius);
		light.setPosition(getLocation().add(LIGHT_OFFSET));

		world.getNode().addLight(light);

		slow = new SlowInRadius(getLocation(), slowRadius, slowPower);

		// if you are not the client, create the slow effect
		if(world.getWorldType() != WorldType.CLIENT)
			world.makeLocalEffect(slow);

	} else {
		onDeactivate();
	}
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:24,代码来源:AbstractTorch.java

示例2: simpleInitApp

import com.jme3.light.PointLight; //导入方法依赖的package包/类
@Override
    public void simpleInitApp() {
        Torus torus = new Torus(10, 6, 1, 3);
//        Torus torus = new Torus(50, 30, 1, 3);
        Geometry g = new Geometry("Torus Geom", torus);
        g.rotate(-FastMath.HALF_PI, 0, 0);
        g.center();
//        g.move(0, 1, 0);
        
        Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
        mat.setFloat("Shininess", 32f);
        mat.setBoolean("UseMaterialColors", true);
        mat.setColor("Ambient",  ColorRGBA.Black);
        mat.setColor("Diffuse",  ColorRGBA.White);
        mat.setColor("Specular", ColorRGBA.White);
//        mat.setBoolean("VertexLighting", true);
//        mat.setBoolean("LowQuality", true);
        g.setMaterial(mat);

        rootNode.attachChild(g);

        lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
        lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
        rootNode.attachChild(lightMdl);

        pl = new PointLight();
        pl.setColor(ColorRGBA.Green);
        pl.setRadius(4f);
        rootNode.addLight(pl);

        DirectionalLight dl = new DirectionalLight();
        dl.setColor(ColorRGBA.Red);
        dl.setDirection(new Vector3f(0, 1, 0));
        rootNode.addLight(dl);
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:36,代码来源:TestLightRadius.java

示例3: initLighting

import com.jme3.light.PointLight; //导入方法依赖的package包/类
private void initLighting() {
    // lights
    AmbientLight ambientLight = new AmbientLight();
    //ambientLight.setColor(ColorRGBA.White.mult(1f));
    rootNode.addLight(ambientLight);

    PointLight light = new PointLight();
    light.setColor(ColorRGBA.White);
    light.setPosition(new Vector3f(0f, 10f, 0f));
    light.setRadius(50f);
    rootNode.addLight(light);
}
 
开发者ID:dwhuang,项目名称:SMILE,代码行数:13,代码来源:MainApp.java

示例4: setupLights

import com.jme3.light.PointLight; //导入方法依赖的package包/类
public void setupLights() {
    AmbientLight al = new AmbientLight();
    al.setColor(new ColorRGBA(0.1f, 0.1f, 0.1f, 1));
    rootNode.addLight(al);

    SpotLight sl = new SpotLight();
    sl.setColor(ColorRGBA.White.mult(1.0f));
    sl.setPosition(new Vector3f(1.2074411f, 10.6868908f, 4.1489987f));
    sl.setDirection(sl.getPosition().mult(-1));
    sl.setSpotOuterAngle(0.1f);
    sl.setSpotInnerAngle(0.004f);
    rootNode.addLight(sl);

    //pointlight to fake indirect light coming from the ground
    PointLight pl = new PointLight();
    pl.setColor(ColorRGBA.White.mult(1.5f));
    pl.setPosition(new Vector3f(0, 0, 1));
    pl.setRadius(2);
    rootNode.addLight(pl);

    SpotLightShadowRenderer shadows = new SpotLightShadowRenderer(assetManager, 1024);
    shadows.setLight(sl);
    shadows.setShadowIntensity(0.3f);
    shadows.setEdgeFilteringMode(EdgeFilteringMode.PCF8);
    viewPort.addProcessor(shadows);

    FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
    SSAOFilter filter = new SSAOFilter(0.10997847f,0.440001f,0.39999998f,-0.008000026f);;
    fpp.addFilter(filter);
    fpp.addFilter(new FXAAFilter());
    fpp.addFilter(new FXAAFilter());

    viewPort.addProcessor(fpp);
}
 
开发者ID:xbuf,项目名称:jme3_xbuf,代码行数:35,代码来源:TestJaimeJ3o.java

示例5: setupLights

import com.jme3.light.PointLight; //导入方法依赖的package包/类
public void setupLights() {
	AmbientLight al = new AmbientLight();
	al.setColor(new ColorRGBA(0.1f, 0.1f, 0.1f, 1));
	rootNode.addLight(al);

	SpotLight sl = new SpotLight();
	sl.setColor(ColorRGBA.White.mult(1.0f));
	sl.setPosition(new Vector3f(1.2074411f, 10.6868908f, 4.1489987f));
	sl.setDirection(sl.getPosition().mult(-1));
	sl.setSpotOuterAngle(0.1f);
	sl.setSpotInnerAngle(0.004f);
	rootNode.addLight(sl);

	//pointlight to fake indirect light coming from the ground
	PointLight pl = new PointLight();
	pl.setColor(ColorRGBA.White.mult(1.5f));
	pl.setPosition(new Vector3f(0, 0, 1));
	pl.setRadius(2);
	rootNode.addLight(pl);

	SpotLightShadowRenderer shadows = new SpotLightShadowRenderer(assetManager, 1024);
	shadows.setLight(sl);
	shadows.setShadowIntensity(0.3f);
	shadows.setEdgeFilteringMode(EdgeFilteringMode.PCF8);
	viewPort.addProcessor(shadows);

	FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
	SSAOFilter filter = new SSAOFilter(0.10997847f,0.440001f,0.39999998f,-0.008000026f);;
	fpp.addFilter(filter);
	fpp.addFilter(new FXAAFilter());
	fpp.addFilter(new FXAAFilter());

	viewPort.addProcessor(fpp);
}
 
开发者ID:xbuf,项目名称:jme3_xbuf,代码行数:35,代码来源:TestXbufWithMaterialHook.java

示例6: createPointLight

import com.jme3.light.PointLight; //导入方法依赖的package包/类
private static PointLight createPointLight(NamedNodeMap map) {
    Vector3f translation = XMLUtils.parseFloat3(getAttrContent("translation", map));
    ColorRGBA color = XMLUtils.parseColor(getAttrContent("color", map));
    float intensity = XMLUtils.parseFloat("intensity", map);
    float radius = XMLUtils.parseFloat("radius", map);
    String name = getAttrContent("name", map);

    PointLight pointlight = new PointLight();
    pointlight.setName(name);
    pointlight.setPosition(translation);
    pointlight.setRadius(radius);
    pointlight.setColor(color.mult(intensity));
    return pointlight;
}
 
开发者ID:samynk,项目名称:DArtE,代码行数:15,代码来源:GameSceneLoader.java

示例7: setupLamplight

import com.jme3.light.PointLight; //导入方法依赖的package包/类
private void setupLamplight() {
    lamp = new PointLight();
    lamp.setColor(ColorRGBA.Yellow);
    lamp.setRadius(4f);
    lamp.setPosition(cam.getLocation());
    rootNode.addLight(lamp);
}
 
开发者ID:mosstest,项目名称:mosstest,代码行数:8,代码来源:RenderProcessor.java

示例8: linkToWorld

import com.jme3.light.PointLight; //导入方法依赖的package包/类
@Override
public void linkToWorld(World world, Vector3f location, int id) {
	super.linkToWorld(world, location, id);
	if (isActive) {
		light = new PointLight();
		light.setColor(lightColor);
		light.setRadius(lightRadius);
		light.setPosition(getLocation().add(LIGHT_OFFSET));
		world.getNode().addLight(light);
	}
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:12,代码来源:AbstractTorch.java

示例9: simpleInitApp

import com.jme3.light.PointLight; //导入方法依赖的package包/类
@Override
    public void simpleInitApp() {
        viewPort.addProcessor(this);
        renderManager.setForcedTechnique("GBuf");

//        flyCam.setEnabled(false);
        cam.setLocation(new Vector3f(4.8037705f, 4.851632f, 10.789033f));
        cam.setRotation(new Quaternion(-0.05143692f, 0.9483723f, -0.21131563f, -0.230846f));

        Node tank = (Node) assetManager.loadModel("Models/HoverTank/Tank2.mesh.xml");
        
        //tankMesh.getMaterial().setColor("Specular", ColorRGBA.Black);
        rootNode.attachChild(tank);

        display1 = new Picture("Picture");
        display1.move(0, 0, -1); // make it appear behind stats view
        display2 = (Picture) display1.clone();
        display3 = (Picture) display1.clone();
        display4 = (Picture) display1.clone();
        display  = (Picture) display1.clone();

        ColorRGBA[] colors = new ColorRGBA[]{
            ColorRGBA.White,
            ColorRGBA.Blue,
            ColorRGBA.Cyan,
            ColorRGBA.DarkGray,
            ColorRGBA.Green,
            ColorRGBA.Magenta,
            ColorRGBA.Orange,
            ColorRGBA.Pink,
            ColorRGBA.Red,
            ColorRGBA.Yellow
        };

        for (int i = 0; i < 3; i++){
            PointLight pl = new PointLight();
            float angle = 0.314159265f * i;
            pl.setPosition( new Vector3f(FastMath.cos(angle)*2f, 0,
                                         FastMath.sin(angle)*2f));
            pl.setColor(colors[i]);
            pl.setRadius(5);
            rootNode.addLight(pl);
            display.addLight(pl);
        }
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:46,代码来源:TestMultiRenderTarget.java

示例10: simpleInitApp

import com.jme3.light.PointLight; //导入方法依赖的package包/类
@Override
    public void simpleInitApp() {
        Geometry teapot = (Geometry) assetManager.loadModel("Models/Teapot/Teapot.obj");
        TangentBinormalGenerator.generate(teapot.getMesh(), true);

        teapot.setLocalScale(2f);
        Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
//        mat.selectTechnique("GBuf");
        mat.setFloat("Shininess", 12);
        mat.setBoolean("UseMaterialColors", true);

//        mat.setTexture("ColorRamp", assetManager.loadTexture("Textures/ColorRamp/cloudy.png"));
//
//        mat.setBoolean("VTangent", true);
//        mat.setBoolean("Minnaert", true);
//        mat.setBoolean("WardIso", true);
//        mat.setBoolean("VertexLighting", true);
//        mat.setBoolean("LowQuality", true);
//        mat.setBoolean("HighQuality", true);

        mat.setColor("Ambient",  ColorRGBA.Black);
        mat.setColor("Diffuse",  ColorRGBA.Gray);
        mat.setColor("Specular", ColorRGBA.Gray);
        
        teapot.setMaterial(mat);
        rootNode.attachChild(teapot);

        lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
        lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
        lightMdl.getMesh().setStatic();
        rootNode.attachChild(lightMdl);

        pl = new PointLight();
        pl.setColor(ColorRGBA.White);
        pl.setRadius(4f);
        rootNode.addLight(pl);

        DirectionalLight dl = new DirectionalLight();
        dl.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
        dl.setColor(ColorRGBA.Green);
        rootNode.addLight(dl);
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:43,代码来源:TestSimpleLighting.java

示例11: simpleInitApp

import com.jme3.light.PointLight; //导入方法依赖的package包/类
@Override
    public void simpleInitApp() {
        Torus torus = new Torus(10, 6, 1, 3);
//        Torus torus = new Torus(50, 30, 1, 3);
        Geometry g = new Geometry("Torus Geom", torus);
        g.rotate(-FastMath.HALF_PI, 0, 0);
        g.center();
//        g.move(0, 1, 0);
        
        Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
        mat.setFloat("Shininess", 32f);
        mat.setBoolean("UseMaterialColors", true);
        mat.setColor("Ambient",  ColorRGBA.Black);
        mat.setColor("Diffuse",  ColorRGBA.White);
        mat.setColor("Specular", ColorRGBA.White);
//        mat.setBoolean("VertexLighting", true);
//        mat.setBoolean("LowQuality", true);
        g.setMaterial(mat);

        rootNode.attachChild(g);

        Geometry lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
        lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
        
        movingNode=new Node("lightParentNode");
        movingNode.attachChild(lightMdl);  
        rootNode.attachChild(movingNode);

        PointLight pl = new PointLight();
        pl.setColor(ColorRGBA.Green);
        pl.setRadius(4f);
        rootNode.addLight(pl);
        
        LightNode lightNode=new LightNode("pointLight", pl);
        movingNode.attachChild(lightNode);

        DirectionalLight dl = new DirectionalLight();
        dl.setColor(ColorRGBA.Red);
        dl.setDirection(new Vector3f(0, 1, 0));
        rootNode.addLight(dl);
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:42,代码来源:TestLightNode.java

示例12: simpleInitApp

import com.jme3.light.PointLight; //导入方法依赖的package包/类
@Override
    public void simpleInitApp() {
        viewPort.addProcessor(this);

//        flyCam.setEnabled(false);
        cam.setLocation(new Vector3f(4.8037705f, 4.851632f, 10.789033f));
        cam.setRotation(new Quaternion(-0.05143692f, 0.9483723f, -0.21131563f, -0.230846f));

        Node tank = (Node) assetManager.loadModel("Models/HoverTank/Tank2.mesh.xml");
        
        //tankMesh.getMaterial().setColor("Specular", ColorRGBA.Black);
        rootNode.attachChild(tank);

        display1 = new Picture("Picture");
        display1.move(0, 0, -1); // make it appear behind stats view
        display2 = (Picture) display1.clone();
        display3 = (Picture) display1.clone();
        display4 = (Picture) display1.clone();
        display  = (Picture) display1.clone();

        ColorRGBA[] colors = new ColorRGBA[]{
            ColorRGBA.White,
            ColorRGBA.Blue,
            ColorRGBA.Cyan,
            ColorRGBA.DarkGray,
            ColorRGBA.Green,
            ColorRGBA.Magenta,
            ColorRGBA.Orange,
            ColorRGBA.Pink,
            ColorRGBA.Red,
            ColorRGBA.Yellow
        };

        pls = new PointLight[3];
        for (int i = 0; i < pls.length; i++){
            PointLight pl = new PointLight();
            pl.setColor(colors[i % colors.length]);
            pl.setRadius(5);
            display.addLight(pl);
            pls[i] = pl;
        }
    }
 
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:43,代码来源:TestMultiRenderTarget.java


注:本文中的com.jme3.light.PointLight.setRadius方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。