青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

天行健 君子當自強而不息

Controlling Players and Characters(41)

 

download source and solution

 

Demonstrating Characters with the Chars Demo

All your hard work is about to pay off with a demonstration of the character and
spell controllers seen in this chapter.

Upon executing the program, you see the scene shown in following snap.

In the Chars demo, you take control of the PC, using the arrow keys to turn and
move him. The controls are straightforward—use the space bar to interact with the
closest character (either to speak to an NPC or to attack a monster). Pressing the
number keys 1 through 3 casts a few spells at the closest monster.

Each character in the game demonstrates a single artificial intelligence. Speaking
to another character conveys which artificial intelligence a particular character uses
(except for monsters, which either stand still or follow the player character). It’s
best to quickly dispatch the monsters before they take your player character out.

Everything in the Chars demo has been explained in this chapter. A script class
determines which characters to place in the map during startup (as detailed in the
startup script) and what each character does or says when spoken to.

The demo’s action template, default.mla, contains a number of script actions that
directly modify a character’s type, artificial intelligence, position, and direction.
Adding characters to the world is as easy as using an add character script action,
and from there, you modify the character’s attributes accordingly.

As for the main application, the system core’s cApp class is being used to
control the flow of the demo; each frame update is regulated to 33-millisecond
lapses, giving a 30-frames-per-second update rate. At each and every frame, keyboard
input is read in and stored, waiting to be used during the PC update function.
A fixed camera renders out the action, with each character fully animated
inside a single level (both characters and the level represented by meshes).

The code to the demo is well commented, so enjoy exploring it, and find out how
quickly you can create characters running around in your game project. Be sure to
check out the scripts and script action template using the Mad Lib Script editor, as
well as the items and character definitions using the MIL and MCL Editors.

 

Main Routine Source:

WinMain.h:

#ifndef WIMMAIN_H
#define WINMAIN_H

#include "core_framework.h"
#include "core_input.h"
#include "text_window.h"
#include "char_ics.h"
#include "char.h"
#include "script.h"
#include "spell.h"

class cApp;

/*************************************************************************************************/

class cGameCharController : public cCharController
{
private:
    cApp*   m_app;

private:    
    
virtual void pc_update(sCharacter* character, long elapsed,
                           
float* x_move, float* y_move, float* z_move);

    
virtual bool validate_move(sCharacter* character, 
                               
float* x_move, float* y_move, float* z_move);

public:
    
void set_data(cApp* app)
    {
        m_app = app;
    }
};

/*************************************************************************************************/

class cGameScript : public cScript
{
    friend cApp;

private:
    BOOL                    m_flags[256];

    cApp*                   m_app;

    cInputDevice*           m_keyboard;    
    cGameCharController*    m_gc_controller;
    
    
long                    m_num_route_points;
    sRoutePoint*            m_route;

    cTextWindow             m_text_window;

    ID3DXFont*              m_font;

    
//////////////////////////////////////////////////////////////////////////////////
    
public:
    cGameScript()
    {
        m_app           = NULL;
        m_keyboard      = NULL;        
        m_gc_controller = NULL;
        m_route         = NULL;
        m_font          = NULL;

        ZeroMemory(m_flags, 
sizeof(m_flags));
    }

