Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

PlayerObject.h

Go to the documentation of this file.
00001 /* -*- Mode: C++ -*-
00002  * $Id: PlayerObject.h,v 1.4 2006/10/05 07:35:21 frehe Exp $
00003  *
00004  *
00005  * COPYRIGHT INFORMATION
00006  *
00007  * This file is part of RoboSoc created by Fredrik Heintz <frehe@ida.liu.se>
00008  * Copyright (C) 1999, 2000 Fredrik Heintz, Linköping University, Sweden
00009  *
00010  * You are allowed to modify and use this code as long as you retain this
00011  * notice. If you make any changes or have any comments I would appreciate
00012  * it if you send me a message. For more information, please see
00013  * http://www.ida.liu.se/~frehe/RoboCup/RoboSoc/
00014  *
00015  *
00016  * IDENTIFICATION
00017  *
00018  * Filename: PlayerObject.h
00019  * Unitname: Library
00020  * $Revision: 1.4 $
00021  * Created by: Fredrik Heintz 1999-xx-xx
00022  * Last modified by $Author: frehe $ $Date: 2006/10/05 07:35:21 $
00023  *
00024  *
00025  * HISTORY
00026  *
00027  * $Log: PlayerObject.h,v $
00028  * Revision 1.4  2006/10/05 07:35:21  frehe
00029  * Added a isRelativePointBehind method.
00030  *
00031  * Revision 1.3  2006/09/25 20:19:22  frehe
00032  * Added behind and in front methods.
00033  *
00034  * Revision 1.2  2006/09/08 16:37:02  frehe
00035  * Added more helpers.
00036  *
00037  * Revision 1.1  2006/09/06 18:03:35  frehe
00038  * Moved files from Library to BasicSystem.
00039  *
00040  * Revision 1.5  2003/11/04 17:17:33  frehe
00041  * Moved the goalie information from AgentObject to PlayerObject.
00042  *
00043  * Revision 1.4  2003/07/21 09:21:12  s02davro
00044  * Tackle, arm update
00045  *
00046  * Revision 1.3  2002/08/31 14:46:02  s02davro
00047  * Small changes in the game objects.
00048  *
00049  * Revision 1.2  2002/08/02 21:36:41  s02davro
00050  * Change types, removed some methods. Relative -> Global position and angles.
00051  *
00052  * Revision 1.1  2000/09/01 03:24:32  frehe
00053  * Importet the current version of RoboSoc (soon to be v2.5.0)
00054  *
00055  * Revision 1.1.1.1  2000/08/31 13:26:04  frehe
00056  * Importet the current version of RoboSoc (soon to be v2.5.0)
00057  *
00058  */
00059 
00072 #ifndef PLAYEROBJECT_H
00073 #define PLAYEROBJECT_H
00074 
00075 
00076 #include "MobileObject.h"
00077 
00078 
00079 RS_BEGIN_NAMESPACE
00080 
00081 
00095 class PlayerObject : public MobileObject {
00096 public:
00098   PlayerObject(const PointUE& def_point = PointUE(),
00099          const TimeUnknown& def_time = TimeUnknown(),
00100          const VectorUE& def_speed = VectorUE(),
00101          const TimeUnknown& def_speed_time = TimeUnknown(),
00102          const AngleDegUE& def_body_dir = AngleDegUE(),
00103          const AngleDegUE& def_neck_dir = AngleDegUE(),
00104          const AngleDegUE& def_point_dir = AngleDegUE(),
00105          const bool def_tackling = false,
00106          const bool def_goalie = false,
00107          const Team def_team = T_UNKNOWN,
00108          const Side def_side = S_UNKNOWN,
00109          const TimeUnknown& def_team_time = TimeUnknown(),
00110          const UIntUnknown def_u_number = UIntUnknown(),
00111          const TimeUnknown& def_unum_time = TimeUnknown(),
00112          const VectorUE& def_acceleration = VectorUE());
00113 
00115   PlayerObject(const PlayerObject& obj);
00116 
00118   PlayerObject& operator= (const PlayerObject& obj);
00119 
00121   void setBodyDirection(const AngleDegUE& ang);
00122 
00124   AngleDegUE getBodyDirection() const;
00125 
00128   AngleDegUE getRelativeBodyDirectionToPoint(const PointUE& point) const;
00129 
00132   AngleDegUE getRelativeBodyDirectionTo(const AngleDegUE& dir) const;
00133   
00137   VectorUE getRelativeVectorTo(const PointUE& point) const;
00138 
00143   FuzzyBool isPointInFrontOf(const PointUE& point) const;
00144 
00149   FuzzyBool isPointBehind(const PointUE& point) const;
00150 
00156   FuzzyBool isRelativePointBehind(const PointUE& point) const;
00157 
00159   void setNeckDirection(const AngleDegUE& ang);
00160 
00162   AngleDegUE getNeckDirection() const;
00163 
00166   AngleDegUE getRelativeNeckDirection() const;
00167 
00170   AngleDegUE getMinNeckDirection() const;
00171 
00174   AngleDegUE getMaxNeckDirection() const;
00175 
00178   AngleDegUE getRelativeNeckDirectionToPoint(const PointUE& point) const;
00179 
00182   AngleDegUE getRelativeNeckDirectionToDirection(const AngleDegUE& dir) const;
00183 
00185   void setPointDirection(const AngleDegUE& ang);
00186 
00188   AngleDegUE getPointDirection() const;
00189 
00191   void setTackling(const bool tackle);
00192 
00194   bool getTackling() const;
00195 
00198   void setTeam(const Team tm);
00199   
00201   void setTeam(const Side our_side);
00202 
00205   Team getTeam() const;
00206   
00208   void setGoalie(const bool goalie_);
00209 
00211   bool isGoalie() const;
00212   
00215   void setSide(const Side new_side);
00216 
00219   Side getSide() const;
00220   
00222   void setTeamObservationTime(const TimeUnknown& def_team_time);
00223 
00225   TimeUnknown getTeamObservationTime() const;
00226 
00228   void setUniformNumber(const UIntUnknown u_num);
00229 
00231   UIntUnknown getUniformNumber() const;
00232 
00234   void setUniformNumberObservationTime(const TimeUnknown& def_unum_time);
00235 
00237   TimeUnknown getUniformNumberObservationTime() const;
00238 
00239 protected:
00241   AngleDegUE bodyDir;
00242 
00244   AngleDegUE neckDir;
00245 
00247   AngleDegUE pointDir;
00248 
00250   bool tackling;
00251 
00253   Team team;
00254 
00256   bool goalie;
00257   
00259   Side side;
00260 
00262   TimeUnknown teamObservationTime;
00263 
00265   UIntUnknown uNumber;
00266 
00268   TimeUnknown uNumberObservationTime;
00269 };
00270 
00271 
00272 RS_END_NAMESPACE
00273 
00274 
00275 /* CONDITIONAL INCLUSION OF INLINE DEFINITIONS
00276  *
00277  * If the compiler and debugger understands the keyword inline then include
00278  * the inline definitions here, otherwise include them in the definition file.
00279  *
00280  * This is controlled by a flag called RS_USE_INLINE, which is usually
00281  * defined. It can be set by the user by giving the compiler an argument
00282  * usually -DRS_USE_INLINE (to define it) or -URS_USE_INLINE (to undefine it).
00283  */
00284 
00285 #ifdef RS_USE_INLINE
00286 #  include "PlayerObject.icc"
00287 #endif
00288 
00289 
00290 #endif // !PLAYEROBJECT_H

Generated on Mon Aug 29 07:57:59 2011 for RoboSoc by doxygen1.3-rc3