All pastes #390807 Raw Edit

Someone

public text v1 · immutable
·published 2007-03-11 18:05 UTC
rendered paste body
#include "include/irrlicht.h"
using namespace irr;
/*

     This program was generated by MASNAI3 M3Code.
    Copyright (C) 2007 <name of author>

    This program 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 2 of the License, or (at your option) any later version.

    This program 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

*/

/* forward ref's */
IrrlichtDevice *device;
video::IVideoDriver* driver;
scene::ISceneManager* scenemgr;

/* functions here */

scene::ISceneNode* m3_modelload(const c8* name) {

 scene::IAnimatedMesh* mesh = scenemgr->getMesh( name );
 scene::IAnimatedMeshSceneNode* node = scenemgr->addAnimatedMeshSceneNode( mesh );
// ~mesh();
 return node;

}
scene::ISceneNode* m3_setpos(scene::ISceneNode* n, core::vector3df v) {
 n->setPosition(v);
// ~v();
 return n;
}
scene::ISceneNode* m3_setrot(scene::ISceneNode* n,core::vector3df v) {
 n->setRotation(v);
// ~v();
 return n;
}
void m3_playanim(scene::ISceneNode* node) {
 node->setFrameLoop(1,30*100);
 node->setAnimationSpeed(30*100);
}
// Start MAIN
int main() {    
       device = createDevice(video::EDT_OPENGL, core::dimension2d<s32>(640,480));
        driver = device->getVideoDriver();
        scenemgr = device->getSceneManager();
 
 // load a model
 scene::ISceneNode* mesh = m3_modelload ("model.x");

 // rotate it
 m3_setrot (mesh, 15, 15, 15);
 
 // add a camera
 camera = scenemgr->addCameraSceneNodeFPS();

 // position our model
 m3_setpos (mesh, 0, 0, 13);

 // now animate it
 m3_playanim (mesh);
 
 while (device->run()) {
 }
}