Skip to content

Commit b899897

Browse files
author
Leph
committed
Atom setPosition
1 parent 7e7d395 commit b899897

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/Atom.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ const Vector3& Atom::getPosition() const
5454
return _position;
5555
}
5656

57+
void Atom::setPosition(const Ogre::Vector3& position)
58+
{
59+
_position = position;
60+
_node->setPosition(_position);
61+
62+
//Mise à jour des structures Ogre de la scene (octree)
63+
Global::getSceneManager()->_updateSceneGraph(0);
64+
}
65+
5766
void Atom::move(Real dt)
5867
{
5968
assert(dt > 0);

src/Atom.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ class Atom
3434
*/
3535
const Ogre::Vector3& getPosition() const;
3636

37+
/**
38+
* Définie manuellement la position de l'atome
39+
* Le respect des contraintes de position n'est
40+
* pas vérifié !
41+
*/
42+
void setPosition(const Ogre::Vector3& position);
43+
3744
/**
3845
* Renvoi true si l'atome représente
3946
* l'atome spécifié

0 commit comments

Comments
 (0)