コード例 #1
0
        protected void RebuildJoint()
        {
            VerifyAccess();

            if (IsInitialised)
            {
                if (_initialising > 0)
                {
                    _needsRebuild = true;
                }
                else
                {
                    _joint.Dispose();
                    _isInitialised = false;

                    _joint = OnInitialise();
                    if (_joint != null)
                    {
                        _isInitialised = true;
                    }

                    _needsRebuild = false;
                }
            }
        }
コード例 #2
0
        public CTire(CJoint pVehicle, IntPtr pHandle)
        {
            m_Vehicle = pVehicle;
            m_Handle  = pHandle;

            CHashTables.Tire.Add(m_Handle, this);
        }
コード例 #3
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_joint != null)
                {
                    if (_isInitialised)
                    {
                        _joint.UserData = null;
                        _joint.Dispose();

                        _isInitialised = false;
                    }
                    _joint = null;
                }
            }
        }
コード例 #4
0
        public void Initialise(World world, Body parent, Body child)
        {
            if (_isInitialised)
            {
                return;
            }

            VerifyAccess();

            if (world == null)
            {
                throw new ArgumentNullException("world");
            }
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }
            parent.VerifyInitialised("Parent");
            if (child == null)
            {
                throw new ArgumentNullException("child");
            }
            child.VerifyInitialised("Child");

            _world      = world;
            _parentBody = parent;
            _childBody  = child;

            _joint = OnInitialise();
            if (_joint != null)
            {
                _joint.CollisionState = (int)(CollisionState)this.CollisionState;

                if (this.Stiffness != null)
                {
                    _joint.Stiffness = (float)this.Stiffness;
                }

                _isInitialised = true;
                AfterInitialise();
            }
        }