Back to index

extremetuxracer  0.5beta
Defines | Functions | Variables
model_hndl.cpp File Reference
#include "model_hndl.h"
#include "lights.h"
#include "hier_cb.h"
#include "hier.h"
#include "gl_util.h"
#include "game_config.h"
#include "string_util.h"
#include "course_mgr.h"
#include "ppgltk/alg/defs.h"

Go to the source code of this file.

Defines

#define MAX_ARM_ANGLE   30.0
#define MAX_PADDLING_ANGLE   35.0
#define MAX_EXT_PADDLING_ANGLE   30.0
#define MAX_KICK_PADDLING_ANGLE   20.0

Functions

static int head_cb (ClientData cd, Tcl_Interp *ip, int argc, CONST84 char *argv[])
static int neck_cb (ClientData cd, Tcl_Interp *ip, int argc, CONST84 char *argv[])
static int root_node_cb (ClientData cd, Tcl_Interp *ip, int argc, CONST84 char *argv[])
static int left_shoulder_cb (ClientData cd, Tcl_Interp *ip, int argc, CONST84 char *argv[])
static int right_shoulder_cb (ClientData cd, Tcl_Interp *ip, int argc, CONST84 char *argv[])
static int left_hip_cb (ClientData cd, Tcl_Interp *ip, int argc, CONST84 char *argv[])
static int right_hip_cb (ClientData cd, Tcl_Interp *ip, int argc, CONST84 char *argv[])
static int left_knee_cb (ClientData cd, Tcl_Interp *ip, int argc, CONST84 char *argv[])
static int right_knee_cb (ClientData cd, Tcl_Interp *ip, int argc, CONST84 char *argv[])
static int left_ankle_cb (ClientData cd, Tcl_Interp *ip, int argc, CONST84 char *argv[])
static int right_ankle_cb (ClientData cd, Tcl_Interp *ip, int argc, CONST84 char *argv[])
static int tail_cb (ClientData cd, Tcl_Interp *ip, int argc, CONST84 char *argv[])
static int tux_add_model_cb (ClientData cd, Tcl_Interp *ip, int argc, CONST84 char *argv[])
static void register_tux_callbacks (Tcl_Interp *ip)

Variables

model_hndlModelHndl = NULL

Define Documentation

#define MAX_ARM_ANGLE   30.0

Definition at line 36 of file model_hndl.cpp.

#define MAX_EXT_PADDLING_ANGLE   30.0

Definition at line 38 of file model_hndl.cpp.

#define MAX_KICK_PADDLING_ANGLE   20.0

Definition at line 39 of file model_hndl.cpp.

#define MAX_PADDLING_ANGLE   35.0

Definition at line 37 of file model_hndl.cpp.


Function Documentation

static int head_cb ( ClientData  cd,
Tcl_Interp *  ip,
int  argc,
CONST84 char *  argv[] 
) [static]

Definition at line 255 of file model_hndl.cpp.

{
    if ( argc != 2 ) {
        Tcl_AppendResult(ip, argv[0], ": invalid number of arguments\n", 
                         "Usage: ", argv[0], " <head joint>",
                      (char *)0 );
        return TCL_ERROR;
    } 

    ModelHndl->tuxHead = string_copy( argv[1] );

    return TCL_OK;
} 

Here is the call graph for this function:

Here is the caller graph for this function:

static int left_ankle_cb ( ClientData  cd,
Tcl_Interp *  ip,
int  argc,
CONST84 char *  argv[] 
) [static]

Definition at line 405 of file model_hndl.cpp.

{

    if ( argc != 2 ) {
        Tcl_AppendResult(ip, argv[0], ": invalid number of arguments\n", 
                      "Usage: ", argv[0], " <left ankle joint>",
                      (char *)0 );
        return TCL_ERROR;
    } 

    ModelHndl->tuxLeftAnkleJoint = string_copy( argv[1] );

    return TCL_OK;
} 

Here is the call graph for this function:

Here is the caller graph for this function:

static int left_hip_cb ( ClientData  cd,
Tcl_Interp *  ip,
int  argc,
CONST84 char *  argv[] 
) [static]

Definition at line 337 of file model_hndl.cpp.

