当前位置: 首页>>代码示例>>C#>>正文


C# BulletSPlugin.BSPhysObject类代码示例

本文整理汇总了C#中OpenSim.Region.Physics.BulletSPlugin.BSPhysObject的典型用法代码示例。如果您正苦于以下问题:C# BSPhysObject类的具体用法?C# BSPhysObject怎么用?C# BSPhysObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BSPhysObject类属于OpenSim.Region.Physics.BulletSPlugin命名空间,在下文中一共展示了BSPhysObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BSActorAvatarMove

 public BSActorAvatarMove(BSScene physicsScene, BSPhysObject pObj, string actorName)
     : base(physicsScene, pObj, actorName)
 {
     m_velocityMotor = null;
     m_walkingUpStairs = 0;
     m_physicsScene.DetailLog("{0},BSActorAvatarMove,constructor", m_controllingPrim.LocalID);
 }
开发者ID:hippie-b,项目名称:opensim,代码行数:7,代码来源:BSActorAvatarMove.cs

示例2: BSActor

 public BSActor(BSScene physicsScene, BSPhysObject pObj, string actorName)
 {
     m_physicsScene = physicsScene;
     m_controllingPrim = pObj;
     ActorName = actorName;
     Enabled = true;
 }
开发者ID:KSLcom,项目名称:Aurora-Sim,代码行数:7,代码来源:BSActors.cs

示例3: GetShapeReference

        // Get a reference to a physical shape. Create if it doesn't exist
        public static BSShape GetShapeReference(BSScene physicsScene, bool forceRebuild, BSPhysObject prim)
        {
            BSShape ret = null;

            if (prim.PreferredPhysicalShape == BSPhysicsShapeType.SHAPE_CAPSULE)
            {
            // an avatar capsule is close to a native shape (it is not shared)
            ret = BSShapeNative.GetReference(physicsScene, prim, BSPhysicsShapeType.SHAPE_CAPSULE,
                                        FixedShapeKey.KEY_CAPSULE);
            physicsScene.DetailLog("{0},BSShape.GetShapeReference,avatarCapsule,shape={1}", prim.LocalID, ret);
            }

            // Compound shapes are handled special as they are rebuilt from scratch.
            // This isn't too great a hardship since most of the child shapes will have already been created.
            if (ret == null  && prim.PreferredPhysicalShape == BSPhysicsShapeType.SHAPE_COMPOUND)
            {
            // Getting a reference to a compound shape gets you the compound shape with the root prim shape added
            ret = BSShapeCompound.GetReference(prim);
            physicsScene.DetailLog("{0},BSShapeCollection.CreateGeom,compoundShape,shape={1}", prim.LocalID, ret);
            }

            // Avatars have their own unique shape
            if (ret == null  && prim.PreferredPhysicalShape == BSPhysicsShapeType.SHAPE_AVATAR)
            {
            // Getting a reference to a compound shape gets you the compound shape with the root prim shape added
            ret = BSShapeAvatar.GetReference(prim);
            physicsScene.DetailLog("{0},BSShapeCollection.CreateGeom,avatarShape,shape={1}", prim.LocalID, ret);
            }

            if (ret == null)
            ret = GetShapeReferenceNonSpecial(physicsScene, forceRebuild, prim);

            return ret;
        }
开发者ID:KSLcom,项目名称:Aurora-Sim,代码行数:35,代码来源:BSShapes.cs

