import com.jme3.scene.Node; //導入方法依賴的package包/類
/**
* Course path constructor. Locate the course path and organise the points
* into an ordered list. Rotate these points to create a smooth path.
* @param scene Root node of scene.
*/
public CoursePath(Node scene, BulletAppState bullet) {
// Locate each course point and create an array of those points ordered by
// the order data in the user data of the spatials.
Spatial coursePath = scene.getChild(COURSE_PATH_NODE_NAME);
final TreeMap points = new TreeMap();
coursePath.breadthFirstTraversal(new SceneGraphVisitor() {
public void visit(Spatial spatial) {
Integer order = spatial.getUserData(COURSE_ORDER_ATTR);
if (order != null) {
points.put(order, spatial);
}
}
});
coursePoints = p