コード例 #1
0
// changes local camera and broadcasts change
/* virtual */ void LLViewerCamera::setView(F32 vertical_fov_rads)
{
	F32 old_fov = LLViewerCamera::getInstance()->getView();

	// cap the FoV
	vertical_fov_rads = llclamp(vertical_fov_rads, getMinView(), getMaxView());

	if (vertical_fov_rads == old_fov) return;

	// send the new value to the simulator
	LLMessageSystem* msg = gMessageSystem;
	msg->newMessageFast(_PREHASH_AgentFOV);
	msg->nextBlockFast(_PREHASH_AgentData);
	msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
	msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
	msg->addU32Fast(_PREHASH_CircuitCode, gMessageSystem->mOurCircuitCode);

	msg->nextBlockFast(_PREHASH_FOVBlock);
	msg->addU32Fast(_PREHASH_GenCounter, 0);
	msg->addF32Fast(_PREHASH_VerticalAngle, vertical_fov_rads);

	gAgent.sendReliableMessage();

	// sync the camera with the new value
	LLCamera::setView(vertical_fov_rads); // call base implementation
}
コード例 #2
0
void LLViewerCamera::setDefaultFOV(F32 vertical_fov_rads) 
{
	vertical_fov_rads = llclamp(vertical_fov_rads, getMinView(), getMaxView());
	setView(vertical_fov_rads);
	mCameraFOVDefault = vertical_fov_rads; 
	mCosHalfCameraFOV = cosf(mCameraFOVDefault * 0.5f);
}
コード例 #3
0
void LLViewerCamera::setDefaultFOV(F32 vertical_fov_rads) {
	vertical_fov_rads = llclamp(vertical_fov_rads, getMinView(), getMaxView());
	setView(vertical_fov_rads);
	mCameraFOVDefault = vertical_fov_rads; 
}