示例4: GetBodyAndShape

    // Called to update/change the body and shape for an object.
    // The object has some shape and body on it. Here we decide if that is the correct shape
    //    for the current state of the object (static/dynamic/...).
    // If bodyCallback is not null, it is called if either the body or the shape are changed
    //    so dependencies (like constraints) can be removed before the physical object is dereferenced.
    // Return 'true' if either the body or the shape changed.
    // Called at taint-time.
    public bool GetBodyAndShape(bool forceRebuild, BulletWorld sim, BSPhysObject prim, PhysicalDestructionCallback bodyCallback)
    {
        m_physicsScene.AssertInTaintTime("BSShapeCollection.GetBodyAndShape");

        bool ret = false;

        // This lock could probably be pushed down lower but building shouldn't take long
        lock (m_collectionActivityLock)
        {
            // Do we have the correct geometry for this type of object?
            // Updates prim.BSShape with information/pointers to shape.
            // Returns 'true' of BSShape is changed to a new shape.
            bool newGeom = CreateGeom(forceRebuild, prim, bodyCallback);
            // If we had to select a new shape geometry for the object,
            //    rebuild the body around it.
            // Updates prim.BSBody with information/pointers to requested body
            // Returns 'true' if BSBody was changed.
            bool newBody = CreateBody((newGeom || forceRebuild), prim, m_physicsScene.World, bodyCallback);
            ret = newGeom || newBody;
        }
        DetailLog("{0},BSShapeCollection.GetBodyAndShape,taintExit,force={1},ret={2},body={3},shape={4}",
                                prim.LocalID, forceRebuild, ret, prim.PhysBody, prim.PhysShape);

        return ret;
    }
开发者ID:szielins,项目名称:opensim,代码行数:32,代码来源:BSShapeCollection.cs

示例5: BSActorLockAxis

 public BSActorLockAxis(BSScene physicsScene, BSPhysObject pObj, string actorName)
     : base(physicsScene, pObj, actorName)
 {
     m_physicsScene.DetailLog("{0},BSActorLockAxis,constructor", m_controllingPrim.LocalID);
     LockAxisConstraint = null;
     HaveRegisteredForBeforeStepCallback = false;
 }
开发者ID:Kubwa,项目名称:opensim,代码行数:7,代码来源:BSActorLockAxis.cs

示例6: BSActorLockAxis

    public BSActorLockAxis(BSScene physicsScene, BSPhysObject pObj, string actorName)
        : base(physicsScene, pObj, actorName)
    {
        m_physicsScene.DetailLog("{0},BSActorLockAxis,constructor", m_controllingPrim.LocalID);
        LockAxisConstraint = null;

        // we place our constraint just before the simulation step to make sure the linkset is complete
        m_physicsScene.BeforeStep += PhysicsScene_BeforeStep;
    }
开发者ID:szielins,项目名称:opensim,代码行数:9,代码来源:BSActorLockAxis.cs

示例7: PreferredPhysicalShape

 // For compound implimented linksets, if there are children, use compound shape for the root.
 public override BSPhysicsShapeType PreferredPhysicalShape(BSPhysObject requestor)
 { 
     // Returning 'unknown' means we don't have a preference.
     BSPhysicsShapeType ret = BSPhysicsShapeType.SHAPE_UNKNOWN;
     if (IsRoot(requestor) && HasAnyChildren)
     {
         ret = BSPhysicsShapeType.SHAPE_COMPOUND;
     }
     // DetailLog("{0},BSLinksetCompound.PreferredPhysicalShape,call,shape={1}", LinksetRoot.LocalID, ret);
     return ret;
 }
开发者ID:justasabc,项目名称:opensim75grid,代码行数:12,代码来源:BSLinksetCompound.cs

示例8: BSLinkset

 public BSLinkset(BSScene scene, BSPhysObject parent)
 {
     // A simple linkset of one (no children)
     LinksetID = m_nextLinksetID++;
     // We create LOTS of linksets.
     if (m_nextLinksetID <= 0)
         m_nextLinksetID = 1;
     PhysicsScene = scene;
     LinksetRoot = parent;
     m_children = new List<BSPhysObject>();
     m_taintChildren = new List<BSPhysObject>();
     m_mass = parent.MassRaw;
 }
开发者ID:p07r0457,项目名称:opensim,代码行数:13,代码来源:BSLinkset.cs

示例9: Refresh

    // When physical properties are changed the linkset needs to recalculate
    //   its internal properties.
    // This is queued in the 'post taint' queue so the
    //   refresh will happen once after all the other taints are applied.
    public override void Refresh(BSPhysObject requestor)
    {
        base.Refresh(requestor);

        if (HasAnyChildren && IsRoot(requestor))
        {
            // Queue to happen after all the other taint processing
            PhysicsScene.PostTaintObject("BSLinksetContraints.Refresh", requestor.LocalID, delegate()
                {
                    if (HasAnyChildren && IsRoot(requestor))
                        RecomputeLinksetConstraints();
                });
        }
    }
