本文整理匯總了C++中ObjectManager::createObject方法的典型用法代碼示例。如果您正苦於以下問題:C++ ObjectManager::createObject方法的具體用法?C++ ObjectManager::createObject怎麽用?C++ ObjectManager::createObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ObjectManager
的用法示例。
在下文中一共展示了ObjectManager::createObject方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: handleSceneObjectCreateMessage
void ZonePacketHandler::handleSceneObjectCreateMessage(Message* pack) {
BaseClient* client = (BaseClient*) pack->getClient();
uint64 objectID = pack->parseLong();
pack->shiftOffset(16);
float x = pack->parseFloat();
float z = pack->parseFloat();
float y = pack->parseFloat();
uint32 crc = pack->parseInt();
ObjectManager* objectManager = zone->getObjectManager();
if (objectManager == NULL) {
error("object manager was NULL");
return;
}
SceneObject* object = objectManager->createObject(crc, objectID);
if (object == NULL) {
StringBuffer infoMsg;
infoMsg << "unknown crc 0x" << hex << crc << " received in SceneObjectCreateMessage";
client->debug(infoMsg.toString());
return;
}
if (zone->isSelfPlayer(object)) {
object->setClient(zone->getZoneClient());
}
}