Add conversion from Vector3
This commit is contained in:
parent
fe12c99159
commit
4b07328790
@ -5,6 +5,7 @@
|
|||||||
#include "Vector2.h"
|
#include "Vector2.h"
|
||||||
#include "Angle.h"
|
#include "Angle.h"
|
||||||
#include "FloatSingle.h"
|
#include "FloatSingle.h"
|
||||||
|
#include "Vector3.h"
|
||||||
|
|
||||||
#if defined(AVR)
|
#if defined(AVR)
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
@ -27,6 +28,11 @@ Vector2::Vector2(Vec2 v) {
|
|||||||
y = v.y;
|
y = v.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vector2::Vector2(Vector3 v) {
|
||||||
|
x = v.x;
|
||||||
|
y = v.z;
|
||||||
|
}
|
||||||
|
|
||||||
Vector2::~Vector2() {}
|
Vector2::~Vector2() {}
|
||||||
|
|
||||||
const Vector2 Vector2::zero = Vector2(0, 0);
|
const Vector2 Vector2::zero = Vector2(0, 0);
|
||||||
|
@ -24,6 +24,8 @@ typedef struct Vec2 {
|
|||||||
} Vec2;
|
} Vec2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Vector3;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A 2-dimensional vector
|
/// A 2-dimensional vector
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -46,6 +48,8 @@ public:
|
|||||||
/// <param name="v">The C-style Vec</param>
|
/// <param name="v">The C-style Vec</param>
|
||||||
Vector2(Vec2 v);
|
Vector2(Vec2 v);
|
||||||
|
|
||||||
|
Vector2(Vector3 v);
|
||||||
|
|
||||||
~Vector2();
|
~Vector2();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user