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

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

simu cameras

File size: 2.1 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
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
24#include "FollowMeCamera.h"
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
35namespace flair {
36namespace simulator {
37
38Model::Model(const Simulator *parent, std::string name)
39    : IODevice(parent, name) {
40#ifdef GL
41  pimpl_ =
42      new Model_impl(this, name, getGui()->getSceneManager(), parent->pimpl_);
43#else
44  pimpl_ = new Model_impl(this, name, parent->pimpl_);
45#endif
46  parent->pimpl_->models.push_back(this);
47}
48
49Model::~Model() { delete pimpl_; }
50#ifdef GL
51ISceneNode *Model::getSceneNode() const { return pimpl_; }
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*/
60void Model::setScale(float value) {
61  pimpl_->setScale(vector3df(value, value, value));
62}
63
64aabbox3d<f32> *Model::Box() const { return &(pimpl_->box); }
65
66FollowMeCamera *Model::getFollowMeCamera(void) const { return pimpl_->camera; }
67
68void Model::setTriangleSelector(ITriangleSelector *selector) {
69
70  pimpl_->selector = selector;
71  pimpl_->setTriangleSelector(selector);
72}
73
74void Model::setCameraFarValue(float zf) { pimpl_->camera->getCameraSceneNode()->setFarValue(zf); }
75#endif
76
77TabWidget *Model::GetTabWidget(void) const { return pimpl_->tabwidget; }
78
79float Model::dT(void) const { return pimpl_->dT->Value(); }
80
81} // end namespace simulator
82} // end namespace flair
Note: See TracBrowser for help on using the repository browser.