
Added Light Base Class Added AmbientLight, DirectionalLight and PointLight Classes Added Constructor to the Camera Class Added Light CoEff's to the Model Class Added Color Variables to Polygon3D Class Added Light Vector to hold the lights in the Rasteriser Added Camera Vector to hold multiple Cameras and Methods to set which is the current Added Lighting to the Rasterizer Added DrawSolidFlat method to the Rastorizer Added Bounds Check to the SharedTools for Int and Float values Added Color Enum Class Added Normalize Method to the Vector3D Class Renamed the TransformTools to SharedTools since adding more non transform methods to it
36 lines
608 B
C++
36 lines
608 B
C++
#pragma once
|
|
#include <cmath>
|
|
|
|
class Vector3D
|
|
{
|
|
public:
|
|
Vector3D();
|
|
Vector3D(float x, float y, float z);
|
|
Vector3D(const Vector3D& other);
|
|
|
|
~Vector3D();
|
|
|
|
// Accessors
|
|
float GetX() const;
|
|
void SetX(const float x);
|
|
float GetY() const;
|
|
void SetY(const float y);
|
|
float GetZ() const;
|
|
void SetZ(const float z);
|
|
|
|
void Normalize();
|
|
|
|
static float DotProduct(const Vector3D v1, const Vector3D v2);
|
|
static Vector3D CrossProduct(const Vector3D v1, const Vector3D v2);
|
|
|
|
const Vector3D operator+ (const Vector3D& rhs) const;
|
|
|
|
private:
|
|
float _x;
|
|
float _y;
|
|
float _z;
|
|
|
|
void Copy(const Vector3D& other);
|
|
};
|
|
|