com.badlogic.gdx.math.Matrix4.getScale()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(64)

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

Matrix4.getScale介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

/** Postmultiplies the current transformation with the given matrix. */
public void mul (Matrix4 transform) {
  this.transform.mul(transform);
  this.transform.getScale(scale);
}

代码示例来源:origin: libgdx/libgdx

/** Sets the current transformation to the given one.
 * @param transform the new transform matrix */
public void setTransform (Matrix4 transform) {
  this.transform.set(transform);
  transform.getScale(scale);
}

代码示例来源:origin: libgdx/libgdx

/** Sets the current transformation to the given one.
 * @param transform the new transform matrix */
public void setTransform (Matrix4 transform) {
  this.transform.set(transform);
  transform.getScale(scale);
}

代码示例来源:origin: libgdx/libgdx

/** Postmultiplies the current transformation with a scale matrix represented by the given scale on x,y,z. */
public void scale (float scaleX, float scaleY, float scaleZ) {
  this.transform.scale(scaleX, scaleY, scaleZ);
  this.transform.getScale(scale);
}

代码示例来源:origin: libgdx/libgdx

/** Postmultiplies the current transformation with a scale matrix represented by the given scale on x,y,z. */
public void scale (float scaleX, float scaleY, float scaleZ) {
  this.transform.scale(scaleX, scaleY, scaleZ);
  this.transform.getScale(scale);
}

代码示例来源:origin: libgdx/libgdx

/** Postmultiplies the current transformation with the given matrix. */
public void mul (Matrix4 transform) {
  this.transform.mul(transform);
  this.transform.getScale(scale);
}

代码示例来源:origin: libgdx/libgdx

/** Averages the given transform with this one and stores the result in this matrix. Translations and scales are lerped while
 * rotations are slerped.
 * @param other The other transform
 * @param w Weight of this transform; weight of the other transform is (1 - w)
 * @return This matrix for chaining */
public Matrix4 avg (Matrix4 other, float w) {
  getScale(tmpVec);
  other.getScale(tmpForward);
  getRotation(quat);
  other.getRotation(quat2);
  getTranslation(tmpUp);
  other.getTranslation(right);
  setToScaling(tmpVec.scl(w).add(tmpForward.scl(1 - w)));
  rotate(quat.slerp(quat2, 1 - w));
  setTranslation(tmpUp.scl(w).add(right.scl(1 - w)));
  return this;
}

代码示例来源:origin: libgdx/libgdx

/** Averages the given transform with this one and stores the result in this matrix. Translations and scales are lerped while
 * rotations are slerped.
 * @param other The other transform
 * @param w Weight of this transform; weight of the other transform is (1 - w)
 * @return This matrix for chaining */
public Matrix4 avg (Matrix4 other, float w) {
  getScale(tmpVec);
  other.getScale(tmpForward);
  getRotation(quat);
  other.getRotation(quat2);
  getTranslation(tmpUp);
  other.getTranslation(right);
  setToScaling(tmpVec.scl(w).add(tmpForward.scl(1 - w)));
  rotate(quat.slerp(quat2, 1 - w));
  setTranslation(tmpUp.scl(w).add(right.scl(1 - w)));
  return this;
}

代码示例来源:origin: libgdx/libgdx

/** Averages the given transforms with the given weights and stores the result in this matrix. Translations and scales are
 * lerped while rotations are slerped. Does not destroy the data contained in t or w; Sum of w_i must be equal to 1, or
 * unexpected results will occur.
 * @param t List of transforms
 * @param w List of weights
 * @return This matrix for chaining */
public Matrix4 avg (Matrix4[] t, float[] w) {
  tmpVec.set(t[0].getScale(tmpUp).scl(w[0]));
  quat.set(t[0].getRotation(quat2).exp(w[0]));
  tmpForward.set(t[0].getTranslation(tmpUp).scl(w[0]));
  for (int i = 1; i < t.length; i++) {
    tmpVec.add(t[i].getScale(tmpUp).scl(w[i]));
    quat.mul(t[i].getRotation(quat2).exp(w[i]));
    tmpForward.add(t[i].getTranslation(tmpUp).scl(w[i]));
  }
  quat.nor();
  setToScaling(tmpVec);
  rotate(quat);
  setTranslation(tmpForward);
  return this;
}

代码示例来源:origin: libgdx/libgdx

/** Averages the given transforms with the given weights and stores the result in this matrix. Translations and scales are
 * lerped while rotations are slerped. Does not destroy the data contained in t or w; Sum of w_i must be equal to 1, or
 * unexpected results will occur.
 * @param t List of transforms
 * @param w List of weights
 * @return This matrix for chaining */
public Matrix4 avg (Matrix4[] t, float[] w) {
  tmpVec.set(t[0].getScale(tmpUp).scl(w[0]));
  quat.set(t[0].getRotation(quat2).exp(w[0]));
  tmpForward.set(t[0].getTranslation(tmpUp).scl(w[0]));
  for (int i = 1; i < t.length; i++) {
    tmpVec.add(t[i].getScale(tmpUp).scl(w[i]));
    quat.mul(t[i].getRotation(quat2).exp(w[i]));
    tmpForward.add(t[i].getTranslation(tmpUp).scl(w[i]));
  }
  quat.nor();
  setToScaling(tmpVec);
  rotate(quat);
  setTranslation(tmpForward);
  return this;
}

