Example #1
0
  private Vector3f interpolate_vertex(final Vector3f vertex0, final Vector3f vertex1) {
    float value0 = this.substitute_plane_equation(vertex0);
    float value1 = this.substitute_plane_equation(vertex1);
    float ratio = kvs.core.util.Math.abs(value0 / (value1 - value0));

    return (vertex0.mul(1.0f - ratio).add(vertex1.mul(ratio)));
  }
Example #2
0
  public void wheel(final float value) {
    Vector3f scale = new Vector3f(1.0f);

    switch (getScalingType()) {
      case ScalingXYZ:
        scale = scale.mul(value);
        break;
      case ScalingX:
        scale = new Vector3f(scale.getX() * value, scale.getY(), scale.getZ());
        break;
      case ScalingY:
        scale = new Vector3f(scale.getX(), scale.getY() * value, scale.getZ());
        break;
      case ScalingZ:
        scale = new Vector3f(scale.getX(), scale.getY(), scale.getZ() * value);
        break;
      case ScalingXY:
        scale = new Vector3f(scale.getX() * value, scale.getY() * value, scale.getZ());
        break;
      case ScalingYZ:
        scale = new Vector3f(scale.getX(), scale.getY() * value, scale.getZ() * value);
        break;
      case ScalingZX:
        scale = new Vector3f(scale.getX() * value, scale.getY(), scale.getZ() * value);
        break;
      default:
        break;
    }

    m_scale = scale;

    scale(m_old, m_new, getScalingType());

    m_old = m_new;
  }
Example #3
0
 public Vector3f point() {
   return (m_from.add(m_direction.mul(m_t)));
 }