Skip to main content

BoneTree

Internal class for all bone trees

Caution:

Changes to the syntax in this class will not count to the major version in semver.

Properties

WindOffset

This item is read only and cannot be modified. Read Only
BoneTree.WindOffset: number

Used in wind calculations so each bone tree has a different solution.

Root

This item is read only and cannot be modified. Read Only
BoneTree.Root: Bone

Root bone of the bone tree

RootPart

This item is read only and cannot be modified. Read Only
BoneTree.RootPart: BasePart

RootPartSize

This item is read only and cannot be modified. Read Only
BoneTree.RootPartSize: Vector3

Constant value of the root parts size at the start of the simulation

Bones

BoneTree.Bones: table

Settings

BoneTree.Settings: {}

UpdateRate

This item is read only and cannot be modified. Read Only
BoneTree.UpdateRate: number

Throttled update rate

InView

This item is read only and cannot be modified. Read Only
BoneTree.InView: boolean

BoundingBoxCFrame

This item is read only and cannot be modified. Read Only
BoneTree.BoundingBoxCFrame: CFrame

BoundingBoxSize

This item is read only and cannot be modified. Read Only
BoneTree.BoundingBoxSize: Size

AccumulatedDelta

This item is read only and cannot be modified. Read Only
BoneTree.AccumulatedDelta: number

Used in the runtime

Destroyed

This item is read only and cannot be modified. Read Only
BoneTree.Destroyed: boolean

True if the root part has been destroyed

IsSkippingUpdates

This item is read only and cannot be modified. Read Only
BoneTree.IsSkippingUpdates: boolean

True if the bone tree is currently skipping updates

InWorkspace

This item is read only and cannot be modified. Read Only
BoneTree.InWorkspace: boolean

Boolean describing if the rootpart is a descendant of workspace

Force

This item is read only and cannot be modified. Read Only
BoneTree.Force: Vector3

ObjectMove

BoneTree.ObjectMove: Vector3

Difference between root parts last position and current position

ObjectVelocity

BoneTree.ObjectVelocity: Vector3

Velocity at which the root part is traveling at, calculated via object move.

ObjectPreviousPosition

BoneTree.ObjectPreviousPosition: Vector3

Root parts previous position

Functions

new

BoneTree.new(
RootBoneBone,
RootPartBasePart
) → BoneTree

UpdateBoundingBox

BoneTree:UpdateBoundingBox() → ()

Called in BoneTree:PreUpdate(), Computes the bounding box of all the bones

UpdateThrottling

BoneTree:UpdateThrottling(
RootPositionVector3--

Position of the root part (Micro Optimization)

) → ()

Called in BoneTree:PreUpdate()

PreUpdate

BoneTree:PreUpdate(
Deltanumber--

Δt

) → ()

Calculates object move, gravity and throttled update rate. Also calls Bone:PreUpdate()

StepPhysics

BoneTree:StepPhysics(
Deltanumber--

Δt

) → ()

Calculates forces and updates wind. Also calls Bone:StepPhysics()

Constrain

BoneTree:Constrain(
ColliderObjectstable,
Deltanumber--

Δt

) → ()

SkipUpdate

BoneTree:SkipUpdate() → ()

Resets all bones to their rest positions.

SolveTransform

BoneTree:SolveTransform(
Deltanumber--

Δt

) → ()

ApplyTransform

BoneTree:ApplyTransform() → ()

Applys all the transforms to bones in serial context.

DrawDebug

