Skip to main content

SixDOFBuilder

Sub-builder for 6DOF aerodynamic physics configuration. Opened via BehaviorBuilder:SixDOF. Call :Done() to return to the root BehaviorBuilder.

BulletMass required

When 6DOF is enabled, BulletMass must be set via :Physics():BulletMass(). :Build() returns nil if it is zero or unset, mass is required to convert aerodynamic force vectors into accelerations.

Functions​

Enabled​

SixDOFBuilder:Enabled(value: boolean) → SixDOFBuilder

Enables or disables the 6DOF aerodynamics system for this cast. When false (the default), no 6DOF code runs and all other fields are ignored.

Default: false

LiftCoefficientSlope​

SixDOFBuilder:LiftCoefficientSlope(value: number) → SixDOFBuilder

dCL/dalpha, lift coefficient slope. Scales aerodynamic lift with angle of attack. Typical range: 1.0,4.0. 0 disables lift.

Default: 0

PitchingMomentSlope​

SixDOFBuilder:PitchingMomentSlope(value: number) → SixDOFBuilder

dCm/dalpha, pitching moment slope. Negative values produce a statically stable restoring torque (the bullet noses back toward velocity). Zero = neutrally stable. Typical range: -1.0 to -0.1.

Default: 0

PitchDampingCoeff​

SixDOFBuilder:PitchDampingCoeff(value: number) → SixDOFBuilder

Cmq, pitch/yaw damping coefficient. Damps wobble and coning motion. Typical range: 0.005,0.05. 0 = no damping.

Default: 0

RollDampingCoeff​

SixDOFBuilder:RollDampingCoeff(value: number) → SixDOFBuilder

Clp, roll damping coefficient. Controls how quickly axial spin decays. Typical range: 0.001,0.02. 0 = no spin decay.

Default: 0

AoADragFactor​

SixDOFBuilder:AoADragFactor(value: number) → SixDOFBuilder

sin^2alpha drag multiplier. Adds extra drag proportional to angle of attack squared. 3.0 triples drag at 90 deg AoA. 0 = no AoA-dependent drag.

Default: 0

ReferenceArea​

SixDOFBuilder:ReferenceArea(value: number) → SixDOFBuilder

Reference cross-sectional area in studs^2. Scales all aerodynamic forces. Typical value for a rifle bullet: 0.005,0.02.

Default: 0

ReferenceLength​

SixDOFBuilder:ReferenceLength(value: number) → SixDOFBuilder

Reference length (caliber) in studs. Used for pitching moment and damping torques. Typical value for a rifle bullet: 0.03,0.1.

Default: 0

AirDensity​

SixDOFBuilder:AirDensity(value: number) → SixDOFBuilder

Air density in kg/m^3. Scales all aerodynamic forces. Use lower values for high-altitude simulation.

Default: 1.225 (sea level)

MomentOfInertia​

SixDOFBuilder:MomentOfInertia(value: number) → SixDOFBuilder

Transverse moment of inertia. Governs pitch/yaw angular acceleration from aerodynamic torques. Typical value for a rifle bullet: 0.0005,0.005.

Default: 0

SpinMOI​

SixDOFBuilder:SpinMOI(value: number) → SixDOFBuilder

Axial (spin) moment of inertia. Required for gyroscopic precession. Typical value for a rifle bullet: 0.0001,0.001. 0 disables precession.

Default: 0

MaxAngularSpeed​

SixDOFBuilder:MaxAngularSpeed(value: number) → SixDOFBuilder

Angular speed ceiling in rad/s. Clamps the angular velocity magnitude each step to prevent divergence under extreme torques.

Default: ~628 rad/s (~=6000 RPM)

InitialOrientation​

SixDOFBuilder:InitialOrientation(value: CFrame?) → SixDOFBuilder

Initial body-frame orientation as a CFrame. When nil, the orientation is seeded from a velocity look-at at fire time.