代码示例来源:origin: libgdx/libgdx

/** Averages the given transforms and stores the result in this matrix. Translations and scales are lerped while rotations are
 * slerped. Does not destroy the data contained in t.
 * @param t List of transforms
 * @return This matrix for chaining */
public Matrix4 avg (Matrix4[] t) {
  final float w = 1.0f / t.length;
  tmpVec.set(t[0].getScale(tmpUp).scl(w));
  quat.set(t[0].getRotation(quat2).exp(w));
  tmpForward.set(t[0].getTranslation(tmpUp).scl(w));
  for (int i = 1; i < t.length; i++) {
    tmpVec.add(t[i].getScale(tmpUp).scl(w));
    quat.mul(t[i].getRotation(quat2).exp(w));
    tmpForward.add(t[i].getTranslation(tmpUp).scl(w));
  }
  quat.nor();
  setToScaling(tmpVec);
  rotate(quat);
  setTranslation(tmpForward);
  return this;
}

代码示例来源:origin: libgdx/libgdx

/** Averages the given transforms and stores the result in this matrix. Translations and scales are lerped while rotations are
 * slerped. Does not destroy the data contained in t.
 * @param t List of transforms
 * @return This matrix for chaining */
public Matrix4 avg (Matrix4[] t) {
  final float w = 1.0f / t.length;
  tmpVec.set(t[0].getScale(tmpUp).scl(w));
  quat.set(t[0].getRotation(quat2).exp(w));
  tmpForward.set(t[0].getTranslation(tmpUp).scl(w));
  for (int i = 1; i < t.length; i++) {
    tmpVec.add(t[i].getScale(tmpUp).scl(w));
    quat.mul(t[i].getRotation(quat2).exp(w));
    tmpForward.add(t[i].getTranslation(tmpUp).scl(w));
  }
  quat.nor();
  setToScaling(tmpVec);
  rotate(quat);
  setTranslation(tmpForward);
  return this;
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

/** Sets the current transformation to the given one.
 * @param transform the new transform matrix */
public void setTransform (Matrix4 transform) {
  this.transform.set(transform);
  transform.getScale(scale);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

/** Postmultiplies the current transformation with a scale matrix represented by the given scale on x,y,z. */
public void scale (float scaleX, float scaleY, float scaleZ) {
  this.transform.scale(scaleX, scaleY, scaleZ);
  this.transform.getScale(scale);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

/** Postmultiplies the current transformation with the given matrix. */
public void mul (Matrix4 transform) {
  this.transform.mul(transform);
  this.transform.getScale(scale);
}

代码示例来源:origin: com.harium.propan/propan

public Vector3 getScale() {
  return transform.getScale(new Vector3());
}

代码示例来源:origin: mbrlabs/Mundus

@Override
public Vector3 getScale(Vector3 out) {
  return getTransform().getScale(out);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

/** Averages the given transform with this one and stores the result in this matrix. Translations and scales are lerped while
 * rotations are slerped.
 * @param other The other transform
 * @param w Weight of this transform; weight of the other transform is (1 - w)
 * @return This matrix for chaining */
public Matrix4 avg (Matrix4 other, float w) {
  getScale(tmpVec);
  other.getScale(tmpForward);
  getRotation(quat);
  other.getRotation(quat2);
  getTranslation(tmpUp);
  other.getTranslation(right);
  setToScaling(tmpVec.scl(w).add(tmpForward.scl(1 - w)));
  rotate(quat.slerp(quat2, 1 - w));
  setTranslation(tmpUp.scl(w).add(right.scl(1 - w)));
  return this;
}

代码示例来源:origin: com.harium.etyl/etyl-gdx-util

/** Averages the given transform with this one and stores the result in this matrix. Translations and scales are lerped while
 * rotations are slerped.
 * @param other The other transform
 * @param w Weight of this transform; weight of the other transform is (1 - w)
 * @return This matrix for chaining */
public Matrix4 avg (Matrix4 other, float w) {
  getScale(tmpVec);
  other.getScale(tmpForward);
  getRotation(quat);
  other.getRotation(quat2);
  getTranslation(tmpUp);
  other.getTranslation(right);
  setToScaling(tmpVec.scl(w).add(tmpForward.scl(1 - w)));
  rotate(quat.slerp(quat2, 1 - w));
  setTranslation(tmpUp.scl(w).add(right.scl(1 - w)));
  return this;
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

/** Averages the given transforms and stores the result in this matrix. Translations and scales are lerped while rotations are
 * slerped. Does not destroy the data contained in t.
 * @param t List of transforms
 * @return This matrix for chaining */
public Matrix4 avg (Matrix4[] t) {
  final float w = 1.0f / t.length;
  tmpVec.set(t[0].getScale(tmpUp).scl(w));
  quat.set(t[0].getRotation(quat2).exp(w));
  tmpForward.set(t[0].getTranslation(tmpUp).scl(w));
  for (int i = 1; i < t.length; i++) {
    tmpVec.add(t[i].getScale(tmpUp).scl(w));
    quat.mul(t[i].getRotation(quat2).exp(w));
    tmpForward.add(t[i].getTranslation(tmpUp).scl(w));
  }
  quat.nor();
  setToScaling(tmpVec);
  rotate(quat);
  setTranslation(tmpForward);
  return this;
}

相关文章