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

Last change on this file since 469 was 361, checked in by Sanahuja Guillaume, 4 years ago

add ball for Julio

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 <DoubleSpinBox.h>
21#include <Vector3DSpinBox.h>
22
23#ifdef GL
24#include "FollowMeCamera.h"
25#include <ICameraSceneNode.h>
26using namespace irr;
27using namespace irr::scene;
28using namespace irr::core;
29#endif
30
31using namespace flair::core;
32using namespace flair::gui;
33
34namespace flair {
35namespace simulator {
36
37Model::Model(std::string name,uint32_t modelId)
38 : IODevice(getSimulator(), name) {
39 pimpl_ = new Model_impl(this, name,modelId);
40}
41
42Model::~Model() { delete pimpl_; }
43#ifdef GL
44ISceneNode *Model::getSceneNode() const { return pimpl_; }
45/*
46only used by dbt, to rewrite using conversion functions (irrlicht <-> simulator)
47void Model::setPosition(Vector3D pos)
48{
49 //note that irrlicht frame is left handed
50 pimpl_->setPosition(ToIrrlichtScale(1)*vector3df(pos.y,pos.z,-pos.x));
51}
52*/
53void Model::setScale(float value) {
54 pimpl_->setScale(vector3df(value, value, value));
55}
56
57aabbox3d<f32> *Model::Box() const { return &(pimpl_->box); }
58
59FollowMeCamera *Model::getFollowMeCamera(void) const { return pimpl_->camera; }
60
61void Model::setTriangleSelector(ITriangleSelector *selector) {
62
63 pimpl_->selector = selector;
64 pimpl_->setTriangleSelector(selector);
65}
66
67void Model::setCameraFarValue(float zf) { pimpl_->camera->getCameraSceneNode()->setFarValue(zf); }
68#endif
69
70TabWidget *Model::GetTabWidget(void) const { return pimpl_->tabwidget; }
71
72double Model::dT(void) const { return pimpl_->dT->Value(); }
73
74int Model::GetId(void) const {
75 return pimpl_->modelId;
76}
77
78core::Vector3Df Model::InitialPosition(void) {
79 return pimpl_->pos_init->Value();
80}
81
82} // end namespace simulator
83} // end namespace flair
Note: See TracBrowser for help on using the repository browser.