TrueReality
v0.1.1912
Vec2f.cpp
Go to the documentation of this file.
1
/*
2
* True Reality Open Source Game and Simulation Engine
3
* Copyright © 2021 Acid Rain Studios LLC
4
*
5
* This library is free software; you can redistribute it and/or modify it under
6
* the terms of the GNU Lesser General Public License as published by the Free
7
* Software Foundation; either version 3.0 of the License, or (at your option)
8
* any later version.
9
*
10
* This library is distributed in the hope that it will be useful, but WITHOUT
11
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13
* details.
14
*
15
* You should have received a copy of the GNU Lesser General Public License
16
* along with this library; if not, write to the Free Software Foundation, Inc.,
17
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
*
19
* @author Maxim Serebrennik
20
*/
21
22
#include <
trBase/Vec2f.h
>
23
24
#include <
trBase/Vec2d.h
>
25
26
#include <osg/Vec2d>
27
28
// Specialize Vec2Impl to be Vec2f
29
#define Vec2Impl Vec2f
30
31
namespace
trBase
32
{
34
Vec2f::Vec2f
(
const
osg::Vec2d &v)
35
: mVec(static_cast<float>(v.x()), static_cast<float>(v.y()))
36
{
37
}
38
40
void
Vec2f::operator =
(
const
Vec2d
& v)
41
{
42
mVec
[0] =
static_cast<
float
>
(v.
X
());
mVec
[1] =
static_cast<
float
>
(v.
Y
());
43
}
44
}
45
46
// Now compile up Vector via Vec2Impl
47
#include "
Vec2Impl.cpp
"
Vec2d.h
trBase::Vec2f::Vec2f
Vec2f()
Default constructor.
Vec2Impl.cpp
trBase::Vec2d
General purpose 2D double Vector.
Definition:
Vec2d.h:48
trBase::Vec2d::X
value_type & X()
Returns the X component of the vector.
trBase::Vec2f::mVec
osg::Vec2f mVec
Definition:
Vec2f.h:288
trBase::Vec2d::Y
value_type & Y()
Returns the Y component of the vector.
Vec2f.h
trBase
Definition:
trBase/Base.h:30
trBase::Vec2f::operator=
void operator=(const Vec2f &v)
Set operator.
src
trBase
Vec2f.cpp
Generated by
1.8.13