    ~cGameScript()
    {
        delete[] m_route;
    }

    
void set_data(cApp* app, cInputDevice* keyboard, cGameCharController* gc_controller, ID3DXFont* font)
    {
        m_app           = app;
        m_keyboard      = keyboard;
        m_gc_controller = gc_controller;
        m_font          = font;

        m_text_window.create(m_font);
    }

    
//////////////////////////////////////////////////////////////////////////////////

private:
    
virtual void release()
    {
        delete[] m_route;
        m_route = NULL;

        m_num_route_points = 0;
    }

    
virtual sScriptInfo* process(sScriptInfo* info)
    {
        
switch(info->action_index)
        {
        
case 0:  return script_end(info);
        
case 1:  return script_if_flag_then(info);
        
case 2:  return script_else(info);
        
case 3:  return script_endif(info);
        
case 4:  return script_set_flag(info);
        
case 5:  return script_show_msg(info);
        
case 6:  return script_add_char(info);
        
case 7:  return script_remove_char(info);
        
case 8:  return script_show_char_msg(info);
        
case 9:  return script_set_char_type(info);
        
case 10: return script_set_char_ai(info);
        
case 11: return script_set_char_distance(info);
        
case 12: return script_set_char_bound(info);
        
case 13: return script_set_target_char(info);
        
case 14: return script_set_no_target(info);
        
case 15: return script_create_route(info);
        
case 16: return script_add_point(info);
        
case 17: return script_assign_route(info);
        
case 18: return script_move_char(info);
        
case 19: return script_set_char_script(info);
        }

        
return NULL;    // error executing
    }

    
//////////////////////////////////////////////////////////////////////////////////

private:

    sScriptInfo* script_end(sScriptInfo* info)
    {
        
return NULL;    // force end of processing
    }

    sScriptInfo* script_else(sScriptInfo* info)
    {
        
return info->next;
    }

    sScriptInfo* script_endif(sScriptInfo* info)
    {
        
return info->next;
    }

    sScriptInfo* script_set_flag(sScriptInfo* info)
    {
        m_flags[info->entries[0].long_value % 256] = info->entries[1].bool_value;

        
return info->next;
    }

    sScriptInfo* script_add_char(sScriptInfo* info)
    {
        m_gc_controller->add_char(info->entries[0].long_value,
                                  info->entries[1].long_value,
                                  info->entries[2].selection,
                                  info->entries[3].selection,
                                  info->entries[4].float_value,
                                  info->entries[5].float_value,
                                  info->entries[6].float_value,
                                  info->entries[7].float_value);

        
return info->next;
    }

    sScriptInfo* script_remove_char(sScriptInfo* info)
    {
        m_gc_controller->remove(info->entries[0].long_value);

        
return info->next;
    }

    sScriptInfo* script_set_char_type(sScriptInfo* info)
    {
        m_gc_controller->set_char_type(info->entries[0].long_value, info->entries[1].selection);

        
return info->next;
    }

    sScriptInfo* script_set_char_ai(sScriptInfo* info)
    {
        m_gc_controller->set_char_ai(info->entries[0].long_value, info->entries[1].selection);

        
return info->next;
    }

    sScriptInfo* script_set_char_distance(sScriptInfo* info)
    {
        m_gc_controller->set_char_distance(info->entries[0].long_value, info->entries[1].float_value);

        
return info->next;
    }

    sScriptInfo* script_set_char_bound(sScriptInfo* info)
    {
        m_gc_controller->set_char_bound(info->entries[0].long_value,
                                        info->entries[1].float_value,
                                        info->entries[2].float_value,
                                        info->entries[3].float_value,
                                        info->entries[4].float_value,
                                        info->entries[5].float_value,
                                        info->entries[6].float_value);

        
return info->next;
    }

    sScriptInfo* script_set_target_char(sScriptInfo* info)
    {
        m_gc_controller->set_target_char(info->entries[0].long_value, info->entries[1].long_value);

        
return info->next;
    }

    sScriptInfo* script_set_no_target(sScriptInfo* info)
    {
        m_gc_controller->set_target_char(info->entries[0].long_value, -1);

        
return info->next;
    }

    sScriptInfo* script_create_route(sScriptInfo* info)
    {
        delete[] m_route;
        m_route = NULL;

        m_num_route_points = 0;

        m_num_route_points = info->entries[0].long_value;
        m_route = 
new sRoutePoint[m_num_route_points];

        
return info->next;
    }

    sScriptInfo* script_add_point(sScriptInfo* info)
    {
        
long route_index = info->entries[0].long_value;

        m_route[route_index].pos_x = info->entries[1].float_value;
        m_route[route_index].pos_y = info->entries[2].float_value;
        m_route[route_index].pos_z = info->entries[3].float_value;

        
return info->next;
    }

