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

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

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

Transform.getMatrix介绍

暂无

代码示例

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

/**
 * Gets the world rotation matrix.
 * 
 * @return the world rotation
 */
public ReadOnlyMatrix3 getWorldRotation() {
  return _worldTransform.getMatrix();
}

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

/**
 * Gets the local rotation matrix.
 *
 * @return the rotation
 */
public ReadOnlyMatrix3 getRotation() {
  return _localTransform.getMatrix();
}

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

/**
 * Gets the local rotation matrix.
 * 
 * @return the rotation
 */
public ReadOnlyMatrix3 getRotation() {
  return _localTransform.getMatrix();
}

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

/**
 * Gets the world rotation matrix.
 *
 * @return the world rotation
 */
public ReadOnlyMatrix3 getWorldRotation() {
  return _worldTransform.getMatrix();
}

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

g2d.rotate(trans.getMatrix().toAngles(null)[2]); // rotation about z
g2d.scale(trans.getScale().getX(), trans.getScale().getY());

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

g2d.rotate(trans.getMatrix().toAngles(null)[2]); // rotation about z
g2d.scale(trans.getScale().getX(), trans.getScale().getY());

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

@Override
  public void drawTo(final BufferedImage image, final ReadOnlyTransform localTransform, final int clipmapLevel) {
    // apply the two transforms together and then use result to scale/translate and rotate image
    final Transform trans = new Transform();
    localTransform.multiply(getTransform(), trans);

    // grab a copy of the graphics so we don't bleed state to next image
    final Graphics2D g2d = (Graphics2D) image.getGraphics().create();

    // apply hints
    for (final RenderingHints.Key key : hints.keySet()) {
      g2d.setRenderingHint(key, hints.get(key));
    }

    // set transform
    g2d.translate(trans.getTranslation().getX(), trans.getTranslation().getY());
    g2d.rotate(trans.getMatrix().toAngles(null)[2]); // rotation about z
    g2d.scale(trans.getScale().getX(), trans.getScale().getY());

    // set composite
    if (_compositeOverride != null) {
      g2d.setComposite(_compositeOverride);
    }

    // draw the image
    g2d.drawImage(_image, 0, 0, null);
  }
}

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

@Override
  public void drawTo(final BufferedImage image, final ReadOnlyTransform localTransform, final int clipmapLevel) {
    // apply the two transforms together and then use result to scale/translate and rotate image
    final Transform trans = new Transform();
    localTransform.multiply(getTransform(), trans);

    // grab a copy of the graphics so we don't bleed state to next image
    final Graphics2D g2d = (Graphics2D) image.getGraphics().create();

    // apply hints
    for (final RenderingHints.Key key : hints.keySet()) {
      g2d.setRenderingHint(key, hints.get(key));
    }

    // set transform
    g2d.translate(trans.getTranslation().getX(), trans.getTranslation().getY());
    g2d.rotate(trans.getMatrix().toAngles(null)[2]); // rotation about z
    g2d.scale(trans.getScale().getX(), trans.getScale().getY());

    // set composite
    if (_compositeOverride != null) {
      g2d.setComposite(_compositeOverride);
    }

    // draw the image
    g2d.drawImage(_image, 0, 0, null);
  }
}

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

/**
 * Draw a single Joint using the given world-space joint transform.
 * 
 * @param jntTransform
 *            our joint transform
 * @param scene
 * @param renderer
 *            the Renderer to draw with.
 */
private static void drawJoint(final Transform jntTransform, final Spatial scene, final Renderer renderer) {
  final BoundingVolume vol = scene.getWorldBound();
  double size = 1.0;
  if (vol != null) {
    SkeletalDebugger.measureSphere.setCenter(vol.getCenter());
    SkeletalDebugger.measureSphere.setRadius(0);
    SkeletalDebugger.measureSphere.mergeLocal(vol);
    size = SkeletalDebugger.BONE_RATIO * SkeletalDebugger.measureSphere.getRadius();
  }
  scene.getWorldTransform().multiply(jntTransform, SkeletalDebugger.spTransform);
  SkeletalDebugger.spTransform.getMatrix().scale(new Vector3(size, size, size), SkeletalDebugger.spMatrix);
  SkeletalDebugger.spTransform.setRotation(SkeletalDebugger.spMatrix);
  SkeletalDebugger.joint.setWorldTransform(SkeletalDebugger.spTransform);
  SkeletalDebugger.joint.draw(renderer);
}

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

