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


C# BSScene.TaintedObject方法代碼示例

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


在下文中一共展示了BSScene.TaintedObject方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: BSCharacter

    public BSCharacter(uint localID, String avName, BSScene parent_scene, Vector3 pos, Vector3 size, bool isFlying)
    {
        _localID = localID;
        _avName = avName;
        _scene = parent_scene;
        _position = pos;
        _size = size;
        _flying = isFlying;
        _orientation = Quaternion.Identity;
        _velocity = Vector3.Zero;
        _buoyancy = isFlying ? 1f : 0f;
        _scale = new Vector3(1f, 1f, 1f);
        _density = _scene.Params.avatarDensity;
        ComputeAvatarVolumeAndMass();   // set _avatarVolume and _mass based on capsule size, _density and _scale

        ShapeData shapeData = new ShapeData();
        shapeData.ID = _localID;
        shapeData.Type = ShapeData.PhysicsShapeType.SHAPE_AVATAR;
        shapeData.Position = _position;
        shapeData.Rotation = _orientation;
        shapeData.Velocity = _velocity;
        shapeData.Scale = _scale;
        shapeData.Mass = _mass;
        shapeData.Buoyancy = _buoyancy;
        shapeData.Static = ShapeData.numericFalse;
        shapeData.Friction = _scene.Params.avatarFriction;
        shapeData.Restitution = _scene.Params.defaultRestitution;

        // do actual create at taint time
        _scene.TaintedObject(delegate()
        {
            BulletSimAPI.CreateObject(parent_scene.WorldID, shapeData);
        });
            
        return;
    }
開發者ID:NovaGrid,項目名稱:opensim,代碼行數:36,代碼來源:BSCharacter.cs

示例2: BSPrim

 public BSPrim(ISceneChildEntity entity, bool isPhysical, BSScene parent_scene)
 {
     _parent_entity = entity;
     // m_log.DebugFormat("{0}: BSPrim creation of {1}, id={2}", LogHeader, primName, localID);
     _localID = _parent_entity.LocalId;
     _avName = _parent_entity.Name;
     _scene = parent_scene;
     _position = _parent_entity.AbsolutePosition;
     _size = _parent_entity.Scale;
     _scale = new OMV.Vector3(1f, 1f, 1f);   // the scale will be set by CreateGeom depending on object type
     _orientation = _parent_entity.Rotation;
     _buoyancy = 1f;
     _velocity = OMV.Vector3.Zero;
     _rotationalVelocity = OMV.Vector3.Zero;
     _angularVelocity = OMV.Vector3.Zero;
     _hullKey = 0;
     _pbs = _parent_entity.Shape;
     _isPhysical = isPhysical;
     _isVolumeDetect = _parent_entity.VolumeDetectActive;
     _subscribedEventsMs = 0;
     _parentPrim = null;
     _vehicle = new BSDynamics(this);
     _childrenPrims = new List<BSPrim>();
     if (_isPhysical)
         _mass = CalculateMass();
     else
         _mass = 0f;
     // do the actual object creation at taint time
     _scene.TaintedObject(delegate()
     {
         RecreateGeomAndObject();
     });
 }
開發者ID:kchi059,項目名稱:Aurora-Sim,代碼行數:33,代碼來源:BSPrim.cs

示例3: BSPrim

 public BSPrim(uint localID, String primName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size,
                    OMV.Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical)
 {
     // m_log.DebugFormat("{0}: BSPrim creation of {1}, id={2}", LogHeader, primName, localID);
     _localID = localID;
     _avName = primName;
     _scene = parent_scene;
     _position = pos;
     _size = size;
     _scale = new OMV.Vector3(1f, 1f, 1f);   // the scale will be set by CreateGeom depending on object type
     _orientation = rotation;
     _buoyancy = 1f;
     _velocity = OMV.Vector3.Zero;
     _rotationalVelocity = OMV.Vector3.Zero;
     _angularVelocity = OMV.Vector3.Zero;
     _hullKey = 0;
     _meshKey = 0;
     _pbs = pbs;
     _isPhysical = pisPhysical;
     _isVolumeDetect = false;
     _subscribedEventsMs = 0;
     _friction = _scene.Params.defaultFriction; // TODO: compute based on object material
     _density = _scene.Params.defaultDensity; // TODO: compute based on object material
     _restitution = _scene.Params.defaultRestitution;
     _parentPrim = null;     // not a child or a parent
     _vehicle = new BSDynamics(this);    // add vehicleness
     _childrenPrims = new List<BSPrim>();
     if (_isPhysical)
         _mass = CalculateMass();
     else
         _mass = 0f;
     // do the actual object creation at taint time
     _scene.TaintedObject(delegate()
     {
         RecreateGeomAndObject();
     });
 }
開發者ID:NovaGrid,項目名稱:opensim,代碼行數:37,代碼來源:BSPrim.cs

示例4: BSCharacter

        public BSCharacter(uint localID, UUID avID, String avName, BSScene parent_scene, Vector3 pos,
                           Quaternion rotation, Vector3 size, bool isFlying)
        {
            _localID = localID;
            _avID = avID;
            _avName = avName;
            _scene = parent_scene;
            _position = pos;
            _orientation = rotation;
            _size = size;
            _orientation = Quaternion.Identity;
            _velocity = Vector3.Zero;
            _scale = new Vector3(1f, 1f, 1f);
            float AVvolume =
                (float) (Math.PI*Math.Pow(_scene.Params.avatarCapsuleRadius, 2)*_scene.Params.avatarCapsuleHeight);
            _density = _scene.Params.avatarDensity;
            _mass = _density*AVvolume;
            _isPhysical = true;

            ShapeData shapeData = new ShapeData
                                      {
                                          ID = _localID,
                                          Type = ShapeData.PhysicsShapeType.SHAPE_AVATAR,
                                          Position = _position,
                                          Rotation = _orientation,
                                          Velocity = _velocity,
                                          Scale = _scale,
                                          Mass = _mass,
                                          Buoyancy = isFlying ? 1f : 0f,
                                          Static = ShapeData.numericFalse,
                                          Friction = _scene.Params.avatarFriction,
                                          Restitution = _scene.Params.defaultRestitution
                                      };

            // do actual create at taint time
            _scene.TaintedObject(() => BulletSimAPI.CreateObject(parent_scene.WorldID, shapeData));

            return;
        }
開發者ID:nathanmarck,項目名稱:Aurora-Sim,代碼行數:39,代碼來源:BSCharacter.cs


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