Default: nil

InitialAngularVelocity​

SixDOFBuilder:InitialAngularVelocity(value: Vector3?) → SixDOFBuilder

Initial angular velocity in rad/s (world frame). When nil, seeded from the Magnus SpinVector if one is set, otherwise zero.

Default: nil

CLAlphaMachTable​

SixDOFBuilder:CLAlphaMachTable(value: {{number}}) → SixDOFBuilder

Mach-indexed CLalpha table. Overrides SixDOFBuilder:LiftCoefficientSlope when set. Useful for transonic/supersonic lift drop-off modelling.

Table format: { {mach, cl_alpha}, ... } sorted ascending by Mach number.

Default: nil (flat scalar used)

CmAlphaMachTable​

SixDOFBuilder:CmAlphaMachTable(value: {{number}}) → SixDOFBuilder

Mach-indexed Cmalpha table. Overrides SixDOFBuilder:PitchingMomentSlope when set. Useful for modelling reduced static stability at transonic speeds.

Table format: { {mach, cm_alpha}, ... } sorted ascending by Mach number.

Default: nil (flat scalar used)

CmqMachTable​

SixDOFBuilder:CmqMachTable(value: {{number}}) → SixDOFBuilder

Mach-indexed Cmq table. Overrides SixDOFBuilder:PitchDampingCoeff when set. Allows pitch/yaw damping to vary with Mach number.

Table format: { {mach, cmq}, ... } sorted ascending by Mach number.

Default: nil (flat scalar used)

ClpMachTable​

SixDOFBuilder:ClpMachTable(value: {{number}}) → SixDOFBuilder

Mach-indexed Clp table. Overrides SixDOFBuilder:RollDampingCoeff when set. Allows spin-decay rate to vary with Mach number.

Table format: { {mach, clp}, ... } sorted ascending by Mach number.

Default: nil (flat scalar used)

Done​

SixDOFBuilder:Done() → BehaviorBuilder

Returns the root BehaviorBuilder.

