second life代码初研究
来源:互联网 发布:mpp数据库 百科 编辑:程序博客网 时间:2024/06/03 20:59
second life这种非拘束的 允许客户上传物体从而建立一个庞大的虚拟世界的游戏是很有前途的.这里开始初步分析其代码.其client已经go public
second life 的client 端的通信代码是包装在
llmessage项目里的各个类
然后如果是命令的话
在不同的实际功能的类里包含了不同的 packmessage 与unpackmessage的方法,
要进行同步对象的话则包装了pack 和unpack的方法
其中最重要的人物是通过agent类来进行管理的在 newview项目里的llagent类.
这个是客户自身可以操作的类
// forward declarations
//
class LLAgent : public LLObservable
{
}
从agent的teleportViaLandmark可以知道server是怎么存储和管理不同的
场景的.每个场景都有一个uuid
// Landmark ID = LLUUID::null means teleport home
void LLAgent::teleportViaLandmark(const LLUUID& landmark_id)
{
LLViewerRegion *regionp = getRegion();
if(regionp && teleportCore())
{
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_TeleportLandmarkRequest);
msg->nextBlockFast(_PREHASH_Info);
msg->addUUIDFast(_PREHASH_AgentID, getID());
msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
msg->addUUIDFast(_PREHASH_LandmarkID, landmark_id);
sendReliableMessage();
}
}
//对于大量的资源文件是通过一个独立的虚拟文件系统vfs来操作的.这里
每个image通过一个独立的uuid来表示.在这里上层系统从vfs里得到要操作的image
//BOOL LLViewerImage::loadLocalImage(const LLUUID &image_id)
{
LLMemType mt1(LLMemType::MTYPE_APPFMTIMAGE);
// first look for this image in the static VFS
LLAssetType::EType asset_type = LLAssetType::AT_NONE;
// Try TGA first
if (gStaticVFS->getExists(image_id, LLAssetType::AT_TEXTURE_TGA))
{
asset_type = LLAssetType::AT_TEXTURE_TGA;
//RN: force disable discards for TGA files because they can't decode at different quality levels
dontDiscard();
mDataCodec = IMG_CODEC_TGA;
}
else if (gStaticVFS->getExists(image_id, LLAssetType::AT_TEXTURE))
{
// then try for a J2C version
asset_type = LLAssetType::AT_TEXTURE;
mDataCodec = IMG_CODEC_J2C;
LLImageJ2C* imagej2c = new LLImageJ2C();
setFormattedImage(imagej2c);
}
if (asset_type != LLAssetType::AT_NONE)
{
S32 size = gStaticVFS->getSize(image_id, asset_type);
U8* buffer = new U8[size];
BOOL success = LLVFSThread::sLocal->readImmediate(gStaticVFS, image_id, asset_type, buffer, 0, size);
if (!success)
{
llwarns << "loadLocalImage() - vfs read failed" << llendl;
return FALSE;
}
mInStaticVFS = TRUE;
mFullyLoaded = TRUE;
setNeedsDecode(TRUE); // Loading a local image
mID = image_id;
setDecodeData(buffer, size);
mTotalBytes = size;
mLastBytesProcessed = size;
return TRUE;
}
return FALSE;
}
- second life代码初研究
- Second Life
- second life
- 第二人生(Second Life)
- Second Life 体验
- 第二人生,Second Life
- Second life 客户机,第 1 部分: 玩转 Second Life
- 从second life说开去
- your second life,your imagination
- Second Life 的数据拾零
- Second Life 的社群观点
- Second Life 的数据拾零
- 哈佛开始second life了!
- second life 挣钱的方法
- second life下开发 经验总结
- 我们需要“第二人生”吗?[Second life]
- 我们需要“第二人生”吗?[Second life]
- Second Life 遭史上最大规模病毒攻击
- 离生日还有三个小时
- 开发人员需要了解的测试
- C/C++语言void及void指针深层探索
- Delphi中统一显示表格字段名的高效方法
- 修改ion2加入xrandr支持
- second life代码初研究
- AT&T汇编语言与GCC内嵌汇编简介
- www.renderchina.com
- 共看海天成一色——河北乐亭游记(完全篇)
- .net视频
- c语言中static 变量,讲解的的确很好!
- 申请了51la流量统计,如何去掉统计图标
- Windows应用程序的运行机制
- 使用该JavaBean可以将数据在JSP页面中以表格的形式显示出来,并具有动态排序、动态生成查询、自动分页功能