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


Java Fixture.getDensity方法代碼示例

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


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

示例1: testPlayerMud

import com.badlogic.gdx.physics.box2d.Fixture; //導入方法依賴的package包/類
public void testPlayerMud(GameEntity geA, GameEntity geB, Fixture fA, Fixture fB, boolean start)
{
	if (geA instanceof Player || geB instanceof Player)
	{
		if (geA instanceof Player && fA.getDensity() == BodyFactory.HIT_BOX_DEN || 
				geB instanceof Player && fB.getDensity() == BodyFactory.HIT_BOX_DEN)
		{
			if (geB.getType() == EntityType.MUD)
			{
				handlePlayerTerrain(geA, geB, start);
			}
			else if (geA.getType() == EntityType.MUD)
			{
				handlePlayerTerrain(geB, geA, start);
			}
		}
	}
}
 
開發者ID:ChainGangChase,項目名稱:cgc-game,代碼行數:19,代碼來源:ContactManager.java

示例2: testPlayerWater

import com.badlogic.gdx.physics.box2d.Fixture; //導入方法依賴的package包/類
public void testPlayerWater(GameEntity geA, GameEntity geB, Fixture fA, Fixture fB, boolean start)
{
	if (geA instanceof Player || geB instanceof Player)
	{
		if (geA instanceof Player && fA.getDensity() == BodyFactory.HIT_BOX_DEN || 
				geB instanceof Player && fB.getDensity() == BodyFactory.HIT_BOX_DEN)
		{
			if (geB.getType() == EntityType.WATER)
			{
				handlePlayerTerrain(geA, geB, start);
			}
			else if (geA.getType() == EntityType.WATER)
			{
				handlePlayerTerrain(geB, geA, start);
			}
		}
	}
}
 
開發者ID:ChainGangChase,項目名稱:cgc-game,代碼行數:19,代碼來源:ContactManager.java

示例3: testPlayerTower

import com.badlogic.gdx.physics.box2d.Fixture; //導入方法依賴的package包/類
public void testPlayerTower(GameEntity geA, GameEntity geB, Fixture fA, Fixture fB, boolean start)
{
	if (geA instanceof Player || geB instanceof Player)
	{
		if (geA instanceof Player && fA.getDensity() == BodyFactory.HIT_BOX_DEN || 
				geB instanceof Player && fB.getDensity() == BodyFactory.HIT_BOX_DEN)
		{
			if (geB.getType() == EntityType.TOWER)
			{
				handlePlayerTower(geA, geB, start);
			}
			else if (geA.getType() == EntityType.TOWER)
			{
				handlePlayerTower(geB, geA, start);
			}
		}
	}
}
 
開發者ID:ChainGangChase,項目名稱:cgc-game,代碼行數:19,代碼來源:ContactManager.java

示例4: testPlayerBridge

import com.badlogic.gdx.physics.box2d.Fixture; //導入方法依賴的package包/類
public void testPlayerBridge(GameEntity geA, GameEntity geB, Fixture fA, Fixture fB, boolean start)
{
	if (geA instanceof Player || geB instanceof Player)
	{
		if (geA instanceof Player && fA.getDensity() == BodyFactory.BRIDGE_BOX_DEN || 
				geB instanceof Player && fB.getDensity() == BodyFactory.BRIDGE_BOX_DEN)
		{
			if (geB.getType() == EntityType.BRIDGE)
			{
				handlePlayerBridge(geA, geB, start);
			}
			else if (geA.getType() == EntityType.BRIDGE)
			{
				handlePlayerBridge(geB, geA, start);
			}
		}
	}
}
 
開發者ID:ChainGangChase,項目名稱:cgc-game,代碼行數:19,代碼來源:ContactManager.java

示例5: testPlayerSpotlight

import com.badlogic.gdx.physics.box2d.Fixture; //導入方法依賴的package包/類
public void testPlayerSpotlight(GameEntity geA, GameEntity geB, Fixture fA, Fixture fB, boolean start)
{
	if (geA instanceof Player && fA.getDensity() == BodyFactory.CIRCLE_DEN || 
			geB instanceof Player && fB.getDensity() == BodyFactory.CIRCLE_DEN)
	{
		if (geB instanceof Spotlight && geA instanceof Prisoner && ((Prisoner)geA).isAlive())
		{
			handlePlayerSpotlight(geA, geB, start);
		}
		else if (geA instanceof Spotlight && geB instanceof Prisoner && ((Prisoner)geB).isAlive())
		{
			handlePlayerSpotlight(geB, geA, start);
		}
	}
}
 
開發者ID:ChainGangChase,項目名稱:cgc-game,代碼行數:16,代碼來源:ContactManager.java

示例6: fromFixture

import com.badlogic.gdx.physics.box2d.Fixture; //導入方法依賴的package包/類
public void fromFixture(Fixture f){
	shapeModel = new ShapeModel(f.getShape());
	Filter filterData = f.getFilterData();
	filter.categoryBits = filterData.categoryBits;
	filter.maskBits = filterData.maskBits;
	filter.groupIndex = filterData.groupIndex;
	sensor = f.isSensor();
	density = f.getDensity();
	friction = f.getFriction();
	restitution = f.getRestitution();
}
 
開發者ID:Deftwun,項目名稱:ZombieCopter,代碼行數:12,代碼來源:FixtureModel.java


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