// Copyright (c) 2021-2021, 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 <OgnReadTimeDatabase.h>

namespace omni
{
namespace graph
{
namespace nodes
{

class OgnReadTime
{
public:

    static bool compute(OgnReadTimeDatabase& db)
    {
        const auto& contextObj = db.abi_context();
        const IGraphContext* const iContext = contextObj.iContext;

        db.outputs.deltaSeconds() = iContext->getElapsedTime(contextObj);
        db.outputs.isPlaying() = iContext->getIsPlaying(contextObj);
        db.outputs.time() = iContext->getTime(contextObj);
        db.outputs.frame() = iContext->getFrame(contextObj);
        db.outputs.timeSinceStart() = iContext->getTimeSinceStart(contextObj);
        db.outputs.absoluteSimTime() = iContext->getAbsoluteSimTime(contextObj);

        return true;
    }
};

REGISTER_OGN_NODE()
} // nodes
} // graph
} // omni