{

    if ( argc != 2 ) {
        Tcl_AppendResult(ip, argv[0], ": invalid number of arguments\n", 
                      "Usage: ", argv[0], " <left hip joint>",
                      (char *)0 );
        return TCL_ERROR;
    } 

    ModelHndl->tuxLeftHipJoint = string_copy( argv[1] );

    return TCL_OK;
} 

Here is the call graph for this function:

Here is the caller graph for this function:

static int left_knee_cb ( ClientData  cd,
Tcl_Interp *  ip,
int  argc,
CONST84 char *  argv[] 
) [static]

Definition at line 371 of file model_hndl.cpp.

{

    if ( argc != 2 ) {
        Tcl_AppendResult(ip, argv[0], ": invalid number of arguments\n", 
                      "Usage: ", argv[0], " <left knee joint>",
                      (char *)0 );
        return TCL_ERROR;
    } 

    ModelHndl->tuxLeftKneeJoint = string_copy( argv[1] );

    return TCL_OK;
} 

Here is the call graph for this function:

Here is the caller graph for this function:

static int left_shoulder_cb ( ClientData  cd,
Tcl_Interp *  ip,
int  argc,
CONST84 char *  argv[] 
) [static]

Definition at line 303 of file model_hndl.cpp.

{

    if ( argc != 2 ) {
        Tcl_AppendResult(ip, argv[0], ": invalid number of arguments\n", 
                      "Usage: ", argv[0], " <left shoulder joint>",
                      (char *)0 );
        return TCL_ERROR;
    } 

    ModelHndl->tuxLeftShoulderJoint = string_copy( argv[1] );

    return TCL_OK;
} 

Here is the call graph for this function:

Here is the caller graph for this function:

static int neck_cb ( ClientData  cd,
Tcl_Interp *  ip,
int  argc,
CONST84 char *  argv[] 
) [static]

Definition at line 270 of file model_hndl.cpp.

{

    if ( argc != 2 ) {
        Tcl_AppendResult(ip, argv[0], ": invalid number of arguments\n", 
                      "Usage: ", argv[0], " <neck joint>",
                      (char *)0 );
        return TCL_ERROR;
    } 

    ModelHndl->tuxNeck = string_copy( argv[1] );

    return TCL_OK;
} 

Here is the call graph for this function:

Here is the caller graph for this function:

static void register_tux_callbacks ( Tcl_Interp *  ip) [static]

Definition at line 476 of file model_hndl.cpp.

