some changes due to lookAt and RotLookAt

This commit is contained in:
UbitUmarov
2015-12-01 10:15:38 +00:00
parent 193b3079e4
commit a9e58d6175
2 changed files with 46 additions and 63 deletions

View File

@@ -458,6 +458,7 @@ namespace OpenSim.Region.Framework.Scenes
Velocity = Vector3.Zero;
AngularVelocity = Vector3.Zero;
Acceleration = Vector3.Zero;
APIDActive = false;
Flags = 0;
CreateSelected = true;
@@ -1713,12 +1714,9 @@ namespace OpenSim.Region.Framework.Scenes
{
if (PhysActor != null)
{
Velocity = new Vector3(0, 0, 0);
Acceleration = new Vector3(0, 0, 0);
if (ParentGroup.RootPart == this)
AngularVelocity = new Vector3(0, 0, 0);
ParentGroup.Scene.RemovePhysicalPrim(1);
RemoveFromPhysics();
Stop();
}
}
else if (PhysActor == null)
@@ -2350,9 +2348,7 @@ namespace OpenSim.Region.Framework.Scenes
ParentGroup.Scene.PhysicsScene.RequestJointDeletion(Name); // FIXME: what if the name changed?
// make sure client isn't interpolating the joint proxy object
Velocity = Vector3.Zero;
AngularVelocity = Vector3.Zero;
Acceleration = Vector3.Zero;
Stop();
}
}
}
@@ -2391,8 +2387,8 @@ namespace OpenSim.Region.Framework.Scenes
Velocity = new Vector3(0, 0, 0);
Acceleration = new Vector3(0, 0, 0);
if (ParentGroup.RootPart == this)
AngularVelocity = new Vector3(0, 0, 0);
AngularVelocity = new Vector3(0, 0, 0);
APIDActive = false;
if (pa.Phantom && !VolumeDetectActive)
{
@@ -2994,7 +2990,7 @@ namespace OpenSim.Region.Framework.Scenes
}
//ParentGroup.RootPart.m_groupPosition = newpos;
}
/* ubit: there are no flexible links
/*
if (pa != null && ParentID != 0 && ParentGroup != null)
{
// Special case where a child object is requesting property updates.
@@ -3095,6 +3091,14 @@ namespace OpenSim.Region.Framework.Scenes
public void RotLookAt(Quaternion target, float strength, float damping)
{
// non physical is done on LSL
// physical is a rootpart thing
if(ParentGroup.IsDeleted)
return;
if(ParentGroup.RootPart != this)
ParentGroup.RootPart.RotLookAt(target, strength, damping);
if (ParentGroup.IsAttachment)
{
/*
@@ -3125,16 +3129,31 @@ namespace OpenSim.Region.Framework.Scenes
public void StartLookAt(Quaternion target, float strength, float damping)
{
// non physical is done on LSL
// physical is a rootpart thing
if(ParentGroup.IsDeleted)
return;
if(ParentGroup.RootPart != this)
ParentGroup.RootPart.RotLookAt(target, strength, damping);
RotLookAt(target,strength,damping);
}
public void StopLookAt()
{
if(ParentGroup.IsDeleted)
return;
if(ParentGroup.RootPart != this)
ParentGroup.RootPart.StopLookAt();
if(APIDActive)
AngularVelocity = Vector3.Zero;
APIDActive = false;
}
public void ScheduleFullUpdateIfNone()
{
if (ParentGroup == null)
@@ -3543,7 +3562,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
}
}
public int VehicleType
{
get
@@ -4733,10 +4751,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
RemoveFromPhysics();
}
Velocity = new Vector3(0, 0, 0);
Acceleration = new Vector3(0, 0, 0);
if (ParentGroup.RootPart == this)
AngularVelocity = new Vector3(0, 0, 0);
Stop();
}
else
@@ -4909,17 +4924,15 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
}
}
if (applyDynamics)
if (applyDynamics && LocalId != ParentGroup.RootPart.LocalId)
// do independent of isphysical so parameters get setted (at least some)
{
Velocity = velocity;
AngularVelocity = rotationalVelocity;
// pa.Velocity = velocity;
pa.RotationalVelocity = rotationalVelocity;
// if not vehicle and root part apply force and torque
if ((m_vehicleParams == null || m_vehicleParams.Type == Vehicle.TYPE_NONE)
&& LocalId == ParentGroup.RootPart.LocalId)
if ((m_vehicleParams == null || m_vehicleParams.Type == Vehicle.TYPE_NONE))
{
pa.Force = Force;
pa.Torque = Torque;
@@ -5629,5 +5642,13 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
return m_sittingAvatars.Count;
}
}
public void Stop()
{
Velocity = Vector3.Zero;
AngularVelocity = Vector3.Zero;
Acceleration = Vector3.Zero;
APIDActive = false;
}
}
}