@Override public void setRadius(float radius) { transform.setScale(radius, radius, radius); }
public void setLocalScale(Vector3f scale) { localTransform.setScale(scale); }
/** * <code>setLocalScale</code> sets the local scale of this node. */ public void setLocalScale(float x, float y, float z) { localTransform.setScale(x, y, z); setTransformRefresh(); }
/** * <code>setLocalScale</code> sets the local scale of this node. * * @param localScale * the new local scale. */ public void setLocalScale(Vector3f localScale) { localTransform.setScale(localScale); setTransformRefresh(); }
/** * <code>setLocalScale</code> sets the local scale of this node. * * @param localScale * the new local scale, applied to x, y and z */ public void setLocalScale(float localScale) { localTransform.setScale(localScale); setTransformRefresh(); }
public void setExtent(Vector3f extent) { transform.setScale(extent); updateMatrix(); }
public Transform getModelBindInverseTransform() { Transform t = new Transform(); t.setTranslation(modelBindInversePos); t.setRotation(modelBindInverseRot); if (modelBindInverseScale != null) { t.setScale(modelBindInverseScale); } return t; }
public Transform getBindInverseTransform() { Transform t = new Transform(); t.setTranslation(bindPos); t.setRotation(bindRot); if (bindScale != null) { t.setScale(bindScale); } return t.invert(); }
joint.getLocalTransform().setRotation(rotation); if (scale != null) { joint.getLocalTransform().setScale(scale);
jmeLocalNodeTransform.setScale(localScale);
transform.setScale( scale.get(0).getAsFloat(), scale.get(1).getAsFloat(),
public void setWorldBindPose(Matrix4f worldBindPose) { if (cachedWorldBindPose != null) { if (!cachedWorldBindPose.equals(worldBindPose)) { throw new UnsupportedOperationException("Bind poses don't match"); } } cachedWorldBindPose = worldBindPose; this.jmeWorldBindPose = new Transform(); this.jmeWorldBindPose.setTranslation(worldBindPose.toTranslationVector()); this.jmeWorldBindPose.setRotation(worldBindPose.toRotationQuat()); this.jmeWorldBindPose.setScale(worldBindPose.toScaleVector()); System.out.println("\tBind Pose for " + getName()); System.out.println(jmeWorldBindPose); float[] angles = new float[3]; jmeWorldBindPose.getRotation().toAngles(angles); System.out.println("Angles: " + angles[0] * FastMath.RAD_TO_DEG + ", " + angles[1] * FastMath.RAD_TO_DEG + ", " + angles[2] * FastMath.RAD_TO_DEG); }
private static void applyInverse(Vector3f translation, Quaternion rotation, Vector3f scale, Transform inverseBindPose) { Transform t = new Transform(); t.setTranslation(translation); t.setRotation(rotation); if (scale != null) { t.setScale(scale); } t.combineWithParent(inverseBindPose); t.getTranslation(translation); t.getRotation(rotation); if (scale != null) { t.getScale(scale); } }
/** * Calculate the correct transform for a collision shape relative to the * ancestor for which the shape was generated. * * @param spat * @param parent * @return a new instance (not null) */ private static Transform getTransform(Spatial spat, Spatial parent) { Transform shapeTransform = new Transform(); Spatial parentNode = spat.getParent() != null ? spat.getParent() : spat; Spatial currentSpatial = spat; //if we have parents combine their transforms while (parentNode != null) { if (parent == currentSpatial) { //real parent -> only apply scale, not transform Transform trans = new Transform(); trans.setScale(currentSpatial.getLocalScale()); shapeTransform.combineWithParent(trans); parentNode = null; } else { shapeTransform.combineWithParent(currentSpatial.getLocalTransform()); parentNode = currentSpatial.getParent(); currentSpatial = parentNode; } } return shapeTransform; }
/** * Calculate the correct transform for a collision shape relative to the * ancestor for which the shape was generated. * * @param spat * @param parent * @return a new instance (not null) */ private static Transform getTransform(Spatial spat, Spatial parent) { Transform shapeTransform = new Transform(); Spatial parentNode = spat.getParent() != null ? spat.getParent() : spat; Spatial currentSpatial = spat; //if we have parents combine their transforms while (parentNode != null) { if (parent == currentSpatial) { //real parent -> only apply scale, not transform Transform trans = new Transform(); trans.setScale(currentSpatial.getLocalScale()); shapeTransform.combineWithParent(trans); parentNode = null; } else { shapeTransform.combineWithParent(currentSpatial.getLocalTransform()); parentNode = currentSpatial.getParent(); currentSpatial = parentNode; } } return shapeTransform; }
transform.setScale(interpolated.getScale());
transform.setScale(m.toScaleVector());
/** * <code>setLocalScale</code> sets the local scale of this node. */ public void setLocalScale(float x, float y, float z) { localTransform.setScale(x, y, z); setTransformRefresh(); }
/** * <code>setLocalScale</code> sets the local scale of this node. */ public void setLocalScale(float x, float y, float z) { localTransform.setScale(x, y, z); setTransformRefresh(); }
public Transform getModelBindInverseTransform() { Transform t = new Transform(); t.setTranslation(modelBindInversePos); t.setRotation(modelBindInverseRot); if (modelBindInverseScale != null) { t.setScale(modelBindInverseScale); } return t; }