source: flair-src/trunk/lib/FlairSimulator/src/Model.cpp@ 107

Last change on this file since 107 was 70, checked in by Sanahuja Guillaume, 8 years ago

simu cameras

File size: 2.1 KB
RevLine 
[10]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[10]4// %flair:license}
[8]5// created: 2013/03/25
6// filename: Model.cpp
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: classe definissant un modele a simuler
14//
15/*********************************************************************/
16
17#include "Model.h"
18#include "Model_impl.h"
19#include "Simulator.h"
20#include "Simulator_impl.h"
21#include <DoubleSpinBox.h>
22
23#ifdef GL
[70]24#include "FollowMeCamera.h"
[8]25#include "Gui.h"
26#include <ICameraSceneNode.h>
27using namespace irr;
28using namespace irr::scene;
29using namespace irr::core;
30#endif
31
32using namespace flair::core;
33using namespace flair::gui;
34
[15]35namespace flair {
36namespace simulator {
37
38Model::Model(const Simulator *parent, std::string name)
39 : IODevice(parent, name) {
[8]40#ifdef GL
[15]41 pimpl_ =
42 new Model_impl(this, name, getGui()->getSceneManager(), parent->pimpl_);
[8]43#else
[15]44 pimpl_ = new Model_impl(this, name, parent->pimpl_);
[8]45#endif
[15]46 parent->pimpl_->models.push_back(this);
[8]47}
48
[15]49Model::~Model() { delete pimpl_; }
[8]50#ifdef GL
[15]51ISceneNode *Model::getSceneNode() const { return pimpl_; }
[8]52/*
53only used by dbt, to rewrite using conversion functions (irrlicht <-> simulator)
54void Model::setPosition(Vector3D pos)
55{
56 //note that irrlicht frame is left handed
57 pimpl_->setPosition(ToIrrlichtScale(1)*vector3df(pos.y,pos.z,-pos.x));
58}
59*/
[15]60void Model::setScale(float value) {
61 pimpl_->setScale(vector3df(value, value, value));
[8]62}
63
[15]64aabbox3d<f32> *Model::Box() const { return &(pimpl_->box); }
[8]65
[69]66FollowMeCamera *Model::getFollowMeCamera(void) const { return pimpl_->camera; }
[8]67
[15]68void Model::setTriangleSelector(ITriangleSelector *selector) {
[8]69
[15]70 pimpl_->selector = selector;
71 pimpl_->setTriangleSelector(selector);
[8]72}
73
[69]74void Model::setCameraFarValue(float zf) { pimpl_->camera->getCameraSceneNode()->setFarValue(zf); }
[8]75#endif
76
[15]77TabWidget *Model::GetTabWidget(void) const { return pimpl_->tabwidget; }
[8]78
[15]79float Model::dT(void) const { return pimpl_->dT->Value(); }
[8]80
81} // end namespace simulator
82} // end namespace flair
Note: See TracBrowser for help on using the repository browser.