本文整理汇总了Java中com.sun.javafx.geom.Vec3d类的典型用法代码示例。如果您正苦于以下问题:Java Vec3d类的具体用法?Java Vec3d怎么用?Java Vec3d使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Vec3d类属于com.sun.javafx.geom包,在下文中一共展示了Vec3d类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getCardDefaultRotation
import com.sun.javafx.geom.Vec3d; //导入依赖的package包/类
/**
* This method return the correct default rotation
* of a card depending on the group
* @since v0.7
* @param viewCard the viewCard object
* @return the default z hard rotation and the default transform y rotation
*/
public Vec3d getCardDefaultRotation(@NotNull ViewCard viewCard) {
Vec3d rotation = new Vec3d(0, 0, 0);
if (viewCardToGroup.get(viewCard) == hands[0] || viewCardToGroup.get(viewCard) == hands[1]
|| viewCardToGroup.get(viewCard) == hands[2] || viewCardToGroup.get(viewCard) == hands[3])
{
double yAngle = -(Math.asin(ViewCard.getDepth() / (ViewCard.getWidth() - MARGIN_BETWEEN_HAND_CARDS)))*(180/Math.PI);
switch (gameModel.getPlayerHandler().getPlayerCardinalPoint((Hand)
getCardGroupFromGroup(viewCardToGroup.get(viewCard))))
{
case North:
rotation.set(0,yAngle,180);
break;
case West:
rotation.set(0,yAngle,90);
break;
case South:
rotation.set(0,yAngle,0);
break;
case East:
rotation.set(0,yAngle,270);
break;
}
}
return rotation;
}
开发者ID:Bokoblin,项目名称:DUTS3-CPOA-ProjetTarot,代码行数:33,代码来源:GameView.java
示例2: lookAt
import com.sun.javafx.geom.Vec3d; //导入依赖的package包/类
public void lookAt(Vec3d centre, Vec3d up) {
final Vec3d f = new Vec3d(), s = new Vec3d(), u = new Vec3d();
final Vec3d t = new Vec3d(), eye = new Vec3d();
eye.set( matrix.getTx(), matrix.getTy(), matrix.getTz());
f.set(eye);
f.sub(centre);
f.normalize();
up.normalize();
t.set(f);
s.cross(t,up);
s.normalize();
t.set(s);
u.cross(f,t);
u.normalize();
matrix.setMxx( -s.x); matrix.setMxy( u.x); matrix.setMxz( -f.x);
matrix.setMyx( -s.y); matrix.setMyy( u.y); matrix.setMyz( -f.y);
matrix.setMzx( -s.z); matrix.setMzy( u.z); matrix.setMzz( -f.z);
}
开发者ID:sanke69,项目名称:fr.xs.jtk,代码行数:26,代码来源:Pivot.java
示例3: unProjectDirection
import com.sun.javafx.geom.Vec3d; //导入依赖的package包/类
public Vec3d unProjectDirection(double sceneX, double sceneY, double sWidth, double sHeight) {
double tanHFov = Math.tan(Math.toRadians(camera.getFieldOfView()) * 0.5f);
Vec3d vMouse = new Vec3d(2 * sceneX / sWidth - 1, 2 * sceneY / sWidth - sHeight / sWidth, 1);
vMouse.x *= tanHFov;
vMouse.y *= tanHFov;
Vec3d result = localToSceneDirection(vMouse, new Vec3d());
result.normalize();
return result;
}
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:11,代码来源:Drag3DObject.java
示例4: localToScene
import com.sun.javafx.geom.Vec3d; //导入依赖的package包/类
public Vec3d localToScene(Vec3d pt, Vec3d result) {
Point3D res = camera.localToParentTransformProperty().get().transform(pt.x, pt.y, pt.z);
if (camera.getParent() != null) {
res = camera.getParent().localToSceneTransformProperty().get().transform(res);
}
result.set(res.getX(), res.getY(), res.getZ());
return result;
}
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:9,代码来源:Drag3DObject.java
示例5: unProjectDirection
import com.sun.javafx.geom.Vec3d; //导入依赖的package包/类
public Vec3d unProjectDirection(double sceneX, double sceneY, double sWidth, double sHeight) {
double tanHFov = Math.tan(Math.toRadians(camera.getFieldOfView()) * 0.5f);
Vec3d vMouse = new Vec3d(2*sceneX/sWidth-1, 2*sceneY/sWidth-sHeight/sWidth, 1);
vMouse.x *= tanHFov;
vMouse.y *= tanHFov;
Vec3d result = localToSceneDirection(vMouse, new Vec3d());
result.normalize();
return result;
}
开发者ID:FXyz,项目名称:FXyzLib,代码行数:11,代码来源:Drag3DObject.java
示例6: localToScene
import com.sun.javafx.geom.Vec3d; //导入依赖的package包/类
public Vec3d localToScene(Vec3d pt, Vec3d result) {
Point3D res = camera.localToParentTransformProperty().get().transform(pt.x, pt.y, pt.z);
if (camera.getParent() != null) {
res = camera.getParent().localToSceneTransformProperty().get().transform(res);
}
result.set(res.getX(), res.getY(), res.getZ());
return result;
}
开发者ID:FXyz,项目名称:FXyzLib,代码行数:9,代码来源:Drag3DObject.java
示例7: localToSceneDirection
import com.sun.javafx.geom.Vec3d; //导入依赖的package包/类
public Vec3d localToSceneDirection(Vec3d dir, Vec3d result) {
localToScene(dir, result);
result.sub(localToScene(new Vec3d(0, 0, 0), new Vec3d()));
return result;
}
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:6,代码来源:Drag3DObject.java
示例8: setColor
import com.sun.javafx.geom.Vec3d; //导入依赖的package包/类
public void setColor(double r, double g, double b) {
setColor(new Vec3d(r, g, b));
}
开发者ID:kravchik,项目名称:senjin,代码行数:4,代码来源:BaseEdu2D.java
示例9: getPosition
import com.sun.javafx.geom.Vec3d; //导入依赖的package包/类
public Vec3d getPosition() {
return new Vec3d(matrix.getTx(),matrix.getTy(),matrix.getTz());
}
开发者ID:sanke69,项目名称:fr.xs.jtk,代码行数:4,代码来源:Pivot.java
示例10: localToSceneDirection
import com.sun.javafx.geom.Vec3d; //导入依赖的package包/类
public Vec3d localToSceneDirection(Vec3d dir, Vec3d result) {
localToScene(dir, result);
result.sub(localToScene(new Vec3d(0, 0, 0), new Vec3d()));
return result;
}
开发者ID:FXyz,项目名称:FXyzLib,代码行数:6,代码来源:Drag3DObject.java
注:本文中的com.sun.javafx.geom.Vec3d类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论