aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-01-29 15:10:18 +0000
committerTeravus Ovares2008-01-29 15:10:18 +0000
commitc4687116adfdeb5de056000ef3d2dd47b8695339 (patch)
tree420ad4a29cd3f20ddf2f7b7922f17c547bd7aea9 /OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
parent* Patch from Ansi (IBM) (diff)
downloadopensim-SC_OLD-c4687116adfdeb5de056000ef3d2dd47b8695339.zip
opensim-SC_OLD-c4687116adfdeb5de056000ef3d2dd47b8695339.tar.gz
opensim-SC_OLD-c4687116adfdeb5de056000ef3d2dd47b8695339.tar.bz2
opensim-SC_OLD-c4687116adfdeb5de056000ef3d2dd47b8695339.tar.xz
* Implemented grab and throw in ODE. It's a little strong still so toss gently at first to test the waters or you'll lose prim to the pit at the edge of the sim. Make sure the object is physical before trying to toss it or it'll just move to the new location.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs44
1 files changed, 38 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 785ebf7..10395b6 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -207,7 +207,14 @@ namespace OpenSim.Region.Environment.Scenes
207 public bool IsSelected 207 public bool IsSelected
208 { 208 {
209 get { return m_isSelected; } 209 get { return m_isSelected; }
210 set { m_isSelected = value; } 210 set {
211 m_isSelected = value;
212 // Tell physics engine that group is selected
213 if (m_rootPart.PhysActor != null)
214 {
215 m_rootPart.PhysActor.Selected = value;
216 }
217 }
211 } 218 }
212 219
213 // The UUID for the Region this Object is in. 220 // The UUID for the Region this Object is in.
@@ -1039,20 +1046,45 @@ namespace OpenSim.Region.Environment.Scenes
1039 } 1046 }
1040 1047
1041 /// <summary> 1048 /// <summary>
1042 /// 1049 /// If object is physical, apply force to move it around
1050 /// If object is not physical, just put it at the resulting location
1043 /// </summary> 1051 /// </summary>
1044 /// <param name="offset"></param> 1052 /// <param name="offset">Always seems to be 0,0,0, so ignoring</param>
1045 /// <param name="pos"></param> 1053 /// <param name="pos">New position. We do the math here to turn it into a force</param>
1046 /// <param name="remoteClient"></param> 1054 /// <param name="remoteClient"></param>
1047 public void GrabMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) 1055 public void GrabMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
1048 { 1056 {
1057
1049 if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) 1058 if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
1050 { 1059 {
1051 AbsolutePosition = pos; 1060
1052 m_rootPart.SendTerseUpdateToAllClients(); 1061 if (m_rootPart.PhysActor != null)
1062 {
1063 if (m_rootPart.PhysActor.IsPhysical)
1064 {
1065 LLVector3 llmoveforce = pos - AbsolutePosition;
1066 PhysicsVector grabforce = new PhysicsVector(llmoveforce.X, llmoveforce.Y, llmoveforce.Z);
1067 grabforce = (grabforce / 10) * m_rootPart.PhysActor.Mass;
1068 m_rootPart.PhysActor.AddForce(grabforce);
1069 m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
1070 }
1071 else
1072 {
1073 NonPhysicalGrabMovement(pos);
1074 }
1075 }
1076 else
1077 {
1078 NonPhysicalGrabMovement(pos);
1079 }
1053 } 1080 }
1054 } 1081 }
1082 public void NonPhysicalGrabMovement(LLVector3 pos)
1083 {
1084 AbsolutePosition = pos;
1085 m_rootPart.SendTerseUpdateToAllClients();
1055 1086
1087 }
1056 /// <summary> 1088 /// <summary>
1057 /// 1089 ///
1058 /// </summary> 1090 /// </summary>