示例#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++;
}
void ModelPreviewWorker::scaleNode()
{
	if (mModelMount) {
		mModelMount->rescale(hasBBox() ? &getBBox() : 0);
	} else {
		S_LOG_WARNING("Tried to scale node without there being a valid model mount.");
	}
}
void EntityCreatorCreationInstance::scaleNode()
{
	if (mModelMount) {
		mModelMount->rescale(hasBBox() ? &getBBox() : 0);
	} else {
		S_LOG_WARNING("Tried to scale node without there being a valid model mount.");
	}
}
示例#4
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();
	}
}