本文整理汇总了C++中Skeleton::load方法的典型用法代码示例。如果您正苦于以下问题:C++ Skeleton::load方法的具体用法?C++ Skeleton::load怎么用?C++ Skeleton::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skeleton
的用法示例。
在下文中一共展示了Skeleton::load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Skeleton
void
set_file (GtkFileChooserButton *widget,
gpointer user_data)
{
const char *fname = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(widget));
Skeleton *x = new Skeleton();
if (x->load(fname)) {
if (skl) delete skl;
skl = x;
clear_surface();
gtk_widget_queue_draw(GTK_WIDGET(user_data));
}
}
示例2: init
void init()
{
new Logger;
new Settings;
ERR_CODE ret = settings.load(CONFIG);
if (ret != NONE)
{
logger.logln(LOG_USER | LOG_FILE, "An error occurred while loading the default settings file (" + CONFIG + "): " + errString(ret));
delete loggerPtr;
delete settingsPtr;
exit(0);
}
new TextureManager;
new SkeletonManager;
atexit(cleanUp);
srand(time(0));
//plant.parse();
Skeleton *skel = new Skeleton;
ret = skel->load("HumanSkel");
if (ret != NONE)
{
delete skel;
die("An error occurred while loading skeleton file: " + errString(ret));
}
ret = skel->add_animation("idle");
if (ret != NONE)
{
delete skel;
die("An error occurred while loading idle animation file: " + errString(ret));
}
skeletonManager.add_skeleton(skel);
#ifdef ANIMATION
ret = animation.link_skeleton("HumanSkel");
if (ret != NONE)
die("An error occurred while linking skeleton to animation: " + errString(ret));
ret = animation.animate("idle", true);
if (ret != NONE)
die("An error occurred in starting idle animation: " + errString(ret));
#else
ret = mesh.load("human.mesh");
if (ret != NONE)
die("An error occurred while loading mesh file: " + errString(ret));
ret = mesh.animate("idle", true);
if (ret != NONE)
die("An error occurred while animating mesh: " + errString(ret));
#endif
cam.advance(-15.0);
setPerspective();
glViewport(0, 0, WIDTH, HEIGHT);
glClearColor(0.0, 0.0, 0.0, 1.0);
glFogi(GL_FOG_MODE, GL_LINEAR);
glFogfv(GL_FOG_COLOR, fog_color);
glFogf(GL_FOG_DENSITY, 0.25f);
glHint(GL_FOG_HINT, GL_DONT_CARE);
glFogf(GL_FOG_START, 1.0f);
glFogf(GL_FOG_END, 5.0f);
glEnable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
Image front, back, right, left, up, down;
#define CHECK_RET_NAME(x, name) if ((ret = x.load(name ".tga")) != NONE) die("Error while loading " name ".tga: " + errString(ret));
#define CHECK_RET(x) CHECK_RET_NAME(x, #x)
CHECK_RET(front);
CHECK_RET(back);
CHECK_RET(right);
CHECK_RET(left);
CHECK_RET(up);
CHECK_RET(down);
Image img_grass, img_snow;
CHECK_RET_NAME(img_grass, "grass");
CHECK_RET_NAME(img_snow, "snow");
grass = textureManager.load(img_grass);
snow_tex = textureManager.load(img_snow);
box.init(front, left, back, right, up, down);
}