* If you llApplyImpulse on an attachment, it applies impulse on the avatar, not the attachment.

This commit is contained in:
Teravus Ovares
2008-05-06 00:23:19 +00:00
parent 9655cf2807
commit 240e8646da
9 changed files with 51 additions and 21 deletions

View File

@@ -1301,8 +1301,19 @@ namespace OpenSim.Region.Environment.Scenes
{
if (rootpart.PhysActor != null)
{
rootpart.PhysActor.AddForce(impulse);
m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor);
if (rootpart.m_IsAttachment)
{
ScenePresence avatar = m_scene.GetScenePresence(rootpart.m_attachedAvatar);
if (avatar != null)
{
avatar.PushForce(impulse);
}
}
else
{
rootpart.PhysActor.AddForce(impulse,true);
m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor);
}
}
}
}
@@ -1909,7 +1920,7 @@ namespace OpenSim.Region.Environment.Scenes
LLVector3 llmoveforce = pos - AbsolutePosition;
PhysicsVector grabforce = new PhysicsVector(llmoveforce.X, llmoveforce.Y, llmoveforce.Z);
grabforce = (grabforce / 10) * m_rootPart.PhysActor.Mass;
m_rootPart.PhysActor.AddForce(grabforce);
m_rootPart.PhysActor.AddForce(grabforce,true);
m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
}
else