本文整理汇总了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);
}
}
}
}
示例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);
}
}
}
}
示例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);
}
}
}
}
示例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);
}
}
}
}
示例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);
}
}
}
示例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();
}