當前位置: 首頁>>代碼示例>>Java>>正文


Java Environment.set方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.graphics.g3d.Environment.set方法的典型用法代碼示例。如果您正苦於以下問題:Java Environment.set方法的具體用法?Java Environment.set怎麽用?Java Environment.set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.graphics.g3d.Environment的用法示例。


在下文中一共展示了Environment.set方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: GameScreen

import com.badlogic.gdx.graphics.g3d.Environment; //導入方法依賴的package包/類
public GameScreen(){
	spriteBatch = new SpriteBatch(); // buffer ok
	texture     = new Texture(Gdx.files.internal("bg/gameBG.jpg"));
	viewMatrix  = new Matrix4();  // matriz de visualização
	tranMatrix  = new Matrix4();  // matriz de escala
	
	// camera
	camera = new PerspectiveCamera(67.0f, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
	camera.near = 0.1f;
	camera.far  = 1000f;
	camera.position.set(0, 5, 10);
	camera.lookAt(0, 5, 0);
	camera.update();
	
	// ambiente
	environment = new Environment();
	environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 1,1,1,1));
	
	// renderizador
	modelBatch = new ModelBatch();
	p1 = new Player(1);
	p2 = new Player(2);
	
	
	
}
 
開發者ID:fmassetto,項目名稱:StreetCampusFighter,代碼行數:27,代碼來源:GameScreen.java

示例2: addBackground

import com.badlogic.gdx.graphics.g3d.Environment; //導入方法依賴的package包/類
private void addBackground(){
        decalBackground = Decal.newDecal(new TextureRegion(managerAssets.getAssetsCrafting().getTexture(NameFiles.backgroundCrafting)));
        decalBackground.setDimensions(100,200);
        decalBackground.setPosition(0,0,0);
        environment = new Environment();
//        environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 1f, 1f, 1f, 1f));
        environment.set(new ColorAttribute(ColorAttribute.Diffuse));
        environment.set(new ColorAttribute(ColorAttribute.Specular));
        environment.set(new ColorAttribute(ColorAttribute.Reflection));
        environment.add(new DirectionalLight().set(0.51f, 0.5f, 0.5f, 0f, -2f, -30f));
        Model model = managerAssets.getAssetsRaider().getModel(NameFiles.raiderFull);
        model.nodes.get(2).translation.set(-12,28.6f,-5.5f);
//        model.nodes.get(0).translation.set(0,28f,29.2f);
//        model.nodes.get(2).translation.set(0,13,-1);
        instance = new ModelInstance(model);
        instance.transform.trn(0,-20,25).rotate(0,1,0,-25);
        instance.transform.scale(1.5f,1.5f,1.5f);
    }
 
開發者ID:TudorRosca,項目名稱:enklave,代碼行數:19,代碼來源:ScreenRaider.java

示例3: Renderer

import com.badlogic.gdx.graphics.g3d.Environment; //導入方法依賴的package包/類
public Renderer(VuforiaRenderer arRenderer) {

        lights = new Environment();
        lights.set(new ColorAttribute(ColorAttribute.AmbientLight, Color.WHITE));

        camera = new PerspectiveCamera(60, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
        camera.near = 1.0F;
        camera.far = 1000.0F;
        //set camera into "Vuforia - style" direction
        camera.position.set(new Vector3(0,0,0));
        camera.lookAt(new Vector3(0,0,1));

        this.vuforiaRenderer = arRenderer;

        modelBatch = new ModelBatch();
    }
 
開發者ID:daemontus,項目名稱:VuforiaLibGDX,代碼行數:17,代碼來源:Renderer.java

示例4: GameModel

import com.badlogic.gdx.graphics.g3d.Environment; //導入方法依賴的package包/類
public GameModel(PerspectiveCamera cam, boolean [][][] collision){
    //setup the model instances
    parts = new Array<ModelInstance>();
    frame = new Array<ModelInstance>();
    shadow = new Array<ModelInstance>();

    //setup environment
    environment = new Environment();
    environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1f));
    environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));

    //setup collision matrix
    matrix = collision;

    //setup camera
    camera = cam;



}
 
