本文整理匯總了Java中com.jme3.gde.scenecomposer.SceneEditTool類的典型用法代碼示例。如果您正苦於以下問題:Java SceneEditTool類的具體用法?Java SceneEditTool怎麽用?Java SceneEditTool使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SceneEditTool類屬於com.jme3.gde.scenecomposer包,在下文中一共展示了SceneEditTool類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initiatePick
import com.jme3.gde.scenecomposer.SceneEditTool; //導入依賴的package包/類
public void initiatePick(Spatial selectedSpatial, Quaternion planeRotation, SceneComposerToolController.TransformationType type, Camera camera, Vector2f screenCoord) {
spatial = selectedSpatial;
startSpatialLocation = selectedSpatial.getWorldTranslation().clone();
setTransformation(planeRotation, type, camera);
plane.setLocalTranslation(startSpatialLocation);
startPickLoc = SceneEditTool.pickWorldLocation(camera, screenCoord, plane, null);
}
示例2: move
import com.jme3.gde.scenecomposer.SceneEditTool; //導入依賴的package包/類
public boolean move(Camera camera, Vector2f screenCoord, Vector3f constraintAxis, boolean gridSnap) {
Node toPick = alternativePickTarget == null ? plane : alternativePickTarget;
Vector3f planeHit = SceneEditTool.pickWorldLocation(camera, screenCoord, toPick, alternativePickTarget == null ? null : spatial);
if (planeHit == null) {
return false;
}
Spatial parent = spatial.getParent();
//we are moving the root node, there is a slight chance that something went wrong.
if (parent == null) {
return false;
}
//offset in world space
if (offset == null) {
offset = planeHit.subtract(spatial.getWorldTranslation()); // get the offset when we start so it doesn't jump
}
newPos.set(planeHit).subtractLocal(offset);
//constraining the translation with the contraintAxis.
Vector3f tmp = startWorldLoc.mult(Vector3f.UNIT_XYZ.subtract(constraintAxis));
newPos.multLocal(constraintAxis).addLocal(tmp);
worldToLocalMove(gridSnap);
return true;
}
示例3: MoveTool
import com.jme3.gde.scenecomposer.SceneEditTool; //導入依賴的package包/類
public MoveTool() {
axisPickType = SceneEditTool.AxisMarkerPickType.axisAndPlane;
setOverrideCameraControl(true);
}
示例4: RotateTool
import com.jme3.gde.scenecomposer.SceneEditTool; //導入依賴的package包/類
public RotateTool() {
axisPickType = SceneEditTool.AxisMarkerPickType.planeOnly;
setOverrideCameraControl(true);
}
示例5: updatePick
import com.jme3.gde.scenecomposer.SceneEditTool; //導入依賴的package包/類
/**
*
* @param camera
* @param screenCoord
* @return true if the the new picked location is set, else return false.
*/
public boolean updatePick(Camera camera, Vector2f screenCoord) {
finalPickLoc = SceneEditTool.pickWorldLocation(camera, screenCoord, plane, null);
return finalPickLoc != null;
}