com.ardor3d.math.Transform.releaseTempInstance()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中com.ardor3d.math.Transform.releaseTempInstance()方法的一些代码示例,展示了Transform.releaseTempInstance()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transform.releaseTempInstance()方法的具体详情如下:
包路径:com.ardor3d.math.Transform
类名称:Transform
方法名:releaseTempInstance

Transform.releaseTempInstance介绍

[英]Releases a Transform back to be used by a future call to fetchTempInstance. TAKE CARE: this Transform object should no longer have other classes referencing it or "Bad Things" will happen.
[中]释放一个转换,供将来调用fetchTempInstance时使用。注意:这个Transform对象不应该再有其他类引用它,否则会发生“不好的事情”。

代码示例

代码示例来源:origin: Renanse/Ardor3D

public void draw(final Renderer renderer, final UIComponent comp, final int height, final double xOffset,
    final double yOffset) {
  final long curr = System.currentTimeMillis();
  if (curr - _lastBlink > _blinkInterval) {
    _lastBlink = curr;
    _show = !_show;
    comp.fireComponentDirty();
  }
  if (!_show) {
    return;
  }
  final Vector3 v = Vector3.fetchTempInstance();
  v.set(getPosX() + xOffset, getPosY() + yOffset, 0);
  final Transform t = Transform.fetchTempInstance();
  t.set(comp.getWorldTransform());
  t.applyForwardVector(v);
  t.translate(v);
  Vector3.releaseTempInstance(v);
  _strip.setWorldTransform(t);
  Transform.releaseTempInstance(t);
  _strip.setWorldScale(1, _strip.getWorldScale().getY() * height, 0);
  _strip.render(renderer);
}

代码示例来源:origin: com.ardor3d/ardor3d-ui

public void draw(final Renderer renderer, final UIComponent comp, final int height, final double xOffset,
    final double yOffset) {
  final long curr = System.currentTimeMillis();
  if (curr - _lastBlink > _blinkInterval) {
    _lastBlink = curr;
    _show = !_show;
    comp.fireComponentDirty();
  }
  if (!_show) {
    return;
  }
  final Vector3 v = Vector3.fetchTempInstance();
  v.set(getPosX() + xOffset, getPosY() + yOffset, 0);
  final Transform t = Transform.fetchTempInstance();
  t.set(comp.getWorldTransform());
  t.applyForwardVector(v);
  t.translate(v);
  Vector3.releaseTempInstance(v);
  _strip.setWorldTransform(t);
  Transform.releaseTempInstance(t);
  _strip.setWorldScale(1, _strip.getWorldScale().getY() * height, 0);
  _strip.render(renderer);
}

代码示例来源:origin: com.ardor3d/ardor3d-animation

/**
 * Update our local joint transforms so that they reflect the skeleton in bind pose.
 */
public void setToBindPose() {
  final Transform temp = Transform.fetchTempInstance();
  // go through our local transforms
  for (int i = 0; i < _localTransforms.length; i++) {
    // Set us to the bind pose
    _localTransforms[i].set(_skeleton.getJoints()[i].getInverseBindPose());
    // then invert.
    _localTransforms[i].invert(_localTransforms[i]);
    // At this point we are in model space, so we need to remove our parent's transform (if we have one.)
    final short parentIndex = _skeleton.getJoints()[i].getParentIndex();
    if (parentIndex != Joint.NO_PARENT) {
      // We remove the parent's transform simply by multiplying by its inverse bind pose. Done! :)
      _skeleton.getJoints()[parentIndex].getInverseBindPose().multiply(_localTransforms[i], temp);
      _localTransforms[i].set(temp);
    }
  }
  Transform.releaseTempInstance(temp);
  updateTransforms();
}

代码示例来源:origin: Renanse/Ardor3D

/**
 * Update our local joint transforms so that they reflect the skeleton in bind pose.
 */
public void setToBindPose() {
  final Transform temp = Transform.fetchTempInstance();
  // go through our local transforms
  for (int i = 0; i < _localTransforms.length; i++) {
    // Set us to the bind pose
    _localTransforms[i].set(_skeleton.getJoints()[i].getInverseBindPose());
    // then invert.
    _localTransforms[i].invert(_localTransforms[i]);
    // At this point we are in model space, so we need to remove our parent's transform (if we have one.)
    final short parentIndex = _skeleton.getJoints()[i].getParentIndex();
    if (parentIndex != Joint.NO_PARENT) {
      // We remove the parent's transform simply by multiplying by its inverse bind pose. Done! :)
      _skeleton.getJoints()[parentIndex].getInverseBindPose().multiply(_localTransforms[i], temp);
      _localTransforms[i].set(temp);
    }
  }
  Transform.releaseTempInstance(temp);
  updateTransforms();
}

