Пример #1
0
        public WhiteCoreODECharacter(String avName, WhiteCoreODEPhysicsScene parent_scene, Vector3 pos, Quaternion rotation,
                                     Vector3 size)
        {
            m_uuid        = UUID.Random();
            _parent_scene = parent_scene;

            m_taintRotation = rotation;

            if (pos.IsFinite())
            {
                if (pos.Z > 9999999f || pos.Z < -90f)
                {
                    pos.Z =
                        _parent_scene.GetTerrainHeightAtXY(_parent_scene.Region.RegionSizeX * 0.5f,
                                                           _parent_scene.Region.RegionSizeY * 0.5f) + 5.0f;
                }
                _position = pos;
            }
            else
            {
                _position.X = _parent_scene.Region.RegionSizeX * 0.5f;
                _position.Y = _parent_scene.Region.RegionSizeY * 0.5f;
                _position.Z = _parent_scene.GetTerrainHeightAtXY(_position.X, _position.Y) + 10f;

                MainConsole.Instance.Warn("[PHYSICS]: Got NaN Position on Character Create");
            }


            m_isPhysical = false; // current status: no ODE information exists
            Size         = size;
            Name         = avName;
        }
        public WhiteCoreODERayCastRequestManager(WhiteCoreODEPhysicsScene pScene)
        {
            m_scene      = pScene;
            nearCallback = near;

            ContactgeomsArray = Marshal.AllocHGlobal(contactsPerCollision * d.ContactGeom.unmanagedSizeOf);
        }
 /// <summary>
 ///     Dereference the creator scene so that it can be garbage collected if needed.
 /// </summary>
 internal void Dispose()
 {
     m_scene = null;
     if (ContactgeomsArray != IntPtr.Zero)
     {
         Marshal.FreeHGlobal(ContactgeomsArray);
     }
 }
Пример #4
0
        public PhysicsScene GetScene()
        {
            lock (m_lock)
            {
                if (_mScene == null)
                {
                    if (!m_initialized) //Only initialize ode once!
                    {
                        // Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to
                        // http://opensimulator.org/mantis/view.php?id=2750).
                        d.InitODE();
                        m_initialized = true;
                    }

                    _mScene = new WhiteCoreODEPhysicsScene();
                }
            }

            return(_mScene);
        }
Пример #5
0
 public ODESpecificAvatar(String avName, WhiteCoreODEPhysicsScene parent_scene, Vector3 pos, Quaternion rotation,
                          Vector3 size) : base(avName, parent_scene, pos, rotation, size)
 {
     base._parent_ref = this;
 }