/**
 * Draw a single Joint using the given world-space joint transform.
 *
 * @param jntTransform
 *                         our joint transform
 * @param scene
 * @param renderer
 *                         the Renderer to draw with.
 */
private static void drawJoint(final Transform jntTransform, final Spatial scene, final Renderer renderer) {
  final BoundingVolume vol = scene.getWorldBound();
  double size = 1.0;
  if (vol != null) {
    SkeletalDebugger.measureSphere.setCenter(vol.getCenter());
    SkeletalDebugger.measureSphere.setRadius(0);
    SkeletalDebugger.measureSphere.mergeLocal(vol);
    size = SkeletalDebugger.BONE_RATIO * SkeletalDebugger.measureSphere.getRadius();
  }
  scene.getWorldTransform().multiply(jntTransform, SkeletalDebugger.spTransform);
  SkeletalDebugger.spTransform.getMatrix().scale(new Vector3(size, size, size), SkeletalDebugger.spMatrix);
  SkeletalDebugger.spTransform.setRotation(SkeletalDebugger.spMatrix);
  SkeletalDebugger.joint.setWorldTransform(SkeletalDebugger.spTransform);
  SkeletalDebugger.joint.draw(renderer);
}

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

@Override
public void processInput(final Canvas source, final TwoInputStates inputStates, final AtomicBoolean inputConsumed,
    final InteractManager manager) {
  final Camera camera = source.getCanvasRenderer().getCamera();
  final MouseState current = inputStates.getCurrent().getMouseState();
  final MouseState previous = inputStates.getPrevious().getMouseState();
  // first process mouse over state
  checkMouseOver(source, current, manager);
  if (current.getButtonsReleasedSince(previous).contains(_dragButton)) {
    _rotateStore.setIdentity();
    if (_interactMatrix != InteractMatrix.Local) {
      setRingRotations(Matrix3.IDENTITY);
    }
  }
  // Now check drag status
  if (!checkShouldDrag(camera, current, previous, inputConsumed, manager)) {
    return;
  }
  // act on drag
  if (_lastDragSpatial instanceof InteractRing) {
    _lastRing = (InteractRing) _lastDragSpatial;
    final Vector2 oldMouse = new Vector2(previous.getX(), previous.getY());
    final ReadOnlyQuaternion rot = getNewAxisRotation(_lastRing, oldMouse, current, camera, manager);
    final Transform transform = manager.getSpatialState().getTransform();
    rot.toRotationMatrix(_calcMat3).multiply(transform.getMatrix(), _calcMat3);
    transform.setRotation(_calcMat3);
    // apply our filters, if any, now that we've made updates.
    applyFilters(manager);
  }
}

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

assertTrue(true == immutable.isRotationMatrix());
assertTrue(true == immutable.isUniformScale());
assertEquals(new Matrix3().applyRotationX(MathUtils.QUARTER_PI), immutable.getMatrix());
assertEquals(new Vector3(0, -1, -2), immutable.getScale());
assertEquals(new Vector3(1, 2, 3), immutable.getTranslation());
    Math.cos(a), 0, Math.sin(a), //
    0, 1, 0, //
    -Math.sin(a), 0, Math.cos(a)), trans.getMatrix());
assertEquals(trans.getMatrix(), trans2.getMatrix());

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

final Matrix3 mat = Matrix3.fetchTempInstance().set(_worldTransform.getMatrix()).multiplyLocal(_orient);
_worldTransform.setRotation(mat);
Matrix3.releaseTempInstance(mat);

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

final Matrix3 worldMatrix = Matrix3.fetchTempInstance().set(_worldTransform.getMatrix());

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

final Matrix3 worldMatrix = Matrix3.fetchTempInstance().set(_worldTransform.getMatrix());

相关文章