BEPUphysics.Vehicle.CylinderCastWheelShape.Initialize C# (CSharp) Метод

Initialize() защищенный Метод

Initializes the detector entity and any other necessary logic.
protected Initialize ( ) : void
Результат void
        protected internal override void Initialize()
        {
            //Setup the dimensions of the detector.
            var initialTransform = new RigidTransform { Orientation = LocalWheelOrientation };
            BoundingBox boundingBox;
            shape.GetBoundingBox(ref initialTransform, out boundingBox);
            var expansion = wheel.suspension.localDirection * wheel.suspension.restLength;
            if (expansion.X > 0)
                boundingBox.Max.X += expansion.X;
            else if (expansion.X < 0)
                boundingBox.Min.X += expansion.X;

            if (expansion.Y > 0)
                boundingBox.Max.Y += expansion.Y;
            else if (expansion.Y < 0)
                boundingBox.Min.Y += expansion.Y;

            if (expansion.Z > 0)
                boundingBox.Max.Z += expansion.Z;
            else if (expansion.Z < 0)
                boundingBox.Min.Z += expansion.Z;


            detector.Width = boundingBox.Max.X - boundingBox.Min.X;
            detector.Height = boundingBox.Max.Y - boundingBox.Min.Y;
            detector.Length = boundingBox.Max.Z - boundingBox.Min.Z;
        }