Modifications for prim movement. For now only in Mod. BulletX, but i think it can be easy to add to ODE. Enjoy kick the prims and be careful with the falling ones ;D

This commit is contained in:
darok
2007-11-03 19:33:00 +00:00
parent dabbdec2cd
commit fbf3c6a768
3 changed files with 114 additions and 56 deletions

View File

@@ -55,6 +55,9 @@ namespace OpenSim.Region.Environment.Scenes
public bool HasChanged = false;
private LLVector3 lastPhysGroupPos;
private LLQuaternion lastPhysGroupRot;
#region Properties
/// <summary>
@@ -490,6 +493,25 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public override void Update()
{
if (lastPhysGroupPos.GetDistanceTo(AbsolutePosition) > 0.02)
{
foreach (SceneObjectPart part in m_parts.Values)
{
if (part.UpdateFlag == 0) part.UpdateFlag = 1;
}
lastPhysGroupPos = AbsolutePosition;
}
if ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1)
|| (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1)
|| (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1)
|| (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1))
{
foreach (SceneObjectPart part in m_parts.Values)
{
if (part.UpdateFlag == 0) part.UpdateFlag = 1;
}
lastPhysGroupRot = GroupRotation;
}
foreach (SceneObjectPart part in m_parts.Values)
{
part.SendScheduledUpdates();