当前位置: 首页>>代码示例>>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;未经允许,请勿转载。