{
    Tcl_CreateCommand (ip, "tux_root_node", root_node_cb,   0,0);
    Tcl_CreateCommand (ip, "tux_left_shoulder",  left_shoulder_cb,   0,0);
    Tcl_CreateCommand (ip, "tux_right_shoulder",  right_shoulder_cb,   0,0);
    Tcl_CreateCommand (ip, "tux_left_hip",  left_hip_cb,   0,0);
    Tcl_CreateCommand (ip, "tux_right_hip",  right_hip_cb,   0,0);
    Tcl_CreateCommand (ip, "tux_left_knee",  left_knee_cb,   0,0);
    Tcl_CreateCommand (ip, "tux_right_knee",  right_knee_cb,   0,0);
    Tcl_CreateCommand (ip, "tux_left_ankle",  left_ankle_cb,   0,0);
    Tcl_CreateCommand (ip, "tux_right_ankle",  right_ankle_cb,   0,0);
    Tcl_CreateCommand (ip, "tux_neck",  neck_cb,   0,0);
    Tcl_CreateCommand (ip, "tux_head", head_cb,  0,0);
    Tcl_CreateCommand (ip, "tux_tail", tail_cb,  0,0);
    Tcl_CreateCommand (ip, "tux_add_model", tux_add_model_cb,  0,0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int right_ankle_cb ( ClientData  cd,
Tcl_Interp *  ip,
int  argc,
CONST84 char *  argv[] 
) [static]

Definition at line 422 of file model_hndl.cpp.

{

    if ( argc != 2 ) {
        Tcl_AppendResult(ip, argv[0], ": invalid number of arguments\n", 
                      "Usage: ", argv[0], " <right ankle joint>",
                      (char *)0 );
        return TCL_ERROR;
    } 

    ModelHndl->tuxRightAnkleJoint = string_copy( argv[1] );

    return TCL_OK;
} 

Here is the call graph for this function:

Here is the caller graph for this function:

static int right_hip_cb ( ClientData  cd,
Tcl_Interp *  ip,
int  argc,
CONST84 char *  argv[] 
) [static]

Definition at line 354 of file model_hndl.cpp.

{

    if ( argc != 2 ) {
        Tcl_AppendResult(ip, argv[0], ": invalid number of arguments\n", 
                      "Usage: ", argv[0], " <right hip joint>",
                      (char *)0 );
        return TCL_ERROR;
    } 

    ModelHndl->tuxRightHipJoint = string_copy( argv[1] );

    return TCL_OK;
} 

Here is the call graph for this function:

Here is the caller graph for this function:

static int right_knee_cb ( ClientData  cd,
Tcl_Interp *  ip,
int  argc,
CONST84 char *  argv[] 
) [static]

Definition at line 388 of file model_hndl.cpp.

{

    if ( argc != 2 ) {
        Tcl_AppendResult(ip, argv[0], ": invalid number of arguments\n", 
                      "Usage: ", argv[0], " <right knee joint>",
                      (char *)0 );
        return TCL_ERROR;
    } 

    ModelHndl->tuxRightKneeJoint = string_copy( argv[1] );

    return TCL_OK;
} 

Here is the call graph for this function:

Here is the caller graph for this function:

static int right_shoulder_cb ( ClientData  cd,
Tcl_Interp *  ip,
int  argc,
CONST84 char *  argv[] 
) [static]

Definition at line 320 of file model_hndl.cpp.

{

    if ( argc != 2 ) {
        Tcl_AppendResult(ip, argv[0], ": invalid number of arguments\n", 
                      "Usage: ", argv[0], " <right shoulder joint>",
                      (char *)0 );
        return TCL_ERROR;
    } 

    ModelHndl->tuxRightShoulderJoint = string_copy( argv[1] );

    return TCL_OK;
} 

Here is the call graph for this function:

Here is the caller graph for this function:

static int root_node_cb ( ClientData  cd,
Tcl_Interp *  ip,
int  argc,
CONST84 char *  argv[] 
) [static]

Definition at line 287 of file model_hndl.cpp.

{
    if ( argc != 2 ) {
        Tcl_AppendResult(ip, argv[0], ": invalid number of arguments\n", 
                      "Usage: ", argv[0], " <root node>",
                      (char *)0 );
        return TCL_ERROR;
    } 

    ModelHndl->tuxRootNode = string_copy( argv[1] );

    return TCL_OK;
} 

Here is the call graph for this function:

Here is the caller graph for this function:

static int tail_cb ( ClientData  cd,
Tcl_Interp *  ip,
int  argc,
CONST84 char *  argv[] 
) [static]

Definition at line 439 of file model_hndl.cpp.

{

    if ( argc != 2 ) {
        Tcl_AppendResult(ip, argv[0], ": invalid number of arguments\n", 
                      "Usage: ", argv[0], " <tail joint>",
                      (char *)0 );
        return TCL_ERROR;
    } 

    ModelHndl->tuxTailJoint = string_copy( argv[1] );

    return TCL_OK;
} 

Here is the call graph for this function:

Here is the caller graph for this function:

static int tux_add_model_cb ( ClientData  cd,
Tcl_Interp *  ip,
int  argc,
CONST84 char *  argv[] 
) [static]

Definition at line 456 of file model_hndl.cpp.

{
    if ( argc != 3 ) {
        Tcl_AppendResult(ip, argv[0], ": invalid number of arguments\n", 
                      "Usage: ", argv[0], " <model file> <model name>",
                      (char *)0 );
        return TCL_ERROR;
    }
 
    model_t tmp_model;
    tmp_model.name = _(string_copy( argv[2] ));
    tmp_model.filename = string_copy( argv[1] );
    tmp_model.id = ModelHndl->num_models++;
    ModelHndl->l_models.push_back(tmp_model);
 
    return TCL_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 56 of file model_hndl.cpp.