Newer
Older
cg / include / poly.h
@glproj03 glproj03 on 29 Jan 2006 991 bytes Did a lot off stuff :-)
#ifndef _POLY_H
#define _POLY_H

#include "vec.h"
#include "spoly.h"
#include "color.h"
#include <vector>
#include <string>

using namespace std;

class Poly : SPoly {
	private:
		std::vector<Vec*> initpoints;
		int size;
		Vec* position;
		Vec* rotation;
		Vec* normal;
		Color* color;
		float delta;
		bool drawNormals;
	public:
		Poly();
		Poly(std::vector<Vec*> & _points);
		Poly(std::vector<Vec*> & _points, Color _color);
		~Poly();
		void setCenter(Vec c);
		void setCenter(Vec* c);
		Vec getInitRotation(Vec& v);
		Vec calcCenter();
		void setPosition(Vec newcenter);
		void rotate(Vec rot);
		Vec rotate_x(Vec& c);
		Vec rotate_y(Vec& c);
		Vec rotate_z(Vec& c);
		Vec rotate_xyz(Vec out);
		void draw();
		int numPoints();
		void vardump(std::string whitespace);
		void addPoint(Vec* p);
		void setColor(Color c);
		void setColor(Color* c);
		Color* getColor();
		void setDelta(float d);
		void showNormals();
		void hideNormals();
		void calcNormal();
		Poly* clone();
};
#endif