#include <stdlib.h>
#include <stdio.h>
#include "objects.h"

/*	This function creates and returns a pointer	*/
object* make_object(int obj_type, int objN)
{
	object* obj;

	if(obj_type == CAMERA)
		obj = (object*) (malloc (sizeof(object)));

	else if(obj_type == LIGHT_POINT)
		obj = (object*) (malloc (sizeof(object)));
	else if(obj_type == BACKGROUND)
		obj = (object*) (malloc (sizeof(object)));
	else if(obj_type == LIGHT_SPHERE)
		obj = (object*) (malloc (sizeof(object)));
	else 
		obj = (object*) (malloc (sizeof(object)));

	obj->obj_type = obj_type;
	obj->id = objN;
	return obj;
}

vector* set_tri(vector* v, double one, double two, double three)
{
	v->x = one;
	v->y = two;
	v->z = three;
	return v;
}

color* make_color(color* c, double red, double green, double blue)
{
	c->r = red;
	c->g = green;
	c->b = blue;
	return c;
}


object* set_misc(object* o, double t, double rl, double ra,
		double rad, double sa)
{
   o->trans = t;
   o->reflect = rl;
   o->refract = ra;
   o->radius = rad;
   o->spec_alpha = sa;
	return o;
}

object* setCameraValues(int w, int h, int u, object* o)
{
   //o->width = w;
   //o->height = h;
   //o->units = u;
   return o;
}