代码示例来源:origin: com.ardor3d/ardor3d-animation

temp.getHomogeneousMatrix(_matrixPalette[index]);
Transform.releaseTempInstance(temp);
firePoseUpdated();

代码示例来源:origin: Renanse/Ardor3D

temp.getHomogeneousMatrix(_matrixPalette[index]);
Transform.releaseTempInstance(temp);
firePoseUpdated();

代码示例来源:origin: com.ardor3d/ardor3d-ui

Vector3.releaseTempInstance(v);
_uiText.setWorldTransform(t);
Transform.releaseTempInstance(t);

代码示例来源:origin: com.ardor3d/ardor3d-ui

Transform.releaseTempInstance(t);
} else {
  _parent.getWorldTransform().multiply(_localTransform, _worldTransform);

代码示例来源:origin: Renanse/Ardor3D

Transform.releaseTempInstance(t);
} else {
  _parent.getWorldTransform().multiply(_localTransform, _worldTransform);

代码示例来源:origin: Renanse/Ardor3D

Vector3.releaseTempInstance(v);
_uiText.setWorldTransform(t);
Transform.releaseTempInstance(t);

代码示例来源:origin: Renanse/Ardor3D

Transform.releaseTempInstance(t);

代码示例来源:origin: Renanse/Ardor3D

Transform.releaseTempInstance(t);

代码示例来源:origin: Renanse/Ardor3D

@Override
public void draw(final Renderer renderer, final UIComponent comp) {
  final float oldA = _color.getAlpha();
  if (oldA == 0) {
    // no need to draw.
    return;
  }
  _color.setAlpha(oldA * UIComponent.getCurrentOpacity());
  SolidBackdrop._standin.setDefaultColor(_color);
  final Vector3 v = Vector3.fetchTempInstance();
  final Insets margin = comp.getMargin() != null ? comp.getMargin() : Insets.EMPTY;
  final Insets border = comp.getBorder() != null ? comp.getBorder() : Insets.EMPTY;
  v.set(margin.getLeft() + border.getLeft(), margin.getBottom() + border.getBottom(), 0);
  final Transform t = Transform.fetchTempInstance();
  t.set(comp.getWorldTransform());
  t.applyForwardVector(v);
  t.translate(v);
  Vector3.releaseTempInstance(v);
  SolidBackdrop._standin.setWorldTransform(t);
  Transform.releaseTempInstance(t);
  final float width = UIBackdrop.getBackdropWidth(comp);
  final float height = UIBackdrop.getBackdropHeight(comp);
  SolidBackdrop._standin.resize(width, height);
  SolidBackdrop._standin.render(renderer);
  _color.setAlpha(oldA);
}

代码示例来源:origin: com.ardor3d/ardor3d-ui

@Override
public void draw(final Renderer renderer, final UIComponent comp) {
  final float oldA = _color.getAlpha();
  if (oldA == 0) {
    // no need to draw.
    return;
  }
  _color.setAlpha(oldA * UIComponent.getCurrentOpacity());
  SolidBackdrop._standin.setDefaultColor(_color);
  final Vector3 v = Vector3.fetchTempInstance();
  v.set(comp.getMargin().getLeft() + comp.getBorder().getLeft(), comp.getMargin().getBottom()
      + comp.getBorder().getBottom(), 0);
  final Transform t = Transform.fetchTempInstance();
  t.set(comp.getWorldTransform());
  t.applyForwardVector(v);
  t.translate(v);
  Vector3.releaseTempInstance(v);
  SolidBackdrop._standin.setWorldTransform(t);
  Transform.releaseTempInstance(t);
  final float width = UIBackdrop.getBackdropWidth(comp);
  final float height = UIBackdrop.getBackdropHeight(comp);
  SolidBackdrop._standin.resize(width, height);
  SolidBackdrop._standin.render(renderer);
  _color.setAlpha(oldA);
}

代码示例来源:origin: com.ardor3d/ardor3d-animation

Transform.releaseTempInstance(store);
Vector3.releaseTempInstance(point);
if (!inOrtho) {

代码示例来源:origin: com.ardor3d/ardor3d-ui

Transform.releaseTempInstance(t);

代码示例来源:origin: com.ardor3d/ardor3d-effects

Transform.releaseTempInstance(t);

代码示例来源:origin: Renanse/Ardor3D

Transform.releaseTempInstance(t);

代码示例来源:origin: Renanse/Ardor3D

Transform.releaseTempInstance(t);

代码示例来源:origin: Renanse/Ardor3D

Transform.releaseTempInstance(store);
Vector3.releaseTempInstance(point);
renderer.renderBuckets();

相关文章