本文整理汇总了Java中javax.media.j3d.PickBounds类的典型用法代码示例。如果您正苦于以下问题:Java PickBounds类的具体用法?Java PickBounds怎么用?Java PickBounds使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PickBounds类属于javax.media.j3d包,在下文中一共展示了PickBounds类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SimpleAgent
import javax.media.j3d.PickBounds; //导入依赖的package包/类
/**
* Constructs a SimpleAgent.
*
* @param pos
* the starting position.
* @param name
* the name of the agent.
*/
public SimpleAgent(Vector3d pos, String name) {
this.name = name;
super.create3D(true);
startPosition = new Vector3d(pos);
sensors = new ArrayList();
actuators = new ArrayList();
// interactingAgents = new ArrayList();
// reserve collision detection stuff
collisionBounds = new BoundingSphere();
collisionPickBounds = new PickBounds();
collisionBoundsCenter = new Point3d();
detachedFromSceneGraph = false;
}
示例2: SimpleAgent
import javax.media.j3d.PickBounds; //导入依赖的package包/类
/**
* Constructs a SimpleAgent.
*
* @param pos
* the starting position.
* @param name
* the name of the agent.
*/
public SimpleAgent(Vector3d pos, String name) {
this.name = name;
super.create3D(true);
startPosition = new Vector3d(pos);
sensors = new ArrayList<SensorDevice>();
actuators = new ArrayList<ActuatorDevice>();
// interactingAgents = new ArrayList();
// reserve collision detection stuff
collisionBounds = new BoundingSphere();
collisionPickBounds = new PickBounds();
collisionBoundsCenter = new Point3d();
detachedFromSceneGraph = false;
}
示例3: getCollision
import javax.media.j3d.PickBounds; //导入依赖的package包/类
/**
* Prueft, ob ein Objekt mit einem Objekt aus der obstacle-BG der Welt kollidiert
* @param body Koerper des Objekts
* @param bounds Grenzen des Objekts
* @return PickInfo ueber die Kollision (null, falls keine)
*/
public PickInfo getCollision(Group body, Bounds bounds) {
/* Welttransformation anwenden */
Transform3D transform = new Transform3D();
worldTG.getTransform(transform);
bounds.transform(transform);
PickBounds pickBounds = new PickBounds(bounds);
PickInfo pickInfo = null;
synchronized (obstBG) {
/* eigenen Koerper verstecken */
body.setPickable(false);
/* Kollisionserkennung von Java3D */
pickInfo = obstBG.pickAny(PickInfo.PICK_BOUNDS, PickInfo.NODE, pickBounds);
/* eigenen Koerper wieder zuruecksetzen */
body.setPickable(true);
}
// if (pickInfo != null && pickInfo.getNode() != null) {
// lg.info("Objekt=" + pickInfo.getNode().getParent().getName() + " kollidiert");
// }
return pickInfo;
}