開發者ID:msk610,項目名稱:Chemtris,代碼行數:21,代碼來源:GameModel.java

示例5: setEnvironmentLights

import com.badlogic.gdx.graphics.g3d.Environment; //導入方法依賴的package包/類
public void setEnvironmentLights(Array<BaseLight<?>> lights, Vector3 sunDirection) {
	environment = new Environment();
	environment.add((shadowLight = new DirectionalShadowLight(
			GameSettings.SHADOW_MAP_WIDTH,
			GameSettings.SHADOW_MAP_HEIGHT,
			GameSettings.SHADOW_VIEWPORT_WIDTH,
			GameSettings.SHADOW_VIEWPORT_HEIGHT,
			GameSettings.SHADOW_NEAR,
			GameSettings.SHADOW_FAR))
			.set(GameSettings.SHADOW_INTENSITY,
					GameSettings.SHADOW_INTENSITY,
					GameSettings.SHADOW_INTENSITY,
					sunDirection.nor()));
	environment.shadowMap = shadowLight;

	float ambientLight = GameSettings.SCENE_AMBIENT_LIGHT;
	environment.set(new ColorAttribute(ColorAttribute.AmbientLight, ambientLight, ambientLight, ambientLight, 1));
	for (BaseLight<?> light : lights) {
		environment.add(light);
	}
}
 
開發者ID:jsjolund,項目名稱:GdxDemo3D,代碼行數:22,代碼來源:GameRenderer.java

示例6: Stage3d

import com.badlogic.gdx.graphics.g3d.Environment; //導入方法依賴的package包/類
public Stage3d (float width, float height, boolean keepAspectRatio) {
	this.width = width;
	this.height = height;

	root = new Group3d();
	root.setStage3d(this);

	modelBatch = new ModelBatch();

	camera =  new Camera3d();
	environment = new Environment();
	environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.9f, 0.9f, 0.9f, 1f));
	environment.add(new DirectionalLight().set(0.8f, 0f, 0f, -1f, -0.8f, -0.2f));

	setViewport(width, height, keepAspectRatio);
}
 
開發者ID:pyros2097,項目名稱:Scene3d,代碼行數:17,代碼來源:Stage3d.java

示例7: create

import com.badlogic.gdx.graphics.g3d.Environment; //導入方法依賴的package包/類
@Override
public void create () {
	super.create();
	lights = new Environment();
	lights.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.1f, 0.1f, 0.1f, 1.f));
	lights.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -0.5f, -1.0f, -0.8f));

	shaderProvider = new TestShaderProvider();
	shaderBatch = new ModelBatch(shaderProvider);

	cam.position.set(1, 1, 1);
	cam.lookAt(0, 0, 0);
	cam.update();
	showAxes = true;

	onModelClicked("g3d/shapes/teapot.g3dj");

	shaderRoot = (hotLoadFolder != null && Gdx.app.getType() == ApplicationType.Desktop) ? Gdx.files.absolute(hotLoadFolder)
		: Gdx.files.internal("data/g3d/shaders");
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:21,代碼來源:ShaderCollectionTest.java

示例8: create

import com.badlogic.gdx.graphics.g3d.Environment; //導入方法依賴的package包/類
@Override
	public void create () {
		modelBatch = new ModelBatch(new DefaultShaderProvider());
// modelBatch = new ModelBatch();
		environment = new Environment();
		environment.set(new ColorAttribute(ColorAttribute.AmbientLight, .4f, .4f, .4f, 1f));
		environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));

		cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
		cam.position.set(10f, 10f, 10f);
		cam.lookAt(0, 0, 0);
		cam.near = 0.1f;
		cam.far = 300f;
		cam.update();

		ModelBuilder modelBuilder = new ModelBuilder();
		model = modelBuilder.createBox(5f, 5f, 5f, new Material(ColorAttribute.createDiffuse(Color.GREEN)), Usage.Position
			| Usage.Normal);
		instance = new ModelInstance(model);

// model = new G3dModelLoader(new UBJsonReader()).loadModel(Gdx.files.internal("data/g3d/knight.g3db"));
// instance = new ModelInstance(model);

		Gdx.input.setInputProcessor(new InputMultiplexer(this, inputController = new CameraInputController(cam)));
	}
 
開發者ID:if1live,項目名稱:amatsukaze,代碼行數:26,代碼來源:Basic3DTest.java

示例9: create

import com.badlogic.gdx.graphics.g3d.Environment; //導入方法依賴的package包/類
@Override
public void create() {
	modelBatch = new ModelBatch();
	
	environment = new Environment();
	environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1f));
	environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));
	
	cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
	cam.position.set(10f, 10f, 10f);
	cam.lookAt(0, 0, 0);
	cam.near = 1f;
	cam.far = 300f;
	cam.update();
	
	camController = new CameraInputController(cam);
	Gdx.input.setInputProcessor(camController);
	
	ModelBuilder modelBuilder = new ModelBuilder();
       model = modelBuilder.createBox(5f, 5f, 5f, 
           new Material(ColorAttribute.createDiffuse(Color.GREEN)),
           Usage.Position | Usage.Normal);
       instance = new ModelInstance(model);
}
 
開發者ID:if1live,項目名稱:amatsukaze,代碼行數:25,代碼來源:Basic3D.java

示例10: create

import com.badlogic.gdx.graphics.g3d.Environment; //導入方法依賴的package包/類
@Override
public void create () {
	modelBatch = new ModelBatch();
	environment = new Environment();
	environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1.f));
	environment.set(new ColorAttribute(ColorAttribute.Fog, 0.13f, 0.13f, 0.13f, 1f));
	environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));

	cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
	cam.position.set(30f, 10f, 30f);
	cam.lookAt(0, 0, 0);
	cam.near = 0.1f;
	cam.far = 45f;
	cam.update();

	ModelBuilder modelBuilder = new ModelBuilder();
	model = modelBuilder.createBox(5f, 5f, 5f, new Material(ColorAttribute.createDiffuse(Color.GREEN)), Usage.Position
		| Usage.Normal);
	instance = new ModelInstance(model);

	Gdx.input.setInputProcessor(new InputMultiplexer(this, inputController = new CameraInputController(cam)));
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:23,代碼來源:FogTest.java

示例11: create

import com.badlogic.gdx.graphics.g3d.Environment; //導入方法依賴的package包/類
@Override
public void create() {
	assets = new AssetManager();
	String model = "Bambo_House.g3db";
	assets.load(model, Model.class);
	assets.finishLoading();
	modelInstance = new ModelInstance(assets.get(model, Model.class), new Matrix4().setToScaling(0.6f, 0.6f, 0.6f));

	DefaultShader.Config config = new Config();
	config.defaultCullFace = GL20.GL_NONE;
	ShaderProvider shaderProvider = new DefaultShaderProvider(config);
	modelBatch = new ModelBatch(shaderProvider);

	ModelBuilder builder = new ModelBuilder();
	float groundSize = 1000f;
	ground = new ModelInstance(builder.createRect(-groundSize, 0, groundSize, groundSize, 0, groundSize, groundSize, 0, -groundSize, -groundSize, 0, -groundSize, 0,
			1, 0, new Material(), Usage.Position | Usage.Normal), new Matrix4().setToTranslation(0, -0.01f, 0));
	environment = new Environment();
	environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1f));
	environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));

	VirtualReality.renderer.listeners.add(this);
	// VirtualReality.head.setCyclops(true);
}
 
開發者ID:nooone,項目名稱:gdx-vr,代碼行數:25,代碼來源:SimpleRoom.java

示例12: setup

import com.badlogic.gdx.graphics.g3d.Environment; //導入方法依賴的package包/類
@Override
public boolean setup() {

	modelBatch = new ModelBatch(new DefaultShaderProvider());

	lights = new Environment();
	lights.set(new ColorAttribute(ColorAttribute.AmbientLight, 1.0f, 1.0f, 1.0f, 1.f));
	lights.add(new DirectionalLight().set(0.3f, 0.3f, 0.3f, 0, 1, -0.2f));

	cam = new MapCamera(mMap);

	renderContext =
	        new RenderContext(new DefaultTextureBinder(DefaultTextureBinder.WEIGHTED, 1));

	// shader = new DefaultShader(renderable.material,
	// renderable.mesh.getVertexAttributes(), true, false, 1, 0, 0, 0);
	// shader.init();

	return true;
}
 
