Fawkes API
Fawkes Development Version
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
position_mapper.cpp
1
2
/***************************************************************************
3
* position_mapper.cpp - Mapper Position2dProxy to ObjectPositionInterface
4
*
5
* Created: Tue Sep 30 00:53:38 2008
6
* Copyright 2006-2008 Tim Niemueller [www.niemueller.de]
7
*
8
****************************************************************************/
9
10
/* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Library General Public License for more details.
19
*
20
* Read the full text in the LICENSE.GPL file in the doc directory.
21
*/
22
23
#include "position_mapper.h"
24
25
#include <interfaces/ObjectPositionInterface.h>
26
#include <libplayerc++/playerc++.h>
27
28
/** @class PlayerPositionMapper "position_mapper.h"
29
* Position mapper for player integration.
30
* This class is used to map a Player position2d proxy to a Fawkes
31
* ObjectPositionInterface.
32
* @author Tim Niemueller
33
*/
34
35
/** Constructor.
36
* @param varname variable name
37
* @param interface Fawkes interface instance
38
* @param proxy Player proxy instance
39
*/
40
PlayerPositionMapper::PlayerPositionMapper
(std::string varname,
41
fawkes::ObjectPositionInterface
*interface,
42
PlayerCc::Position2dProxy *proxy)
43
:
PlayerProxyFawkesInterfaceMapper
(varname)
44
{
45
__interface = interface;
46
__proxy = proxy;
47
}
48
49
50
void
51
PlayerPositionMapper::sync_player_to_fawkes
()
52
{
53
if
( __proxy->IsFresh() ) {
54
//printf("Setting %s to (%f, %f, %f)\n", varname().c_str(), __proxy->GetXPos(),
55
// __proxy->GetYPos(), __proxy->GetYaw());
56
__interface->
set_relative_x
(__proxy->GetXPos());
57
__interface->
set_relative_y
(__proxy->GetYPos());
58
__interface->
set_relative_z
(__proxy->GetYaw());
59
__interface->
write
();
60
__proxy->NotFresh();
61
}
62
}
63
64
void
65
PlayerPositionMapper::sync_fawkes_to_player
()
66
{
67
}
src
plugins
player
position_mapper.cpp
Generated by
1.8.1.1