Skip to content

Commit ba41aa2

Browse files
author
Alessio Linares
committed
Added copy-constructor to Vector2d and Vector3d
1 parent f788682 commit ba41aa2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Vector2d.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33

44
namespace hb
55
{
6-
struct Vector2d
6+
class Vector2d
77
{
8+
public:
89
double x, y;
910
Vector2d(): x(0), y(0){};
1011
Vector2d(double x, double y): x(x), y(y){};
12+
Vector2d(const Vector2d& v): x(v.x), y(v.y){};
1113
};
1214

1315
}

Vector3d.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33

44
namespace hb
55
{
6-
struct Vector3d
6+
class Vector3d
77
{
8+
public:
89
double x, y, z;
910
Vector3d(): x(0), y(0), z(0){};
1011
Vector3d(double x, double y, double z): x(x), y(y), z(z){};
12+
Vector3d(const Vector3d& v): x(v.x), y(v.y), z(v.z){};
1113
};
1214

1315
}

0 commit comments

Comments
 (0)