コード例 #1
0
void LLAgentListener::getAutoPilot(const LLSD& event_data) const
{
	LLSD reply = LLSD::emptyMap();
	
	LLSD::Boolean enabled = mAgent.getAutoPilot();
	reply["enabled"] = enabled;
	
	reply["target_global"] = ll_sd_from_vector3d(mAgent.getAutoPilotTargetGlobal());
	
	reply["leader_id"] = mAgent.getAutoPilotLeaderID();
	
	reply["stop_distance"] = mAgent.getAutoPilotStopDistance();

	reply["target_distance"] = mAgent.getAutoPilotTargetDist();
	if (!enabled &&
		mFollowTarget.notNull())
	{	// Get an actual distance from the target object we were following
		LLViewerObject * target = gObjectList.findObject(mFollowTarget);
		if (target)
		{	// Found the target AV, return the actual distance to them as well as their ID
			LLVector3 difference = target->getPositionRegion() - mAgent.getPositionAgent();
			reply["target_distance"] = difference.length();
			reply["leader_id"] = mFollowTarget;
		}
	}

	reply["use_rotation"] = (LLSD::Boolean) mAgent.getAutoPilotUseRotation();
	reply["target_facing"] = ll_sd_from_vector3(mAgent.getAutoPilotTargetFacing());
	reply["rotation_threshold"] = mAgent.getAutoPilotRotationThreshold();
	reply["behavior_name"] = mAgent.getAutoPilotBehaviorName();
	reply["fly"] = (LLSD::Boolean) mAgent.getFlying();

	sendReply(reply, event_data);
}
コード例 #2
0
void LLAgentPilot::saveXML(const std::string& filename)
{
	llofstream file;
	file.open(filename);

	if (!file)
	{
		llinfos << "Couldn't open " << filename << ", aborting agentpilot save!" << llendl;
	}

	S32 i;
	for (i = 0; i < mActions.count(); i++)
	{
		Action& action = mActions[i];
		LLSD record;
		record["time"] = (LLSD::Real)action.mTime;
		record["type"] = (LLSD::Integer)action.mType;
		record["camera_view"] = (LLSD::Real)action.mCameraView;
		record["target"] = ll_sd_from_vector3d(action.mTarget);
		record["camera_origin"] = ll_sd_from_vector3(action.mCameraOrigin);
		record["camera_xaxis"] = ll_sd_from_vector3(action.mCameraXAxis);
		record["camera_yaxis"] = ll_sd_from_vector3(action.mCameraYAxis);
		record["camera_zaxis"] = ll_sd_from_vector3(action.mCameraZAxis);
		LLSDSerialize::toXML(record, file);
	}
	file.close();
}
コード例 #3
0
ファイル: llsdmessagereader_tut.cpp プロジェクト: Boy/netbook
	void LLSDMessageReaderTestObject::test<16>()
		// Vector3d
	{
		 LLVector3d outValue, inValue = LLVector3d(1,2,3);
		 LLSD sdValue = ll_sd_from_vector3d(inValue);
		LLSDMessageReader msg = testType(sdValue);
		msg.getVector3d("block", "var", outValue);
		ensure_equals("Ensure Vector3d", outValue, inValue);
	}
コード例 #4
0
	void llsdutil_object::test<5>()
	{
		LLSD sd;
		LLVector3d vec1((F64)(U64L(0xFEDCBA9876543210) << 2), -1., 0);
		sd = ll_sd_from_vector3d(vec1); 
		LLVector3d vec2 = ll_vector3d_from_sd(sd);
		ensure_equals("vector3d -> sd -> vector3d: 1", vec1, vec2);
		
		LLVector3d vec3(sd); 
		ensure_equals("vector3d -> sd -> vector3d : 2", vec1, vec3);
	}