Show raw api
{
    "functions": [
        {
            "name": "Enabled",
            "desc": "Enables or disables the 6DOF aerodynamics system for this cast.\nWhen `false` (the default), no 6DOF code runs and all other fields are ignored.\n\nDefault: `false`",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1049,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "LiftCoefficientSlope",
            "desc": "dCL/dalpha, lift coefficient slope. Scales aerodynamic lift with angle of attack.\nTypical range: `1.0`,`4.0`. `0` disables lift.\n\nDefault: `0`",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1060,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "PitchingMomentSlope",
            "desc": "dCm/dalpha, pitching moment slope. Negative values produce a statically stable\nrestoring torque (the bullet noses back toward velocity). Zero = neutrally stable.\nTypical range: `-1.0` to `-0.1`.\n\nDefault: `0`",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1072,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "PitchDampingCoeff",
            "desc": "Cmq, pitch/yaw damping coefficient. Damps wobble and coning motion.\nTypical range: `0.005`,`0.05`. `0` = no damping.\n\nDefault: `0`",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1083,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "RollDampingCoeff",
            "desc": "Clp, roll damping coefficient. Controls how quickly axial spin decays.\nTypical range: `0.001`,`0.02`. `0` = no spin decay.\n\nDefault: `0`",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1094,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "AoADragFactor",
            "desc": "sin^2alpha drag multiplier. Adds extra drag proportional to angle of attack squared.\n`3.0` triples drag at 90 deg AoA. `0` = no AoA-dependent drag.\n\nDefault: `0`",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1105,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "ReferenceArea",
            "desc": "Reference cross-sectional area in studs^2. Scales all aerodynamic forces.\nTypical value for a rifle bullet: `0.005`,`0.02`.\n\nDefault: `0`",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1116,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "ReferenceLength",
            "desc": "Reference length (caliber) in studs. Used for pitching moment and damping torques.\nTypical value for a rifle bullet: `0.03`,`0.1`.\n\nDefault: `0`",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1127,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "AirDensity",
            "desc": "Air density in kg/m^3. Scales all aerodynamic forces.\nUse lower values for high-altitude simulation.\n\nDefault: `1.225` (sea level)",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1138,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "MomentOfInertia",
            "desc": "Transverse moment of inertia. Governs pitch/yaw angular acceleration from aerodynamic torques.\nTypical value for a rifle bullet: `0.0005`,`0.005`.\n\nDefault: `0`",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1149,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "SpinMOI",
            "desc": "Axial (spin) moment of inertia. Required for gyroscopic precession.\nTypical value for a rifle bullet: `0.0001`,`0.001`. `0` disables precession.\n\nDefault: `0`",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1160,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "MaxAngularSpeed",
            "desc": "Angular speed ceiling in rad/s. Clamps the angular velocity magnitude each step\nto prevent divergence under extreme torques.\n\nDefault: `~628` rad/s (~=6000 RPM)",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1171,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "InitialOrientation",
            "desc": "Initial body-frame orientation as a `CFrame`. When `nil`, the orientation is\nseeded from a velocity look-at at fire time.\n\nDefault: `nil`",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "CFrame?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1182,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "InitialAngularVelocity",
            "desc": "Initial angular velocity in rad/s (world frame). When `nil`, seeded from the\nMagnus `SpinVector` if one is set, otherwise zero.\n\nDefault: `nil`",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "Vector3?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1193,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "CLAlphaMachTable",
            "desc": "Mach-indexed CLalpha table. Overrides [SixDOFBuilder:LiftCoefficientSlope] when set.\nUseful for transonic/supersonic lift drop-off modelling.\n\nTable format: `{ {mach, cl_alpha}, ... }` sorted ascending by Mach number.\n\nDefault: `nil` (flat scalar used)",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "{{number}}"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1206,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "CmAlphaMachTable",
            "desc": "Mach-indexed Cmalpha table. Overrides [SixDOFBuilder:PitchingMomentSlope] when set.\nUseful for modelling reduced static stability at transonic speeds.\n\nTable format: `{ {mach, cm_alpha}, ... }` sorted ascending by Mach number.\n\nDefault: `nil` (flat scalar used)",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "{{number}}"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1219,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "CmqMachTable",
            "desc": "Mach-indexed Cmq table. Overrides [SixDOFBuilder:PitchDampingCoeff] when set.\nAllows pitch/yaw damping to vary with Mach number.\n\nTable format: `{ {mach, cmq}, ... }` sorted ascending by Mach number.\n\nDefault: `nil` (flat scalar used)",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "{{number}}"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1232,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "ClpMachTable",
            "desc": "Mach-indexed Clp table. Overrides [SixDOFBuilder:RollDampingCoeff] when set.\nAllows spin-decay rate to vary with Mach number.\n\nTable format: `{ {mach, clp}, ... }` sorted ascending by Mach number.\n\nDefault: `nil` (flat scalar used)",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "{{number}}"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SixDOFBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1245,
                "path": "docs/SubBuilders.lua"
            }
        },
        {
            "name": "Done",
            "desc": "Returns the root [BehaviorBuilder].",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "BehaviorBuilder"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1251,
                "path": "docs/SubBuilders.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "SixDOFBuilder",
    "desc": "Sub-builder for 6DOF aerodynamic physics configuration. Opened via [BehaviorBuilder:SixDOF].\nCall `:Done()` to return to the root [BehaviorBuilder].\n\n:::caution BulletMass required\nWhen 6DOF is enabled, `BulletMass` must be set via `:Physics():BulletMass()`.\n`:Build()` returns `nil` if it is zero or unset, mass is required to convert\naerodynamic force vectors into accelerations.\n:::",
    "source": {
        "line": 1038,
        "path": "docs/SubBuilders.lua"
    }
}