Esempio n. 1
0
 public BSDynamics(BSScene myScene, BSPrim myPrim)
 {
     PhysicsScene = myScene;
     Prim = myPrim;
     Type = Vehicle.TYPE_NONE;
 }
    // Routine called when rebuilding the body of some member of the linkset.
    // Destroy all the constraints have have been made to root and set
    //     up to rebuild the constraints before the next simulation step.
    // Returns 'true' of something was actually removed and would need restoring
    // Called at taint-time!!
    public override bool RemoveBodyDependencies(BSPrim child)
    {
        bool ret = false;

        DetailLog("{0},BSLinksetConstraint.RemoveBodyDependencies,removeChildrenForRoot,rID={1},rBody={2}",
                                    child.LocalID, LinksetRoot.LocalID, LinksetRoot.PhysBody.ptr.ToString());

        lock (m_linksetActivityLock)
        {
            // Just undo all the constraints for this linkset. Rebuild at the end of the step.
            ret = PhysicallyUnlinkAllChildrenFromRoot(LinksetRoot);
            // Cause the constraints, et al to be rebuilt before the next simulation step.
            Refresh(LinksetRoot);
        }
        return ret;
    }
Esempio n. 3
0
    public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
                                              Vector3 size, Quaternion rotation, bool isPhysical, uint localID)
    {
        // m_log.DebugFormat("{0}: AddPrimShape2: {1}", LogHeader, primName);

        if (!m_initialized) return null;

        DetailLog("{0},AddPrimShape,call", localID);

        BSPrim prim = new BSPrim(localID, primName, this, position, size, rotation, pbs, isPhysical);
        lock (PhysObjects) PhysObjects.Add(localID, prim);
        return prim;
    }
 // Companion to RemoveBodyDependencies(). If RemoveBodyDependencies() returns 'true',
 // this routine will restore the removed constraints.
 // Called at taint-time!!
 public override void RestoreBodyDependencies(BSPrim child)
 {
     // The Refresh operation queued by RemoveBodyDependencies() will build any missing constraints.
 }
Esempio n. 5
0
 // Companion to RemoveBodyDependencies(). If RemoveBodyDependencies() returns 'true',
 //     this routine will restore the removed constraints.
 // Called at taint-time!!
 public abstract void RestoreBodyDependencies(BSPrim child);
Esempio n. 6
0
 // Routine used when rebuilding the body of the root of the linkset
 // Destroy all the constraints have have been made to root.
 // This is called when the root body is changing.
 // Returns 'true' of something was actually removed and would need restoring
 // Called at taint-time!!
 public abstract bool RemoveBodyDependencies(BSPrim child);
 // Companion to RemoveBodyDependencies(). If RemoveBodyDependencies() returns 'true',
 //     this routine will restore the removed constraints.
 // Called at taint-time!!
 public override void RestoreBodyDependencies(BSPrim child)
 {
 }
    // Routine called when rebuilding the body of some member of the linkset.
    // Since we don't keep in world relationships, do nothing unless it's a child changing.
    // Returns 'true' of something was actually removed and would need restoring
    // Called at taint-time!!
    public override bool RemoveBodyDependencies(BSPrim child)
    {
        bool ret = false;

        DetailLog("{0},BSLinksetCompound.RemoveBodyDependencies,refreshIfChild,rID={1},rBody={2},isRoot={3}",
                        child.LocalID, LinksetRoot.LocalID, LinksetRoot.PhysBody.ptr.ToString(), IsRoot(child));

        if (!IsRoot(child))
        {
            // Because it is a convenient time, recompute child world position and rotation based on
            //    its position in the linkset.
            RecomputeChildWorldPosition(child, true);
        }

        // Cannot schedule a refresh/rebuild here because this routine is called when
        //     the linkset is being rebuilt.
        // InternalRefresh(LinksetRoot);

        return ret;
    }