Java3D 禁止在 PickMouseBehavior 中单击

发布于 2024-08-15 21:01:50 字数 563 浏览 1 评论 0原文

运行我的代码时,

  @Override
public void updateScene(int x, int y) 

运行时间有点长,用户可以在代码完成运行之前单击 java3D 对象,而我的 RotationInterpolator 无法跟上我无法更改 RotationInterpolator 上的 Alpha,因为这就是按钮的内容更新所以我正在寻找一种方法来禁用 Pick 的能力,我已经尝试过,

       Thread.currentThread().sleep(s * 1000);

但这会使整个线程睡眠,因此动画停止,并且在 PickMouseBehavior Java Doc 中找不到任何可能的方法,这是

我现在唯一的解决方案看到的是禁用用户选择编码长度的能力,例如“

@Override
public void updateScene(int x, int y) {
disablePick();
// my code
enablePick();
}

非常感谢”^_^

When running my

  @Override
public void updateScene(int x, int y) 

The code the runs takes a little to long, and a user can click on a java3D object before the code has finished running and my RotationInterpolator can't keep up I cant change the Alpha on the RotationInterpolator as this is what the button updates so im looking for a way to disable the ability to Pick, I have tried

       Thread.currentThread().sleep(s * 1000);

but this makes the whole thread sleep , and thus the animation stops, and can't find any likely looking methods in the PickMouseBehavior Java Doc

the only solution I now see is to disable the users ability to Pick over the length of the coded something like

@Override
public void updateScene(int x, int y) {
disablePick();
// my code
enablePick();
}

Many Thanks ^_^

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

左耳近心 2024-08-22 21:01:50

解决方案是从受影响的 RotationInterpolator 中提取 Alpha,然后在允许我的代码使用 If 语句运行之前,这样

      Alpha al = head.getAlpha();

  if (al.finished())
  {
//code 
  }

The solution was to pull the Alpha from the effected RotationInterpolator, and before allowing my code to run using an If statement such that

      Alpha al = head.getAlpha();

  if (al.finished())
  {
//code 
  }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文