[prev in list] [next in list] [prev in thread] [next in thread]
List: bzflag-commits
Subject: SF.net SVN: bzflag: [16635] trunk/bzflag/src/bzrobots
From: jannejun () users ! sourceforge ! net
Date: 2008-02-20 21:53:25
Message-ID: E1JRwsX-0001Ym-0q () sc8-pr-svn2 ! sourceforge ! net
[Download RAW message or body]
Revision: 16635
http://bzflag.svn.sourceforge.net/bzflag/?rev=16635&view=rev
Author: jannejun
Date: 2008-02-20 13:53:24 -0800 (Wed, 20 Feb 2008)
Log Message:
-----------
Removed useless dt stuff in getVelocity for shots.
Modified Paths:
--------------
trunk/bzflag/src/bzrobots/RCRequests.cxx
trunk/bzflag/src/bzrobots/RCRequests.h
trunk/bzflag/src/bzrobots/RCRequests_Process.cxx
trunk/bzflag/src/bzrobots/Shot.cxx
trunk/bzflag/src/bzrobots/Shot.h
Modified: trunk/bzflag/src/bzrobots/RCRequests.cxx
===================================================================
--- trunk/bzflag/src/bzrobots/RCRequests.cxx 2008-02-20 20:38:01 UTC (rev 16634)
+++ trunk/bzflag/src/bzrobots/RCRequests.cxx 2008-02-20 21:53:24 UTC (rev 16635)
@@ -127,20 +127,18 @@
messageParseStatus GetShotVelocityReq::parse(char **arguments, int count)
{
- if (count != 2)
+ if (count != 1)
return InvalidArgumentCount;
if (!MessageUtilities::parse(arguments[0], id))
return InvalidArguments;
- if (!MessageUtilities::parse(arguments[1], dt))
- return InvalidArguments;
return ParseOk;
}
void GetShotVelocityReq::getParameters(std::ostream &stream) const
{
- stream << id << " " << dt;
+ stream << id;
}
// Local Variables: ***
Modified: trunk/bzflag/src/bzrobots/RCRequests.h
===================================================================
--- trunk/bzflag/src/bzrobots/RCRequests.h 2008-02-20 20:38:01 UTC (rev 16634)
+++ trunk/bzflag/src/bzrobots/RCRequests.h 2008-02-20 21:53:24 UTC (rev 16635)
@@ -205,8 +205,8 @@
class GetShotVelocityReq : public RCRequest {
public:
- GetShotVelocityReq() : id(0), dt(0) {}
- GetShotVelocityReq(uint64_t _id, double _dt) : id(_id), dt(_dt) {}
+ GetShotVelocityReq() : id(0) {}
+ GetShotVelocityReq(uint64_t _id) : id(_id) {}
std::string getType() const { return "GetShotVelocity"; }
@@ -216,7 +216,6 @@
private:
uint64_t id;
- double dt;
};
Modified: trunk/bzflag/src/bzrobots/RCRequests_Process.cxx
===================================================================
--- trunk/bzflag/src/bzrobots/RCRequests_Process.cxx 2008-02-20 20:38:01 UTC (rev \
16634)
+++ trunk/bzflag/src/bzrobots/RCRequests_Process.cxx 2008-02-20 21:53:24 UTC (rev \
16635) @@ -352,7 +352,7 @@
Shot shot(id);
double x, y, z;
- shot.getVelocity(x, y, z, dt);
+ shot.getVelocity(x, y, z);
link->send(ShotVelocityReply(id, x, y, z));
return true;
Modified: trunk/bzflag/src/bzrobots/Shot.cxx
===================================================================
--- trunk/bzflag/src/bzrobots/Shot.cxx 2008-02-20 20:38:01 UTC (rev 16634)
+++ trunk/bzflag/src/bzrobots/Shot.cxx 2008-02-20 21:53:24 UTC (rev 16635)
@@ -117,7 +117,7 @@
}
}
-void Shot::getVelocity(double &x, double &y, double &z, double dt) const
+void Shot::getVelocity(double &x, double &y, double &z) const
{
ShotPath *path = searchShot(getPlayerId(), getShotId());
@@ -126,24 +126,10 @@
* We found the shot.
*/
- if (dt == 0) {
- const float *pos = path->getVelocity();
- x = pos[0];
- y = pos[1];
- z = pos[2];
- } else {
- //Make a copy of the ShotPath/ShotStrategy, run update(dt) and check the new \
velocity
- //TODO: Find a way to do this, we can easily copy ShotPath but to get \
ShotStrategy
- //we'd have to access a protected member function
- //
- //Now just return the current velocity...
- //
-
- const float *pos = path->getVelocity();
- x = pos[0];
- y = pos[1];
- z = pos[2];
- }
+ const float *pos = path->getVelocity();
+ x = pos[0];
+ y = pos[1];
+ z = pos[2];
}
}
@@ -166,10 +152,10 @@
toz = z;
}
-void FrontendShot::getVelocity(double &tox, double &toy, double &toz, double dt) \
const +void FrontendShot::getVelocity(double &tox, double &toy, double &toz) const
{
RCLinkFrontend *link = robot->getLink();
- link->sendAndProcess(GetShotVelocityReq(id,dt), robot);
+ link->sendAndProcess(GetShotVelocityReq(id), robot);
tox = vx;
toy = vy;
toz = vz;
Modified: trunk/bzflag/src/bzrobots/Shot.h
===================================================================
--- trunk/bzflag/src/bzrobots/Shot.h 2008-02-20 20:38:01 UTC (rev 16634)
+++ trunk/bzflag/src/bzrobots/Shot.h 2008-02-20 21:53:24 UTC (rev 16635)
@@ -39,7 +39,7 @@
messageParseStatus parse(char **arguments, int count);
virtual void getPosition(double &x, double &y, double &z, double dt = 0) const; \
//Return the shots position in dt seconds
- virtual void getVelocity(double &x, double &y, double &z, double dt = 0) const;
+ virtual void getVelocity(double &x, double &y, double &z) const;
protected:
uint64_t id;
@@ -55,7 +55,7 @@
void setRobot(const BZAdvancedRobot *_robot);
void getPosition(double &x, double &y, double &z, double dt = 0) const;
- void getVelocity(double &x, double &y, double &z, double dt = 0) const;
+ void getVelocity(double &x, double &y, double &z) const;
mutable double x, y, z;
mutable double vx, vy, vz;
This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
BZFlag-commits mailing list
BZFlag-commits@lists.SourceForge.net
https://lists.SourceForge.net/lists/listinfo/bzflag-commits
irc: #BZFlag @ irc.freenode.net
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic