本文整理汇总了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());
}
}