1
This commit is contained in:
parent
0a22db99d6
commit
879ae26490
@ -25,6 +25,46 @@ a8::Vec2 Position::CalcDir2D(const Position& target_pos)
|
|||||||
return target_pos.ToVec2() - ToVec2();
|
return target_pos.ToVec2() - ToVec2();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Position::FromVec2(const a8::Vec2 v)
|
||||||
|
{
|
||||||
|
x = v.x;
|
||||||
|
y = v.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Position::FromVec2Ex(const a8::Vec2 v)
|
||||||
|
{
|
||||||
|
x = v.x;
|
||||||
|
y = v.y;
|
||||||
|
z = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Position::FromVec3(const a8::Vec3 v)
|
||||||
|
{
|
||||||
|
x = v.x;
|
||||||
|
y = v.y;
|
||||||
|
z = v.z;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Position::FromGlmVec2Ex(const glm::vec2 v)
|
||||||
|
{
|
||||||
|
x = v.x;
|
||||||
|
y = v.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Position::FromGlmVec2Ex(const glm::vec2 v)
|
||||||
|
{
|
||||||
|
x = v.x;
|
||||||
|
y = v.y;
|
||||||
|
z = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Position::FromGlmVec3(const glm::vec3 v)
|
||||||
|
{
|
||||||
|
x = v.x;
|
||||||
|
y = v.y;
|
||||||
|
z = v.z;
|
||||||
|
}
|
||||||
|
|
||||||
a8::Vec2 Position::ToVec2() const
|
a8::Vec2 Position::ToVec2() const
|
||||||
{
|
{
|
||||||
a8::Vec2 v2;
|
a8::Vec2 v2;
|
||||||
|
@ -76,6 +76,15 @@ struct Position
|
|||||||
float Distance2D2(const Position& pos);
|
float Distance2D2(const Position& pos);
|
||||||
float ManhattanDistance2D(const Position& target_pos);
|
float ManhattanDistance2D(const Position& target_pos);
|
||||||
a8::Vec2 CalcDir2D(const Position& target_pos);
|
a8::Vec2 CalcDir2D(const Position& target_pos);
|
||||||
|
|
||||||
|
void FromVec2(const a8::Vec2 v);
|
||||||
|
void FromVec2Ex(const a8::Vec2 v);
|
||||||
|
void FromVec3(const a8::Vec3 v);
|
||||||
|
|
||||||
|
void FromGlmVec2(const glm::vec2 v);
|
||||||
|
void FromGlmVec2Ex(const glm::vec2 v);
|
||||||
|
void FromGlmVec3(const glm::vec3 v);
|
||||||
|
|
||||||
a8::Vec2 ToVec2() const;
|
a8::Vec2 ToVec2() const;
|
||||||
a8::Vec3 ToVec3() const;
|
a8::Vec3 ToVec3() const;
|
||||||
glm::vec2 ToGlmVec2() const;
|
glm::vec2 ToGlmVec2() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user