Ejemplo n.º 1
0
 public AddForceCmd(PhysicsActor actor, OpenMetaverse.Vector3 force, OpenMetaverse.Vector3 forceOffset, ForceType type)
 {
     Actor = actor;
     Force = force;
     Type = type;
     ForceOffset = forceOffset;
 }
Ejemplo n.º 2
0
 public override void AddPhysicsActorTaint(PhysicsActor prim)
 {
 }
Ejemplo n.º 3
0
 public override void RemovePrim(PhysicsActor prim)
 {
 }
Ejemplo n.º 4
0
 public override void RemoveAvatar(PhysicsActor actor)
 {
 }
Ejemplo n.º 5
0
 public abstract void AddPhysicsActorTaint(PhysicsActor prim);
Ejemplo n.º 6
0
 public virtual void RemoveAllJointsConnectedToActorThreadLocked(PhysicsActor actor)
 {
     return;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Remove a prim.
 /// </summary>
 /// <param name="prim"></param>
 public abstract void RemovePrim(PhysicsActor prim);
Ejemplo n.º 8
0
    private bool GetRootPhysActor(UUID hostID, out SceneObjectGroup containingGroup, out SceneObjectPart rootPart, out PhysicsActor rootPhysActor)
    {
        bool ret = false;
        rootPhysActor = null;
        containingGroup = null;
        rootPart = null;

        SceneObjectPart requestingPart;

        requestingPart = BaseScene.GetSceneObjectPart(hostID);
        if (requestingPart != null)
        {
            // The type is is always on the root of a linkset.
            containingGroup = requestingPart.ParentGroup;
            if (containingGroup != null && !containingGroup.IsDeleted)
            {
                rootPart = containingGroup.RootPart;
                if (rootPart != null)
                {
                    rootPhysActor = rootPart.PhysActor;
                    if (rootPhysActor != null)
                    {
                        ret = true;
                    }
                    else
                    {
                        m_log.WarnFormat("{0} GetRootAndChildPhysActors: Root part does not have a physics actor. rootName={1}, hostID={2}",
                                        LogHeader, rootPart.Name, hostID);
                    }
                }
                else
                {
                    m_log.WarnFormat("{0} GetRootAndChildPhysActors: Root part does not exist. RequestingPartName={1}, hostID={2}",
                                    LogHeader, requestingPart.Name, hostID);
                }
            }
            else
            {
                m_log.WarnFormat("{0} GetRootAndChildPhysActors: Containing group missing or deleted. hostID={1}", LogHeader, hostID);
            }
        }
        else
        {
            m_log.WarnFormat("{0} GetRootAndChildPhysActors: cannot find script object in scene. hostID={1}", LogHeader, hostID);
        }

        return ret;
    }
Ejemplo n.º 9
0
 public override void link(PhysicsActor obj)
 {
 }
Ejemplo n.º 10
0
        private void KickOrRideOnPrim(PhysX.ControllerShapeHit hit, PhysicsActor otherActor)
        {
            PhysxPrim otherPrimActor = (PhysxPrim)otherActor;
            //m_log.InfoFormat("dir: {0} {1} {2}", hit.Direction, hit.WorldNormal, hit.WorldPosition);

            float coeff;
            if (hit.Direction.Z != 0)
            {
                if (otherPrimActor.PhysxExtents.X > MIN_RIDEON_HALF_EXTENTS || otherPrimActor.PhysxExtents.Y > MIN_RIDEON_HALF_EXTENTS ||
                    otherPrimActor.PhysxExtents.Z > MIN_RIDEON_HALF_EXTENTS)
                {
                    _rideOnBehavior.AvatarStandingOn(otherPrimActor);
                }
                else
                {
                    _rideOnBehavior.AvatarNotStandingOnPrim();
                }

                coeff = _mass * Math.Abs(Settings.Instance.Gravity) * MIN_TIMESTEP;
            }
            else
            {
                if (_rideOnBehavior.IsRideOnPrim(otherPrimActor))
                {
                    //dont kick the thing we're riding on
                    coeff = 0;
                }
                else
                {
                    //push the object out of the way at the appropriate rate
                    const float OTHER_PUSH_MULT = 100.0f;
                    coeff = _mass * hit.Length * OTHER_PUSH_MULT;
                }
            }

            //OpenMetaverse.Vector3.Negate(PhysUtil.PhysxVectorToOmv(hit.WorldNormal))

            if (coeff != 0.0f)
            {
                OpenMetaverse.Vector3 hitVector = PhysUtil.PhysxVectorToOmv(hit.WorldPosition);
                if (hit.Direction.Z == 0)
                {
                    //put the hit down the legs
                    hitVector.Z -= _height / 3.0f;
                }

                otherActor.AddForceSync(PhysUtil.PhysxVectorToOmv(hit.Direction) * coeff, hitVector, ForceType.GlobalLinearImpulse);
            }
        }
Ejemplo n.º 11
0
 public override void LinkToNewParent(PhysicsActor obj, OpenMetaverse.Vector3 localPos, OpenMetaverse.Quaternion localRot)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 12
0
 public abstract void AddPhysicsActorTaint(PhysicsActor prim, TaintType taint);
Ejemplo n.º 13
0
    // Find the root and child PhysActors based on the linkNum.
    // Return 'true' if both are found and returned.
    private bool GetRootAndChildPhysActors(UUID hostID, int linkNum, out PhysicsActor rootPhysActor, out PhysicsActor childPhysActor)
    {
        bool ret = false;
        rootPhysActor = null;
        childPhysActor = null;

        SceneObjectGroup containingGroup;
        SceneObjectPart rootPart;

        if (GetRootPhysActor(hostID, out containingGroup, out rootPart, out rootPhysActor))
        {
            SceneObjectPart linkPart = containingGroup.GetLinkNumPart(linkNum);
            if (linkPart != null)
            {
                childPhysActor = linkPart.PhysActor;
                if (childPhysActor != null)
                {
                    ret = true;
                }
                else
                {
                    m_log.WarnFormat("{0} GetRootAndChildPhysActors: Link part has no physical actor. rootName={1}, hostID={2}, linknum={3}",
                                        LogHeader, rootPart.Name, hostID, linkNum);
                }
            }
            else
            {
                m_log.WarnFormat("{0} GetRootAndChildPhysActors: Could not find linknum part. rootName={1}, hostID={2}, linknum={3}",
                                    LogHeader, rootPart.Name, hostID, linkNum);
            }
        }
        else
        {
            m_log.WarnFormat("{0} GetRootAndChildPhysActors: Root part does not have a physics actor. rootName={1}, hostID={2}",
                            LogHeader, rootPart.Name, hostID);
        }

        return ret;
    }
Ejemplo n.º 14
0
 public abstract void LinkToNewParent(PhysicsActor obj, OpenMetaverse.Vector3 localPos, OpenMetaverse.Quaternion localRot);
Ejemplo n.º 15
0
 /// <summary>
 /// Remove an avatar.
 /// </summary>
 /// <param name="actor"></param>
 public abstract void RemoveAvatar(PhysicsActor actor);
Ejemplo n.º 16
0
 public abstract void link(PhysicsActor obj);
Ejemplo n.º 17
0
 private bool GetRootPhysActor(UUID hostID, out PhysicsActor rootPhysActor)
 {
     SceneObjectGroup containingGroup;
     SceneObjectPart rootPart;
     return GetRootPhysActor(hostID, out containingGroup, out rootPart, out rootPhysActor);
 }