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

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

add ball for Julio

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 <DoubleSpinBox.h>
[361]21#include <Vector3DSpinBox.h>
[8]22
23#ifdef GL
[70]24#include "FollowMeCamera.h"
[8]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
[15]34namespace flair {
35namespace simulator {
36
[158]37Model::Model(std::string name,uint32_t modelId)
38 : IODevice(getSimulator(), name) {
39 pimpl_ = new Model_impl(this, name,modelId);
[8]40}
41
[15]42Model::~Model() { delete pimpl_; }
[8]43#ifdef GL
[15]44ISceneNode *Model::getSceneNode() const { return pimpl_; }
[8]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*/
[15]53void Model::setScale(float value) {
54 pimpl_->setScale(vector3df(value, value, value));
[8]55}
56
[15]57aabbox3d<f32> *Model::Box() const { return &(pimpl_->box); }
[8]58
[69]59FollowMeCamera *Model::getFollowMeCamera(void) const { return pimpl_->camera; }
[8]60
[15]61void Model::setTriangleSelector(ITriangleSelector *selector) {
[8]62
[15]63 pimpl_->selector = selector;
64 pimpl_->setTriangleSelector(selector);
[8]65}
66
[69]67void Model::setCameraFarValue(float zf) { pimpl_->camera->getCameraSceneNode()->setFarValue(zf); }
[8]68#endif
69
[15]70TabWidget *Model::GetTabWidget(void) const { return pimpl_->tabwidget; }
[8]71
[167]72double Model::dT(void) const { return pimpl_->dT->Value(); }
[8]73
[158]74int Model::GetId(void) const {
75 return pimpl_->modelId;
76}
77
[361]78core::Vector3Df Model::InitialPosition(void) {
79 return pimpl_->pos_init->Value();
80}
81
[8]82} // end namespace simulator
83} // end namespace flair
Note: See TracBrowser for help on using the repository browser.