本文整理汇总了Java中com.watabou.utils.PointF.diff方法的典型用法代码示例。如果您正苦于以下问题:Java PointF.diff方法的具体用法?Java PointF.diff怎么用?Java PointF.diff使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.watabou.utils.PointF
的用法示例。
在下文中一共展示了PointF.diff方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reset
import com.watabou.utils.PointF; //导入方法依赖的package包/类
public void reset(int from, int to, Callback callback) {
this.callback = callback;
revive();
PointF pf = DungeonTilemap.tileCenterToWorld(from);
PointF pt = DungeonTilemap.tileCenterToWorld(to);
x = pf.x;
y = pf.y;
width = 0;
height = 0;
PointF d = PointF.diff(pt, pf);
PointF speed = new PointF(d).normalize().scale(SPEED);
sx = speed.x;
sy = speed.y;
time = d.length() / SPEED;
}
示例2: reset
import com.watabou.utils.PointF; //导入方法依赖的package包/类
public void reset( int from, int to, float velocity, Callback callback ) {
this.callback = callback;
revive();
PointF pf = DungeonTilemap.tileCenterToWorld( from );
PointF pt = DungeonTilemap.tileCenterToWorld( to );
x = pf.x;
y = pf.y;
width = 0;
height = 0;
PointF d = PointF.diff( pt, pf );
PointF speed = new PointF( d ).normalize().scale( velocity );
sx = speed.x;
sy = speed.y;
time = d.length() / velocity;
}
示例3: reset
import com.watabou.utils.PointF; //导入方法依赖的package包/类
public void reset( int from, int to, float velocity, Callback callback ) {
this.callback = callback;
revive();
PointF pf = DungeonTilemap.tileCenterToWorld( from );
PointF pt = DungeonTilemap.tileCenterToWorld( to );
x = pf.x;
y = pf.y;
width = 0;
height = 0;
PointF d = PointF.diff( pt, pf );
PointF speed = new PointF( d ).normalize().scale( velocity );
sx = speed.x;
sy = speed.y;
time = d.length() / velocity;
}
示例4: reset
import com.watabou.utils.PointF; //导入方法依赖的package包/类
public void reset(int from, int to, int image, Glowing glowing,
Callback listener) {
revive();
view(image, glowing);
this.callback = listener;
point(DungeonTilemap.tileToWorld(from));
PointF dest = DungeonTilemap.tileToWorld(to);
PointF d = PointF.diff(dest, point());
speed.set(d).normalize().scale(SPEED);
if (image == ItemSpriteSheet.DART
|| image == ItemSpriteSheet.INCENDIARY_DART
|| image == ItemSpriteSheet.CURARE_DART
|| image == ItemSpriteSheet.JAVELIN) {
angularSpeed = 0;
angle = 135 - (float) (Math.atan2(d.x, d.y) / 3.1415926 * 180);
} else if (image == ItemSpriteSheet.WAVE
|| image == ItemSpriteSheet.SKULLWEP) {
angularSpeed = 0;
angle = 90 - (float) (Math.atan2(d.x, d.y) / 3.1415926 * 180);
} else {
angularSpeed = image == 15 || image == 106 ? 1440 : 720;
}
PosTweener tweener = new PosTweener(this, dest, d.length() / SPEED);
tweener.listener = this;
parent.add(tweener);
}
示例5: reset
import com.watabou.utils.PointF; //导入方法依赖的package包/类
public void reset( int from, int to, int image, Glowing glowing, Callback listener ) {
revive();
view( image, glowing );
this.callback = listener;
point( DungeonTilemap.tileToWorld( from ) );
PointF dest = DungeonTilemap.tileToWorld( to );
PointF d = PointF.diff( dest, point() );
speed.set( d ).normalize().scale( SPEED );
if (image == ItemSpriteSheet.DART || image == ItemSpriteSheet.INCENDIARY_DART
|| image == ItemSpriteSheet.CURARE_DART || image == ItemSpriteSheet.JAVELIN) {
angularSpeed = 0;
angle = 135 - (float)(Math.atan2( d.x, d.y ) / 3.1415926 * 180);
} else {
angularSpeed = image == 15 || image == 106 ? 1440 : 720;
}
PosTweener tweener = new PosTweener( this, dest, d.length() / SPEED );
tweener.listener = this;
parent.add( tweener );
}
示例6: reset
import com.watabou.utils.PointF; //导入方法依赖的package包/类
public void reset( int from, int to, int image, Glowing glowing, Callback listener ) {
revive();
view( image, glowing );
this.callback = listener;
point( DungeonTilemap.tileToWorld( from ) );
PointF dest = DungeonTilemap.tileToWorld( to );
PointF d = PointF.diff( dest, point() );
speed.set( d ).normalize().scale( SPEED );
if (image == 31 || image == 108 || image == 109 || image == 110) {
angularSpeed = 0;
angle = 135 - (float)(Math.atan2( d.x, d.y ) / 3.1415926 * 180);
} else {
angularSpeed = image == 15 || image == 106 ? 1440 : 720;
}
PosTweener tweener = new PosTweener( this, dest, d.length() / SPEED );
tweener.listener = this;
parent.add( tweener );
}