using KWEngine3;
using KWEngine3.GameObjects;
using KWEngine3_Game.Classes;
using OpenTK.Mathematics;

namespace KWEngine3_Game
{
    public class GameWorld01 : World
    {
        public override void Act()
        {
            
        }

        public override void Prepare()
        {
            KWEngine.LoadModel("Robot", "./Models/robotERS.fbx");

            SetCameraPosition(0.0f, 10.0f, 15.0f);
            SetCameraFOV(90);

            SetColorAmbient(0.25f, 0.25f, 0.25f);
            SetBackground2D("./Textures/spacebackground.png");
            SetBackground2DRepeat(2, 2);
            SetBackgroundBrightnessMultiplier(4);

            Floor f1 = new Floor();
            f1.Name = "Floor";
            f1.SetModel("KWCube");
            f1.SetScale(20f, 1f, 20f);
            f1.SetPosition(0.0f, -0.5f, 0.0f);
            f1.SetTexture("./Textures/metalfloor_albedo.png", TextureType.Albedo);
            f1.SetTexture("./Textures/metalfloor_normal.png", TextureType.Normal);
            f1.SetTexture("./Textures/metalfloor_roughness.png", TextureType.Roughness);
            f1.SetTextureRepeat(2, 2);
            f1.IsCollisionObject = true;
            f1.IsShadowCaster = true;
            AddGameObject(f1);

            Player p1 = new Player();
            p1.Name = "Player #1";
            p1.SetModel("Robot");
            p1.SetScale(2);
            p1.SetPosition(0, 0, 0);
            p1.IsCollisionObject = true;
            p1.IsShadowCaster = true;
            if(p1.HasAnimations)
            {
                p1.SetAnimationID(0);
                p1.SetAnimationPercentage(0);
            }
            AddGameObject(p1);

            LightObjectSun sun = new LightObjectSun(ShadowQuality.High, SunShadowType.Default);
            sun.Name = "Sunlight";
            sun.SetPosition(-50f, 50f, 25f);
            sun.SetNearFar(25f, 125f);
            sun.SetFOV(80);
            sun.SetColor(1f, 1f, 1f, 3f);
            AddLightObject(sun);
        }
    }
}
