[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/worldmap pingus.cxx,1.15,1.16
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/worldmap pingus.cxx,1.15,1.16 |
Date: |
15 Oct 2002 13:58:34 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src/worldmap
In directory dark:/tmp/cvs-serv13697
Modified Files:
pingus.cxx
Log Message:
fixed speed bug... ugh...
Index: pingus.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldmap/pingus.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- pingus.cxx 14 Oct 2002 10:19:31 -0000 1.15
+++ pingus.cxx 15 Oct 2002 13:58:31 -0000 1.16
@@ -63,10 +63,10 @@
{
float velocity = 50.0f;
- //std::cout << "Updating Walk: " << edge_path_position << "/" <<
edge_path_length << std::endl;
+ std::cout << "Updating Walk: " << edge_path_position << "/" <<
edge_path_length << std::endl;
// Update the edge_path_position
edge_path_position += velocity * delta;
-
+
if (edge_path_position > edge_path_length) // target reached
{
if (node_path.empty ()) // final target reached
@@ -155,9 +155,9 @@
{
float length = distance(*current, *next);
+ // The pingu is between current and next
if (comp_length + length > edge_path_position)
{
- // FIXME: this is incorrect, it causses speed miss match
float perc = (edge_path_position - comp_length) // length to
walk from current node
/ length;
@@ -177,7 +177,10 @@
float
Pingus::distance(const Vector& a, const Vector& b)
{
- return fabsf(sqrt((a.x * b.x) + (a.y * b.y)));
+ float x = b.x - a.x;
+ float y = b.y - a.y;
+
+ return fabsf(sqrt((x * x) + (y * y)));
}
Vector
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/worldmap pingus.cxx,1.15,1.16,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/war .cvsignore,1.1,NONE
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src/worldmap graph.hxx,1.18,1.19 manager.cxx,1.16,1.17 path_graph.cxx,1.9,1.10 path_graph.hxx,1.4,1.5 pathfinder.hxx,1.4,1.5 pingus.cxx,1.16,1.17 pingus.hxx,1.16,1.17 worldmap.cxx,1.21,1.22
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/war .cvsignore,1.1,NONE
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src/worldmap graph.hxx,1.18,1.19 manager.cxx,1.16,1.17 path_graph.cxx,1.9,1.10 path_graph.hxx,1.4,1.5 pathfinder.hxx,1.4,1.5 pingus.cxx,1.16,1.17 pingus.hxx,1.16,1.17 worldmap.cxx,1.21,1.22
- Index(es):