Clean up constructors for Object and Sphere
Use default arguments instead of multiple constructors. I forgot about those! Use Vector4s all around.
This commit is contained in:
parent
8ccfbc0498
commit
ab9ac5e963
4 changed files with 28 additions and 49 deletions
|
@ -12,32 +12,26 @@
|
|||
#include "basics.h"
|
||||
#include "material.h"
|
||||
#include "object.h"
|
||||
#include "basics/basics.hh"
|
||||
|
||||
|
||||
using charles::basics::Vector4;
|
||||
|
||||
|
||||
namespace charles {
|
||||
|
||||
#pragma mark - Objects
|
||||
|
||||
/*
|
||||
* Object::Object --
|
||||
*
|
||||
* Default constructor. Create a new Object with an origin at (0, 0, 0).
|
||||
*/
|
||||
Object::Object()
|
||||
: Object(Vector3::Zero)
|
||||
{ }
|
||||
|
||||
|
||||
/*
|
||||
* Object::Object --
|
||||
*
|
||||
* Constructor. Create a new Object with an origin at o.
|
||||
*/
|
||||
Object::Object(Vector3 origin)
|
||||
: mOrigin(origin),
|
||||
Object::Object(const Vector4& origin)
|
||||
: mTranslation(basics::TranslationMatrix(origin.X(), origin.Y(), origin.Z())),
|
||||
mMaterial()
|
||||
{ }
|
||||
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
|
||||
Vector3
|
||||
Object::GetOrigin()
|
||||
const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue