Skip to content

Commit

Permalink
Finished the falling anim, changed the camera zoom a little (need to …
Browse files Browse the repository at this point in the history
…add camera zoom ability), added glut to the Windows package
  • Loading branch information
penguin673 committed Feb 5, 2009
1 parent 38ae995 commit 17a1e29
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 12 deletions.
2 changes: 1 addition & 1 deletion L1.xml → LEcho1.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" standalone="no" ?>
<stage name="L1" start="g1" goals="4">
<stage name="LEcho1" start="g1" goals="4">
<escgrid id="g1" x="-2" y="0" z="0" prev="g2" next="g2">
<angle x="-50" y="90">
<grid id="g1_esc" x="-3.5" y="-2" z="0" prev="left4" next="g2"/>
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ DOFILES := $(CPPFILES:.cpp=.DO)
#.DOA - Darwin Object ARM (iPhone, iPod Touch)
DOAFILES := $(CPPFILES:.cpp=.DOA)

VERSION := 0.4.2
REVISION := 105
VERSION := 0.4.3
REVISION := 107

PKGCOMMON := -echo-$(VERSION)_r$(REVISION)
PKGPREFIX := ../l$(PKGCOMMON)-
Expand Down Expand Up @@ -73,7 +73,7 @@ dbg: all

package: all w32
zip -r $(PKGPREFIX)lin32.zip l-echo *.xml *.xml.real L_ECHO_README
zip -r $(PKGPREFIX)w32.zip l-echo.exe *.xml *.xml.real L_ECHO_README
zip -r $(PKGPREFIX)w32.zip l-echo.exe *.xml *.xml.real glut32.dll L_ECHO_README

package-mac: mac
#macintel macppc
Expand Down
32 changes: 27 additions & 5 deletions echo_character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,15 @@ void echo_char::draw(float x, float y, float z)
{
grid_mode_joints(y);
}
else if(mode != LANDING)
else if(mode == LANDING)
{
landing_mode_joints();
}
else if(mode == STANDING_UP)
{
standing_up_joints();
}
else
{
falling_mode_joints();
}
Expand Down Expand Up @@ -747,24 +755,38 @@ void echo_char::initialize_falling_mode()
joints.waist_bow = 10;
joints.rshoulder_flap = -75;
joints.lshoulder_flap = 75;
joints.rshoulder_push = -15;
joints.lshoulder_push = 15;
joints.rshoulder_push = -45;
joints.lshoulder_push = 45;
joints.rarm_twist = 45;
joints.larm_twist = 45;
joints.rarm_bend = -45;
joints.larm_bend = -45;
}
/// Calculate joint values for a character in the air (Falling Mode)
void echo_char::falling_mode_joints()
{
static float rotation = 0;

joints.body_turn = 30 * echo_sin(rotation);
joints.lshoulder_swing = rotation;
joints.rshoulder_swing = -rotation;
joints.rarm_bend = 45 * echo_sin(rotation / 2);
joints.larm_bend = joints.rarm_bend;
joints.lthigh_lift = 45 * echo_sin(rotation);
joints.rthigh_lift = -joints.lthigh_lift;
joints.lleg_bend = 30 * echo_sin(rotation) + 30;
joints.rleg_bend = 30 * echo_sin(rotation + 90) + 30;

rotation += 10;
if(rotation > 360)
rotation = 0;
}
/// Joint calculation for a character just landing
void echo_char::landing_mode_joints()
{
}
/// Joint calculation for a character standing up right after a landing
void echo_char::standing_up_joints()
{
}
/// Step through joint calculations for walking (used in Grid Mode)
void echo_char::grid_mode_joints(float y)
{
Expand Down
11 changes: 10 additions & 1 deletion echo_character.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/** Speeds/modes of the character. STEP and RUN are percentage speeds (%/sec),
* and FALL, FALL_FROM_SKY, LAUNCH are "real" speeds (Units/sec)
*/
enum CHARACTER_SPEED{ STEP = 0, RUN = 1, FALL = 2, FALL_FROM_SKY = 3, LAUNCH = 4, LANDING = 5 };
enum CHARACTER_SPEED{ STEP = 0, RUN = 1, FALL = 2, FALL_FROM_SKY = 3, LAUNCH = 4, LANDING = 5, STANDING_UP = 6 };
const float CHARACTER_SPEEDS[] = { 0.07f, 0.25f, 0.00f, -0.50f, 14.4913767f, 0.00f };

/// Launching initial horizontal velocity (see echo_char#initialize_launching)
Expand Down Expand Up @@ -229,8 +229,17 @@ class echo_char
* @param direction Direction to launch towards laterally (on the xz-plane). If this is NULL, then get_direction will be used. WILL BE DELETED!!!
*/
void initialize_launching(vector3f* pos, vector3f* direction);
/** Initialize the landing sequence; doesn't actually call
* land. The step method will call land after the landing and
* standing up sequences have been executed.
*/
void initialize_landing();
/// Calculate joint values for a character in the air (Falling Mode)
void falling_mode_joints();
/// Joint calculation for a character just landing
void landing_mode_joints();
/// Joint calculation for a character standing up right after a landing
void standing_up_joints();
/// Step through joint calculations for walking (used in Grid Mode)
void grid_mode_joints(float y);
/// Initializes the joints for falling mode
Expand Down
Binary file added glut32.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,8 @@ static void load(const char* fname)
#endif
//not in menu mode
menu_mode = 0;
//the distance to the farthest point plus 2.5 for good measure.
depth = echo_ns::current_stage->get_farthest() + 5;
//the distance to the farthest point plus 2.8 for good measure.
depth = echo_ns::current_stage->get_farthest() + 2.8f;
//so i don't have to call it all the time
name_cache = const_cast<char*>(echo_ns::current_stage->get_name()->c_str());
}
Expand Down
4 changes: 4 additions & 0 deletions simple.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
<stage name="simple" start="grid" goals="0">
<grid id="grid" x="0" y="0" z="0" prev="grid2" next="grid2" />
<grid id="grid2" x="1" y="0" z="0" prev="grid" next="grid" />
<freeform_grid id="f" x="-0.5" y="1.35" z="0" prev="NONE" next="NONE">
<angle x="0" y="0" z="0.5" />
<angle x="0" y="1.35" z="0" />
</freeform_grid>
</stage>

0 comments on commit 17a1e29

Please sign in to comment.