diff options
author | John Hurliman | 2009-10-25 23:16:12 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-26 18:23:43 -0700 |
commit | d199767e6991d6f368661fce9c5a072e564b8a4b (patch) | |
tree | d9347b8a424c0164e208f908613aa8fe1511444b /OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |
parent | * Double the priority on avatar bake texture requests to get avatars rezzing ... (diff) | |
download | opensim-SC_OLD-d199767e6991d6f368661fce9c5a072e564b8a4b.zip opensim-SC_OLD-d199767e6991d6f368661fce9c5a072e564b8a4b.tar.gz opensim-SC_OLD-d199767e6991d6f368661fce9c5a072e564b8a4b.tar.bz2 opensim-SC_OLD-d199767e6991d6f368661fce9c5a072e564b8a4b.tar.xz |
Experimental change of PhysicsVector to Vector3. Untested
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 34ada4c..38a0cff 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1479,8 +1479,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1479 | dupe.RootPart.PhysActor = m_scene.PhysicsScene.AddPrimShape( | 1479 | dupe.RootPart.PhysActor = m_scene.PhysicsScene.AddPrimShape( |
1480 | dupe.RootPart.Name, | 1480 | dupe.RootPart.Name, |
1481 | pbs, | 1481 | pbs, |
1482 | new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y, dupe.RootPart.AbsolutePosition.Z), | 1482 | dupe.RootPart.AbsolutePosition, |
1483 | new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z), | 1483 | dupe.RootPart.Scale, |
1484 | dupe.RootPart.RotationOffset, | 1484 | dupe.RootPart.RotationOffset, |
1485 | dupe.RootPart.PhysActor.IsPhysical); | 1485 | dupe.RootPart.PhysActor.IsPhysical); |
1486 | 1486 | ||
@@ -1595,7 +1595,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1595 | */ | 1595 | */ |
1596 | } | 1596 | } |
1597 | 1597 | ||
1598 | public void applyImpulse(PhysicsVector impulse) | 1598 | public void applyImpulse(Vector3 impulse) |
1599 | { | 1599 | { |
1600 | // We check if rootpart is null here because scripts don't delete if you delete the host. | 1600 | // We check if rootpart is null here because scripts don't delete if you delete the host. |
1601 | // This means that unfortunately, we can pass a null physics actor to Simulate! | 1601 | // This means that unfortunately, we can pass a null physics actor to Simulate! |
@@ -1622,7 +1622,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1622 | } | 1622 | } |
1623 | } | 1623 | } |
1624 | 1624 | ||
1625 | public void applyAngularImpulse(PhysicsVector impulse) | 1625 | public void applyAngularImpulse(Vector3 impulse) |
1626 | { | 1626 | { |
1627 | // We check if rootpart is null here because scripts don't delete if you delete the host. | 1627 | // We check if rootpart is null here because scripts don't delete if you delete the host. |
1628 | // This means that unfortunately, we can pass a null physics actor to Simulate! | 1628 | // This means that unfortunately, we can pass a null physics actor to Simulate! |
@@ -1641,7 +1641,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1641 | } | 1641 | } |
1642 | } | 1642 | } |
1643 | 1643 | ||
1644 | public void setAngularImpulse(PhysicsVector impulse) | 1644 | public void setAngularImpulse(Vector3 impulse) |
1645 | { | 1645 | { |
1646 | // We check if rootpart is null here because scripts don't delete if you delete the host. | 1646 | // We check if rootpart is null here because scripts don't delete if you delete the host. |
1647 | // This means that unfortunately, we can pass a null physics actor to Simulate! | 1647 | // This means that unfortunately, we can pass a null physics actor to Simulate! |
@@ -1672,8 +1672,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1672 | { | 1672 | { |
1673 | if (!IsAttachment) | 1673 | if (!IsAttachment) |
1674 | { | 1674 | { |
1675 | PhysicsVector torque = rootpart.PhysActor.Torque; | 1675 | Vector3 torque = rootpart.PhysActor.Torque; |
1676 | return new Vector3(torque.X, torque.Y, torque.Z); | 1676 | return torque; |
1677 | } | 1677 | } |
1678 | } | 1678 | } |
1679 | } | 1679 | } |
@@ -1706,7 +1706,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1706 | { | 1706 | { |
1707 | if (rootpart.PhysActor != null) | 1707 | if (rootpart.PhysActor != null) |
1708 | { | 1708 | { |
1709 | rootpart.PhysActor.PIDTarget = new PhysicsVector(target.X, target.Y, target.Z); | 1709 | rootpart.PhysActor.PIDTarget = target; |
1710 | rootpart.PhysActor.PIDTau = tau; | 1710 | rootpart.PhysActor.PIDTau = tau; |
1711 | rootpart.PhysActor.PIDActive = true; | 1711 | rootpart.PhysActor.PIDActive = true; |
1712 | } | 1712 | } |
@@ -2374,7 +2374,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2374 | if (m_rootPart.PhysActor.IsPhysical) | 2374 | if (m_rootPart.PhysActor.IsPhysical) |
2375 | { | 2375 | { |
2376 | Vector3 llmoveforce = pos - AbsolutePosition; | 2376 | Vector3 llmoveforce = pos - AbsolutePosition; |
2377 | PhysicsVector grabforce = new PhysicsVector(llmoveforce.X, llmoveforce.Y, llmoveforce.Z); | 2377 | Vector3 grabforce = llmoveforce; |
2378 | grabforce = (grabforce / 10) * m_rootPart.PhysActor.Mass; | 2378 | grabforce = (grabforce / 10) * m_rootPart.PhysActor.Mass; |
2379 | m_rootPart.PhysActor.AddForce(grabforce,true); | 2379 | m_rootPart.PhysActor.AddForce(grabforce,true); |
2380 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); | 2380 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); |
@@ -2479,7 +2479,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2479 | rotationAxis.Normalize(); | 2479 | rotationAxis.Normalize(); |
2480 | 2480 | ||
2481 | //m_log.Error("SCENE OBJECT GROUP]: rotation axis is " + rotationAxis); | 2481 | //m_log.Error("SCENE OBJECT GROUP]: rotation axis is " + rotationAxis); |
2482 | PhysicsVector spinforce = new PhysicsVector(rotationAxis.X, rotationAxis.Y, rotationAxis.Z); | 2482 | Vector3 spinforce = new Vector3(rotationAxis.X, rotationAxis.Y, rotationAxis.Z); |
2483 | spinforce = (spinforce/8) * m_rootPart.PhysActor.Mass; // 8 is an arbitrary torque scaling factor | 2483 | spinforce = (spinforce/8) * m_rootPart.PhysActor.Mass; // 8 is an arbitrary torque scaling factor |
2484 | m_rootPart.PhysActor.AddAngularForce(spinforce,true); | 2484 | m_rootPart.PhysActor.AddAngularForce(spinforce,true); |
2485 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); | 2485 | m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); |
@@ -2706,8 +2706,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2706 | if (scale.Z > m_scene.m_maxPhys) | 2706 | if (scale.Z > m_scene.m_maxPhys) |
2707 | scale.Z = m_scene.m_maxPhys; | 2707 | scale.Z = m_scene.m_maxPhys; |
2708 | } | 2708 | } |
2709 | part.PhysActor.Size = | 2709 | part.PhysActor.Size = scale; |
2710 | new PhysicsVector(scale.X, scale.Y, scale.Z); | ||
2711 | m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); | 2710 | m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); |
2712 | } | 2711 | } |
2713 | //if (part.UUID != m_rootPart.UUID) | 2712 | //if (part.UUID != m_rootPart.UUID) |
@@ -2851,8 +2850,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2851 | 2850 | ||
2852 | if (part.PhysActor != null) | 2851 | if (part.PhysActor != null) |
2853 | { | 2852 | { |
2854 | part.PhysActor.Size = | 2853 | part.PhysActor.Size = prevScale; |
2855 | new PhysicsVector(prevScale.X, prevScale.Y, prevScale.Z); | ||
2856 | m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); | 2854 | m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); |
2857 | } | 2855 | } |
2858 | 2856 | ||