#pragma once
#include "nodes.h"

namespace enginend::nodes::trid {
	struct node3d:public node {
		Vector3 pos,rot,size,scale;
		Camera3D* watcher;
		Shader* shader;
		Color tint;
		node3d(){}
		node3d(Vector3 pos,Vector3 rot,Vector3 size,Vector3 scale);
	};

	struct physicsagent:virtual public node3d {
		bool hardbody,isphysics;
		std::vector<BoundingBox>* bboxes;
		physicsagent();
		physicsagent(bool hardbody,bool isphysics);
		physicsagent(bool hardbody,bool isphysics,std::vector<BoundingBox>* bboxes);
		void boot() override;
		void tick() override;
		void draw() override;
		void exit() override;
	};

	struct billboard:virtual public physicsagent {
		Texture2D texture;
		char*texpath;
		billboard(){}
		billboard(Vector3 pos,Vector3 rot,Vector3 size,Vector3 scale,char* texture);
		void boot() override;
		void tick() override;
		void draw() override;
		void exit() override;
	};

	struct object3d:public physicsagent {
		Model* model;
		const char *path;
		object3d(const char* path);
		void boot() override;
		void tick() override;
		void draw() override;
		void exit() override;
	};

	struct animatedbillboard:virtual public physicsagent {
		Image animimage;
		int frames;
		int currentframe;
		int framedelay;
		int framecounter;
		unsigned int nextframeoffset;
		int prevframe;
		Texture2D* texture;
		animatedbillboard();
		animatedbillboard(const char* gifpath, int delay = 6,Vector3 pos={},Vector3 rot={},Vector3 size={},Vector3 scale={});
		void tick() override;
		void draw() override;
		void exit() override;
	};

	struct animatedmodel:virtual public physicsagent {
		std::vector<ModelAnimation> *animation;
		Model *model;
		int animcount;
		int curranimation=0;
		int currentframe=0;
		animatedmodel();
		animatedmodel(Model *model,std::vector<ModelAnimation>* animation,int animcount,Vector3 pos,Vector3 rot,Vector3 size,Vector3 scale);
		void draw() override;
		void exit() override;
	};
}
