📄 coforagecirclerangesim.java
字号:
/* * ObstacleInvisibleSim.java */package EDU.gatech.cc.is.simulation;import java.awt.*;import EDU.gatech.cc.is.util.Vec2;import EDU.gatech.cc.is.util.Units;/** * an invisible obstacle. * <P> * Copyright (c)2000 Tucker Balch * * @author Tucker Balch * @version $Revision: 1.2 $ */public class CoForageCircleRangeSim extends ObstacleSim { /** *Get the closest point . */ public Vec2 getClosestPoint(Vec2 from) { Vec2 tmp = new Vec2(from.x, from.y); tmp.setr(RADIUS-from.r); Vec2 last = new Vec2(tmp.x, tmp.y); last.add(from); lastx = last.x; lasty = last.y; return(tmp); } /** * Override draw objects's State. Make it do nothing */ public void drawState(Graphics g, int w, int h, double t, double b, double l, double r) { // do nothing } /** *Draw the obstacle. Make it invisible. */ public void draw(Graphics g, int w, int h, double t, double b, double l, double r) { // do nothing } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -