<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://opensimulator.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://opensimulator.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Xadmin</id>
		<title>OpenSimulator - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://opensimulator.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Xadmin"/>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/Special:Contributions/Xadmin"/>
		<updated>2026-05-11T18:39:57Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.9</generator>

	<entry>
		<id>http://opensimulator.org/wiki/Physics_Engine_Interface</id>
		<title>Physics Engine Interface</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/Physics_Engine_Interface"/>
				<updated>2011-09-14T07:33:57Z</updated>
		
		<summary type="html">&lt;p&gt;Xadmin: /* PhysicsScene */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Base Classes ==&lt;br /&gt;
&lt;br /&gt;
''Note: I ([[User:Rknop]]) am trying to figure this out by looking at some of the code; my main interest is the NewtonPlugin.  AS such, there are whole swaths of the physics engine, such as joints, that I have no clue about at the moment''&lt;br /&gt;
&lt;br /&gt;
The base classes for a physics module can be found in OpenSim.Region.Physics.Manager.  The physics module itself should be a subclass of Physics, e.g. OpenSim.Region.Physics.OdePlugin.&lt;br /&gt;
&lt;br /&gt;
* '''&amp;lt;tt&amp;gt;PhysicsActor&amp;lt;/tt&amp;gt;''' is the base class for both prims and avatars.&lt;br /&gt;
* '''&amp;lt;tt&amp;gt;PhysicsScene&amp;lt;/tt&amp;gt;''' is the main base class that interfaces with the region's Scene.&lt;br /&gt;
* (others)&lt;br /&gt;
&lt;br /&gt;
The Physics Scene doesn't access the Region Scene.  The region scene will tell the physics engine about prims and avatars, and will send updates to the physics engine.  It will then pull positions and velocities of objects and avatars out of the physics engine.&lt;br /&gt;
&lt;br /&gt;
For the most part, the things that will be interfacing with the physics engine are the classes &amp;lt;tt&amp;gt;OpenSim.Region.Framework.Scenes.Scene&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;OpenSim.Region.Framework.Scenes.SceneObjectGroup&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;OpenSim.Region.Framework.Scenes.SceneObjectPart&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Plugin Class ==&lt;br /&gt;
&lt;br /&gt;
If you're writing a Physics engine named Foo, you need to write a class OpenSim.Region.Physics.FooPlugin with the following methods:&lt;br /&gt;
&lt;br /&gt;
* '''FooPlugin()''' &amp;amp;mdash; constructor&lt;br /&gt;
* '''bool Init()''' &amp;amp;mdash; (not sure exactly when this is called.  return true)&lt;br /&gt;
* '''PhysicsScene GetScene(String sceneIdentifier)''' &amp;amp;mdash; return a FooScene, which is derived from PhysicsScene&lt;br /&gt;
* '''string GetName()''' &amp;amp;mdash; return the name that folks can use in OpenSim.ini to select this physics engine&lt;br /&gt;
* '''Dispose()''' &amp;amp;mdash; destructor&lt;br /&gt;
&lt;br /&gt;
== PhysicsScene  ==&lt;br /&gt;
&lt;br /&gt;
Your class OpenSim.Region.Physics.FooScene must derive from OpenSim.Region.Physics.PhysicsScene. Members include: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''public override void Initialize(IMesher meshmerizer, IConfigSource config)''' &lt;br /&gt;
:Passes in the Meshing plugin to the Physics Plugin. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''public override PhysicsActor AddAvatar(string avName, PhysicsVector position, PhysicsVector size, bool isFlying)''' &lt;br /&gt;
:Scene calls this method when adding an avatar to the physics scene or changing appearance &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''public override void SetWaterLevel(float baseheight)''' &lt;br /&gt;
:If water is simulated in your physics engine, this passes in the visual base height &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''public override void RemovePrim(PhysicsActor prim)''' &lt;br /&gt;
:This gets called when a prim is made into something the physics engine no longer needs to know about. The physics engine should remove it from any internal lists of prims it is keeping track of. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''public override void RemoveAvatar(PhysicsActor character)''' &lt;br /&gt;
:Like RemovePrim, but for avatars. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position, PhysicsVector size, Quarternion rotation)''' &lt;br /&gt;
:Tells the physics engine to add a new prim it needs to keep track of. This prim is ''not'' a physical prim, but as long as it's not phantom, physical objects may collide with it, and thus the physics engine (may) need to know about it. (Unless the physics engine punts on collisions, as, for instance, NewtonPlugin does.) Comments in the code indicate that this method is slated to be removed.... &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position, PhysicsVector size, Quarternion rotation, bool isPhysical)''' &lt;br /&gt;
:Like the previous one, but you've got the flag that tells you if it's physical or not. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''public override void AddPhysicsActorTaint(PhysicsActor prim)''' &lt;br /&gt;
:When the scene makes a change to the Physics Scene, it informs the Physics Plugin that it tainted the object to give the physics scene a chance to update it's internal data during or before next step &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''public override void GetResults()''' &lt;br /&gt;
:When the physics engine is multi-threaded (such as PhysX), GetResults would be called to Select the threads and wait until they're finished. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''public override bol IsThreaded''' &lt;br /&gt;
:A member that needs a get method. Returns if the Physics Plugin/Engine is Multi-Threaded &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''public override void SetTerrain(float[] heightMap)''' &lt;br /&gt;
:Sets terrain using a flattened(strided) y-flipped float array of Constants.RegionSize by Constants.RegionSize. float val= heightmap[y * Constants.RegionSize + x] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''public override void DeleteTerrain()''' &lt;br /&gt;
:Remove terrain. (does this ever get called?) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''public override Dictionary&amp;amp;lt;unit, float&amp;amp;gt; GetTopColliders()''' &lt;br /&gt;
:Provides the Scene with information about the Physics Scene (requested through the Estate Module). uint is the unique ID of the object in the Simulator. float is a rating value. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''public override float Simulate(float timestep)''' &lt;br /&gt;
:This is the core function. This gets called by the main loop when it wants the Physics engine to do its magic and propagate forward the positions and velocities of all the stuff it knows about. The physics engine should update the Position and Velocity members of the PhysicsActor class it knows about (those things that have been added to it by the methods above). '''Important:''' when the physics engine thinks that things have changed enough for any given prims that the surrounding scene should updates it's own idea about the positions and velocities of those prims, it should call the RequestPhysicsterseUpdate() method of the changed PhysicsActors(). (The safest, but slowest, way to do this is for Simulate() to call this for every physical prim it knows about every time it is called.)&lt;br /&gt;
[http://www.gadgetsdotcom.com Gadgets]&lt;br /&gt;
&lt;br /&gt;
== PhysicsActor  ==&lt;br /&gt;
&lt;br /&gt;
PhysicsActor represents both prims and characters. You may want to make separate classes for the two. You can get away with this because PhysicsActors are actually created by PhysicsScene. Your subclass of PhysicsScene has different methods called when an avatar or a prim is added to the scene, returning a PhysicsActor. You can return the appropriate subclass in each case.&amp;amp;nbsp; Be aware, that these properties are not thread safe by default and multiple threads *will* reach in here.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Members: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''int PhysicsActorType''' &lt;br /&gt;
:Needs get and set methods. Return ActorTypes.Prim or ActorTypes.Agent if it's a prim or an avatar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''bool IsPhysical''' &lt;br /&gt;
:Needs get and set.&amp;amp;nbsp; Returns true if the object has a RigidBody, False if it is static.&amp;amp;nbsp; The Scene will set the object Static and Active here. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''PhysicsVector Position''' &lt;br /&gt;
:Needs get and set. If an object is physical, the physics engine keeps the &amp;quot;real&amp;quot; position for that object. However, it's the surrounding scene's impression of the position that gets rendered and sent to the client. It will pull the position out of the physics engine by looking at this member, and tell the physics engine about any external changes in its position through this member. Note that the scene doesn't automatically pull out the position, but only when it thinks it needs to. You can call the RequestPhysicsterseUpdate() method of PhysicsActor to ask the Scene to update its position for any given PhysicsActor. (See PhysicsScene.Simulate() above.) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''PhysicsVector Velocity''' &lt;br /&gt;
:Need get and set. Similar considerations to Position &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''PhysicsVector RotationalVelocity''' &lt;br /&gt;
:Needs get and set Angular Velocity of the object being simulated&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''PhysicsVector Acceleration''' &lt;br /&gt;
:Needs get; there's no set method. The Linear Acceleration of the object&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''void SetAcceleration(PhysicsVector accel)''' &lt;br /&gt;
:Do what you'd think Acceleration.set would do &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''PhysicsVector Size''' &lt;br /&gt;
:Needs get and set. Sets the scale of the object. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''float Mass''' &lt;br /&gt;
:Needs get; there is no set method at the moment.&amp;amp;nbsp;&amp;amp;nbsp; The scene reaches requests the mass from the physics engine here&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''void SetMass(float mass)''' &lt;br /&gt;
:Instead of Mass.set &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''void SetMomentum(PhysicsVector momentum)''' &lt;br /&gt;
:I am disturbed that this exists in addition to Velocity.set and SetMass.... &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''Quarternion Orientation''' &lt;br /&gt;
:Needs get and set. &amp;amp;nbsp;&amp;amp;nbsp;Quaternion representing the orientation of the object in WorldSpace when non-physical.&amp;amp;nbsp; It's in LocalSpace when it's a child object linked to a root object. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''bool ThrottleUpdates''' &lt;br /&gt;
:Needs get and set. I'm not sure what this means, exactly.&amp;amp;nbsp; This informs the scene and physics engine to reduce the number of updates to save Resources.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''bool IsColliding''' &lt;br /&gt;
:Needs get and set. True if object is colliding with another object&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''bool CollidingGround''' &lt;br /&gt;
:Needs get and set. True if object is colliding with the ground&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''bool CollidingObj''' &lt;br /&gt;
:Needs get and set True if object is colliding with another object (but not the ground)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''bool Stopped''' &lt;br /&gt;
:Just needs get &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''PhysicsVector CenterOfMass&amp;amp;nbsp;''' &lt;br /&gt;
:Just needs get. Returns the Center of Mass of the object.&amp;amp;nbsp;&amp;amp;nbsp; In most cases that will be &amp;amp;lt;0,0,0&amp;amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''PhysicsVector GeometricCenter''' &lt;br /&gt;
:Just needs get. I&amp;amp;nbsp;doubt that anything is using this now.. &amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''PrimitiveBaseShape Shape''' &lt;br /&gt;
:Just needs set.&amp;amp;nbsp; When a user changes the type of object to simulate, Shape gets set by the scene. &amp;amp;nbsp; Going from a Cube, to a Sphere or Torus, for example.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''PhysicsVector Force''' &lt;br /&gt;
:Needs get and set. I ''think'' this is a steady force (in N) always acting on the object. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''PhysicsVector Torque''' &lt;br /&gt;
:Needs get and set. Like Force, I think this is a steady torque operating on the object. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''void AddForce(PhysicsVector force, bool pushforce)''' &lt;br /&gt;
:This should apply a one-time impulse to the object of magnitude &amp;quot;force&amp;quot; Newton-seconds.&amp;amp;nbsp; AddForce is used to move objects around in the PhysicsEngine (avatar too!).&amp;amp;nbsp; PushForce means that one of the script engine pushes is being employed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''void AddAngularForce(PhsyicsVector force, bool pushforce)''' &lt;br /&gt;
:A one-time angular impulse. See AddForce for more info on pushforce. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''int VehicleType''' &lt;br /&gt;
:(I don't know anything about the vehicle code requirements) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''void VehicleFloatParam(int param, float value)''' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''void VehicleVectorParam(int param, PhysicsVector value)''' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''void VehicleRotationParam(int param, Quarternion rotation)''' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''void SetVoulumeDetect(int param)''' &lt;br /&gt;
:This is some weird mode that can be set via a LSL function.&amp;amp;nbsp; (Object receives collisions but doesn't cause a reaction) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''float Buoyancy''' &lt;br /&gt;
:Needs get and set &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''bool FloatOnWater''' &lt;br /&gt;
:Just needs set &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''float CollisionScore''' &lt;br /&gt;
:Needs get and set. I don't know what this is. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''bool Flying''' &lt;br /&gt;
:Needs get and set &amp;amp;nbsp;(Avatar Flying = True, else, False)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''bool SetAlwaysRun''' &lt;br /&gt;
:Needs get and set. Avatar running -&amp;amp;gt; True, Else false&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''unit LocalID''' &lt;br /&gt;
:Needs set. I don't know what this is. This is the simulator Unique ID for the object &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''bool Grabbed''' &lt;br /&gt;
:Needs set. I'm not sure what this is,&amp;amp;nbsp; when you control-click on an object &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''void link(PhysicsActor obj)''' &lt;br /&gt;
:I haven't delved into how linking works in the physics engine. This says &amp;quot;link yourself to obj with obj as the root &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''void delink() &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''void LockAngularMomentum(PhysicsVector axis)''' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''bool Selected''' &lt;br /&gt;
:Just needs set. Gets set when this object is selected and deselected in the edit tools. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''void CrossingFailure()''' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''PhysicsVector PIDTarget''' &lt;br /&gt;
:Just needs set. A position to which an object is supposed to move. Correct!&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''bool PIDActive''' &lt;br /&gt;
:Just needs set. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''float PIDTau''' &lt;br /&gt;
:Just needs set. This is the timescale (in seconds) in which the object should move to PIDTarget when it is set to be PID Active. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''float PIDHoverHeight''' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''float PIDHoverActive''' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''PIDHoverType PIDHoverType''' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''float PIDHoverTau''' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''void SubscribeEvents(int ms)''' &lt;br /&gt;
:I do not know what sorts of events the PhysicsActor sends... hopefully I'll update this if/when I figure that out! It looks like you can ask for OnPositionUpdate, OnVelocityUpdate, OnOrientationUpdate, OnRequestTerseUpdate, OnCollisionUpdate, and OnOutOfBounds... but I have yet to fully understand the OpenSim event system, so I may be speaking out of the side of my mouth here.&lt;br /&gt;
&lt;br /&gt;
:This actually gets called when the Script engine script handles collision, collision_start, and collision_end events. &amp;amp;nbsp;&amp;amp;nbsp; The scene is requesting that the Physics Plugin send collision updates back to the scene every n Milliseconds.&amp;amp;nbsp; If it's 0, then it's Physics Plugin default.&amp;amp;nbsp; This also gets called for Avatar.&amp;amp;nbsp; PhysicsActor has an method called SendCollisionUpdate that needs to be called to send collision data (pairs) back to the scene.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;'''bool SubscribedEvents()'''&lt;/div&gt;</summary>
		<author><name>Xadmin</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/wiki/Hypergrid</id>
		<title>Hypergrid</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/Hypergrid"/>
				<updated>2011-09-14T07:33:45Z</updated>
		
		<summary type="html">&lt;p&gt;Xadmin: /* Development Meetings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Quicklinks}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The OpenSim Hypergrid==&lt;br /&gt;
&lt;br /&gt;
Also see [[Grider]]; [[Virtual World Model]]; [[HyperGrid Team]]&lt;br /&gt;
&lt;br /&gt;
=== What is the hypergrid? ===&lt;br /&gt;
&amp;lt;!-- [[image:VWV.jpg|250px|thumb|Web of Virtual Worlds]] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The hypergrid is an extension to opensim that allows you to link your opensim to other opensims on the internet, and that supports seamless agent transfers among those opensims. It can be used both in standalone mode and in grid mode. The hypergrid is effectively supporting the emergence of a Web of virtual worlds. &lt;br /&gt;
&lt;br /&gt;
The basic idea for the hypergrid is that region/grid administrations can place hyperlinks on their map to hypergrided regions run by others. Once those hyperlinks are established, users interact with those regions in exactly the same way as they interact with local regions. Specifically, users can choose to teleport there. Once the user reaches the region behind the hyperlink, she is automatically interacting with a different virtual world without having to logout from the world where she came from, and while still having access to her inventory.&lt;br /&gt;
&lt;br /&gt;
The hypergrid started as a GForge project, but it is now included in the standard distribution of OpenSim. To run your OpenSim instance in hypergrid mode, please see [[Installing_and_Running_Hypergrid|Installing and Running]].&lt;br /&gt;
&lt;br /&gt;
=== Virtual World Hyperlinks ===&lt;br /&gt;
[[image:hghyperlink.jpg|250px|thumb|A Virtual World Hyperlink]]&lt;br /&gt;
&lt;br /&gt;
We're all familiar with hypertext links on the Web. But what is a virtual world hyperlink?&lt;br /&gt;
&lt;br /&gt;
In the hypergrid model, we consider the 2D map of the virtual world as the equivalent of a web page. As such, a VW hyperlink is simply a region on that map. &lt;br /&gt;
&lt;br /&gt;
The default model of opensim-based virtual worlds already supports this concept of hyperlink, to some extent. When you teleport from one region to another via the map, chances are you are migrating your agent into a different opensim server. This migration is a glorified &amp;quot;agent transfer&amp;quot; that also exists, in rudimentary form, on the web when hypertext links are followed. The default model, however, imposes two very strong constraints on these hyperlinks: &lt;br /&gt;
# The entire map of regions is controlled by a central service known as the grid service, whose job is to provide a uniform view of the world to all of its regions.&lt;br /&gt;
# The only agents that can be transferred are those pertaining to users known to another central service, the user service; if the incoming user is not on that service's database, the agent transfer doesn't go through.&lt;br /&gt;
&lt;br /&gt;
The hypergrid simply removes these two constraints. &lt;br /&gt;
&lt;br /&gt;
First, it allows individual opensim instances to add &amp;quot;neighbors&amp;quot; to their local map, shifting the control of the map down from the grid server to individual opensim instances (although hyperlinks can also be served by grid servers if grid admins so wish). In doing so, the world becomes a lot more interesting and varied. The map that you see in one opensim instance may be completely different from the map that you see after you teleport via an hyperlink. As an opensim administrator, you are free to define what other opensims you want to see on your map.&lt;br /&gt;
&lt;br /&gt;
Second, it allows the transfer of agents pertaining to foreigner users, i.e. users who are registered elsewhere. Instead of assuming one central user service, the hypergrid assumes an arbitrarily large number of such services distributed all over the world. As such, when agents are transferred among hypergrided opensims, a lot more information is passed about the corresponding user. That information includes the collection of servers that the transferring user needs.&lt;br /&gt;
&lt;br /&gt;
=== Usage Scenarios ===&lt;br /&gt;
&lt;br /&gt;
The following are some usage scenarios. There isn't a clear separation between these scenarios, there's a large overlap between them. This is also not an exhaustive list. The purpose of these descriptions is to give you some starting ideas for how to use the hypergrid in practice. Please feel free to add other interesting scenarios to this list.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
[[image:topoA.jpg|400px|left]]&lt;br /&gt;
|&lt;br /&gt;
'''Personal Worlds'''&lt;br /&gt;
&lt;br /&gt;
This first scenario pertains to standalone opensims. Normally, standalones are completely disconnected from the internet. However, when run in hypergrid mode, standalones become network-able. As such, you can run your own world in your own computer, and link your world to whoever you want. For example, you can link to your friends' hypergrided opensims and to hypergrid gateways in open grids such as OSGrid. &lt;br /&gt;
&lt;br /&gt;
The great thing about this scenario is that all of your assets are stored on your computer, and not on somebody else's server. You can back them up using ordinary backend tools. The not so great thing about this scenario is that all of your assets are stored on your computer! If your disk goes berserk, you loose them. (so make sure you make external backups regularly)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
[[image:topoB.jpg|400px|left]]&lt;br /&gt;
|&lt;br /&gt;
'''Communities'''&lt;br /&gt;
&lt;br /&gt;
This second scenario is about communities, broadly construed. The idea here is that a group of people come together to support a small community grid, i.e. a common world where shared activities take place. But at the same time, the members of the community maintain their own standalone worlds. The standalones link to the community grid, and the community grid may link back to the individual members' worlds and other places of interest.&lt;br /&gt;
&lt;br /&gt;
The members' identities are probably the identities they have on their standalones, and their assets are also probably stored there. The assets present in the community regions, however, are stored on the grid asset server.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
[[image:topoC.jpg|400px|left]]&lt;br /&gt;
|&lt;br /&gt;
'''Grid Public Regions'''&lt;br /&gt;
&lt;br /&gt;
Walled-gardens are here to stay, and they serve many useful purposes. There is a hybrid mode for the hypergrid that some walled-garden grid operators may be interested in supporting. In this hybrid mode, most opensim instances on the grid run in normal, wall-garden mode, so no foreign visitors are allowed there - technically it is impossible to reach them. However, a few opensim instances on that grid can run in hypergrid mode, so that foreign visitors are allowed. This way, there is a gateway for grid-local users and arbitrary visitors to meet. This is also a good strategy for attracting new users to the grid, since random users are able to visit those gateway regions without having to sign up for an account upfront.&lt;br /&gt;
&lt;br /&gt;
This hybrid mode is very similar to what happens on the web. For example, anyone can visit Facebook's public pages without having to sign up for a Facebook account. However, only Facebook users can go further inside.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
[[image:topoD.jpg|400px|left]]&lt;br /&gt;
|&lt;br /&gt;
'''Level Games'''&lt;br /&gt;
&lt;br /&gt;
The normal version of OpenSim enforces a common map for all the regions on a grid. The hypergrid removes that constraint. As such, it becomes easy to design VW games where the world looks different depending of where the player is. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hypergrid Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hyperlinks and Agent Transfers ===&lt;br /&gt;
&lt;br /&gt;
When you establish a link between your opensim and another, a message is sent out to that other opensim requesting information about it; the required information includes the network information of that opensim host, and the coordinates of its first region on its local grid in the form of a region handle. For example, suppose you are linking node X.com:9000, placing it in your local map at 900, 900. That opensim runs one or more regions that likely are not in 900, 900 on their own map; suppose the first region of that opensim is at 1100, 1100. From your point of view, it doesn't matter what those other coordinates are, and you don't need to know -- that's the key to being able to decentralize the &amp;quot;world&amp;quot; as given by a 2D map; you want to place it in your map at 900, 900. The &amp;quot;true&amp;quot; position of that simulator only matters for the LL viewer, when there are teleports between your world and that other opensim. This mapping between coordinate systems is the essence of  hyperlinks for opensim; it's one simple but critical thing that the hypergrid implementation does. The mapping happens on the TeleportFinish event; instead of sending the local coordinates to the viewer, the hypergrid teleport wrapper sends the remote coordinates.&lt;br /&gt;
&lt;br /&gt;
When an agent teleports through that hyperlink the following happens. First, before InformRegionOfChildAgent, the local opensim notifies the remote opensim of this foreign user via the &amp;quot;expect_hg_user&amp;quot; method. That message sends along the addresses of all the servers that this user uses, i.e. user, inventory and asset servers. The remote opensim places an entry for that user in its local user profile cache but not in its user database; the foreign user information is non-persistent. After that, the teleport process is exactly the same as the normal teleport process; the only difference is that the region handles are switched between the remote region's hyperlink position on the local grid and its actual position on its grid. &lt;br /&gt;
&lt;br /&gt;
In summary, the two new concepts introduced by the hypergrid are the concept of an hyperlink and the concept of a &amp;quot;local user&amp;quot; vs. &amp;quot;[[Banning_Foreign_Users_in_Hypergrid|foreign user]]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Inventory Access ===&lt;br /&gt;
&lt;br /&gt;
Inventory access from abroad is done by wrapping the existing scene-inventory interactions with additional code that gets or posts inventory assets from/to the user's asset server. When inventory is accessed, the hypergrid wrapper checks if the user is foreign and, if she is, the wrapper simply brings the necessary assets from the user's asset server to the local asset cache and server; from then on, the wrapper passes the control to the existing inventory access functions. When something is added to inventory, the hypergrid wrapper is notified via an event, and posts the assets to the user's asset server. A cache of the exchanged item identifiers is maintained so that they aren't brought back over and over again.&lt;br /&gt;
&lt;br /&gt;
The result is that hypergrided opensim instances end up interacting with several asset servers, instead of just one. That interaction is implemented in a straightforward manner by instantiating several GridAssetClient objects, instead of just one.&lt;br /&gt;
&lt;br /&gt;
=== The Hypergrid Classes ===&lt;br /&gt;
&lt;br /&gt;
Currently, the hypergrid is implemented outside of the OpenSim namespace, so that there is complete separation between what already exists and this new behavior. It has its own namespace, HyperGrid. In it, there are 4 sub-namespaces that follow directly the software architecture of OpenSim, namely:&lt;br /&gt;
&lt;br /&gt;
* '''OpenSim.Framework''':&lt;br /&gt;
** ForeignUserProfileData extends UserProfileData by introducing information about the user's &amp;quot;home&amp;quot;, namely the home address, port and remoting port. The user's home is not that user's user service; it's the opensim that the user has defined to be her home. This is necessary for supporting the home jump (Ctrl-Shift-H).&lt;br /&gt;
** HGNetworkServersInfo follows the spirit of NetworkServersInfo, although it neither extends it nor uses it. For now, it's a utility class whose two main functions are to convert domain names of servers to IP addresses, and to uniformly provide the answer to the question bool IsLocalUser(...).&lt;br /&gt;
&lt;br /&gt;
* '''OpenSim.Region.Framework.Scenes.Hypergrid''':&lt;br /&gt;
** HGSceneCommunicationService extends SceneCommunicationService, overriding RequestTeleportToLocation. There are two very small but critical changes to the base method: (a) on the TeleportFinish event, we switch the region handles when the destination region is an hyperlink; (b) the connections at the end are always closed for hyperlink TPs.&lt;br /&gt;
** HGScene extends Scene, overriding TeleportClientHome(...). The only change to the base method is to stay away from the user server, for now, because the user service is still not completely wrapped up for foreign users. Once the user service is properly wrapped up, this class will become unnecessary.&lt;br /&gt;
** HGScene.Inventory is a partial class of HGScene, just like what happens in the OpenSim framework. This part of HGScene overrides some inventory-scene interaction methods, so that assets are fetched/posted from/to the user's asset server. Once that extra fetching/posting is done, these methods simply pass the ball to the base methods.&lt;br /&gt;
** HGAssetMapper: this is a new class specific to the hypergrid that manages the fetching and posting of assets between foreign regions where the user is and the user's asset server.&lt;br /&gt;
&lt;br /&gt;
* '''OpenSim.Region.Communications.HyperGrid''' is a mashup of OpenSim.Region.Communications.*. This is the place where most of the hypergrid extension lies. One of the reasons for this is that the hypergrid communications part is doing one additional thing: it is making standalones network-able.&lt;br /&gt;
** HGCommunicationsStandalone extends CommuniationsLocal. Just as its base, it is a hub for the several network services available in standalone mode. The main difference is that those services are extensions of what's in OpenSim.&lt;br /&gt;
** HGCommunicationsGridMode extends CommunicationsManager directly. Again, it's a hub for the network services available in grid mode, those services being extensions of OpenSim.&lt;br /&gt;
** The cluster HGGridServices (superclass), HGGridServicesStandalone and HGGridServicesGridMode (subclasses) implements the OpenSim interfaces IGridServices and IInterRegionCommunications. The 2 subclasses are wrappers for LocalBackEndServices and OGS1GridServices, respectively. There is one common pattern throughout these classes: check if the region to talk to is an hyperlink; if it's not, simply delegate the work to LocalBackEndServices/OGS1GridServices; if it is, push the work to the base class HGGridServices. HGGridServices, in turn, does the management of hyperlink regions, and defines two additional pieces of inter-region protocol:&lt;br /&gt;
*** region_uuid: for linking regions&lt;br /&gt;
*** expect_hg_user: similar to the existing expect_user interface, but with a lot more information about the user being passed around, namely all the user's servers (inventory, asset, user, home, etc.)&lt;br /&gt;
** HGInventoryService extends LocalInventoryService and implements ISecureInventoryService. This class is the most obvious mashup of the pack, mixing local service access for standalone users and remote inventory access for when users are out and about. Right now, there is a fair amount of selective copy-and-paste, to stay away from the ugliness coming from OGS1InventoryService and OGS1SecureInventoryService. HGInventoryService is always a ISecureInventoryService. Its methods all follow the same pattern: check if the user is a local standalone user; if it is, pass the work to the base method (in LocalInventoryService); if it's not perform secure remote access.&lt;br /&gt;
** HGUserServices wraps OSG1UserServices, but it's not functional yet.&lt;br /&gt;
&lt;br /&gt;
* '''OpenSim.Region.CoreModules.HyperGrid''' is a collection of 3 region modules:&lt;br /&gt;
** HGWorldMapModule extends WorldMapModule. It reuses almost everything from the base class. The only small change is in RequestMapBlocks, where it tries to send Offline mapblocks to the client.&lt;br /&gt;
** HGStandaloneInventoryService and HGStandaloneAssetService do what their names say. They are region modules that allow access to inventory and assets for standalones, when the standalone user is out and about. In spirit, there is a lot in common between these modules and the REST inventory/asset plugin. Unfortunately, that plugin could not be used because it defines a completely different interface than that used by existing inventory and asset servers, and the access for the hypergrid must use a consistent interface.&lt;br /&gt;
&lt;br /&gt;
== Installing and Running ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Installing and Running Hypergrid]]&lt;br /&gt;
&lt;br /&gt;
== Hypergrid and Security ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Hypergrid Security]]&lt;br /&gt;
&lt;br /&gt;
== Banning Foreign Users ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Banning Foreign Users in Hypergrid]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Public Hypergrid Nodes ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Public Hypergrid Nodes]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hypergrid Lists ==&lt;br /&gt;
Please see [[Hypergrid Lists]].&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Development Meetings ==&lt;br /&gt;
[http://www.gadgetsdotcom.com Gadgets]&lt;br /&gt;
[[Hypergrid Meetings]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Hypergrid]]&lt;/div&gt;</summary>
		<author><name>Xadmin</name></author>	</entry>

	</feed>