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

BallView.icc

Go to the documentation of this file.
00001 /* -*- Mode: C++ -*-
00002  * $Id: BallView.icc,v 1.8 2004/08/13 11:47:35 petan 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: BallView.icc
00019  * Unitname: Framework/view
00020  * $Revision: 1.8 $
00021  * Created by: Fredrik Heintz 2000-09-04
00022  * Last modified by $Author: petan $ $Date: 2004/08/13 11:47:35 $
00023  *
00024  *
00025  * HISTORY
00026  *
00027  * $Log: BallView.icc,v $
00028  * Revision 1.8  2004/08/13 11:47:35  petan
00029  * Changed absolute references to relative and made the documentation more clear
00030  *
00031  * Revision 1.7  2002/09/26 15:28:20  s02davro
00032  * Moved isBallKickable to cc and corrected it
00033  *
00034  * Revision 1.6  2002/08/31 15:22:46  s02davro
00035  * Small changes in views
00036  *
00037  * Revision 1.5  2002/08/02 21:53:13  s02davro
00038  * Now works by extracting information from the BallObject, uses AgentView as before.
00039  *
00040  * Revision 1.4  2001/09/17 21:27:39  andbo928
00041  * Removed FutureBallView references.
00042  *
00043  * Revision 1.3  2001/01/11 22:00:18  olalu526
00044  * Added the real world model with support for new simulation steps.
00045  *
00046  * Revision 1.2  2001/01/10 15:12:58  olalu526
00047  * Added support for WorldModel to some basic classes.
00048  *
00049  * Revision 1.1  2000/09/21 13:46:40  frehe
00050  * Move the RoboSoc views from rsviews to the rsframework library.
00051  *
00052  * Revision 1.2  2000/09/13 00:08:06  frehe
00053  * Updated the views to inherit from the ViewWithHistory instead and also changed those views that used a static pointer to itself to do process the data in the sensor interface to use the new forEach methods implemented in the FrameworkSensorInterface.
00054  *
00055  * Revision 1.1  2000/09/04 15:27:20  frehe
00056  * Imported the current version of RoboSoc (soon to be v2.5.0)
00057  *
00058  */
00059 
00072 #include "machine_dependent_compiler_directives.h"
00073 
00074 
00075 RS_BEGIN_NAMESPACE
00076 
00077 inline const BallObject& BallView::getBallObject(const Int hist) const {
00078   return worldModelInterface->getWorld(hist).getBall();
00079 }
00080 
00081 inline TimeUnknown BallView::getLastObservationTime(const Int hist) const {
00082   return getBallObject(hist).getObservationTime();
00083 }
00084 
00085 inline FloatUE BallView::getRelativeDistance(const Int hist) const {
00086   return getRelativeVector(hist).getLength();
00087 }
00088 
00089 inline AngleDegUE BallView::getRelativeDirection(const Int hist) const {
00090   return getRelativeVector(hist).getAngle();
00091 }
00092 
00093 inline VectorUE BallView::getRelativeVector(const Int hist) const {
00094   VectorUE absoluteVector(agentView->getPosition(hist), getPosition(hist));
00095   if (agentView->getBodyDirection(hist).isKnown()) {
00096     return absoluteVector.rotate(-agentView->getBodyDirection(hist));
00097   }
00098   else {
00099     return absoluteVector.makeUnknown();
00100   }
00101 }
00102 
00103 inline PointUE BallView::getPosition(const Int hist) const {
00104   return getBallObject(hist).getPosition();
00105 }
00106 
00107 inline VectorUE BallView::getSpeedVector(const Int hist) const {
00108   return getBallObject(hist).getSpeedVector();
00109 }
00110 
00111 inline VectorUE BallView::getRelativeSpeedVector(const Int hist) const {
00112   return getSpeedVector(hist) - agentView->getSpeedVector(hist);
00113 }
00114 
00115 inline void BallView::myUpdateAfterInit() {}
00116 
00117 inline void BallView::myNewCycle() {}
00118 
00119 inline void BallView::myUpdateAfterSee() {}
00120 
00121 inline void BallView::myUpdateAfterHear() {}
00122 
00123 inline void BallView::myUpdateAfterCommand() {}
00124 
00125 inline void BallView::myUpdateAfterSense() {}
00126 
00127 inline void BallView::myUpdateAfterCoachMessage() {}
00128 
00129 
00130 RS_END_NAMESPACE

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