當前位置: 首頁>>代碼示例>>C#>>正文


C# BulletSPlugin.BSScene類代碼示例

本文整理匯總了C#中OpenSim.Region.Physics.BulletSPlugin.BSScene的典型用法代碼示例。如果您正苦於以下問題:C# BSScene類的具體用法?C# BSScene怎麽用?C# BSScene使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BSScene類屬於OpenSim.Region.Physics.BulletSPlugin命名空間,在下文中一共展示了BSScene類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: BSPrim

    public BSPrim(uint localID, String primName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size,
                       OMV.Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical)
            : base(parent_scene, localID, primName, "BSPrim")
    {
        // m_log.DebugFormat("{0}: BSPrim creation of {1}, id={2}", LogHeader, primName, localID);
        _physicsActorType = (int)ActorTypes.Prim;
        _position = pos;
        _size = size;
        Scale = size;   // prims are the size the user wants them to be (different for BSCharactes).
        _orientation = rotation;
        _buoyancy = 0f;
        RawVelocity = OMV.Vector3.Zero;
        _rotationalVelocity = OMV.Vector3.Zero;
        BaseShape = pbs;
        _isPhysical = pisPhysical;
        _isVolumeDetect = false;

        // We keep a handle to the vehicle actor so we can set vehicle parameters later.
        VehicleActor = new BSDynamics(PhysScene, this, VehicleActorName);
        PhysicalActors.Add(VehicleActorName, VehicleActor);

        _mass = CalculateMass();

        // DetailLog("{0},BSPrim.constructor,call", LocalID);
        // do the actual object creation at taint time
        PhysScene.TaintedObject("BSPrim.create", delegate()
        {
            // Make sure the object is being created with some sanity.
            ExtremeSanityCheck(true /* inTaintTime */);

            CreateGeomAndObject(true);

            CurrentCollisionFlags = PhysScene.PE.GetCollisionFlags(PhysBody);
        });
    }
開發者ID:hippie-b,項目名稱:opensim,代碼行數:35,代碼來源:BSPrim.cs

示例2: 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

示例3: BSPhysObject

    protected BSPhysObject(BSScene parentScene, uint localID, string name, string typeName)
    {
        PhysicsScene = parentScene;
        LocalID = localID;
        PhysObjectName = name;
        Name = name;    // PhysicsActor also has the name of the object. Someday consolidate.
        TypeName = typeName;

        // Initialize variables kept in base.
        GravModifier = 1.0f;
        Gravity = new OMV.Vector3(0f, 0f, BSParam.Gravity);

        // We don't have any physical representation yet.
        PhysBody = new BulletBody(localID);
        PhysShape = new BulletShape();

        LastAssetBuildFailed = false;

        // Default material type. Also sets Friction, Restitution and Density.
        SetMaterial((int)MaterialAttributes.Material.Wood);

        CollisionCollection = new CollisionEventUpdate();
        CollisionsLastTick = CollisionCollection;
        SubscribedEventsMs = 0;
        CollidingStep = 0;
        CollidingGroundStep = 0;
        CollisionAccumulation = 0;
        ColliderIsMoving = false;
        CollisionScore = 0;

        // All axis free.
        LockedAxis = LockedAxisFree;
    }
開發者ID:rryk,項目名稱:omp-server,代碼行數:33,代碼來源:BSPhysObject.cs

示例4: Factory

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

        switch (parent.LinksetType)
        {
            case LinksetImplementation.Constraint:
                ret = new BSLinksetConstraints(physScene, parent);
                break;
            case LinksetImplementation.Compound:
                ret = new BSLinksetCompound(physScene, parent);
                break;
            case LinksetImplementation.Manual:
                // ret = new BSLinksetManual(physScene, parent);
                break;
            default:
                ret = new BSLinksetCompound(physScene, parent);
                break;
        }
        if (ret == null)
        {
            physScene.Logger.ErrorFormat("[BULLETSIM LINKSET] Factory could not create linkset. Parent name={1}, ID={2}", parent.Name, parent.LocalID);
        }
        return ret;
    }
開發者ID:BogusCurry,項目名稱:arribasim-dev,代碼行數:26,代碼來源:BSLinkset.cs

示例5: 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

