From ec2dc354b485491d7879686b4a78027971e3ed92 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Fri, 26 Dec 2008 12:58:02 +0000 Subject: * Applying Nlin's NINJA Joint patch. v2. Mantis# 2874 * Thanks nlin! * To try it out, set ninja joints active in the ODEPhysicsSettings and use the example at: * http://forge.opensimulator.org/gf/download/frsrelease/142/304/demo-playground.tgz. * Don't forget to change the .tgz to .oar and load it with load-oar. --- OpenSim/Region/Environment/Scenes/SceneGraph.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'OpenSim/Region/Environment/Scenes/SceneGraph.cs') diff --git a/OpenSim/Region/Environment/Scenes/SceneGraph.cs b/OpenSim/Region/Environment/Scenes/SceneGraph.cs index dbb8539..d998dbb 100644 --- a/OpenSim/Region/Environment/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Environment/Scenes/SceneGraph.cs @@ -159,6 +159,22 @@ namespace OpenSim.Region.Environment.Scenes { lock (m_syncRoot) { + // Here is where the Scene calls the PhysicsScene. This is a one-way + // interaction; the PhysicsScene cannot access the calling Scene directly. + // But with joints, we want a PhysicsActor to be able to influence a + // non-physics SceneObjectPart. In particular, a PhysicsActor that is connected + // with a joint should be able to move the SceneObjectPart which is the visual + // representation of that joint (for editing and serialization purposes). + // However the PhysicsActor normally cannot directly influence anything outside + // of the PhysicsScene, and the non-physical SceneObjectPart which represents + // the joint in the Scene does not exist in the PhysicsScene. + // + // To solve this, we have an event in the PhysicsScene that is fired when a joint + // has changed position (because one of its associated PhysicsActors has changed + // position). + // + // Therefore, JointMoved and JointDeactivated events will be fired as a result of the following Simulate(). + return _PhyScene.Simulate((float)elapsed); } } @@ -875,6 +891,7 @@ namespace OpenSim.Region.Environment.Scenes { List EntityList = GetEntities(); + // FIXME: use a dictionary here foreach (EntityBase ent in EntityList) { if (ent is SceneObjectGroup) -- cgit v1.1