public void SetPhysicsPart(Pax4ObjectPhysicsPart p_physicsPart)
        {
            if (p_physicsPart == null)
            {
                return;
            }

            _physicsPart = p_physicsPart;

            _physicsPart.AddConstraint(this);
        }
Beispiel #2
0
        public void SetPhysicsPart(Pax4ObjectPhysicsPart p_physicsPart, int p_wayPointIndex = 0)
        {
            if (p_physicsPart == null)
            {
                return;
            }

            p_physicsPart.DisableConstraint();

            _physicsPart = p_physicsPart;

            _physicsPart.AddConstraint(this);

            if (_wayPointPath == null)
            {
                return;
            }

            _wayPointIndex   = p_wayPointIndex;
            _worldHeading    = _wayPointPath._wayPoint[_wayPointIndex] - _physicsPart._body.Position;
            _currentDistance = _worldHeading.Length();
        }