/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
 *
 * SPDX-License-Identifier: Apache-2.0 */

#include "stdcycles.h"

shader node_vector_transform(string transform_type = "vector",
                             string convert_from = "world",
                             string convert_to = "object",
                             vector VectorIn = vector(0.0, 0.0, 0.0),
                             output vector VectorOut = vector(0.0, 0.0, 0.0))
{
  if (transform_type == "vector" || transform_type == "normal") {
    VectorOut = transform(convert_from, convert_to, VectorIn);
    if (transform_type == "normal")
      VectorOut = normalize(VectorOut);
  }
  else if (transform_type == "point") {
    point Point = (point)VectorIn;
    VectorOut = transform(convert_from, convert_to, Point);
  }
}
