#include <msp/gl/animatedobject.h>
#include <msp/gl/animation.h>
#include <msp/gl/animationplayer.h>
#include <msp/gl/blend.h>
#include <msp/gl/camera.h>
#include <msp/gl/animatedobject.h>
#include <msp/gl/animation.h>
#include <msp/gl/animationplayer.h>
#include <msp/gl/blend.h>
#include <msp/gl/camera.h>
#include <msp/gl/resources.h>
#include <msp/gl/simplescene.h>
#include <msp/gl/technique.h>
#include <msp/gl/resources.h>
#include <msp/gl/simplescene.h>
#include <msp/gl/technique.h>
#include <msp/gl/windowview.h>
#include <msp/input/mouse.h>
#include <msp/io/print.h>
#include <msp/gl/windowview.h>
#include <msp/input/mouse.h>
#include <msp/io/print.h>
GL::Renderable *renderable;
GL::AnimatedObject *anim_object;
GL::AnimationPlayer *anim_player;
GL::Renderable *renderable;
GL::AnimatedObject *anim_object;
GL::AnimationPlayer *anim_player;
Viewer::Viewer(int argc, char **argv):
opts(argc, argv),
window(display, opts.wnd_opts),
Viewer::Viewer(int argc, char **argv):
opts(argc, argv),
window(display, opts.wnd_opts),
IO::BufferedFile in(opts.renderable_name);
DataFile::Parser parser(in, opts.renderable_name);
ldr.load(parser);
IO::BufferedFile in(opts.renderable_name);
DataFile::Parser parser(in, opts.renderable_name);
ldr.load(parser);
{
GL::SequenceTemplate *tmpl = load<GL::SequenceTemplate>(opts.renderable_name);
GL::SequenceBuilder bld(*tmpl);
{
GL::SequenceTemplate *tmpl = load<GL::SequenceTemplate>(opts.renderable_name);
GL::SequenceBuilder bld(*tmpl);
mouse.signal_button_release.connect(sigc::bind_return(sigc::mem_fun(this, &Viewer::button_release), false));
mouse.signal_axis_motion.connect(sigc::bind_return(sigc::mem_fun(this, &Viewer::axis_motion), false));
mouse.signal_button_release.connect(sigc::bind_return(sigc::mem_fun(this, &Viewer::button_release), false));
mouse.signal_axis_motion.connect(sigc::bind_return(sigc::mem_fun(this, &Viewer::axis_motion), false));
GL::Sequence::Step &step = sequence->add_step(0, *renderable);
step.set_lighting(&lighting);
GL::Sequence::Step &step = sequence->add_step(0, *renderable);
step.set_lighting(&lighting);
float sy = sin(light_yaw);
float cp = cos(light_pitch);
float sp = sin(light_pitch);
float sy = sin(light_yaw);
float cp = cos(light_pitch);
float sp = sin(light_pitch);
- light.set_position(GL::Vector4(-cy*cp, -sy*cp, -sp, 0));
+ light.set_direction(GL::Vector3(cy*cp, sy*cp, sp));