示例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;
     HaveRegisteredForBeforeStepCallback = false;
 }
開發者ID:Kubwa,項目名稱:opensim,代碼行數:7,代碼來源:BSActorLockAxis.cs

示例7: 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

示例8: GetScene

 public PhysicsScene GetScene(String sceneIdentifier)
 {
     if (_mScene == null)
     {
         _mScene = new BSScene(GetName(), sceneIdentifier);
     }
     return (_mScene);
 }
開發者ID:szielins,項目名稱:opensim,代碼行數:8,代碼來源:BSPlugin.cs

示例9: BSShapeCollection

 public BSShapeCollection(BSScene physScene)
 {
     PhysicsScene = physScene;
     // Set the next to 'true' for very detailed shape update detailed logging (detailed details?)
     // While detailed debugging is still active, this is better than commenting out all the
     //     DetailLog statements. When debugging slows down, this and the protected logging
     //     statements can be commented/removed.
     DDetail = true;
 }
開發者ID:BogusCurry,項目名稱:WhiteCore-Dev,代碼行數:9,代碼來源:BSShapeCollection.cs

示例10: ApplyCollisionMask

 // Apply the specificed collision mask into the physical world
 public virtual bool ApplyCollisionMask(BSScene physicsScene)
 {
     // Should assert the body has been added to the physical world.
     // (The collision masks are stored in the collision proxy cache which only exists for
     //    a collision body that is in the world.)
     return physicsScene.PE.SetCollisionGroupMask(this,
                             BulletSimData.CollisionTypeMasks[collisionType].group,
                             BulletSimData.CollisionTypeMasks[collisionType].mask);
 }
開發者ID:AkiraSonoda,項目名稱:akisim,代碼行數:10,代碼來源:BulletSimData.cs

示例11: 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

示例12: GetScene

    public PhysicsScene GetScene(String sceneIdentifier)
    {
        if (_mScene == null)
        {
            if (Util.IsWindows())
                Util.LoadArchSpecificWindowsDll("BulletSim.dll");

            _mScene = new BSScene(sceneIdentifier);
        }
        return (_mScene);
    }
開發者ID:JAllard,項目名稱:opensim,代碼行數:11,代碼來源:BSPlugin.cs

示例13: BSPrimLinkable

    public BSPrimLinkable(uint localID, String primName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size,
                       OMV.Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical)
        : base(localID, primName, parent_scene, pos, size, rotation, pbs, pisPhysical)
    {
        // Default linkset implementation for this prim
        LinksetType = (BSLinkset.LinksetImplementation)BSParam.LinksetImplementation;

        Linkset = BSLinkset.Factory(PhysScene, this);

        Linkset.Refresh(this);
    }
開發者ID:AkiraSonoda,項目名稱:akisim,代碼行數:11,代碼來源:BSPrimLinkable.cs

示例14: BSPrimLinkable

    public BSPrimLinkable(uint localID, String primName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size,
                       OMV.Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical)
        : base(localID, primName, parent_scene, pos, size, rotation, pbs, pisPhysical)
    {
        Linkset = BSLinkset.Factory(PhysScene, this);

        PhysScene.TaintedObject("BSPrimLinksetCompound.Refresh", delegate()
        {
            Linkset.Refresh(this);
        });
    }
開發者ID:hippie-b,項目名稱:opensim,代碼行數:11,代碼來源:BSPrimLinkable.cs

示例15: BSAPIUnman

        public BSAPIUnman(string paramName, BSScene physScene)
        {
            PhysicsScene = physScene;

            // Do something fancy with the paramName to get the right DLL implementation
            //     like "Bullet-2.80-OpenCL-Intel" loading the version for Intel based OpenCL implementation, etc.
            if (Util.IsWindows())
            Util.LoadArchSpecificWindowsDll("BulletSim.dll");
            // If not Windows, loading is performed by the
            // Mono loader as specified in
            // "bin/Physics/OpenSim.Region.Physics.BulletSPlugin.dll.config".
        }
開發者ID:KSLcom,項目名稱:Aurora-Sim,代碼行數:12,代碼來源:BSAPIUnman.cs


注:本文中的OpenSim.Region.Physics.BulletSPlugin.BSScene類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。