    sScriptInfo* script_assign_route(sScriptInfo* info)
    {
        m_gc_controller->set_char_route(info->entries[0].long_value, m_num_route_points, m_route);

        
return info->next;
    }

    sScriptInfo* script_move_char(sScriptInfo* info)
    {
        m_gc_controller->move_char(info->entries[0].long_value,
                                   info->entries[1].float_value,
                                   info->entries[2].float_value,
                                   info->entries[3].float_value);

        
return info->next;
    }

    sScriptInfo* script_set_char_script(sScriptInfo* info)
    {
        m_gc_controller->set_char_script(info->entries[0].long_value, info->entries[1].text);

        
return info->next;
    }
    
    
//////////////////////////////////////////////////////////////////////////////////

private:
    sScriptInfo* script_if_flag_then(sScriptInfo* info);
    sScriptInfo* script_show_msg(sScriptInfo* info);
    sScriptInfo* script_show_char_msg(sScriptInfo* info);

    
void render_scene_and_msg();
};

/*************************************************************************************************/

class cApp : public cFramework
{
    friend 
class cGameScript;
    friend 
class cGameCharController;

private:
    cCamera             m_camera;

    cInput              m_input;
    cInputDevice        m_keyboard;
    cInputDevice        m_mouse;

    cMesh               m_terrain_mesh;
    cObject             m_terrain_object;

    cGameCharController m_gc_controller;
    cSpellController    m_spell_controller;

    cGameScript         m_game_script;

    sItem               m_mil[1024];

    ID3DXFont*          m_font;

public:
    
bool init();
    
bool frame();

    
long get_input();

    
bool check_intersect(float x_start, float y_start, float z_start,
                         
float x_end,   float y_end,   float z_end);
};


#endif
 

WinMain.cpp:

#include "core_common.h"
#include "core_graphics.h"
#include "char.h"
#include "script.h"
#include "text_window.h"
#include "tool.h"
#include "WinMain.h"

#define PRESS_UP        1
#define PRESS_RIGHT     2
#define PRESS_DOWN      4
#define PRESS_LEFT      8
#define PRESS_SPACE     16
#define PRESS_1         32
#define PRESS_2         64
#define PRESS_3         128

#define CLIENT_WIDTH    800
#define CLIENT_HEIGHT   600

cApp g_app;

// Global names of character meshes
PCSTR g_char_mesh_names[] = {
    "..\\Data\\Warrior.x",  
// Mesh # 0
    "..\\Data\\Yodan.x"     // Mesh # 1
};

sCharAnimInfo g_char_anim_infos[] = {
    { "Idle",  
true  },
    { "Walk",  
true  },
    { "Swing", 
false },
    { "Spell", 
false },
    { "Swing", 
false },
    { "Hurt",  
false },
    { "Die",   
false },
    { "Idle",  
true  }
};

PCSTR g_spell_mesh_names[] = {
    "..\\Data\\Fireball.x",
    "..\\Data\\Explosion.x",
    "..\\Data\\Groundball.x",
    "..\\Data\\ice.x",
    "..\\Data\\bomb.x",
};

int WINAPI WinMain(HINSTANCE inst, HINSTANCE, LPSTR cmd_line, int cmd_show)
{        
    DWORD pos_x = (get_screen_width()  - CLIENT_WIDTH) / 2;
    DWORD pos_y = (get_screen_height() - CLIENT_HEIGHT) / 4;

    build_window(inst, "CharClass", "Characters Demo", 
                 WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU,
                 pos_x, pos_y, CLIENT_WIDTH, CLIENT_HEIGHT);
    
    g_app.run();

    
return 0;
}

/*************************************************************************************************/

