public override void RemovePrim(PhysicsObject prim)
 {
 }
 public override void DeletePrim(PhysicsObject prim)
 {
 }
Beispiel #3
0
        public override void RemovePrim(PhysicsObject prim)
        {
            // MainConsole.Instance.DebugFormat("{0}: RemovePrim", LogHeader);
            if (prim is BSPrim)
                ((BSPrim) prim).Destroy();

            try
            {
                lock (m_prims) m_prims.Remove(prim.LocalID);
            }
            catch (Exception e)
            {
                MainConsole.Instance.WarnFormat("{0}: Attempt to remove prim that is not in physics scene: {1}", LogHeader, e);
            }
        }
        public override void DeletePrim(PhysicsObject prim)
        {
            if (prim is AuroraODEPrim)
            {
                if (!IsLocked) //Fix a deadlock situation.. have we been locked by Simulate?
                {
                    lock (OdeLock)
                    {
                        AuroraODEPrim p = (AuroraODEPrim)prim;

                        p.setPrimForDeletion();
                        AddPhysicsActorTaint(prim);
                        //RemovePrimThreadLocked(p);
                    }
                }
                else
                {
                    //Add the prim to a queue which will be removed when Simulate has finished what it's doing.
                    DeleteQueue.Add(prim);
                }
            }
        }
Beispiel #5
0
 public override void link(PhysicsObject obj)
 {
     _parent_scene.AddSimulationChange(() => changelink((AuroraODEPrim)obj));
 }
Beispiel #6
0
        private void changelink(AuroraODEPrim newparent)
        {
            // If the newly set parent is not null
            // create link
            if (_parent == null && newparent != null)
            {
                newparent.ParentPrim(this);
            }
            // If the newly set parent is null
            // destroy link
            else if (_parent != null)
            {
                if (_parent is AuroraODEPrim)
                {
                    if (newparent != _parent)
                    {
                        AuroraODEPrim obj = (AuroraODEPrim)_parent;
                        obj.ChildDelink(this);
                        childPrim = false;

                        if (newparent != null)
                        {
                            newparent.ParentPrim(this);
                        }
                    }
                }
            }

            _parent = newparent;
        }
Beispiel #7
0
 public virtual void link(PhysicsObject obj) { }
Beispiel #8
0
 public override void DeletePrim(PhysicsObject prim)
 {
     //Add the prim to a queue which will be removed when Simulate has finished what it's doing.
     DeleteQueue.Enqueue(prim);
 }
Beispiel #9
0
 public abstract void RemovePrim(PhysicsObject prim);
Beispiel #10
0
 // link me to the specified parent
 public override void link(PhysicsObject obj)
 {
     BSPrim parent = (BSPrim) obj;
     // MainConsole.Instance.DebugFormat("{0}: link {1}/{2} to {3}", LogHeader, _avName, _localID, obj.LocalID);
     // TODO: decide if this parent checking needs to happen at taint time
     if (_parentPrim == null)
     {
         if (parent != null)
         {
             // I don't have a parent so I am joining a linkset
             parent.AddChildToLinkset(this);
         }
     }
     else
     {
         // I already have a parent, is parenting changing?
         if (parent != _parentPrim)
         {
             if (parent == null)
             {
                 // we are being removed from a linkset
                 _parentPrim.RemoveChildFromLinkset(this);
             }
             else
             {
                 // asking to reparent a prim should not happen
                 MainConsole.Instance.ErrorFormat("{0}: Reparenting a prim. ", LogHeader);
             }
         }
     }
     return;
 }
Beispiel #11
0
 public abstract void DeletePrim(PhysicsObject prim);
Beispiel #12
0
 public override void link(PhysicsObject obj)
 {
     AddChange(AuroraODEPhysicsScene.changes.Link, obj);
 }
 private void ResetPrim(PhysicsObject physicsObject, PhysicsState physicsState, float direction)
 {
     physicsObject.Position = physicsState.Position;
     physicsObject.Orientation = physicsState.Rotation;
     physicsObject.RotationalVelocity = physicsState.AngularVelocity*direction;
     physicsObject.Velocity = physicsState.LinearVelocity*direction;
     physicsObject.ForceSetVelocity(physicsState.LinearVelocity*direction);
     physicsObject.RequestPhysicsterseUpdate();
 }
 public void AddPrim(PhysicsObject prm)
 {
     PhysicsState state = new PhysicsState
                              {
                                  Position = prm.Position,
                                  AngularVelocity = prm.RotationalVelocity,
                                  LinearVelocity = prm.Velocity,
                                  Rotation = prm.Orientation
                              };
     m_activePrims[prm.UUID] = state;
 }
 public virtual void link(PhysicsObject obj)
 {
 }