Skip to main content

FabricBallSocketUtils

Joints a mesh of wedge parts together with BallSocketConstraint objects so it simulates as fabric. Sails, flags, capes, and banners are all rigged this way.

Wedges are jointed wherever their corners meet, so the fabric has to be built with its wedges lined up corner to corner. Parts that are not wedges are left alone.

FabricBallSocketUtils.create(sailModel)

Functions

create

FabricBallSocketUtils.create(adorneeInstance) → {BallSocketConstraint}--

One joint per pair of touching corners

Joints every wedge in the adornee to the wedges it shares corners with, and unanchors them, leaving the adornee free to simulate.

Show raw api
{
    "functions": [
        {
            "name": "create",
            "desc": "Joints every wedge in the adornee to the wedges it shares corners with, and unanchors them,\nleaving the adornee free to simulate.",
            "params": [
                {
                    "name": "adornee",
                    "desc": "",
                    "lua_type": "Instance"
                }
            ],
            "returns": [
                {
                    "desc": "One joint per pair of touching corners",
                    "lua_type": "{ BallSocketConstraint }"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 47,
                "path": "src/weldconstraintutils/src/Shared/FabricBallSocketUtils.lua"
            }
        },
        {
            "name": "_createCornerAttachments",
            "desc": "Creates an [Attachment] at each corner of the wedge. Every attachment is given the adornee's\norientation rather than its own part's, so the joint limits line up across the whole fabric.",
            "params": [
                {
                    "name": "part",
                    "desc": "",
                    "lua_type": "WedgePart"
                },
                {
                    "name": "boundingBoxCFrame",
                    "desc": "",
                    "lua_type": "CFrame"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ Attachment }"
                }
            ],
            "function_type": "static",
            "private": true,
            "source": {
                "line": 107,
                "path": "src/weldconstraintutils/src/Shared/FabricBallSocketUtils.lua"
            }
        },
        {
            "name": "_createBallSocket",
            "desc": "",
            "params": [
                {
                    "name": "attachment0",
                    "desc": "",
                    "lua_type": "Attachment"
                },
                {
                    "name": "attachment1",
                    "desc": "",
                    "lua_type": "Attachment"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "BallSocketConstraint"
                }
            ],
            "function_type": "static",
            "private": true,
            "source": {
                "line": 130,
                "path": "src/weldconstraintutils/src/Shared/FabricBallSocketUtils.lua"
            }
        },
        {
            "name": "_markJointed",
            "desc": "Records that the two parts are jointed together, so touching wedges only get one\n[NoCollisionConstraint] between them however many corners they share.",
            "params": [
                {
                    "name": "jointed",
                    "desc": "",
                    "lua_type": "{ [BasePart]: { [BasePart]: boolean } }"
                },
                {
                    "name": "part0",
                    "desc": "",
                    "lua_type": "BasePart"
                },
                {
                    "name": "part1",
                    "desc": "",
                    "lua_type": "BasePart"
                }
            ],
            "returns": [
                {
                    "desc": "True if this is the first joint between the two parts",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "private": true,
            "source": {
                "line": 153,
                "path": "src/weldconstraintutils/src/Shared/FabricBallSocketUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "FabricBallSocketUtils",
    "desc": "Joints a mesh of wedge parts together with [BallSocketConstraint] objects so it simulates as\nfabric. Sails, flags, capes, and banners are all rigged this way.\n\nWedges are jointed wherever their corners meet, so the fabric has to be built with its wedges\nlined up corner to corner. Parts that are not wedges are left alone.\n\n```lua\nFabricBallSocketUtils.create(sailModel)\n```",
    "source": {
        "line": 15,
        "path": "src/weldconstraintutils/src/Shared/FabricBallSocketUtils.lua"
    }
}