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

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

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

Transform.setScale介绍

[英]Sets the scale portion of this transform to the given value as a vector (u, u, u)
[中]将此变换的比例部分设置为向量(u,u,u)的给定值

代码示例

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

/**
 * Sets the world scale.
 * 
 * @param scale
 *            the new world scale vector
 */
public void setWorldScale(final ReadOnlyVector3 scale) {
  _worldTransform.setScale(scale);
}

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

/**
 * Sets the world scale.
 *
 * @param scale
 *            the new world scale
 */
public void setWorldScale(final double scale) {
  _worldTransform.setScale(scale);
}

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

/**
 * Sets the world scale.
 * 
 * @param scale
 *            the new world scale
 */
public void setWorldScale(final double scale) {
  _worldTransform.setScale(scale);
}

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

/**
 * <code>setScale</code> sets the scale of this spatial. This marks the spatial as DirtyType.Transform.
 * 
 * @param scale
 *            the new scale of this spatial
 */
public void setScale(final double scale) {
  _localTransform.setScale(scale);
  markDirty(DirtyType.Transform);
}

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

@Override
public ValidatingTransform setScale(final double x, final double y, final double z) {
  super.setScale(x, y, z);
  validate();
  return this;
}

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

@Override
public ValidatingTransform setScale(final ReadOnlyVector3 scale) {
  super.setScale(scale);
  validate();
  return this;
}

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

/**
 * <code>setScale</code> sets the scale of this spatial. This marks the spatial as DirtyType.Transform.
 * 
 * @param scale
 *            the new scale of this spatial
 */
public void setScale(final ReadOnlyVector3 scale) {
  _localTransform.setScale(scale);
  markDirty(DirtyType.Transform);
}

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

/**
 * <code>setScale</code> sets the scale of this spatial. This marks the spatial as DirtyType.Transform.
 *
 * @param scale
 *            the new scale of this spatial
 */
public void setScale(final double scale) {
  _localTransform.setScale(scale);
  markDirty(DirtyType.Transform);
}

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

/**
 * <code>setScale</code> sets the scale of this spatial. This marks the spatial as DirtyType.Transform.
 *
 * @param scale
 *            the new scale of this spatial
 */
public void setScale(final ReadOnlyVector3 scale) {
  _localTransform.setScale(scale);
  markDirty(DirtyType.Transform);
}

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

@Override
public ValidatingTransform setScale(final ReadOnlyVector3 scale) {
  super.setScale(scale);
  validate();
  return this;
}

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

@Override
public ValidatingTransform setScale(final double uniformScale) {
  super.setScale(uniformScale);
  validate();
  return this;
}

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

@Test(expected = IllegalArgumentException.class)
public void testFailScale2B() {
  final Transform trans = new Transform();
  trans.setScale(0, 0, 0);
}

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

@Test(expected = IllegalArgumentException.class)
public void testFailScale1B() {
  final Transform trans = new Transform();
  trans.setScale(Vector3.ZERO);
}

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

public void applyTo(final Transform transform) {
  transform.setIdentity();
  transform.setRotation(getRotation());
  transform.setScale(getScale());
  transform.setTranslation(getTranslation());
}

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

public void applyTo(final Transform transform) {
  transform.setIdentity();
  transform.setRotation(getRotation());
  transform.setScale(getScale());
  transform.setTranslation(getTranslation());
}

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

public ReadOnlyTransform getValue() {
  final Transform t = new Transform();
  t.setTranslation(_translationX.getDoubleValue(), _translationY.getDoubleValue(), 0);
  final double val = _rotation.getDoubleValue() * MathUtils.DEG_TO_RAD;
  final Matrix3 mat = Matrix3.fetchTempInstance().fromAngles(0, 0, val);
  t.setRotation(mat);
  Matrix3.releaseTempInstance(mat);
  t.setScale(_scale.getDoubleValue());
  return t;
}

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

@Override
public void applyFilter(final InteractManager manager) {
  final ReadOnlyVector3 oldScale = manager.getSpatialTarget().getScale();
  final SpatialState state = manager.getSpatialState();
  final ReadOnlyVector3 scale = state.getTransform().getScale();
  state.getTransform().setScale( //
      _xAxis ? scale.getX() : oldScale.getX(), //
      _yAxis ? scale.getY() : oldScale.getY(), //
      _zAxis ? scale.getZ() : oldScale.getZ());
}

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

public ReadOnlyTransform getValue() {
  final Transform t = new Transform();
  t.setTranslation(_translation.getValue());
  final Vector3 val = _rotation.getValue().multiplyLocal(MathUtils.DEG_TO_RAD);
  final Matrix3 mat = Matrix3.fetchTempInstance().fromAngles(val.getX(), val.getY(), val.getZ());
  t.setRotation(mat);
  Matrix3.releaseTempInstance(mat);
  t.setScale(_scale.getValue());
  return t;
}

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

@Override
public void applyFilter(final InteractManager manager) {
  final SpatialState state = manager.getSpatialState();
  final ReadOnlyVector3 scale = state.getTransform().getScale();
  final double x = MathUtils.clamp(scale.getX(), _minScale.getX(), _maxScale.getX());
  final double y = MathUtils.clamp(scale.getY(), _minScale.getY(), _maxScale.getY());
  final double z = MathUtils.clamp(scale.getZ(), _minScale.getZ(), _maxScale.getZ());
  state.getTransform().setScale(x, y, z);
}

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

@Test(expected = TransformException.class)
public void testFailScale3A() {
  final Transform trans = new Transform(new Matrix3(), new Vector3(), new Vector3(), false, false, false);
  trans.setScale(1);
}

相关文章