This item only works when running on the client. Client
BoneTree:DrawDebug(
DRAW_CONTACTSboolean,
DRAW_PHYSICAL_BONEboolean,
DRAW_BONEboolean,
DRAW_AXIS_LIMITSboolean,
DRAW_ROOT_PARTboolean,
DRAW_BOUNDING_BOXboolean,
DRAW_ROTATION_LIMITSboolean,
DRAW_ACCELERATION_INFOboolean
) → ()
Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "",
            "params": [
                {
                    "name": "RootBone",
                    "desc": "",
                    "lua_type": "Bone"
                },
                {
                    "name": "RootPart",
                    "desc": "",
                    "lua_type": "BasePart"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "BoneTree"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 170,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "UpdateBoundingBox",
            "desc": "Called in BoneTree:PreUpdate(),\nComputes the bounding box of all the bones\r",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 217,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "UpdateThrottling",
            "desc": "Called in BoneTree:PreUpdate()\r",
            "params": [
                {
                    "name": "RootPosition",
                    "desc": "Position of the root part (Micro Optimization)",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 254,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "PreUpdate",
            "desc": "Calculates object move, gravity and throttled update rate. Also calls Bone:PreUpdate()\r",
            "params": [
                {
                    "name": "Delta",
                    "desc": "Δt",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 275,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "StepPhysics",
            "desc": "Calculates forces and updates wind. Also calls Bone:StepPhysics()\r",
            "params": [
                {
                    "name": "Delta",
                    "desc": "Δt",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 300,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "Constrain",
            "desc": "",
            "params": [
                {
                    "name": "ColliderObjects",
                    "desc": "",
                    "lua_type": "table"
                },
                {
                    "name": "Delta",
                    "desc": "Δt",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 330,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "SkipUpdate",
            "desc": "Resets all bones to their rest positions.\r",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 340,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "SolveTransform",
            "desc": "",
            "params": [
                {
                    "name": "Delta",
                    "desc": "Δt",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 352,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "ApplyTransform",
            "desc": "Applys all the transforms to bones in serial context.\r",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 364,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "DrawDebug",
            "desc": "",
            "params": [
                {
                    "name": "DRAW_CONTACTS",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "DRAW_PHYSICAL_BONE",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "DRAW_BONE",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "DRAW_AXIS_LIMITS",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "DRAW_ROOT_PART",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "DRAW_BOUNDING_BOX",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "DRAW_ROTATION_LIMITS",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "DRAW_ACCELERATION_INFO",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "method",
            "realm": [
                "Client"
            ],
            "source": {
                "line": 382,
                "path": "src/Components/BoneTree.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "WindOffset",
            "desc": "Used in wind calculations so each bone tree has a different solution.\r",
            "lua_type": "number",
            "readonly": true,
            "source": {
                "line": 89,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "Root",
            "desc": "Root bone of the bone tree\r",
            "lua_type": "Bone",
            "readonly": true,
            "source": {
                "line": 94,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "RootPart",
            "desc": "",
            "lua_type": "BasePart",
            "readonly": true,
            "source": {
                "line": 98,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "RootPartSize",
            "desc": "Constant value of the root parts size at the start of the simulation\r",
            "lua_type": "Vector3",
            "readonly": true,
            "source": {
                "line": 103,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "Bones",
            "desc": "",
            "lua_type": "table",
            "source": {
                "line": 106,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "Settings",
            "desc": "",
            "lua_type": "{}",
            "source": {
                "line": 109,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "UpdateRate",
            "desc": "Throttled update rate\r",
            "lua_type": "number",
            "readonly": true,
            "source": {
                "line": 114,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "InView",
            "desc": "",
            "lua_type": "boolean",
            "readonly": true,
            "source": {
                "line": 118,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "BoundingBoxCFrame",
            "desc": "",
            "lua_type": "CFrame",
            "readonly": true,
            "source": {
                "line": 122,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "BoundingBoxSize",
            "desc": "",
            "lua_type": "Size",
            "readonly": true,
            "source": {
                "line": 126,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "AccumulatedDelta",
            "desc": "Used in the runtime\r",
            "lua_type": "number",
            "readonly": true,
            "source": {
                "line": 131,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "Destroyed",
            "desc": "True if the root part has been destroyed\r",
            "lua_type": "boolean",
            "readonly": true,
            "source": {
                "line": 136,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "IsSkippingUpdates",
            "desc": "True if the bone tree is currently skipping updates\r",
            "lua_type": "boolean",
            "readonly": true,
            "source": {
                "line": 141,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "InWorkspace",
            "desc": "Boolean describing if the rootpart is a descendant of workspace\r",
            "lua_type": "boolean",
            "readonly": true,
            "source": {
                "line": 146,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "Force",
            "desc": "",
            "lua_type": "Vector3",
            "readonly": true,
            "source": {
                "line": 150,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "ObjectMove",
            "desc": "Difference between root parts last position and current position\r",
            "lua_type": "Vector3",
            "source": {
                "line": 154,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "ObjectVelocity",
            "desc": "Velocity at which the root part is traveling at, calculated via object move.\r",
            "lua_type": "Vector3",
            "source": {
                "line": 158,
                "path": "src/Components/BoneTree.lua"
            }
        },
        {
            "name": "ObjectPreviousPosition",
            "desc": "Root parts previous position\r",
            "lua_type": "Vector3",
            "source": {
                "line": 162,
                "path": "src/Components/BoneTree.lua"
            }
        }
    ],
    "types": [],
    "name": "BoneTree",
    "desc": "Internal class for all bone trees\n:::caution Caution:\nChanges to the syntax in this class will not count to the major version in semver.\n:::\r",
    "source": {
        "line": 84,
        "path": "src/Components/BoneTree.lua"
    }
}