void cGameCharController::pc_update(sCharacter* character, long elapsed,
                                    
float* x_move, float* y_move, float* z_move)
{
    
if(character->id != CHAR_PC)
        
return;

    
float speed = elapsed/1000.0f * get_speed(character);

    
// rotate character

    
long action = m_app->get_input();    

    
if(action & PRESS_RIGHT)
    {
        character->direction += (elapsed/1000.0f * 8);
        character->action = CHAR_MOVE;
    }

    
if(action & PRESS_LEFT)
    {
        character->direction -= (elapsed/1000.0f * 8);
        character->action = CHAR_MOVE;
    }

    
// walk forward
    if(action & PRESS_UP)
    {
        *x_move = sin(character->direction) * speed;
        *z_move = cos(character->direction) * speed;
        
        character->action = CHAR_MOVE;
    }

    sCharacter* char_ptr;
    
float x_diff, y_diff, z_diff, dist;

    
// attack a nearby monster or process NPC script
    if(action & PRESS_SPACE)
    {
        
for(char_ptr = get_root_char(); char_ptr != NULL; char_ptr = char_ptr->next)
        {
            
// only check other characters
            if(char_ptr->id == character->id)
                
continue;
            
            x_diff = fabs(char_ptr->pos_x - character->pos_x);
            y_diff = fabs(char_ptr->pos_y - character->pos_y);
            z_diff = fabs(char_ptr->pos_z - character->pos_z);

            dist = x_diff * x_diff + y_diff * y_diff + z_diff * z_diff;

            
// only check characters within 1000.0 units distance
            if(dist > 10000.0f)
                
continue;
            
            
if(char_ptr->script_filename[0])
                m_app->m_game_script.execute(char_ptr->script_filename);
            
else
            {
                
// turn toward victim
                x_diff = char_ptr->pos_x - character->pos_x;
                z_diff = char_ptr->pos_z - character->pos_z;

                character->direction = atan2(x_diff, z_diff);

                character->victim  = char_ptr;
                char_ptr->attacker = character;

                m_app->m_gc_controller.set_char_action(character, CHAR_ATTACK, 0);
            }

            
break;
        }
    }

    
long spell_index = 0;

    
// cast spells
    if(action & PRESS_1 || action & PRESS_2 || action & PRESS_3)
    {
        
// get spell index to cast
        if(action & PRESS_1)    spell_index = 0;
        
if(action & PRESS_2)    spell_index = 1;
        
if(action & PRESS_3)    spell_index = 2;

        
float spell_max_dist = m_app->m_spell_controller.get_spell(spell_index)->max_dist;

        
// search for closest monster
        for(char_ptr = get_root_char(); char_ptr != NULL; char_ptr = char_ptr->next)
        {
            
if(char_ptr->type == CHAR_MONSTER)
            {
                x_diff = fabs(char_ptr->pos_x - character->pos_x);
                y_diff = fabs(char_ptr->pos_y - character->pos_y);
                z_diff = fabs(char_ptr->pos_z - character->pos_z);

                dist = x_diff * x_diff + y_diff * y_diff + z_diff * z_diff;

                
if(dist <= (spell_max_dist * spell_max_dist))
                {
                    character->spell_index = spell_index;
                    character->target_type = CHAR_MONSTER;
                    character->target_x    = char_ptr->pos_x;
                    character->target_y    = char_ptr->pos_y;
                    character->target_z    = char_ptr->pos_z;

                    
// turn toward victim
                    x_diff = char_ptr->pos_x - character->pos_x;
                    z_diff = char_ptr->pos_z - character->pos_z;
                    character->direction = atan2(x_diff, z_diff);

                    m_app->m_gc_controller.set_char_action(character, CHAR_SPELL, 0);
                    
break;
                }
            }
        }
    }
}

///////////////////////////////////////////////////////////////////////////////////

bool cGameCharController::validate_move(sCharacter* character, 
                                        
float* x_move, float* y_move, float* z_move)
{
    
// check against terrain mesh for collision
    
    
return ! m_app->check_intersect(character->pos_x, character->pos_y + 2.0f, character->pos_z,
        *x_move + character->pos_x, *y_move + character->pos_y + 2.0f, *z_move + character->pos_z);   
}

/*************************************************************************************************/

void cGameScript::render_scene_and_msg()
{
    clear_display(0, 1.0);

    
if(begin_display_scene())
    {
        enable_zbuffer();            

        g_app.m_terrain_object.render();
        g_app.m_gc_controller.render(-1, NULL, 0);
        g_app.m_spell_controller.render(NULL, 0);

        m_text_window.render(NULL, 0);

        end_display_scene();
    }

    present_display();
}

