// Copyright (c) 2022-2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto.  Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//

#include <OgnMakeTransformLookAtDatabase.h>
#include <omni/math/linalg/matrix.h>

using omni::math::linalg::matrix4d;

namespace omni
{
namespace graph
{
namespace nodes
{

class OgnMakeTransformLookAt
{
public:
    static bool compute(OgnMakeTransformLookAtDatabase& db)
    {
        const auto& eyeInput = db.inputs.eye();
        const auto& centerInput = db.inputs.center();
        const auto& upInput = db.inputs.up();

        matrix4d matrix;
        matrix.SetLookAt(centerInput,eyeInput,upInput);
        db.outputs.transform() = matrix;

        return true; 
    }
};

REGISTER_OGN_NODE()

}
}
}