コード例 #5
0
void LLAgentListener::getPosition(const LLSD& event_data) const
{
    F32 roll, pitch, yaw;
    LLQuaternion quat(mAgent.getQuat());
    quat.getEulerAngles(&roll, &pitch, &yaw);

	LLSD reply = LLSD::emptyMap();
	reply["quat"] = llsd_copy_array(boost::begin(quat.mQ), boost::end(quat.mQ));
	reply["euler"] = LLSD::emptyMap();
	reply["euler"]["roll"] = roll;
	reply["euler"]["pitch"] = pitch;
	reply["euler"]["yaw"] = yaw;
    reply["region"] = ll_sd_from_vector3(mAgent.getPositionAgent());
    reply["global"] = ll_sd_from_vector3d(mAgent.getPositionGlobal());

	sendReply(reply, event_data);
}
コード例 #6
0
void LLSDMessageBuilder::addVector3d(const char* varname, const LLVector3d& v)
{
	(*mCurrentBlock)[varname] = ll_sd_from_vector3d(v);
}
コード例 #7
0
// static
LLSD LLFloaterAbout::getInfo()
{
	// The point of having one method build an LLSD info block and the other
	// construct the user-visible About string is to ensure that the same info
	// is available to a getInfo() caller as to the user opening
	// LLFloaterAbout.
	LLSD info;
	LLSD version;
	version.append(LLVersionInfo::getMajor());
	version.append(LLVersionInfo::getMinor());
	version.append(LLVersionInfo::getPatch());
	version.append(LLVersionInfo::getBuild());
	info["VIEWER_VERSION"] = version;
	info["VIEWER_VERSION_STR"] = LLVersionInfo::getVersion();
	info["BUILD_DATE"] = __DATE__;
	info["BUILD_TIME"] = __TIME__;
	info["CHANNEL"] = LLVersionInfo::getChannel();

	info["VIEWER_RELEASE_NOTES_URL"] = get_viewer_release_notes_url();

#if LL_MSVC
	info["COMPILER"] = "MSVC";
	info["COMPILER_VERSION"] = _MSC_VER;
#elif LL_GNUC
	info["COMPILER"] = "GCC";
	info["COMPILER_VERSION"] = GCC_VERSION;
#endif

	// Position
	LLViewerRegion* region = gAgent.getRegion();
	if (region)
	{
		const LLVector3d &pos = gAgent.getPositionGlobal();
		info["POSITION"] = ll_sd_from_vector3d(pos);
		info["REGION"] = gAgent.getRegion()->getName();
		info["HOSTNAME"] = gAgent.getRegion()->getHost().getHostName();
		info["HOSTIP"] = gAgent.getRegion()->getHost().getString();
		info["SERVER_VERSION"] = gLastVersionChannel;
		info["SERVER_RELEASE_NOTES_URL"] = LLWeb::escapeURL(region->getCapability("ServerReleaseNotes"));
	}

	// CPU
	info["CPU"] = gSysCPU.getCPUString();
	info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB() / 1024);
	// Moved hack adjustment to Windows memory size into llsys.cpp
	info["OS_VERSION"] = LLAppViewer::instance()->getOSInfo().getOSString();
	info["GRAPHICS_CARD_VENDOR"] = (const char*)(glGetString(GL_VENDOR));
	info["GRAPHICS_CARD"] = (const char*)(glGetString(GL_RENDERER));

#if LL_WINDOWS
    LLSD driver_info = gDXHardware.getDisplayInfo();
    if (driver_info.has("DriverVersion"))
    {
        info["GRAPHICS_DRIVER_VERSION"] = driver_info["DriverVersion"];
    }
#endif

	info["OPENGL_VERSION"] = (const char*)(glGetString(GL_VERSION));
	info["LIBCURL_VERSION"] = LLCurl::getVersionString();
	info["J2C_VERSION"] = LLImageJ2C::getEngineInfo();
	bool want_fullname = true;
	info["AUDIO_DRIVER_VERSION"] = gAudiop ? LLSD(gAudiop->getDriverName(want_fullname)) : LLSD();
	if(LLVoiceClient::getInstance()->voiceEnabled())
	{
		LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion();
		std::ostringstream version_string;
		version_string << version.serverType << " " << version.serverVersion << std::endl;
		info["VOICE_VERSION"] = version_string.str();
	}
	else 
	{
		info["VOICE_VERSION"] = LLTrans::getString("NotConnected");
	}
	
	// TODO: Implement media plugin version query
	info["QT_WEBKIT_VERSION"] = "4.7.1 (version number hard-coded)";

	if (gPacketsIn > 0)
	{
		info["PACKETS_LOST"] = LLViewerStats::getInstance()->mPacketsLostStat.getCurrent();
		info["PACKETS_IN"] = F32(gPacketsIn);
		info["PACKETS_PCT"] = 100.f*info["PACKETS_LOST"].asReal() / info["PACKETS_IN"].asReal();
	}

    return info;
}