Exemple #1
0
void EmberEntity::init(const Atlas::Objects::Entity::RootEntity &ge, bool fromCreateOp)
{
  if (mEntityMapping) {
    //Calling this will result in the graphical represention being correctly set up.
    //It's important that we call initialize before call Eris::Entity::init, since else we get strange results.
    mEntityMapping->initialize();
  }

  Eris::Entity::init(ge, fromCreateOp);

  // Setup Sounds
  //	setSounds();

  // set the Ogre node position and orientation based on Atlas data
  std::stringstream ss;
  if (getPredictedPos().isValid()) {
    ss << "Entity " << getId() << "(" << getName() << ") placed at (" << getPredictedPos().x() << "," << getPredictedPos().y() << "," << getPredictedPos().x() << ")";
  }
  S_LOG_VERBOSE(ss.str());

  mIsInitialized = true;

  //If the entity had no bounding box, the onBboxChanged will never have been called, and we want to do that now instead.
  if (!hasBBox()) {
    onBboxChanged();
  }

  will_not_compile++;
}
Exemple #2
0
void EmberEntity::onAttrChanged(const std::string& str, const Atlas::Message::Element& v)
{
	if (str == "mode") {
		parsePositioningModeChange(v);
	} else if (str == "bbox") {
		Entity::onAttrChanged(str, v);
		onBboxChanged();
		return;
	}

	Entity::onAttrChanged(str, v);

}
Exemple #3
0
void EmberEntity::onAttrChanged(const std::string& str, const Atlas::Message::Element& v)
{
  if (str == "mode") {
    parsePositioningModeChange(v);
  } else if (str == "bbox") {
    Entity::onAttrChanged(str, v);
    onBboxChanged();
    return;
  }

  //call this before checking for areas and terrainmods, since those instances created to handle that (TerrainMod and TerrainArea) will listen to the AttrChanged event, which would then be emitted after those have been created, causing duplicate regeneration from the same data
  Entity::onAttrChanged(str, v);

}
Exemple #4
0
void EmberEntity::onAttrChanged(const std::string& str, const Atlas::Message::Element& v)
{
	if (str == "mode") {
		parsePositioningModeChange(v);
	} else if (str == "bbox") {
		Entity::onAttrChanged(str, v);
		onBboxChanged();
		return;
	}

	//Dispatch attribute changes to any global listeners.
	sGlobalDispatcher.dispatchAttributeChange(*this, str, v);

	Entity::onAttrChanged(str, v);

}
Exemple #5
0
void EmberEntity::init(const Atlas::Objects::Entity::RootEntity &ge, bool fromCreateOp)
{
	Eris::Entity::init(ge, fromCreateOp);

	// Setup Sounds
	//	setSounds();

	if (getPredictedPos().isValid()) {
		std::stringstream ss;
		ss << "Entity " << getId() << " (" << getName() << ", " << getType()->getName() << ") placed at (" << getPredictedPos().x() << "," << getPredictedPos().y() << "," << getPredictedPos().x() << ")";
		S_LOG_VERBOSE(ss.str());
	}

	mIsInitialized = true;

	//If the entity had no bounding box, the onBboxChanged will never have been called, and we want to do that now instead.
	if (!hasBBox()) {
		onBboxChanged();
	}
}