///////////////////////////////////////////////////////////////////////////////////

sScriptInfo* cGameScript::script_if_flag_then(sScriptInfo* info)
{
    
bool skip;

    
// see if a flag matches second entry
    if(m_flags[info->entries[0].long_value % 256] == info->entries[1].bool_value)
        skip = 
false;
    
else
        skip = 
true;

    
// At this point, Skip states if the script actions need to be skipped due to a conditional 
    // if..then statement.
    // 
    // Actions are further processed if skip = false, looking for an else to flip the skip mode, 
    // or an endif to end the conditional block.
    
    info = info->next;

    
while(info)
    {
        
if(info->action_index == 2)         // if else, flip skip mode.
            skip = !skip;   
        
else if(info->action_index == 3)    // break on end if
            return info->next;

        
// Process script function in conditional block, making sure to skip actions when condition not met.
        if(skip)
            info = info->next;
        
else
        {
            
if((info = process(info)) == NULL)
                
return NULL;
        }
    }

    
return NULL;    // end of script reached
}

///////////////////////////////////////////////////////////////////////////////////

sScriptInfo* cGameScript::script_show_msg(sScriptInfo* info)
{
    m_text_window.set_text(info->entries[0].text, COLOR_WHITE);
    m_text_window.move(10, 10, CLIENT_WIDTH-20, 0, -1, -1, COLOR_BLACK, COLOR_ARGENTINE);

    render_scene_and_msg();

    
// wait for a key press

    m_keyboard->acquire();
    m_keyboard->m_locks[KEY_SPACE] = 
true;
    m_keyboard->set_key_state(KEY_SPACE, 
false);
    
    
while(1)
    {
        m_keyboard->read();

        
if(m_keyboard->get_key_state(KEY_SPACE))
            
break;
    }

    m_keyboard->m_locks[KEY_SPACE] = 
true;
    m_keyboard->set_key_state(KEY_SPACE, 
false);

    
return info->next;
}

///////////////////////////////////////////////////////////////////////////////////

sScriptInfo* cGameScript::script_show_char_msg(sScriptInfo* info)
{
    D3DXMATRIX mat_world, mat_view, mat_proj;

    D3DXMatrixIdentity(&mat_world);
    get_display_view_matrix(&mat_view);
    get_display_proj_matrix(&mat_proj);    

    D3DVIEWPORT9 viewport;
    get_display_viewport(&viewport);    

    
// get the character's coordinates

    
float max_y;
    sCharacter* character = m_gc_controller->get_char(info->entries[1].long_value);

    character->
object.get_bounds(NULL, NULL, NULL, NULL, &max_y, NULL, NULL);

    
// project the 3D coordinates in 2D coordinates

    D3DXVECTOR3 target_vec;
    D3DXVECTOR3 source_vec(character->pos_x, character->pos_y + max_y, character->pos_z);

    D3DXVec3Project(&target_vec, &source_vec, &viewport, &mat_proj, &mat_view, &mat_world);

    m_text_window.set_text(info->entries[0].text, D3DCOLOR_RGBA(255, 255, 0, 255));
    m_text_window.move(10, 10, CLIENT_WIDTH-20, 0, target_vec.x, target_vec.y, 
                       D3DCOLOR_RGBA(0, 30, 60, 255), COLOR_ARGENTINE);

    
// display the window while waiting for a keypress

    m_keyboard->acquire();
    m_keyboard->m_locks[KEY_SPACE] = 
true;
    m_keyboard->set_key_state(KEY_SPACE, 
false);
    
    
while(1)
    {
        m_keyboard->read();

        
if(m_keyboard->get_key_state(KEY_SPACE))
            
break;

        render_scene_and_msg();
    }

    m_keyboard->m_locks[KEY_SPACE] = 
true;
    m_keyboard->set_key_state(KEY_SPACE, 
false);   

    
return info->next;
}

/*************************************************************************************************/

