package wtf.beatrice.retrorender.engine.world;

import com.badlogic.gdx.graphics.g3d.ModelInstance;
import com.badlogic.gdx.math.Vector3;
public class WorldObject {

    public final String id;
    public final ModelInstance instance;
    public final Collider collider;
    public boolean staticObject = true;
    public boolean castsShadow  = true;

    // NEW: gameplay flags
    public boolean walkableSurface = false; // contributes to getGroundHeightAt
    public boolean collidable      = true;  // used by collidesAt

    // Cached translation for faster queries
    private final Vector3 tmpPos = new Vector3();

    public WorldObject(String id, ModelInstance instance, Collider collider) {
        this.id = id;
        this.instance = instance;
        this.collider = collider;
    }

    public void update(float delta) {
        // default: do nothing
        // For rotating decoration, set collidable=false + walkableSurface=false
        // and rotate instance.transform here if you want.
    }

    public Vector3 getPosition(Vector3 out) {
        instance.transform.getTranslation(out);
        return out;
    }

    public Vector3 getPosition() {
        return getPosition(tmpPos);
    }
}