开发者ID:justasabc,项目名称:opensim75grid,代码行数:18,代码来源:BSLinksetConstraints.cs

示例10: Factory

    // private static string LogHeader = "[BULLETSIM LINKSET]";

    // Create the correct type of linkset for this child
    public static BSLinkset Factory(BSScene physScene, BSPhysObject parent)
    {
        BSLinkset ret = null;
        /*
        if (parent.IsPhysical)
            ret = new BSLinksetConstraints(physScene, parent);
        else
            ret = new BSLinksetManual(physScene, parent);
         */

        // at the moment, there is only one
        ret = new BSLinksetConstraints(physScene, parent);

        return ret;
    }
开发者ID:CCIR,项目名称:opensim,代码行数:18,代码来源:BSLinkset.cs

示例11: Refresh

    // When physical properties are changed the linkset needs to recalculate
    //   its internal properties.
    // May be called at runtime or taint-time (just pass the appropriate flag).
    public override void Refresh(BSPhysObject requestor, bool inTaintTime)
    {
        // If there are no children or not root, I am not the one that recomputes the constraints
        if (!HasAnyChildren || !IsRoot(requestor))
            return;

        BSScene.TaintCallback refreshOperation = delegate()
            {
                RecomputeLinksetConstraintVariables();
                DetailLog("{0},BSLinkset.Refresh,complete,rBody={1}",
                                LinksetRoot.LocalID, LinksetRoot.BSBody.ptr.ToString("X"));
            };
        if (inTaintTime)
            refreshOperation();
        else
            PhysicsScene.TaintedObject("BSLinkSet.Refresh", refreshOperation);
    }
开发者ID:CCIR,项目名称:opensim,代码行数:20,代码来源:BSLinksetConstraints.cs

示例12: Factory

    // Create the correct type of linkset for this child
    public static BSLinkset Factory(BSScene physScene, BSPhysObject parent)
    {
        BSLinkset ret = null;

        switch ((int)BSParam.LinksetImplementation)
        {
            case (int)LinksetImplementation.Constraint:
                ret = new BSLinksetConstraints(physScene, parent);
                break;
            case (int)LinksetImplementation.Compound:
                ret = new BSLinksetCompound(physScene, parent);
                break;
            case (int)LinksetImplementation.Manual:
                // ret = new BSLinksetManual(physScene, parent);
                break;
            default:
                ret = new BSLinksetCompound(physScene, parent);
                break;
        }
        return ret;
    }
开发者ID:justasabc,项目名称:opensim75grid,代码行数:22,代码来源:BSLinkset.cs

示例13: IsRoot

 // Return 'true' if the passed object is the root object of this linkset
 public bool IsRoot(BSPhysObject requestor)
 {
     return (requestor.LocalID == LinksetRoot.LocalID);
 }
开发者ID:p07r0457,项目名称:opensim,代码行数:5,代码来源:BSLinkset.cs

示例14: RemoveMeFromLinkset

    // Remove a child from a linkset.
    // Returns a new linkset for the child which is a linkset of one (just the
    //    orphened child).
    // Called at runtime.
    public BSLinkset RemoveMeFromLinkset(BSPhysObject child)
    {
        lock (m_linksetActivityLock)
        {
            if (IsRoot(child))
            {
                // Cannot remove the root from a linkset.
                return this;
            }

            RemoveChildFromLinkset(child);
        }

        // The child is down to a linkset of just itself
        return new BSLinkset(PhysicsScene, child);
    }
开发者ID:p07r0457,项目名称:opensim,代码行数:20,代码来源:BSLinkset.cs

示例15: HasChild

 // Return 'true' if this child is in this linkset
 public bool HasChild(BSPhysObject child)
 {
     bool ret = false;
     lock (m_linksetActivityLock)
     {
         foreach (BSPhysObject bp in m_children)
         {
             if (child.LocalID == bp.LocalID)
             {
                 ret = true;
                 break;
             }
         }
     }
     return ret;
 }
开发者ID:p07r0457,项目名称:opensim,代码行数:17,代码来源:BSLinkset.cs


注:本文中的OpenSim.Region.Physics.BulletSPlugin.BSPhysObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。