aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
diff options
context:
space:
mode:
authorMelanie2012-08-18 13:57:50 +0100
committerMelanie2012-08-18 13:57:50 +0100
commit5d43e27de29c104c3026b3c64ac3cc684f6353f2 (patch)
tree25b2e737c25fd168eb28e9b8e082f993844329c3 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
parentMerge branch 'master' into careminster (diff)
parentrefactoring for Vector3 operator & constructor tweaks (diff)
downloadopensim-SC-5d43e27de29c104c3026b3c64ac3cc684f6353f2.zip
opensim-SC-5d43e27de29c104c3026b3c64ac3cc684f6353f2.tar.gz
opensim-SC-5d43e27de29c104c3026b3c64ac3cc684f6353f2.tar.bz2
opensim-SC-5d43e27de29c104c3026b3c64ac3cc684f6353f2.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs106
1 files changed, 43 insertions, 63 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 0ed1ccb..c305f86 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1240,9 +1240,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1240 public LSL_Float llGround(LSL_Vector offset) 1240 public LSL_Float llGround(LSL_Vector offset)
1241 { 1241 {
1242 m_host.AddScriptLPS(1); 1242 m_host.AddScriptLPS(1);
1243 Vector3 pos = m_host.GetWorldPosition() + new Vector3((float)offset.x, 1243 Vector3 pos = m_host.GetWorldPosition() + (Vector3)offset;
1244 (float)offset.y,
1245 (float)offset.z);
1246 1244
1247 //Get the slope normal. This gives us the equation of the plane tangent to the slope. 1245 //Get the slope normal. This gives us the equation of the plane tangent to the slope.
1248 LSL_Vector vsn = llGroundNormal(offset); 1246 LSL_Vector vsn = llGroundNormal(offset);
@@ -1578,7 +1576,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1578 if (face == ScriptBaseClass.ALL_SIDES) 1576 if (face == ScriptBaseClass.ALL_SIDES)
1579 face = SceneObjectPart.ALL_SIDES; 1577 face = SceneObjectPart.ALL_SIDES;
1580 1578
1581 m_host.SetFaceColor(new Vector3((float)color.x, (float)color.y, (float)color.z), face); 1579 m_host.SetFaceColor(color, face);
1582 } 1580 }
1583 1581
1584 public void SetTexGen(SceneObjectPart part, int face,int style) 1582 public void SetTexGen(SceneObjectPart part, int face,int style)
@@ -2208,7 +2206,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2208 2206
2209 bool sameParcel = here.GlobalID == there.GlobalID; 2207 bool sameParcel = here.GlobalID == there.GlobalID;
2210 2208
2211 if (!sameParcel && !World.Permissions.CanObjectEntry(m_host.UUID, false, new Vector3((float)pos.x, (float)pos.y, (float)pos.z))) 2209 if (!sameParcel && !World.Permissions.CanRezObject(
2210 m_host.ParentGroup.PrimCount, m_host.ParentGroup.OwnerID, pos))
2212 { 2211 {
2213 return 0; 2212 return 0;
2214 } 2213 }
@@ -2267,16 +2266,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2267 if (part.ParentGroup.RootPart == part) 2266 if (part.ParentGroup.RootPart == part)
2268 { 2267 {
2269 SceneObjectGroup parent = part.ParentGroup; 2268 SceneObjectGroup parent = part.ParentGroup;
2270 Vector3 dest = new Vector3((float)toPos.x, (float)toPos.y, (float)toPos.z); 2269 if (!World.Permissions.CanObjectEntry(parent.UUID, false, (Vector3)toPos))
2271 if (!World.Permissions.CanObjectEntry(parent.UUID, false, dest))
2272 return; 2270 return;
2273 Util.FireAndForget(delegate(object x) { 2271 Util.FireAndForget(delegate(object x) {
2274 parent.UpdateGroupPosition(dest); 2272 parent.UpdateGroupPosition((Vector3)toPos);
2275 }); 2273 });
2276 } 2274 }
2277 else 2275 else
2278 { 2276 {
2279 part.OffsetPosition = new Vector3((float)toPos.x, (float)toPos.y, (float)toPos.z); 2277 part.OffsetPosition = (Vector3)toPos;
2280 SceneObjectGroup parent = part.ParentGroup; 2278 SceneObjectGroup parent = part.ParentGroup;
2281 parent.HasGroupChanged = true; 2279 parent.HasGroupChanged = true;
2282 parent.ScheduleGroupForTerseUpdate(); 2280 parent.ScheduleGroupForTerseUpdate();
@@ -2314,7 +2312,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2314 pos = part.AbsolutePosition; 2312 pos = part.AbsolutePosition;
2315 } 2313 }
2316 2314
2317 return new LSL_Vector(pos.X, pos.Y, pos.Z); 2315// m_log.DebugFormat("[LSL API]: Returning {0} in GetPartLocalPos()", pos);
2316
2317 return new LSL_Vector(pos);
2318 } 2318 }
2319 2319
2320 public void llSetRot(LSL_Rotation rot) 2320 public void llSetRot(LSL_Rotation rot)
@@ -2464,7 +2464,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2464 if (local != 0) 2464 if (local != 0)
2465 force *= llGetRot(); 2465 force *= llGetRot();
2466 2466
2467 m_host.ParentGroup.RootPart.SetForce(new Vector3((float)force.x, (float)force.y, (float)force.z)); 2467 m_host.ParentGroup.RootPart.SetForce(force);
2468 } 2468 }
2469 } 2469 }
2470 2470
@@ -2476,10 +2476,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2476 2476
2477 if (!m_host.ParentGroup.IsDeleted) 2477 if (!m_host.ParentGroup.IsDeleted)
2478 { 2478 {
2479 Vector3 tmpForce = m_host.ParentGroup.RootPart.GetForce(); 2479 force = m_host.ParentGroup.RootPart.GetForce();
2480 force.x = tmpForce.X;
2481 force.y = tmpForce.Y;
2482 force.z = tmpForce.Z;
2483 } 2480 }
2484 2481
2485 return force; 2482 return force;
@@ -2488,8 +2485,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2488 public LSL_Integer llTarget(LSL_Vector position, double range) 2485 public LSL_Integer llTarget(LSL_Vector position, double range)
2489 { 2486 {
2490 m_host.AddScriptLPS(1); 2487 m_host.AddScriptLPS(1);
2491 return m_host.ParentGroup.registerTargetWaypoint( 2488 return m_host.ParentGroup.registerTargetWaypoint(position,
2492 new Vector3((float)position.x, (float)position.y, (float)position.z), (float)range); 2489 (float)range);
2493 } 2490 }
2494 2491
2495 public void llTargetRemove(int number) 2492 public void llTargetRemove(int number)
@@ -2514,7 +2511,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2514 public void llMoveToTarget(LSL_Vector target, double tau) 2511 public void llMoveToTarget(LSL_Vector target, double tau)
2515 { 2512 {
2516 m_host.AddScriptLPS(1); 2513 m_host.AddScriptLPS(1);
2517 m_host.MoveToTarget(new Vector3((float)target.x, (float)target.y, (float)target.z), (float)tau); 2514 m_host.MoveToTarget(target, (float)tau);
2518 } 2515 }
2519 2516
2520 public void llStopMoveToTarget() 2517 public void llStopMoveToTarget()
@@ -2527,7 +2524,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2527 { 2524 {
2528 m_host.AddScriptLPS(1); 2525 m_host.AddScriptLPS(1);
2529 //No energy force yet 2526 //No energy force yet
2530 Vector3 v = new Vector3((float)force.x, (float)force.y, (float)force.z); 2527 Vector3 v = force;
2531 if (v.Length() > 20000.0f) 2528 if (v.Length() > 20000.0f)
2532 { 2529 {
2533 v.Normalize(); 2530 v.Normalize();
@@ -2540,13 +2537,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2540 public void llApplyRotationalImpulse(LSL_Vector force, int local) 2537 public void llApplyRotationalImpulse(LSL_Vector force, int local)
2541 { 2538 {
2542 m_host.AddScriptLPS(1); 2539 m_host.AddScriptLPS(1);
2543 m_host.ParentGroup.RootPart.ApplyAngularImpulse(new Vector3((float)force.x, (float)force.y, (float)force.z), local != 0); 2540 m_host.ParentGroup.RootPart.ApplyAngularImpulse(force, local != 0);
2544 } 2541 }
2545 2542
2546 public void llSetTorque(LSL_Vector torque, int local) 2543 public void llSetTorque(LSL_Vector torque, int local)
2547 { 2544 {
2548 m_host.AddScriptLPS(1); 2545 m_host.AddScriptLPS(1);
2549 m_host.ParentGroup.RootPart.SetAngularImpulse(new Vector3((float)torque.x, (float)torque.y, (float)torque.z), local != 0); 2546 m_host.ParentGroup.RootPart.SetAngularImpulse(torque, local != 0);
2550 } 2547 }
2551 2548
2552 public LSL_Vector llGetTorque() 2549 public LSL_Vector llGetTorque()
@@ -3111,13 +3108,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3111 return; 3108 return;
3112 } 3109 }
3113 3110
3114 Vector3 llpos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z);
3115 Vector3 llvel = new Vector3((float)vel.x, (float)vel.y, (float)vel.z);
3116
3117 // need the magnitude later 3111 // need the magnitude later
3118 // float velmag = (float)Util.GetMagnitude(llvel); 3112 // float velmag = (float)Util.GetMagnitude(llvel);
3119 3113
3120 SceneObjectGroup new_group = World.RezObject(m_host, item, llpos, Rot2Quaternion(rot), llvel, param); 3114 SceneObjectGroup new_group = World.RezObject(m_host, item, pos, Rot2Quaternion(rot), vel, param);
3121 3115
3122 // If either of these are null, then there was an unknown error. 3116 // If either of these are null, then there was an unknown error.
3123 if (new_group == null) 3117 if (new_group == null)
@@ -3144,11 +3138,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3144 3138
3145 PhysicsActor pa = new_group.RootPart.PhysActor; 3139 PhysicsActor pa = new_group.RootPart.PhysActor;
3146 3140
3147 if (pa != null && pa.IsPhysical && llvel != Vector3.Zero) 3141 if (pa != null && pa.IsPhysical && (Vector3)vel != Vector3.Zero)
3148 { 3142 {
3149 float groupmass = new_group.GetMass(); 3143 float groupmass = new_group.GetMass();
3150 llvel *= -groupmass; 3144 vel *= -groupmass;
3151 llApplyImpulse(new LSL_Vector(llvel.X, llvel.Y,llvel.Z), 0); 3145 llApplyImpulse(vel, 0);
3152 } 3146 }
3153 // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) 3147 // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay)
3154 return; 3148 return;
@@ -3706,7 +3700,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3706 3700
3707 protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain) 3701 protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain)
3708 { 3702 {
3709 part.UpdateAngularVelocity(new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate))); 3703 part.UpdateAngularVelocity(axis * spinrate);
3710 } 3704 }
3711 3705
3712 public LSL_Integer llGetStartParameter() 3706 public LSL_Integer llGetStartParameter()
@@ -3916,7 +3910,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3916 try 3910 try
3917 { 3911 {
3918 foreach (SceneObjectPart part in parts) 3912 foreach (SceneObjectPart part in parts)
3919 part.SetFaceColor(new Vector3((float)color.x, (float)color.y, (float)color.z), face); 3913 part.SetFaceColor(color, face);
3920 } 3914 }
3921 finally 3915 finally
3922 { 3916 {
@@ -4386,8 +4380,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4386 public void llSetText(string text, LSL_Vector color, double alpha) 4380 public void llSetText(string text, LSL_Vector color, double alpha)
4387 { 4381 {
4388 m_host.AddScriptLPS(1); 4382 m_host.AddScriptLPS(1);
4389 Vector3 av3 = Util.Clip(new Vector3((float)color.x, (float)color.y, 4383 Vector3 av3 = Util.Clip(color, 0.0f, 1.0f);
4390 (float)color.z), 0.0f, 1.0f);
4391 m_host.SetText(text.Length > 254 ? text.Remove(254) : text, av3, Util.Clip((float)alpha, 0.0f, 1.0f)); 4384 m_host.SetText(text.Length > 254 ? text.Remove(254) : text, av3, Util.Clip((float)alpha, 0.0f, 1.0f));
4392 //m_host.ParentGroup.HasGroupChanged = true; 4385 //m_host.ParentGroup.HasGroupChanged = true;
4393 //m_host.ParentGroup.ScheduleGroupForFullUpdate(); 4386 //m_host.ParentGroup.ScheduleGroupForFullUpdate();
@@ -4603,14 +4596,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4603 ScriptSleep(5000); 4596 ScriptSleep(5000);
4604 } 4597 }
4605 4598
4606 public void llTeleportAgent(string agent, string destination, LSL_Vector pos, LSL_Vector lookAt) 4599 public void llTeleportAgent(string agent, string destination, LSL_Vector targetPos, LSL_Vector targetLookAt)
4607 { 4600 {
4608 m_host.AddScriptLPS(1); 4601 m_host.AddScriptLPS(1);
4609 UUID agentId = new UUID(); 4602 UUID agentId = new UUID();
4610 4603
4611 Vector3 targetPos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z);
4612 Vector3 targetLookAt = new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z);
4613
4614 if (UUID.TryParse(agent, out agentId)) 4604 if (UUID.TryParse(agent, out agentId))
4615 { 4605 {
4616 ScenePresence presence = World.GetScenePresence(agentId); 4606 ScenePresence presence = World.GetScenePresence(agentId);
@@ -4639,15 +4629,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4639 } 4629 }
4640 } 4630 }
4641 4631
4642 public void llTeleportAgentGlobalCoords(string agent, LSL_Vector global_coords, LSL_Vector pos, LSL_Vector lookAt) 4632 public void llTeleportAgentGlobalCoords(string agent, LSL_Vector global_coords, LSL_Vector targetPos, LSL_Vector targetLookAt)
4643 { 4633 {
4644 m_host.AddScriptLPS(1); 4634 m_host.AddScriptLPS(1);
4645 UUID agentId = new UUID(); 4635 UUID agentId = new UUID();
4646 4636
4647 ulong regionHandle = Utils.UIntsToLong((uint)global_coords.x, (uint)global_coords.y); 4637 ulong regionHandle = Utils.UIntsToLong((uint)global_coords.x, (uint)global_coords.y);
4648 4638
4649 Vector3 targetPos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z);
4650 Vector3 targetLookAt = new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z);
4651 if (UUID.TryParse(agent, out agentId)) 4639 if (UUID.TryParse(agent, out agentId))
4652 { 4640 {
4653 ScenePresence presence = World.GetScenePresence(agentId); 4641 ScenePresence presence = World.GetScenePresence(agentId);
@@ -4944,7 +4932,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4944 distance_attenuation = 1f / normalized_units; 4932 distance_attenuation = 1f / normalized_units;
4945 } 4933 }
4946 4934
4947 Vector3 applied_linear_impulse = new Vector3((float)impulse.x, (float)impulse.y, (float)impulse.z); 4935 Vector3 applied_linear_impulse = impulse;
4948 { 4936 {
4949 float impulse_length = applied_linear_impulse.Length(); 4937 float impulse_length = applied_linear_impulse.Length();
4950 4938
@@ -6505,9 +6493,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6505 6493
6506 //Plug the x,y coordinates of the slope normal into the equation of the plane to get 6494 //Plug the x,y coordinates of the slope normal into the equation of the plane to get
6507 //the height of that point on the plane. The resulting vector gives the slope. 6495 //the height of that point on the plane. The resulting vector gives the slope.
6508 Vector3 vsl = new Vector3(); 6496 Vector3 vsl = vsn;
6509 vsl.X = (float)vsn.x;
6510 vsl.Y = (float)vsn.y;
6511 vsl.Z = (float)(((vsn.x * vsn.x) + (vsn.y * vsn.y)) / (-1 * vsn.z)); 6497 vsl.Z = (float)(((vsn.x * vsn.x) + (vsn.y * vsn.y)) / (-1 * vsn.z));
6512 vsl.Normalize(); 6498 vsl.Normalize();
6513 //Normalization might be overkill here 6499 //Normalization might be overkill here
@@ -6518,9 +6504,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6518 public LSL_Vector llGroundNormal(LSL_Vector offset) 6504 public LSL_Vector llGroundNormal(LSL_Vector offset)
6519 { 6505 {
6520 m_host.AddScriptLPS(1); 6506 m_host.AddScriptLPS(1);
6521 Vector3 pos = m_host.GetWorldPosition() + new Vector3((float)offset.x, 6507 Vector3 pos = m_host.GetWorldPosition() + (Vector3)offset;
6522 (float)offset.y,
6523 (float)offset.z);
6524 // Clamp to valid position 6508 // Clamp to valid position
6525 if (pos.X < 0) 6509 if (pos.X < 0)
6526 pos.X = 0; 6510 pos.X = 0;
@@ -6974,8 +6958,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6974 6958
6975 if (!m_host.ParentGroup.IsDeleted) 6959 if (!m_host.ParentGroup.IsDeleted)
6976 { 6960 {
6977 m_host.ParentGroup.RootPart.SetVehicleVectorParam(param, 6961 m_host.ParentGroup.RootPart.SetVehicleVectorParam(param, vec);
6978 new Vector3((float)vec.x, (float)vec.y, (float)vec.z));
6979 } 6962 }
6980 } 6963 }
6981 6964
@@ -7017,7 +7000,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7017 if (rot.s == 0 && rot.x == 0 && rot.y == 0 && rot.z == 0) 7000 if (rot.s == 0 && rot.x == 0 && rot.y == 0 && rot.z == 0)
7018 rot.s = 1; // ZERO_ROTATION = 0,0,0,1 7001 rot.s = 1; // ZERO_ROTATION = 0,0,0,1
7019 7002
7020 part.SitTargetPosition = new Vector3((float)offset.x, (float)offset.y, (float)offset.z); 7003 part.SitTargetPosition = offset;
7021 part.SitTargetOrientation = Rot2Quaternion(rot); 7004 part.SitTargetOrientation = Rot2Quaternion(rot);
7022 part.ParentGroup.HasGroupChanged = true; 7005 part.ParentGroup.HasGroupChanged = true;
7023 } 7006 }
@@ -7121,13 +7104,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7121 public void llSetCameraEyeOffset(LSL_Vector offset) 7104 public void llSetCameraEyeOffset(LSL_Vector offset)
7122 { 7105 {
7123 m_host.AddScriptLPS(1); 7106 m_host.AddScriptLPS(1);
7124 m_host.SetCameraEyeOffset(new Vector3((float)offset.x, (float)offset.y, (float)offset.z)); 7107 m_host.SetCameraEyeOffset(offset);
7125 } 7108 }
7126 7109
7127 public void llSetCameraAtOffset(LSL_Vector offset) 7110 public void llSetCameraAtOffset(LSL_Vector offset)
7128 { 7111 {
7129 m_host.AddScriptLPS(1); 7112 m_host.AddScriptLPS(1);
7130 m_host.SetCameraAtOffset(new Vector3((float)offset.x, (float)offset.y, (float)offset.z)); 7113 m_host.SetCameraAtOffset(offset);
7131 } 7114 }
7132 7115
7133 public LSL_String llDumpList2String(LSL_List src, string seperator) 7116 public LSL_String llDumpList2String(LSL_List src, string seperator)
@@ -7149,7 +7132,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7149 public LSL_Integer llScriptDanger(LSL_Vector pos) 7132 public LSL_Integer llScriptDanger(LSL_Vector pos)
7150 { 7133 {
7151 m_host.AddScriptLPS(1); 7134 m_host.AddScriptLPS(1);
7152 bool result = World.ScriptDanger(m_host.LocalId, new Vector3((float)pos.x, (float)pos.y, (float)pos.z)); 7135 bool result = World.ScriptDanger(m_host.LocalId, pos);
7153 if (result) 7136 if (result)
7154 { 7137 {
7155 return 1; 7138 return 1;
@@ -8263,7 +8246,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8263 LSL_Vector color=rules.GetVector3Item(idx++); 8246 LSL_Vector color=rules.GetVector3Item(idx++);
8264 double alpha=(double)rules.GetLSLFloatItem(idx++); 8247 double alpha=(double)rules.GetLSLFloatItem(idx++);
8265 8248
8266 part.SetFaceColor(new Vector3((float)color.x, (float)color.y, (float)color.z), face); 8249 part.SetFaceColor(color, face);
8267 SetAlpha(part, alpha, face); 8250 SetAlpha(part, alpha, face);
8268 8251
8269 break; 8252 break;
@@ -8412,9 +8395,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8412 string primText = rules.GetLSLStringItem(idx++); 8395 string primText = rules.GetLSLStringItem(idx++);
8413 LSL_Vector primTextColor = rules.GetVector3Item(idx++); 8396 LSL_Vector primTextColor = rules.GetVector3Item(idx++);
8414 LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++); 8397 LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++);
8415 Vector3 av3 = Util.Clip(new Vector3((float)primTextColor.x, 8398 Vector3 av3 = Util.Clip(primTextColor, 0.0f, 1.0f);
8416 (float)primTextColor.y,
8417 (float)primTextColor.z), 0.0f, 1.0f);
8418 part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f)); 8399 part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f));
8419 8400
8420 break; 8401 break;
@@ -8470,12 +8451,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8470 { 8451 {
8471 SceneObjectGroup parent = part.ParentGroup; 8452 SceneObjectGroup parent = part.ParentGroup;
8472 Util.FireAndForget(delegate(object x) { 8453 Util.FireAndForget(delegate(object x) {
8473 parent.UpdateGroupPosition(new Vector3((float)currentPosition.x, (float)currentPosition.y, (float)currentPosition.z)); 8454 parent.UpdateGroupPosition(currentPosition);
8474 }); 8455 });
8475 } 8456 }
8476 else 8457 else
8477 { 8458 {
8478 part.OffsetPosition = new Vector3((float)currentPosition.x, (float)currentPosition.y, (float)currentPosition.z); 8459 part.OffsetPosition = currentPosition;
8479 SceneObjectGroup parent = part.ParentGroup; 8460 SceneObjectGroup parent = part.ParentGroup;
8480 parent.HasGroupChanged = true; 8461 parent.HasGroupChanged = true;
8481 parent.ScheduleGroupForTerseUpdate(); 8462 parent.ScheduleGroupForTerseUpdate();
@@ -11161,9 +11142,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
11161 ScenePresence avatar = World.GetScenePresence(detectedParams.Key); 11142 ScenePresence avatar = World.GetScenePresence(detectedParams.Key);
11162 if (avatar != null) 11143 if (avatar != null)
11163 { 11144 {
11164 avatar.ControllingClient.SendScriptTeleportRequest(m_host.Name, simname, 11145 avatar.ControllingClient.SendScriptTeleportRequest(m_host.Name,
11165 new Vector3((float)pos.x, (float)pos.y, (float)pos.z), 11146 simname, pos, lookAt);
11166 new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z));
11167 } 11147 }
11168 11148
11169 ScriptSleep(1000); 11149 ScriptSleep(1000);
@@ -12510,8 +12490,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
12510 12490
12511 m_host.AddScriptLPS(1); 12491 m_host.AddScriptLPS(1);
12512 12492
12513 Vector3 rayStart = new Vector3((float)start.x, (float)start.y, (float)start.z); 12493 Vector3 rayStart = start;
12514 Vector3 rayEnd = new Vector3((float)end.x, (float)end.y, (float)end.z); 12494 Vector3 rayEnd = end;
12515 Vector3 dir = rayEnd - rayStart; 12495 Vector3 dir = rayEnd - rayStart;
12516 12496
12517 float dist = Vector3.Mag(dir); 12497 float dist = Vector3.Mag(dir);