/* osgEarth
 * Copyright 2025 Pelican Mapping
 * MIT License
 */

#ifndef OSGEARTH_INSTANCE_BUILDER_H
#define OSGEARTH_INSTANCE_BUILDER_H 1

#include <osgEarth/Export>
#include <osg/ref_ptr>
#include <osg/Array>
#include <osg/Geometry>

namespace osgEarth
{
    class OSGEARTH_EXPORT InstanceBuilder
    {
    public:
        InstanceBuilder();
        static osg::Geometry* createGeometry();
        osg::Vec3Array* getPositions() { return _positions.get(); };
        void setPositions(osg::Vec3Array* positions) { _positions = positions; };
        osg::Vec4Array* getRotations() { return _rotations.get(); };
        void setRotations(osg::Vec4Array* rotations) { _rotations = rotations; }
        osg::Vec3Array* getScales() { return _scales.get(); }
        void setScales(osg::Vec3Array* scales) { _scales = scales; }
        void installInstancing(osg::Geometry* geometry) const;
    protected:
        osg::ref_ptr<osg::Vec3Array> _positions;
        osg::ref_ptr<osg::Vec4Array> _rotations;
        osg::ref_ptr<osg::Vec3Array> _scales;
        // Overall values 
        osg::ref_ptr<osg::Vec3Array> _position;
        osg::ref_ptr<osg::Vec4Array> _rotation;
        osg::ref_ptr<osg::Vec3Array> _scale;
    };
}
#endif // OSGEARTH_INSTANCE_BUILDER_H
