Beispiel #1
0
        /// <summary>
        /// Creates a new polygon shape from body-space vertices.
        /// </summary>
        public VoltPolygon CreatePolygonBodySpace(
            VoltVector2[] bodyVertices, Fix64 density, Fix64 friction, Fix64 restitution)
        {
            VoltPolygon polygon = (VoltPolygon)this.polygonPool.Allocate();

            polygon.InitializeFromBodyVertices(
                bodyVertices,
                density,
                friction,
                restitution);
            return(polygon);
        }
Beispiel #2
0
        /// <summary>
        /// Creates a new polygon shape from body-space vertices.
        /// </summary>
        public VoltPolygon CreatePolygonBodySpace(
            TSVector2[] bodyVertices,
            FP?density     = null,
            FP?friction    = null,
            FP?restitution = null)
        {
            VoltPolygon polygon = (VoltPolygon)this.polygonPool.Allocate();

            polygon.InitializeFromBodyVertices(
                bodyVertices,
                density ?? VoltConfig.DEFAULT_DENSITY,
                friction ?? VoltConfig.DEFAULT_FRICTION,
                restitution ?? VoltConfig.DEFAULT_RESTITUTION);
            return(polygon);
        }
Beispiel #3
0
        /// <summary>
        /// Creates a new polygon shape from body-space vertices.
        /// </summary>
        public VoltPolygon CreatePolygonBodySpace(
            Vector2[] bodyVertices,
            float density     = VoltConfig.DEFAULT_DENSITY,
            float friction    = VoltConfig.DEFAULT_FRICTION,
            float restitution = VoltConfig.DEFAULT_RESTITUTION)
        {
            VoltPolygon polygon = (VoltPolygon)this.polygonPool.Allocate();

            polygon.InitializeFromBodyVertices(
                bodyVertices,
                density,
                friction,
                restitution);
            return(polygon);
        }