def __init__(self): ObjectDepth.__init__(self, None) self.entity = render_engine.SceneManager.createEntity("ChemistryAtom_" + str(self), chem_env.mesh_sphere) self.sceneNode.attachObject(self.entity) #self.setScale(ogre.Vector3(0.35, 0.35, 0.35)) self._name = None self.needNameUpdate = True
def __init__(self): ObjectDepth.__init__(self, None) self.entity = render_engine.SceneManager.createEntity( "ChemistryAtom_" + str(self), chem_env.mesh_sphere) self.sceneNode.attachObject(self.entity) #self.setScale(ogre.Vector3(0.35, 0.35, 0.35)) self._name = None self.needNameUpdate = True
def _updateView(self): """View update function Updates state for object """ if self.needNameUpdate: self.needNameUpdate = False self.entity.setMaterialName(self._getMaterialName()) self.setText(self._name) if self.needStateUpdate: self.needStateUpdate = False self.entity.setMaterialName(self._getMaterialName()) ObjectDepth._updateView(self)
def __del__(self): ObjectDepth.__del__(self) render_engine.SceneManager.destroyEntity(self.entity)