開發者ID:opensciencemap,項目名稱:vtm,代碼行數:21,代碼來源:GdxModelRenderer.java

示例13: show

import com.badlogic.gdx.graphics.g3d.Environment; //導入方法依賴的package包/類
@Override
public void show() {
    super.show();
    assets = new AssetManager();
    assets.load("theme/basic/campaign/scene.g3db", Model.class);
    modelBatch = new ModelBatch();
    environment = new Environment();

    environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 1f, 1f, 1f, 1f));
    //environment.add(new DirectionalLight().set(1f, 1f, 1f, -1f, -1f, -1f));
    addDisposables(modelBatch, assets);
}
 
開發者ID:justinmarentette11,項目名稱:Tower-Defense-Galaxy,代碼行數:13,代碼來源:LevelSelectScreen.java

示例14: drawProfile

import com.badlogic.gdx.graphics.g3d.Environment; //導入方法依賴的package包/類
private void drawProfile() {
    environment = new Environment();
    environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 1f, 1f, 1f, 1f));
    environment.add(new DirectionalLight().set(1f, 1f, 1f, 1f, 1f, 1f));
    Model model = managerAssets.getAssetsProfile().getModel(NameFiles.profileObject);
    model.nodes.get(2).translation.set(0,-14.5f,9);
    instance = new ModelInstance(model);
    instance.transform.scale(0.2f,0.2f,0.2f);
    instance.transform.trn(0,-8f,27).rotate(0,1,0,55);
    decalBackground = Decal.newDecal(new TextureRegion(managerAssets.getAssetsCrafting().getTexture(NameFiles.backgroundCrafting)));
    decalBackground.setDimensions(75,150);
    decalBackground.setPosition(0,0,0);
    queueDisplay = QueueDisplay.getInstance();
}
 
開發者ID:TudorRosca,項目名稱:enklave,代碼行數:15,代碼來源:ScreenProfile.java

示例15: MapsScreen

import com.badlogic.gdx.graphics.g3d.Environment; //導入方法依賴的package包/類
public MapsScreen(GameManager game) {
    gameManager = game;
    environment = new Environment();
    environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 1f, 1f, 1f, 1f));
    environment.add(new DirectionalLight().set(1f, 1f, 1f, -1f, -0.8f, -0.2f));
    camera = new PerspectiveCamera(40, Width, Height);
    camera.lookAt(0, 0, 0);
    camera.far = 4000;
    camera.near = 1;
    camera.update();
    pos = new Vector2[3][3];
    CameraGroupStrategy cameraGroupStategy = new CameraGroupStrategy(camera);
    batch = new DecalBatch(cameraGroupStategy);
    bounds = new Bounds();
    matrixPixmap = MapPixmap.getInstance();
    managerAssets = ManagerAssets.getInstance();
    myLocation = MyLocation.getInstance();
    pointerx = new int[4];
    pointery = new int[4];
    compass = myLocation.getCompas();
    queue = MyQueue.getInstance();
    //calc bounds
    bounds.getCorners(matrixPixmap.getMatrix()[1][1].getLatitude(),matrixPixmap.getMatrix()[1][1].getLongitude() , 17.0, 640.0, 640.0);
    unitlong = (bounds.calcDisance(bounds.latSW, bounds.longSW, bounds.latSW, bounds.longNE)+bounds.calcDisance(bounds.latNE,bounds.longNE,bounds.latNE,bounds.longSW))/2.0;
    unitlong=600/unitlong;
    unitlat = bounds.calcDisance(bounds.latSW, bounds.longSW, bounds.latNE, bounds.longSW);
    unitlat= 600/unitlat;
    timerEnergy = new Timer();
    informationProfile = InformationProfile.getInstance();
}
 
開發者ID:TudorRosca,項目名稱:enklave,代碼行數:31,代碼來源:MapsScreen.java


注:本文中的com.badlogic.gdx.graphics.g3d.Environment.set方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。