Mantis#1859. Thank you kindly, Lmmz for a patch that:

Implements llForceMouselook().
0.6.0-stable
Charles Krinke 2008-08-01 02:33:28 +00:00
parent 43f3b9ad7b
commit ab778c4114
4 changed files with 44 additions and 7 deletions

View File

@ -195,6 +195,12 @@ namespace OpenSim.Region.Environment.Scenes
protected LLUUID m_uuid; protected LLUUID m_uuid;
protected LLVector3 m_velocity; protected LLVector3 m_velocity;
// TODO: Those have to be changed into persistent properties at some later point,
// or sit-camera on vehicles will break on sim-crossing.
private LLVector3 m_cameraEyeOffset = new LLVector3(0.0f, 0.0f, 0.0f);
private LLVector3 m_cameraAtOffset = new LLVector3(0.0f, 0.0f, 0.0f);
private bool m_forceMouselook = false;
#endregion Fields #endregion Fields
#region Constructors #region Constructors
@ -3313,6 +3319,30 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
public void SetCameraAtOffset(LLVector3 v) {
m_cameraAtOffset = v;
}
public void SetCameraEyeOffset(LLVector3 v) {
m_cameraEyeOffset = v;
}
public void SetForceMouselook(bool force) {
m_forceMouselook = force;
}
public LLVector3 GetCameraAtOffset() {
return m_cameraAtOffset;
}
public LLVector3 GetCameraEyeOffset() {
return m_cameraEyeOffset;
}
public bool GetForceMouselook() {
return m_forceMouselook;
}
#endregion Public Methods #endregion Public Methods
} }
} }

View File

@ -1129,6 +1129,9 @@ namespace OpenSim.Region.Environment.Scenes
bool autopilot = true; bool autopilot = true;
LLVector3 pos = new LLVector3(); LLVector3 pos = new LLVector3();
LLQuaternion sitOrientation = new LLQuaternion(0, 0, 0, 1); LLQuaternion sitOrientation = new LLQuaternion(0, 0, 0, 1);
LLVector3 cameraEyeOffset = LLVector3.Zero;
LLVector3 cameraAtOffset = LLVector3.Zero;
bool forceMouselook = false;
//SceneObjectPart part = m_scene.GetSceneObjectPart(targetID); //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID);
SceneObjectPart part = FindNextAvailableSitTarget(targetID); SceneObjectPart part = FindNextAvailableSitTarget(targetID);
@ -1183,9 +1186,13 @@ namespace OpenSim.Region.Environment.Scenes
RemoveFromPhysicalScene(); RemoveFromPhysicalScene();
} }
} }
cameraAtOffset = part.GetCameraAtOffset();
cameraEyeOffset = part.GetCameraEyeOffset();
forceMouselook = part.GetForceMouselook();
} }
ControllingClient.SendSitResponse(targetID, offset, sitOrientation, autopilot, LLVector3.Zero, LLVector3.Zero, false); ControllingClient.SendSitResponse(targetID, offset, sitOrientation, autopilot, cameraAtOffset, cameraEyeOffset, forceMouselook);
m_requestedSitTargetUUID = targetID; m_requestedSitTargetUUID = targetID;
// This calls HandleAgentSit twice, once from here, and the client calls // This calls HandleAgentSit twice, once from here, and the client calls
// HandleAgentSit itself after it gets to the location // HandleAgentSit itself after it gets to the location

View File

@ -4747,13 +4747,13 @@ namespace OpenSim.Region.ScriptEngine.Common
public void llSetCameraEyeOffset(LSL_Types.Vector3 offset) public void llSetCameraEyeOffset(LSL_Types.Vector3 offset)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llSetCameraEyeOffset"); m_host.SetCameraEyeOffset(new LLVector3((float)offset.x, (float)offset.y, (float)offset.z));
} }
public void llSetCameraAtOffset(LSL_Types.Vector3 offset) public void llSetCameraAtOffset(LSL_Types.Vector3 offset)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llSetCameraAtOffset"); m_host.SetCameraAtOffset(new LLVector3((float)offset.x, (float)offset.y, (float)offset.z));
} }
public string llDumpList2String(LSL_Types.list src, string seperator) public string llDumpList2String(LSL_Types.list src, string seperator)
@ -6627,7 +6627,7 @@ namespace OpenSim.Region.ScriptEngine.Common
public void llForceMouselook(int mouselook) public void llForceMouselook(int mouselook)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llForceMouselook"); m_host.SetForceMouselook(mouselook != 0);
} }
public double llGetObjectMass(string id) public double llGetObjectMass(string id)

View File

@ -4609,13 +4609,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llSetCameraEyeOffset(LSL_Types.Vector3 offset) public void llSetCameraEyeOffset(LSL_Types.Vector3 offset)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llSetCameraEyeOffset"); m_host.SetCameraEyeOffset(new LLVector3((float)offset.x, (float)offset.y, (float)offset.z));
} }
public void llSetCameraAtOffset(LSL_Types.Vector3 offset) public void llSetCameraAtOffset(LSL_Types.Vector3 offset)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llSetCameraAtOffset"); m_host.SetCameraAtOffset(new LLVector3((float)offset.x, (float)offset.y, (float)offset.z));
} }
public string llDumpList2String(LSL_Types.list src, string seperator) public string llDumpList2String(LSL_Types.list src, string seperator)
@ -6410,7 +6410,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llForceMouselook(int mouselook) public void llForceMouselook(int mouselook)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llForceMouselook"); m_host.SetForceMouselook(mouselook != 0);
} }
public double llGetObjectMass(string id) public double llGetObjectMass(string id)