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

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

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

Matrix4.<init>介绍

[英]Constructs an identity matrix
[中]构造一个身份矩阵

代码示例

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

@Override
  protected Matrix4 newObject () {
    return new Matrix4();
  }
};

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

@Override
  protected Matrix4 newObject () {
    return new Matrix4();
  }
};

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

/** @return a copy of this matrix */
public Matrix4 cpy () {
  return new Matrix4(this);
}

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

/** @return a copy of this matrix */
public Matrix4 cpy () {
  return new Matrix4(this);
}

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

private void init () {
  // create the isometric transform
  isoTransform = new Matrix4();
  isoTransform.idt();
  // isoTransform.translate(0, 32, 0);
  isoTransform.scale((float)(Math.sqrt(2.0) / 2.0), (float)(Math.sqrt(2.0) / 4.0), 1.0f);
  isoTransform.rotate(0.0f, 0.0f, 1.0f, -45);
  // ... and the inverse matrix
  invIsotransform = new Matrix4(isoTransform);
  invIsotransform.inv();
}

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

private void init () {
  // create the isometric transform
  isoTransform = new Matrix4();
  isoTransform.idt();
  // isoTransform.translate(0, 32, 0);
  isoTransform.scale((float)(Math.sqrt(2.0) / 2.0), (float)(Math.sqrt(2.0) / 4.0), 1.0f);
  isoTransform.rotate(0.0f, 0.0f, 1.0f, -45);
  // ... and the inverse matrix
  invIsotransform = new Matrix4(isoTransform);
  invIsotransform.inv();
}

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

/** Constructs a new ModelInstance with only the specified nodes and materials of the given model. */
public ModelInstance (final Model model, final Matrix4 transform, final Array<String> rootNodeIds, boolean shareKeyframes) {
  this.model = model;
  this.transform = transform == null ? new Matrix4() : transform;
  copyNodes(model.nodes, rootNodeIds);
  copyAnimations(model.animations, shareKeyframes);
  calculateTransforms();
}

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

public ParticleController () {
  transform = new Matrix4();
  scale = new Vector3(1, 1, 1);
  influencers = new Array<Influencer>(true, 3, Influencer.class);
  setTimeStep(DEFAULT_TIME_STEP);
}

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

/** Constructs a new ModelInstance which is an copy of the specified ModelInstance. */
public ModelInstance (ModelInstance copyFrom, final Matrix4 transform, boolean shareKeyframes) {
  this.model = copyFrom.model;
  this.transform = transform == null ? new Matrix4() : transform;
  copyNodes(copyFrom.nodes);
  copyAnimations(copyFrom.animations, shareKeyframes);
  calculateTransforms();
}

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

public ParticleController () {
  transform = new Matrix4();
  scale = new Vector3(1, 1, 1);
  influencers = new Array<Influencer>(true, 3, Influencer.class);
  setTimeStep(DEFAULT_TIME_STEP);
}

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

/** Constructs a new ModelInstance which is an copy of the specified ModelInstance. */
public ModelInstance (ModelInstance copyFrom, final Matrix4 transform, boolean shareKeyframes) {
  this.model = copyFrom.model;
  this.transform = transform == null ? new Matrix4() : transform;
  copyNodes(copyFrom.nodes);
  copyAnimations(copyFrom.animations, shareKeyframes);
  calculateTransforms();
}

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

/** Constructs a new ModelInstance with only the specified nodes and materials of the given model. */
public ModelInstance (final Model model, final Matrix4 transform, final Array<String> rootNodeIds, boolean shareKeyframes) {
  this.model = model;
  this.transform = transform == null ? new Matrix4() : transform;
  copyNodes(model.nodes, rootNodeIds);
  copyAnimations(model.animations, shareKeyframes);
  calculateTransforms();
}

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

/** Constructs a new ModelInstance with only the specified nodes and materials of the given model. */
public ModelInstance (final Model model, final Matrix4 transform, final String... rootNodeIds) {
  this.model = model;
  this.transform = transform == null ? new Matrix4() : transform;
  if (rootNodeIds == null)
    copyNodes(model.nodes);
  else
    copyNodes(model.nodes, rootNodeIds);
  copyAnimations(model.animations, defaultShareKeyframes);
  calculateTransforms();
}

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

/** Constructs a new ModelInstance with only the specified nodes and materials of the given model. */
public ModelInstance (final Model model, final Matrix4 transform, final String... rootNodeIds) {
  this.model = model;
  this.transform = transform == null ? new Matrix4() : transform;
  if (rootNodeIds == null)
    copyNodes(model.nodes);
  else
    copyNodes(model.nodes, rootNodeIds);
  copyAnimations(model.animations, defaultShareKeyframes);
  calculateTransforms();
}

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

public void resize (int width, int height) {
  renderer.setProjectionMatrix(new Matrix4().setToOrtho2D(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()));
}

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

public void resize (int width, int height) {
  renderer.setProjectionMatrix(new Matrix4().setToOrtho2D(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()));
}

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

@Override
protected void onLoaded () {
  if (currentlyLoading == null || currentlyLoading.length() == 0) return;
  final ModelInstance instance = new ModelInstance(assets.get(currentlyLoading, Model.class));
  instance.transform = new Matrix4().idt();
  instance.transform.setToTranslation(MathUtils.random(-10, 10), MathUtils.random(-10, 10), MathUtils.random(-10, 10));
  instance.transform.rotate(Vector3.X, MathUtils.random(-180, 180));
  instance.transform.rotate(Vector3.Y, MathUtils.random(-180, 180));
  instance.transform.rotate(Vector3.Z, MathUtils.random(-180, 180));
  instances.add(instance);
}

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

protected void loadNodes (Iterable<ModelNode> modelNodes) {
  nodePartBones.clear();
  for (ModelNode node : modelNodes) {
    nodes.add(loadNode(node));
  }
  for (ObjectMap.Entry<NodePart, ArrayMap<String, Matrix4>> e : nodePartBones.entries()) {
    if (e.key.invBoneBindTransforms == null)
      e.key.invBoneBindTransforms = new ArrayMap<Node, Matrix4>(Node.class, Matrix4.class);
    e.key.invBoneBindTransforms.clear();
    for (ObjectMap.Entry<String, Matrix4> b : e.value.entries())
      e.key.invBoneBindTransforms.put(getNode(b.key), new Matrix4(b.value).inv());
  }
}

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

protected void loadNodes (Iterable<ModelNode> modelNodes) {
  nodePartBones.clear();
  for (ModelNode node : modelNodes) {
    nodes.add(loadNode(node));
  }
  for (ObjectMap.Entry<NodePart, ArrayMap<String, Matrix4>> e : nodePartBones.entries()) {
    if (e.key.invBoneBindTransforms == null)
      e.key.invBoneBindTransforms = new ArrayMap<Node, Matrix4>(Node.class, Matrix4.class);
    e.key.invBoneBindTransforms.clear();
    for (ObjectMap.Entry<String, Matrix4> b : e.value.entries())
      e.key.invBoneBindTransforms.put(getNode(b.key), new Matrix4(b.value).inv());
  }
}

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

public void create () {
  batch = new SpriteBatch();
  batch.setProjectionMatrix(new Matrix4().setToOrtho2D(0, 0, 855, 480));
  atlas = new TextureAtlas(Gdx.files.internal("data/issue_pack"), Gdx.files.internal("data/"));
  sprite = atlas.createSprite("map");
  font = new BitmapFont(Gdx.files.internal("data/font.fnt"), Gdx.files.internal("data/font.png"), false);
  Gdx.gl.glClearColor(0, 1, 0, 1);
}

相关文章