-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
started modification to separate freeform_grids (used for obstacles) …
…and stairs (which can only be angled about the y axis, but actually look like stairs)
- Loading branch information
penguin673
committed
Jul 3, 2008
1 parent
b3989fc
commit ec06b9e
Showing
12 changed files
with
327 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?xml version="1.0" standalone="no" ?> | ||
<stage name="A4" start="start" goals="3"> | ||
<freeform_grid id="p_east" x="0.75f" y="0" z="0" prev="NONE" next="NONE" noland="1"> | ||
<angle x="0" y="3" z="0" /> | ||
<angle x="0" y="0" z="0.75f" /> | ||
</freeform_grid> | ||
<freeform_grid id="p_west" x="-0.75f" y="0" z="0" prev="NONE" next="NONE" noland="1"> | ||
<angle x="0" y="3" z="0" /> | ||
<angle x="0" y="0" z="0.75f" /> | ||
</freeform_grid> | ||
<freeform_grid id="p_south" x="0" y="0" z="0.75f" prev="NONE" next="NONE" noland="1"> | ||
<angle x="0" y="3" z="0" /> | ||
<angle x="0.75f" y="0" z="0" /> | ||
</freeform_grid> | ||
<freeform_grid id="p_north" x="0" y="0" z="-0.75f" prev="NONE" next="NONE" noland="1"> | ||
<angle x="0" y="3" z="0" /> | ||
<angle x="0.75f" y="0" z="0" /> | ||
</freeform_grid> | ||
|
||
<grid id="west6" x="-5" y="0" z="-3" prev="west5" next="north1" goal="1"> | ||
<triggers> | ||
<trigger id="start"> | ||
<not> | ||
<goal id="south8" /> | ||
</not> | ||
</trigger> | ||
</triggers> | ||
</grid> | ||
|
||
<grid id="start" x="3" y="0" z="-3" prev="north7" next="east1" /> | ||
<grid id="east1" x="3" y="0" z="-2" prev="start" next="east2" /> | ||
<grid id="east2" x="3" y="0" z="-1" prev="east1" next="east3" /> | ||
<grid id="east3" x="3" y="0" z="0" prev="east2" next="east4" /> | ||
<grid id="east4" x="3" y="0" z="1" prev="east3" next="east5" /> | ||
<grid id="east5" x="3" y="0" z="2" prev="east4" next="east6" /> | ||
<grid id="east6" x="3" y="0" z="3" prev="east5" next="south1" /> | ||
|
||
<grid id="south1" x="2" y="0" z="3" prev="east6" next="south2" /> | ||
<hole id="south2" x="1" y="0" z="3" prev="south1" next="south3"> | ||
<range x_min="-40" x_max="40" y_min="-150" y_max="-170" z_min="0" z_max="0"> | ||
<grid id="south2_esc" x="1" y="0" z="3" prev="south1" next="south3"/> | ||
</range> | ||
</hole> | ||
<grid id="south3" x="0" y="0" z="3" prev="south2" next="south4" /> | ||
<grid id="south4" x="-1" y="0" z="3" prev="south3" next="south5" /> | ||
<grid id="south5" x="-2" y="0" z="3" prev="south4" next="south6" /> | ||
<grid id="south6" x="-3" y="0" z="3" prev="south5" next="south7" /> | ||
<grid id="south7" x="-4" y="0" z="3" prev="south6" next="south8" /> | ||
<grid id="south8" x="-5" y="0" z="3" prev="south7" next="west1" goal="1"> | ||
<triggers> | ||
<trigger id="start"> | ||
<not> | ||
<goal id="west6" /> | ||
</not> | ||
</trigger> | ||
</triggers> | ||
</grid> | ||
|
||
<escgrid id="west1" x="-5" y="0" z="2" prev="south8" next="south8"> | ||
<range x_min="-40" x_max="40" y_min="100" y_max="105" z_min="0" z_max="0"> | ||
<grid id="west1_esc" x="-5" y="0" z="2" prev="south8" next="west2" /> | ||
</range> | ||
</escgrid> | ||
<grid id="west2" x="-5" y="0" z="1" prev="west1" next="west3" nodraw="1"/> | ||
<escgrid id="west3" x="-5" y="0" z="0" prev="west4" next="west4"> | ||
<range x_min="-40" x_max="40" y_min="100" y_max="105" z_min="0" z_max="0"> | ||
<grid id="west3_esc" x="-5" y="0" z="0" prev="west2" next="west4" /> | ||
</range> | ||
</escgrid> | ||
<grid id="west4" x="-5" y="0" z="-1" prev="west3" next="west5" /> | ||
<grid id="west5" x="-5" y="0" z="-2" prev="west4" next="west6" /> | ||
|
||
|
||
<grid id="north1" x="-4" y="0" z="-3" prev="west6" next="north2" /> | ||
<grid id="north2" x="-3" y="0" z="-3" prev="north1" next="north3" /> | ||
<escgrid id="north3" x="-2" y="0" z="-3" prev="north2" next="north2"> | ||
<range x_min="-40" x_max="40" y_min="15" y_max="25" z_min="0" z_max="0"> | ||
<grid id="north3_esc" x="-2" y="0" z="-3" prev="north2" next="north4" /> | ||
</range> | ||
</escgrid> | ||
<grid id="north4" x="-1" y="0" z="-3" prev="north3" next="north5" nodraw="1"/> | ||
<escgrid id="north5" x="0" y="0" z="-3" prev="north6" next="north6"> | ||
<range x_min="-40" x_max="40" y_min="15" y_max="25" z_min="0" z_max="0"> | ||
<grid id="north5_esc" x="0" y="0" z="-3" prev="north4" next="north6" /> | ||
</range> | ||
</escgrid> | ||
<grid id="north6" x="1" y="0" z="-3" prev="north5" next="north7" /> | ||
<grid id="north7" x="2" y="0" z="-3" prev="north6" next="start" /> | ||
</stage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// freeform_grid.cpp | ||
|
||
/* | ||
This file is part of L-Echo. | ||
L-Echo is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
L-Echo is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with L-Echo. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include <cstdlib> | ||
|
||
#include <echo_error.h> | ||
#include <freeform_grid.h> | ||
#include <echo_math.h> | ||
#include <grid.h> | ||
|
||
freeform_grid::freeform_grid() : grid() | ||
{ | ||
init(NULL, NULL, NULL, new vector3f(0.5f, 0.5f, 0), new vector3f(0, 0, 0.5f)); | ||
} | ||
|
||
freeform_grid::freeform_grid(grid_info_t* my_info, grid* my_prev, grid* my_next, vector3f* my_dir, vector3f* my_width) : grid() | ||
{ | ||
dir = my_dir; | ||
width = my_width; | ||
init(my_info, my_prev, my_next, my_dir, my_width); | ||
} | ||
|
||
void freeform_grid::init(grid_info_t* my_info, grid* my_prev, grid* my_next, vector3f* my_dir, vector3f* my_width) | ||
{ | ||
dir = my_dir; | ||
width = my_width; | ||
grid::init(my_info, my_prev, my_next); | ||
} | ||
|
||
void freeform_grid::init_to_null() | ||
{ | ||
grid::init_to_null(); | ||
dir = NULL; | ||
width = NULL; | ||
} | ||
|
||
line3f* freeform_grid::generate_lines(grid_info_t my_info) | ||
{ | ||
line3f* ret = new line3f[4]; | ||
CHKPTR(ret); | ||
|
||
vector3f pos = my_info.pos; | ||
vector3f p1 = pos + *dir + *width; | ||
vector3f p2 = pos - *dir + *width; | ||
vector3f p3 = pos - *dir - *width; | ||
vector3f p4 = pos + *dir - *width; | ||
|
||
ret[0].p1 = p1; ret[0].p2 = p2; | ||
ret[1].p1 = p2; ret[1].p2 = p3; | ||
ret[2].p1 = p3; ret[2].p2 = p4; | ||
ret[3].p1 = p4; ret[3].p2 = p1; | ||
|
||
return(ret); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// freeform_grid.h | ||
|
||
/* | ||
This file is part of L-Echo. | ||
L-Echo is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
L-Echo is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with L-Echo. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include <echo_math.h> | ||
#include <grid.h> | ||
|
||
#ifndef __ECHO_CLASS_FREEFORM_GRID__ | ||
#define __ECHO_CLASS_FREEFORM_GRID__ | ||
class freeform_grid : public grid | ||
{ | ||
protected: | ||
vector3f* dir; | ||
vector3f* width; | ||
public: | ||
freeform_grid(); | ||
freeform_grid(grid_info_t* my_info, grid* my_prev, grid* my_next, vector3f* my_dir, vector3f* my_width); | ||
void init(grid_info_t* my_info, grid* my_prev, grid* my_next, vector3f* my_dir, vector3f* my_width); | ||
virtual line3f* generate_lines(grid_info_t my_info); | ||
virtual void init_to_null(); | ||
//virtual void draw(vector3f angle); | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.