本文整理了Java中com.ardor3d.math.Transform.fetchTempInstance()
方法的一些代码示例,展示了Transform.fetchTempInstance()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transform.fetchTempInstance()
方法的具体详情如下:
包路径:com.ardor3d.math.Transform
类名称:Transform
方法名:fetchTempInstance
暂无
代码示例来源: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
final Transform temp = Transform.fetchTempInstance();
代码示例来源:origin: Renanse/Ardor3D
final Transform temp = Transform.fetchTempInstance();
代码示例来源:origin: com.ardor3d/ardor3d-ui
final Transform t = Transform.fetchTempInstance();
t.set(getWorldTransform());
t.applyForwardVector(v);
代码示例来源:origin: com.ardor3d/ardor3d-ui
final Transform t = Transform.fetchTempInstance();
t.set(_parent.getWorldTransform());
代码示例来源:origin: Renanse/Ardor3D
final Transform t = Transform.fetchTempInstance();
t.set(_parent.getWorldTransform());
代码示例来源:origin: Renanse/Ardor3D
final Transform t = Transform.fetchTempInstance();
t.set(getWorldTransform());
t.applyForwardVector(v);
代码示例来源:origin: Renanse/Ardor3D
v.addLocal(comp.getContentWidth() / 2, comp.getContentHeight() / 2, 0);
final Transform t = Transform.fetchTempInstance();
t.set(comp.getWorldTransform());
t.applyForwardVector(v);
代码示例来源:origin: Renanse/Ardor3D
v.set(margin.getLeft(), margin.getBottom(), 0);
final Transform t = Transform.fetchTempInstance();
t.set(comp.getWorldTransform());
t.applyForwardVector(v);
代码示例来源: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
renderer.setOrtho();
final Transform store = Transform.fetchTempInstance();
final Vector3 point = Vector3.fetchTempInstance();
for (int i = 0, max = joints.length; i < max; i++) {
代码示例来源:origin: com.ardor3d/ardor3d-ui
+ comp.getBorder().getBottom(), 0);
final Transform t = Transform.fetchTempInstance();
t.set(comp.getWorldTransform());
t.applyForwardVector(v);
代码示例来源:origin: com.ardor3d/ardor3d-effects
final Transform t = Transform.fetchTempInstance();
t.setIdentity();
t.setTranslation(getWorldTranslation());
代码示例来源:origin: Renanse/Ardor3D
final Transform t = Transform.fetchTempInstance();
t.setIdentity();
t.setTranslation(getWorldTranslation());
代码示例来源:origin: Renanse/Ardor3D
v.addLocal(comp.getContentWidth() / 2, comp.getContentHeight() / 2, 0);
final Transform t = Transform.fetchTempInstance();
t.set(comp.getWorldTransform());
t.applyForwardVector(v);
代码示例来源:origin: Renanse/Ardor3D
final Transform store = Transform.fetchTempInstance();
final Vector3 point = Vector3.fetchTempInstance();
for (int i = 0, max = joints.length; i < max; i++) {
内容来源于网络,如有侵权,请联系作者删除!