mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
refactor: move SOP.IsAttachment and AttachmentPoint up into SOG to avoid pointless duplication of identical values
This commit is contained in:
@@ -303,7 +303,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
float dz;
|
||||
|
||||
Quaternion q = SensePoint.RotationOffset;
|
||||
if (SensePoint.ParentGroup.RootPart.IsAttachment)
|
||||
if (SensePoint.ParentGroup.IsAttachment)
|
||||
{
|
||||
// In attachments, the sensor cone always orients with the
|
||||
// avatar rotation. This may include a nonzero elevation if
|
||||
@@ -352,7 +352,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
objtype = 0;
|
||||
|
||||
part = ((SceneObjectGroup)ent).RootPart;
|
||||
if (part.AttachmentPoint != 0) // Attached so ignore
|
||||
if (part.ParentGroup.AttachmentPoint != 0) // Attached so ignore
|
||||
continue;
|
||||
|
||||
if (part.Inventory.ContainsScripts())
|
||||
@@ -423,7 +423,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
Vector3 fromRegionPos = SensePoint.AbsolutePosition;
|
||||
|
||||
Quaternion q = SensePoint.RotationOffset;
|
||||
if (SensePoint.ParentGroup.RootPart.IsAttachment)
|
||||
if (SensePoint.ParentGroup.IsAttachment)
|
||||
{
|
||||
// In attachments, the sensor cone always orients with the
|
||||
// avatar rotation. This may include a nonzero elevation if
|
||||
@@ -435,7 +435,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
|
||||
LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r);
|
||||
double mag_fwd = LSL_Types.Vector3.Mag(forward_dir);
|
||||
bool attached = (SensePoint.AttachmentPoint != 0);
|
||||
bool attached = (SensePoint.ParentGroup.AttachmentPoint != 0);
|
||||
Vector3 toRegionPos;
|
||||
double dis;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user