mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
a few more changes on vectors etc
This commit is contained in:
@@ -101,7 +101,7 @@ namespace OpenSim.Groups
|
||||
//ExtendedGroupRecord group = m_GroupsService.UpdateGroup(RequestingAgentID, groupID, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish);
|
||||
ExtendedGroupRecord group = d();
|
||||
|
||||
if (group != null && !group.GroupID.IsZero())
|
||||
if (!group.GroupID.IsZero())
|
||||
m_Cache.AddOrUpdate("group-" + group.GroupID.ToString(), group, GROUPS_CACHE_TIMEOUT);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -3729,7 +3729,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
reply.Data.Flags |= 0x04;
|
||||
|
||||
Vector3 pos = land.UserLocation;
|
||||
if (pos.Equals(Vector3.Zero))
|
||||
if (pos.IsZero())
|
||||
{
|
||||
pos = (land.AABBMax + land.AABBMin) * 0.5f;
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
public void AddVector4(Vector4 v)
|
||||
{
|
||||
if (v == Vector4.Zero)
|
||||
if (v.IsZero())
|
||||
AddZeros(16);
|
||||
else
|
||||
{
|
||||
|
||||
@@ -2903,7 +2903,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return false;
|
||||
}
|
||||
|
||||
if (newPosition != Vector3.Zero)
|
||||
if (!newPosition.IsZero())
|
||||
so.RootPart.GroupPosition = newPosition;
|
||||
|
||||
if (!Scene.AddSceneObject(so))
|
||||
|
||||
@@ -695,7 +695,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
pos.X -= m_boundingOrigin.X;
|
||||
pos.Y -= m_boundingOrigin.Y;
|
||||
}
|
||||
if (m_displacement != Vector3.Zero)
|
||||
if (!m_displacement.IsZero())
|
||||
{
|
||||
pos += m_displacement;
|
||||
if (pos.X < 0 || pos.X >= scene.RegionInfo.RegionSizeX
|
||||
@@ -1164,7 +1164,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>();
|
||||
using (MemoryStream ms = new MemoryStream(data))
|
||||
{
|
||||
if (m_displacement != Vector3.Zero || m_rotation != 0f || m_boundingBox)
|
||||
if (!m_displacement.IsZero() || m_rotation != 0f || m_boundingBox)
|
||||
{
|
||||
Vector2 boundingOrigin = new Vector2(m_boundingOrigin.X, m_boundingOrigin.Y);
|
||||
Vector2 boundingSize = new Vector2(m_boundingSize.X, m_boundingSize.Y);
|
||||
|
||||
@@ -398,7 +398,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
PhysicsActor pa = sceneObject.RootPart.PhysActor;
|
||||
if (pa != null && pa.IsPhysical && vel != Vector3.Zero)
|
||||
if (pa != null && pa.IsPhysical && !vel.IsZero())
|
||||
{
|
||||
sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false);
|
||||
}
|
||||
|
||||
@@ -2779,7 +2779,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
};
|
||||
if(av.IsSatOnObject)
|
||||
detobj.colliderType |= 0x4; //passive
|
||||
else if(detobj.velVector != Vector3.Zero)
|
||||
else if(!detobj.velVector.IsZero())
|
||||
detobj.colliderType |= 0x2; //active
|
||||
return detobj;
|
||||
}
|
||||
|
||||
@@ -3994,7 +3994,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
!vel.ApproxEquals(m_lastVelocity) ||
|
||||
!m_bodyRot.ApproxEquals(m_lastRotation) ||
|
||||
|
||||
(vel == Vector3.Zero && m_lastVelocity != Vector3.Zero) ||
|
||||
(vel.IsZero() && !m_lastVelocity.IsZero()) ||
|
||||
|
||||
Math.Abs(dpos.X) > POSITION_LARGETOLERANCE ||
|
||||
Math.Abs(dpos.Y) > POSITION_LARGETOLERANCE ||
|
||||
@@ -6453,7 +6453,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Don't restrict gods, estate managers, or land owners to
|
||||
// the TP point. This behaviour mimics agni.
|
||||
if (land.LandData.LandingType == (byte)LandingType.LandingPoint &&
|
||||
land.LandData.UserLocation != Vector3.Zero &&
|
||||
!land.LandData.UserLocation.IsZero() &&
|
||||
!IsViewerUIGod &&
|
||||
((land.LandData.OwnerID != m_uuid &&
|
||||
!m_scene.Permissions.IsGod(m_uuid) &&
|
||||
@@ -6510,12 +6510,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|| (m_teleportFlags & adicionalLandPointFlags) != 0)
|
||||
{
|
||||
if (land.LandData.LandingType == (byte)LandingType.LandingPoint &&
|
||||
land.LandData.UserLocation != Vector3.Zero )
|
||||
!land.LandData.UserLocation.IsZero() )
|
||||
// &&
|
||||
// land.LandData.OwnerID != m_uuid )
|
||||
{
|
||||
pos = land.LandData.UserLocation;
|
||||
if(land.LandData.UserLookAt != Vector3.Zero)
|
||||
if(!land.LandData.UserLookAt.IsZero())
|
||||
lookat = land.LandData.UserLookAt;
|
||||
positionChanged = true;
|
||||
}
|
||||
@@ -6559,7 +6559,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (av.IsSatOnObject)
|
||||
detobj.colliderType |= 0x4; //passive
|
||||
else if (detobj.velVector != Vector3.Zero)
|
||||
else if (!detobj.velVector.IsZero())
|
||||
detobj.colliderType |= 0x2; //active
|
||||
return detobj;
|
||||
}
|
||||
|
||||
@@ -1577,7 +1577,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
WriteVector(writer, "SitTargetPosition", sop.SitTargetPosition);
|
||||
WriteVector(writer, "SitTargetPositionLL", sop.SitTargetPositionLL);
|
||||
WriteQuaternion(writer, "SitTargetOrientationLL", sop.SitTargetOrientationLL);
|
||||
if(sop.StandOffset != Vector3.Zero)
|
||||
if(!sop.StandOffset.IsZero())
|
||||
WriteVector(writer, "StandTarget", sop.StandOffset);
|
||||
writer.WriteElementString("ParentID", sop.ParentID.ToString());
|
||||
writer.WriteElementString("CreationDate", sop.CreationDate.ToString());
|
||||
|
||||
@@ -200,7 +200,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
if (ent is SceneObjectGroup)
|
||||
{
|
||||
SceneObjectGroup g = (SceneObjectGroup)ent;
|
||||
if (!min.Equals(Vector3.Zero) || !max.Equals(Vector3.Zero))
|
||||
if (!min.IsZero() || !max.IsZero())
|
||||
{
|
||||
Vector3 pos = g.RootPart.GetWorldPosition();
|
||||
if (min.X > pos.X || min.Y > pos.Y || min.Z > pos.Z)
|
||||
|
||||
@@ -200,7 +200,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
|
||||
//default location
|
||||
XmlNode tpLocation = nodeFactory.CreateNode(XmlNodeType.Element, "location", "");
|
||||
Vector3 loc = parcel.UserLocation;
|
||||
if (loc.Equals(Vector3.Zero)) // This test is moot at this point: the location is wrong by default
|
||||
if (loc.IsZero()) // This test is moot at this point: the location is wrong by default
|
||||
loc = new Vector3((parcel.AABBMax.X + parcel.AABBMin.X) / 2, (parcel.AABBMax.Y + parcel.AABBMin.Y) / 2, (parcel.AABBMax.Z + parcel.AABBMin.Z) / 2);
|
||||
tpLocation.InnerText = loc.X.ToString() + "/" + loc.Y.ToString() + "/" + loc.Z.ToString();
|
||||
xmlparcel.AppendChild(tpLocation);
|
||||
|
||||
@@ -5012,7 +5012,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
Error("llRequestAgentData","Invalid UUID passed to llRequestAgentData.");
|
||||
}
|
||||
return "";
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
//bad if lm is HG
|
||||
@@ -5226,7 +5226,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
public void llCollisionSound(LSL_String impact_sound, LSL_Float impact_volume)
|
||||
{
|
||||
|
||||
if(impact_sound == "")
|
||||
if(String.IsNullOrEmpty(impact_sound.m_string))
|
||||
{
|
||||
m_host.CollisionSoundVolume = (float)impact_volume;
|
||||
m_host.CollisionSound = m_host.invalidCollisionSoundUUID;
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
||||
// of all others so the m_DetachQuantum won't run out
|
||||
// before attach(NULL_KEY) is executed.
|
||||
case ScriptEventCode.attach:
|
||||
if (evt.Params[0].ToString() == UUID.ZeroString)
|
||||
if (evt.Params[0].ToString().Equals(UUID.ZeroString))
|
||||
{
|
||||
LinkedListNode<EventParams> lln2 = null;
|
||||
for(lln2 = m_EventQueue.First; lln2 != null; lln2 = lln2.Next)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user