当前位置: 首页>>代码示例>>C++>>正文


C++ MovableObject::getName方法代码示例

本文整理汇总了C++中MovableObject::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ MovableObject::getName方法的具体用法?C++ MovableObject::getName怎么用?C++ MovableObject::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MovableObject的用法示例。


在下文中一共展示了MovableObject::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: detachObject

	void SceneNode::detachObject( MovableObject & object )
	{
		auto it = std::find_if( m_objects.begin(), m_objects.end(), [&object]( std::reference_wrapper< MovableObject > obj )
		{
			return obj.get().getName() == object.getName();
		} );

		if ( it != m_objects.end() )
		{
			m_objects.erase( it );
			object.attachTo( nullptr );
		}
	}
开发者ID:DragonJoker,项目名称:Castor3D,代码行数:13,代码来源:SceneNode.cpp

示例2:

/** Destructor */
SubObject::~SubObject() {

	// Destroy all attached entities and scene nodes
	unsigned short count = node_->numAttachedObjects();
	for (unsigned short i = 0; i < count; i++) {
		MovableObject* obj = node_->getAttachedObject(0U);
		node_->detachObject((unsigned short)0);
		node_->getCreator()->destroyMovableObject(obj->getName(), obj->getMovableType());
	}
	node_->getParentSceneNode()->removeAndDestroyChild(node_->getName());

	// Remove from world if the subobject was separated off
	if (body_.get()) { 
		body_->setUserPointer(0);
		game_->getWorld()->removeCollisionObject(body_.get()); 
	}
}
开发者ID:mfichman,项目名称:warp,代码行数:18,代码来源:SubObject.cpp

示例3: check

Object::~Object() {

	// Notify projectiles that the object is toast
	clearAllTrackers();
	//cout << "Collecting " << name_ << endl;

	// Un-track
	if (target_) target_->removeTracker(this);

	// Clean up physics
	game_->getWorld()->removeCollisionObject(body_.get());

	// Destroy all subobjects
	subObjects_.clear();

	// Destroy objects attached to the scene node
	while (node_->numAttachedObjects() > 0) {
		MovableObject* obj = node_->getAttachedObject(0U);
		node_->detachObject((unsigned short)0U);
		node_->getCreator()->destroyMovableObject(obj->getName(), obj->getMovableType());
	}

	// Destroy all attached entities and scene nodes
	SceneNode::ChildNodeIterator i = node_->getChildIterator();
	while (i.hasMoreElements()) {
		SceneNode* node = static_cast<SceneNode*>(i.getNext());
		MovableObject* obj = node->getAttachedObject(0U);
		node->detachObject((unsigned short)0U);
		node->getCreator()->destroyMovableObject(obj->getName(), obj->getMovableType());
	}
	node_->removeAndDestroyAllChildren();
	node_->getParentSceneNode()->removeAndDestroyChild(node_->getName());

	// Clean up scripting
	lua_State* env = game_->getScriptState();
	StackCheck check(env);
	lua_getref(env, table_);
	
	lua_pushnil(env);
	lua_setfield(env, -2, "__thiscpp");

	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "addEntity");
	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "setEntity");
	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "addParticleSystem");
	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "setParticleSystem");
	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "set");
	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "explode");
	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "destroy");
	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "target");
	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "setPosition");
	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "getPosition");
	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "setVelocity");
	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "getVelocity");
	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "setOrientation");
	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "getOrientation");
	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "createMissile");
	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "getTarget");
	lua_pushcclosure(env, &Object::luaWarningDestroyed, 0);
	lua_setfield(env, -2, "setTarget");
	lua_unref(env, table_);
}
开发者ID:mfichman,项目名称:warp,代码行数:77,代码来源:Object.cpp


注:本文中的MovableObject::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。