Revert "* Adding Scale to EntityBase * Fixing the incorrect initialization of EntityBase.Rotation * Removed SceneObjectGroup.GroupRotation and added overrides for Scale/Rotation/Velocity"

This reverts commit 39842eb4af.
0.6.8-post-fixes
Melanie 2009-10-02 00:47:01 +01:00
parent d0cc0985fa
commit 212e132e79
6 changed files with 27 additions and 46 deletions

View File

@ -69,7 +69,6 @@ namespace OpenSim.Region.Examples.SimpleModule
public override void UpdateMovement() public override void UpdateMovement()
{ {
UpdateGroupRotationR(m_rootPart.RotationOffset * m_rotationDirection); UpdateGroupRotationR(m_rootPart.RotationOffset * m_rotationDirection);
base.UpdateMovement(); base.UpdateMovement();
} }

View File

@ -94,7 +94,7 @@ namespace OpenSim.Region.Framework.Scenes
set { m_velocity = value; } set { m_velocity = value; }
} }
protected Quaternion m_rotation; protected Quaternion m_rotation = new Quaternion(0f, 0f, 1f, 0f);
public virtual Quaternion Rotation public virtual Quaternion Rotation
{ {
@ -102,14 +102,6 @@ namespace OpenSim.Region.Framework.Scenes
set { m_rotation = value; } set { m_rotation = value; }
} }
protected Vector3 m_scale;
public virtual Vector3 Scale
{
get { return m_scale; }
set { m_scale = value; }
}
protected uint m_localId; protected uint m_localId;
public virtual uint LocalId public virtual uint LocalId
@ -123,9 +115,13 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public EntityBase() public EntityBase()
{ {
m_rotation = Quaternion.Identity; m_uuid = UUID.Zero;
m_scale = Vector3.One;
m_pos = Vector3.Zero;
m_velocity = Vector3.Zero;
Rotation = Quaternion.Identity;
m_name = "(basic entity)"; m_name = "(basic entity)";
m_rotationalvelocity = Vector3.Zero;
} }
/// <summary> /// <summary>

View File

@ -2305,8 +2305,8 @@ namespace OpenSim.Region.Framework.Scenes
"to avatar {0} at position {1}", "to avatar {0} at position {1}",
sp.UUID.ToString(), grp.AbsolutePosition); sp.UUID.ToString(), grp.AbsolutePosition);
AttachObject(sp.ControllingClient, AttachObject(sp.ControllingClient,
grp.LocalId, 0, grp.LocalId, (uint)0,
grp.Rotation, grp.GroupRotation,
grp.AbsolutePosition, false); grp.AbsolutePosition, false);
RootPrim.RemFlag(PrimFlags.TemporaryOnRez); RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
grp.SendGroupFullUpdate(); grp.SendGroupFullUpdate();

View File

@ -204,22 +204,9 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_parts.Count; } get { return m_parts.Count; }
} }
public override Quaternion Rotation public Quaternion GroupRotation
{ {
get { return m_rootPart.RotationOffset; } get { return m_rootPart.RotationOffset; }
set { m_rootPart.RotationOffset = value; }
}
public override Vector3 Scale
{
get { return m_rootPart.Scale; }
set { m_rootPart.Scale = value; }
}
public override Vector3 Velocity
{
get { return m_rootPart.Velocity; }
set { m_rootPart.Velocity = value; }
} }
public UUID GroupID public UUID GroupID
@ -548,7 +535,7 @@ namespace OpenSim.Region.Framework.Scenes
// Temporary commented to stop compiler warning // Temporary commented to stop compiler warning
//Vector3 partPosition = //Vector3 partPosition =
// new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z); // new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z);
Quaternion parentrotation = Rotation; Quaternion parentrotation = GroupRotation;
// Telling the prim to raytrace. // Telling the prim to raytrace.
//EntityIntersection inter = part.TestIntersection(hRay, parentrotation); //EntityIntersection inter = part.TestIntersection(hRay, parentrotation);
@ -1891,17 +1878,14 @@ namespace OpenSim.Region.Framework.Scenes
checkAtTargets(); checkAtTargets();
Quaternion rot = Rotation; if (UsePhysics && ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1)
|| (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1)
if (UsePhysics && || (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1)
((Math.Abs(lastPhysGroupRot.W - rot.W) > 0.1f) || (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1)))
|| (Math.Abs(lastPhysGroupRot.X - rot.X) > 0.1f)
|| (Math.Abs(lastPhysGroupRot.Y - rot.Y) > 0.1f)
|| (Math.Abs(lastPhysGroupRot.Z - rot.Z) > 0.1f)))
{ {
m_rootPart.UpdateFlag = 1; m_rootPart.UpdateFlag = 1;
lastPhysGroupRot = rot; lastPhysGroupRot = GroupRotation;
} }
foreach (SceneObjectPart part in m_parts.Values) foreach (SceneObjectPart part in m_parts.Values)

View File

@ -2013,10 +2013,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
q = avatar.Rotation; // Currently infrequently updated so may be inaccurate q = avatar.Rotation; // Currently infrequently updated so may be inaccurate
} }
else else
q = part.ParentGroup.Rotation; // Likely never get here but just in case q = part.ParentGroup.GroupRotation; // Likely never get here but just in case
} }
else else
q = part.ParentGroup.Rotation; // just the group rotation q = part.ParentGroup.GroupRotation; // just the group rotation
return new LSL_Rotation(q.X, q.Y, q.Z, q.W); return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
} }
q = part.GetWorldRotation(); q = part.GetWorldRotation();
@ -7184,10 +7184,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
else else
q = avatar.Rotation; // Currently infrequently updated so may be inaccurate q = avatar.Rotation; // Currently infrequently updated so may be inaccurate
else else
q = m_host.ParentGroup.Rotation; // Likely never get here but just in case q = m_host.ParentGroup.GroupRotation; // Likely never get here but just in case
} }
else else
q = m_host.ParentGroup.Rotation; // just the group rotation q = m_host.ParentGroup.GroupRotation; // just the group rotation
return new LSL_Rotation(q.X, q.Y, q.Z, q.W); return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
} }

View File

@ -218,14 +218,16 @@ namespace OpenSim.Region.ScriptEngine.Shared
} }
} }
Vector3 absPos = part.AbsolutePosition; Position = new LSL_Types.Vector3(part.AbsolutePosition.X,
Position = new LSL_Types.Vector3(absPos.X, absPos.Y, absPos.Z); part.AbsolutePosition.Y,
part.AbsolutePosition.Z);
Quaternion wr = part.ParentGroup.Rotation; Quaternion wr = part.ParentGroup.GroupRotation;
Rotation = new LSL_Types.Quaternion(wr.X, wr.Y, wr.Z, wr.W); Rotation = new LSL_Types.Quaternion(wr.X, wr.Y, wr.Z, wr.W);
Vector3 vel = part.Velocity; Velocity = new LSL_Types.Vector3(part.Velocity.X,
Velocity = new LSL_Types.Vector3(vel.X, vel.Y, vel.Z); part.Velocity.Y,
part.Velocity.Z);
} }
} }