예제 #1
0
        /// <summary>
        /// Creates a new polygon shape from world-space vertices.
        /// </summary>
        public VoltPolygon CreatePolygonWorldSpace(
            VoltVector2[] worldVertices, Fix64 density, Fix64 friction, Fix64 restitution)
        {
            VoltPolygon polygon = (VoltPolygon)this.polygonPool.Allocate();

            polygon.InitializeFromWorldVertices(
                worldVertices,
                density,
                friction,
                restitution);
            return(polygon);
        }
예제 #2
0
        /// <summary>
        /// Creates a new polygon shape from world-space vertices.
        /// </summary>
        public VoltPolygon CreatePolygonWorldSpace(
            TSVector2[] worldVertices,
            FP?density     = null,
            FP?friction    = null,
            FP?restitution = null)
        {
            VoltPolygon polygon = (VoltPolygon)this.polygonPool.Allocate();

            polygon.InitializeFromWorldVertices(
                worldVertices,
                density ?? VoltConfig.DEFAULT_DENSITY,
                friction ?? VoltConfig.DEFAULT_FRICTION,
                restitution ?? VoltConfig.DEFAULT_RESTITUTION);
            return(polygon);
        }
예제 #3
0
        /// <summary>
        /// Creates a new polygon shape from world-space vertices.
        /// </summary>
        public VoltPolygon CreatePolygonWorldSpace(
            Vector2[] worldVertices,
            float density     = VoltConfig.DEFAULT_DENSITY,
            float friction    = VoltConfig.DEFAULT_FRICTION,
            float restitution = VoltConfig.DEFAULT_RESTITUTION)
        {
            VoltPolygon polygon = (VoltPolygon)this.polygonPool.Allocate();

            polygon.InitializeFromWorldVertices(
                worldVertices,
                density,
                friction,
                restitution);
            return(polygon);
        }