2013-09-07 16:09:19 -07:00
|
|
|
/* object.c
|
|
|
|
*
|
2013-09-10 15:45:13 -07:00
|
|
|
* Definition of generic scene objects.
|
2013-09-07 16:09:19 -07:00
|
|
|
*
|
|
|
|
* Eryn Wells <eryn@erynwells.me>
|
|
|
|
*/
|
|
|
|
|
2013-09-10 09:33:59 -07:00
|
|
|
#include <cassert>
|
|
|
|
#include <cmath>
|
|
|
|
#include <cstdlib>
|
2013-09-07 22:22:27 -07:00
|
|
|
|
2013-09-07 16:48:50 -07:00
|
|
|
#include "basics.h"
|
2013-09-11 09:05:27 -07:00
|
|
|
#include "material.h"
|
2013-09-07 16:09:19 -07:00
|
|
|
#include "object.h"
|
2014-08-09 08:57:41 -07:00
|
|
|
#include "basics/basics.hh"
|
|
|
|
|
|
|
|
|
|
|
|
using charles::basics::Vector4;
|
|
|
|
|
2013-09-07 16:09:19 -07:00
|
|
|
|
2014-07-20 16:46:49 -07:00
|
|
|
namespace charles {
|
2014-08-03 17:25:00 -07:00
|
|
|
|
2013-09-10 15:45:13 -07:00
|
|
|
#pragma mark - Objects
|
2013-09-07 16:48:50 -07:00
|
|
|
|
2014-08-09 08:57:41 -07:00
|
|
|
Object::Object(const Vector4& origin)
|
|
|
|
: mTranslation(basics::TranslationMatrix(origin.X(), origin.Y(), origin.Z())),
|
|
|
|
mMaterial()
|
2013-09-10 15:45:13 -07:00
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2014-08-09 08:59:11 -07:00
|
|
|
* charles::Object::~Object --
|
2013-09-10 15:45:13 -07:00
|
|
|
*/
|
2014-07-20 16:46:49 -07:00
|
|
|
Object::~Object()
|
2013-09-10 15:45:13 -07:00
|
|
|
{ }
|
2013-09-07 18:26:32 -07:00
|
|
|
|
2013-09-09 08:52:14 -07:00
|
|
|
|
2014-07-20 16:46:49 -07:00
|
|
|
Material&
|
|
|
|
Object::GetMaterial()
|
2013-09-09 08:52:14 -07:00
|
|
|
{
|
2014-07-20 16:46:49 -07:00
|
|
|
return mMaterial;
|
2013-09-09 08:52:14 -07:00
|
|
|
}
|
|
|
|
|
2014-07-20 16:46:49 -07:00
|
|
|
|
2013-09-11 09:05:27 -07:00
|
|
|
void
|
2014-07-20 16:46:49 -07:00
|
|
|
Object::SetMaterial(const Material& material)
|
2013-09-09 08:52:14 -07:00
|
|
|
{
|
2014-07-20 16:46:49 -07:00
|
|
|
mMaterial = material;
|
2013-09-09 08:52:14 -07:00
|
|
|
}
|
2014-07-20 16:46:49 -07:00
|
|
|
|
2014-08-03 17:25:00 -07:00
|
|
|
|
|
|
|
void
|
|
|
|
Object::Write(std::ostream& ost)
|
|
|
|
const
|
|
|
|
{
|
|
|
|
ost << "[Object]";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::ostream&
|
|
|
|
operator<<(std::ostream& ost,
|
|
|
|
const Object& object)
|
|
|
|
{
|
|
|
|
object.Write(ost);
|
|
|
|
return ost;
|
|
|
|
}
|
|
|
|
|
2014-07-20 16:46:49 -07:00
|
|
|
} /* namespace charles */
|