bool cApp::init()
{
    create_display(g_hwnd, CLIENT_WIDTH, CLIENT_HEIGHT, 16, 
truetrue);
    set_perspective(D3DX_PI/4, 1.3333f, 1.0f, 10000.0f);

    create_font(&m_font, "Arial", 16, 
truefalse);

    m_input.create(g_hwnd, get_window_inst());
    m_keyboard.create_keyboard(&m_input);
    m_mouse.create_mouse(&m_input, 
true);

    m_terrain_mesh.load("..\\Data\\World.x", "..\\Data\\");
    m_terrain_object.create(&m_terrain_mesh);

    
// load the master item list

    ZeroMemory(m_mil, 
sizeof(m_mil));

    FILE* fp;
    
if((fp = fopen("..\\Data\\Default.mil", "rb")) == NULL)
        
return false;

    fread(m_mil, 1, 
sizeof(m_mil), fp);
    fclose(fp);

    m_spell_controller.init("..\\Data\\Default.msl",
                            array_num(g_spell_mesh_names), g_spell_mesh_names,
                            "..\\Data\\");

    m_gc_controller.init(m_font, "..\\Data\\Default.mcl",
                         m_mil, m_spell_controller.get_spell_list(),
                         array_num(g_char_mesh_names), g_char_mesh_names,
                         "..\\Data\\", "..\\Data\\",
                         array_num(g_char_anim_infos), g_char_anim_infos);

    m_spell_controller.attach(&m_gc_controller);
    m_gc_controller.attach(&m_spell_controller);

    m_gc_controller.set_data(
this);

    
// add the character player
    m_gc_controller.add_char(0, 0, CHAR_PC, CHAR_STAND, 0.0f, 0.0f, 0.0f, 3.14f);

    
// process the startup script
    m_game_script.set_data(this, &m_keyboard, &m_gc_controller, m_font);
    m_game_script.execute("..\\Data\\Startup.mls");

    
return true;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////

bool cApp::frame()
{
    
static DWORD update_counter = timeGetTime();

    
// lock to 30fps
    if(timeGetTime() < update_counter + 33)
        
return true;

    update_counter = timeGetTime();

    m_keyboard.acquire();
    m_keyboard.read();

    
// exit if ESC pressed
    if(m_keyboard.get_key_state(KEY_ESC))
        
return false;

    m_gc_controller.update(33);
    m_spell_controller.update(33);

    m_camera.point(0.0f, 700.0f, -700.0f, 0.0f, 0.0f, 0.0f);
    set_display_camera(&m_camera);
    
    clear_display(0, 1.0f);

    
if(begin_display_scene())
    {
        enable_zbuffer();

        m_terrain_object.render();
        m_gc_controller.render(-1, NULL, 0);
        m_spell_controller.render(NULL, 0);

        
static sCharacter* character = m_gc_controller.get_char(0);

        
char stats[128];

        sprintf(stats, "HP: %ld / %ld\r\nMP: %ld / %ld",
                character->health_points, character->char_def.health_points,
                character->mana_points, character->char_def.mana_points);

        draw_font(m_font, stats, 2, 2, 0, 0, COLOR_WHITE, DT_LEFT);

        end_display_scene();
    }

    present_display();

    
return true;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////

long cApp::get_input()
{
    
long action = 0;

    
if(m_keyboard.get_key_state(KEY_UP) || m_keyboard.get_key_state(KEY_W))
        action |= PRESS_UP;

    
if(m_keyboard.get_key_state(KEY_RIGHT) || m_keyboard.get_key_state(KEY_D))
        action |= PRESS_RIGHT;

    
if(m_keyboard.get_key_state(KEY_DOWN) || m_keyboard.get_key_state(KEY_S))
        action |= PRESS_DOWN;

    
if(m_keyboard.get_key_state(KEY_LEFT) || m_keyboard.get_key_state(KEY_A))
        action |= PRESS_LEFT;

    
if(m_keyboard.get_key_state(KEY_SPACE))
    {
        action |= PRESS_SPACE;
        m_keyboard.m_locks[KEY_SPACE] = 
true;
        m_keyboard.set_key_state(KEY_SPACE, 
false);
    }

    
if(m_keyboard.get_key_state(KEY_1))
    {
        action |= PRESS_1;
        m_keyboard.m_locks[KEY_1] = 
true;
        m_keyboard.set_key_state(KEY_1, 
false);
    }

    
if(m_keyboard.get_key_state(KEY_2))
    {
        action |= PRESS_2;
        m_keyboard.m_locks[KEY_2] = 
true;
        m_keyboard.set_key_state(KEY_2, 
false);
    }
    
    
if(m_keyboard.get_key_state(KEY_3))
    {
        action |= PRESS_3;
        m_keyboard.m_locks[KEY_3] = 
true;
        m_keyboard.set_key_state(KEY_3, 
false);
    }

    
return action;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////

bool cApp::check_intersect(float x_start, float y_start, float z_start,
                           
float x_end,   float y_end,   float z_end)
{
    
for(sMeshInfo* mesh_info = m_terrain_mesh.get_root_mesh(); mesh_info != NULL; mesh_info = mesh_info->m_next)
    {
        
if(is_ray_intersect_mesh(mesh_info->m_d3d_mesh, x_start, y_start, z_start, x_end, y_end, z_end, NULL))        
            
return true;        
    }
    
    
return false;
}

posted on 2007-12-04 21:05 lovedday 閱讀(496) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


公告

導航

統計

常用鏈接

隨筆分類(178)

3D游戲編程相關鏈接

搜索

最新評論

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美精品久久久久久久免费观看| 久久先锋影音av| 欧美日韩国产高清| 亚洲少妇中出一区| 99精品免费视频| 国产精品一区二区女厕厕| 亚洲免费网址| 校园春色综合网| 揄拍成人国产精品视频| 欧美激情精品久久久久久黑人| 美女主播视频一区| 亚洲精品美女在线| 亚洲天堂成人| 永久免费毛片在线播放不卡| 亚洲激情视频网| 国产精品高潮呻吟久久| 久久激情五月丁香伊人| 久久综合亚州| 亚洲天堂成人在线观看| 久久福利精品| 日韩图片一区| 欧美一区二区三区在| 91久久国产自产拍夜夜嗨| 国产精品99久久久久久久久| 激情综合色综合久久| 日韩一区二区精品在线观看| 国产日韩精品一区二区三区| 亚洲国产精品t66y| 国产精品一二一区| 久久夜色精品国产亚洲aⅴ| 欧美99在线视频观看| 日韩视频三区| 欧美一区二区精品| 最新国产の精品合集bt伙计| 夜夜嗨av一区二区三区中文字幕 | 正在播放欧美一区| 夜久久久久久| 黄色日韩精品| 亚洲欧洲一区| 国产日韩一区二区三区在线播放| 美日韩精品视频免费看| 欧美黑人国产人伦爽爽爽| 亚洲一区二区精品视频| 久久在线免费观看| 一片黄亚洲嫩模| 久久久久久久激情视频| 亚洲一级在线| 久久精品夜色噜噜亚洲aⅴ| 日韩视频精品在线| 久久精品一区二区国产| 亚洲少妇在线| 牛牛影视久久网| 欧美中文字幕视频在线观看| 欧美激情按摩在线| 久久久久亚洲综合| 国产精品久久久久久久7电影| 久久日韩粉嫩一区二区三区| 欧美日韩国产另类不卡| 欧美91福利在线观看| 国产欧美日韩中文字幕在线| 亚洲欧洲一区二区三区久久| 国产在线不卡视频| 中文精品99久久国产香蕉| 亚洲三级免费观看| 久久九九国产精品| 欧美一级黄色网| 国产精品美女久久久久aⅴ国产馆| 亚洲高清久久久| 极品尤物一区二区三区| 欧美一区二区精品在线| 欧美一区二区啪啪| 国产精品久久午夜| 99在线精品免费视频九九视| 亚洲欧洲一区二区三区| 久久精品国产77777蜜臀| 久久精品成人欧美大片古装| 国产精品久久久久9999| 99视频国产精品免费观看| 亚洲开发第一视频在线播放| 欧美jjzz| 亚洲国产欧美一区二区三区同亚洲| 黄色免费成人| 久久精品视频导航| 亚洲免费观看高清完整版在线观看熊| 欧美11—12娇小xxxx| 亚洲高清在线播放| 亚洲精品一区二区网址| 欧美激情第五页| 日韩一区二区电影网| 亚洲一区二区高清| 国产精品久久久久久久久久妞妞| 亚洲美女视频在线免费观看| 一本久久精品一区二区| 欧美区日韩区| 一本色道久久综合亚洲91| 亚洲男女自偷自拍| 国产美女高潮久久白浆| 亚洲一区二区三区国产| 久久久久国产一区二区三区| 伊人成人网在线看| 欧美福利影院| 亚洲国产成人精品女人久久久 | 性色一区二区三区| 噜噜噜躁狠狠躁狠狠精品视频| 亚洲二区免费| 欧美日韩国产在线看| 亚洲欧美激情四射在线日| 久热这里只精品99re8久| 亚洲国产片色| 欧美亚洲成人精品| 欧美亚洲一区| 亚洲国产精品一区在线观看不卡| 亚洲裸体在线观看| 国产精品第一区| 久久资源在线| 亚洲手机在线| 欧美黑人在线观看| 欧美一区二区三区四区在线观看地址 | 欧美性大战久久久久久久| 亚洲欧美日韩专区| 亚洲激情六月丁香| 久久精品成人一区二区三区蜜臀 | 欧美综合国产| 蜜桃精品久久久久久久免费影院| 亚洲人午夜精品| 国产女主播一区| 欧美韩国日本综合| 午夜免费日韩视频| 亚洲精品日韩在线| 久久网站免费| 亚洲永久免费观看| 亚洲精品久久久久久一区二区| 国产精品久久久久久久久久久久久久| 久久高清免费观看| 亚洲桃花岛网站| 亚洲国产高清视频| 美女主播精品视频一二三四| 亚洲欧美日韩精品| 亚洲神马久久| 亚洲欧洲日产国码二区| 亚洲国产91| 一区二区三区在线看| 国产精品人成在线观看免费| 欧美理论电影在线观看| 久久乐国产精品| 欧美一区二区三区四区在线观看地址 | 国产精品视频网| 欧美日本免费| 欧美极品一区| 免费国产自线拍一欧美视频| 欧美一区二区三区四区高清| 亚洲午夜激情| 在线视频一区观看| 亚洲精品美女免费| 亚洲国产99| 亚洲国产视频直播| 欧美成人中文| 亚洲第一页自拍| 嫩模写真一区二区三区三州| 久久久久久午夜| 亚洲欧美国产77777| 亚洲综合色自拍一区| 一区二区av在线| 99精品99久久久久久宅男| 亚洲精品永久免费| 亚洲三级性片| 亚洲视频axxx| 亚洲无线视频| 亚洲欧美日韩综合| 欧美一级在线亚洲天堂| 亚洲欧美久久| 久久精品伊人| 欧美大片在线观看一区| 亚洲国产成人精品女人久久久 | 亚洲午夜三级在线| 亚洲综合精品四区| 欧美亚洲网站| 久久午夜色播影院免费高清| 久久男人资源视频| 亚洲大胆视频| 亚洲精品国产精品国自产观看浪潮 | 久久另类ts人妖一区二区| 久热精品视频在线观看一区| 欧美黄色aaaa| 国产精品卡一卡二| 国产综合色在线| 有坂深雪在线一区| 一本久道久久综合婷婷鲸鱼| 亚洲欧美日韩视频二区| 久久久国产精品一区二区中文| 久久综合网hezyo| 亚洲日本中文字幕区| 亚洲伊人网站| 你懂的网址国产 欧美| 欧美日韩高清在线播放| 国产欧美另类| 99pao成人国产永久免费视频| 午夜视频一区二区| 欧美77777| 亚洲午夜激情网站|