Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions assets/data/classes/BallSocketConstraint.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const c, t, p = require("@scripts/classes").unpack()

return c({
name = "BallSocketConstraint",
extends = "Constraint",
description = " Forces its two attachments into the same position and allows them to freely rotate about all three axes, with optional limits to restrict both tilt and twist. ",
since = "0.1.0",

properties = {
MaxFrictionTorque = {
description = "Sets the maximum frictional torque applied to keep its Attachments aligned.",
type = t.Float,
unmodified = "0",
serializable = true,
},
Restitution = {
description = "How elastic Attachments connected by a BallSocketConstraint will be when they reach the end of the range specified by UpperAngle when LimitsEnabled is true.",
type = t.Float,
unmodified = "0",
serializable = true,
},
LimitsEnabled = {
description = "Sets whether the BallSocketConstraint sets a limit on rotation based on UpperAngle.",
type = t.Bool,
unmodified = "false",
serializable = true,
},
UpperAngle = {
description = "Sets the upper rotation limit of the BallSocketConstraint, as long as LimitsEnabled is true.",
type = t.Float,
unmodified = "0",
serializable = true,
},
TwistLimitsEnabled = {
description = "Sets whether the BallSocketConstraint sets a limit on twist rotation based on TwistUpperAngle and TwistLowerAngle.",
type = t.Bool,
unmodified = "false",
serializable = true,
},
TwistLowerAngle = {
description = "Sets the lower twist rotation limit of the BallSocketConstraint, as long as TwistLimitsEnabled is true.",
type = t.Float,
unmodified = "0",
serializable = true,
},
TwistUpperAngle = {
description = "Sets the upper twist rotation limit of the BallSocketConstraint, as long as TwistLimitsEnabled is true.",
type = t.Float,
unmodified = "0",
serializable = true,
},
},
})
4 changes: 4 additions & 0 deletions assets/data/classes/BasePart.luau
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,9 @@ return c({
description = "Applies an impulse onto this instance.",
params = { p("impulse", t.Vector3) },
},
ApplyAngularImpulse = {
description = "Applies an angular impulse onto this instance.",
params = { p("impulse", t.Vector3) },
},
},
})
77 changes: 77 additions & 0 deletions assets/data/classes/HingeConstraint.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
const c, t, p = require("@scripts/classes").unpack()

return c({
name = "HingeConstraint",
extends = "Constraint",
description = " Constrains its attachments to rotate about a single axis. ",
since = "0.1.0",

properties = {
ActuatorType = {
description = "Sets whether the rotation of the HingeConstraint is actuated and, if so, what kind of actuation it uses.",
type = t.EnumItem("ActuatorType"),
unmodified = "Enums::ActuatorType::None",
},
CurrentAngle = {
description = "Read only property that contains the current angle of the constriant.",
type = t.Float,
unmodified = "0",
serializable = false,
writeLevel = "Never",
},
LimitsEnabled = {
description = "Sets wheter the HingeConstraint will limit the range of rotation.",
type = t.Bool,
unmodified = "false",
serializable = true,
},
UpperAngle = {
description = "Minimum rotation angle the HingeConstraint will allow if LimitsEnabled is true.",
type = t.Float,
unmodified = "0",
serializable = true,
},
LowerAngle = {
description = "Maximum rotation angle the HingeConstraint will allow if LimitsEnabled is true.",
type = t.Float,
unmodified = "0",
serializable = true,
},
TargetAngle = {
description = "The target angle a HingeConstraint will attempt to rotate to if its ActuatorType is set to Servo. Measured in degrees.",
type = t.Float,
unmodified = "0",
serializable = true,
},
AngularSpeed = {
description = "The desired angular speed a HingeConstraint with ActuatorType set to Servo will attempt to maintain while rotating towards its TargetAngle. Measured in radians/second.",
type = t.Float,
unmodified = "0",
serializable = true,
},
ServoMaxTorque = {
description = "The maximum torque a HingeConstraint with ActuatorType set to Servo can apply when trying to reach its desired TargetAngle.",
type = t.Float,
unmodified = "0",
serializable = true,
},
AngularVelocity = {
description = "The angular velocity a HingeConstraint with ActuatorType set to Motor will attempt to achieve. Measured in radians/second.",
type = t.Float,
unmodified = "0",
serializable = true,
},
MotorMaxAcceleration = {
description = "The maximum angular acceleration a HingeConstraint with ActuatorType set to Motor can apply to achieve its AngularVelocity. Measured in radians/second^2.",
type = t.Float,
unmodified = "0",
serializable = true,
},
MotorMaxTorque = {
description = "The maximum torque a HingeConstraint with ActuatorType set to Motor can apply when trying to reach its desired AngularVelocity.",
type = t.Float,
unmodified = "0",
serializable = true,
},
},
})
8 changes: 8 additions & 0 deletions assets/data/classes/PrismaticConstraint.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const c, t, p = require("@scripts/classes").unpack()

return c({
name = "PrismaticConstraint",
extends = "SlidingBallConstraint",
description = " Constraint its attachments to slide along one axis but not rotate. ",
since = "0.1.0",
})
42 changes: 42 additions & 0 deletions assets/data/classes/RodConstraint.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const c, t, p = require("@scripts/classes").unpack()

return c({
name = "RodConstraint",
extends = "Constraint",
description = " Constrains its attachments to maintain a fixed distance. ",
since = "0.1.0",

properties = {
CurrentDistance = {
description = "Read only property that contains the current distance of the constriant.",
type = t.Float,
unmodified = "0",
serializable = false,
writeLevel = "Never",
},
Length = {
description = "The target distance. Measured in units.",
type = t.Float,
unmodified = "0",
serializable = true,
},
LimitsEnabled = {
description = "Sets wheter the RodConstraint will limit the angles of rod and respective attachments.",
type = t.Bool,
unmodified = "false",
serializable = true,
},
LimitAngle0 = {
description = "Maximum angle the RodConstraint will allow between the Rod and Attachment0.",
type = t.Float,
unmodified = "0",
serializable = true,
},
LimitAngle1 = {
description = "Maximum angle the RodConstraint will allow between the Rod and Attachment1.",
type = t.Float,
unmodified = "0",
serializable = true,
},
},
})
77 changes: 77 additions & 0 deletions assets/data/classes/SlidingBallConstraint.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
const c, t, p = require("@scripts/classes").unpack()

return c({
name = "SlidingBallConstraint",
extends = "Constraint",
description = " The base class for constraints that allow their attachments to slide along an axis but not rotate. ",
since = "0.1.0",

properties = {
ActuatorType = {
description = "Sets whether the rotation of the PrismaticConstraint is actuated and, if so, what kind of actuation it uses.",
type = t.EnumItem("ActuatorType"),
unmodified = "Enums::ActuatorType::None",
},
CurrentPosition = {
description = "Read only property that contains the current position of the constriant.",
type = t.Float,
unmodified = "0",
serializable = false,
writeLevel = "Never",
},
LimitsEnabled = {
description = "Sets wheter the PrismaticConstraint will limit the range of rotation.",
type = t.Bool,
unmodified = "false",
serializable = true,
},
UpperLimit = {
description = "The higher positional limit the PrismaticConstraint will allow if LimitsEnabled is true.",
type = t.Float,
unmodified = "0",
serializable = true,
},
LowerLimit = {
description = "The lower positional limit the PrismaticConstraint will allow if LimitsEnabled is true.",
type = t.Float,
unmodified = "0",
serializable = true,
},
TargetPosition = {
description = "The PrismaticConstraint's attempted target position when ActuatorType is set to Servo.",
type = t.Float,
unmodified = "0",
serializable = true,
},
Speed = {
description = "The desired speed a PrismaticConstraint with ActuatorType set to Servo will attempt to maintain while moving towards its TargetPosition. Measured in units per second.",
type = t.Float,
unmodified = "0",
serializable = true,
},
ServoMaxForce = {
description = "The PrismaticConstraint's maximum force when ActuatorType is set to Servo, as the constraint attempts to reach its desired Speed.",
type = t.Float,
unmodified = "0",
serializable = true,
},
Velocity = {
description = "The PrismaticConstraint's attempted velocity when ActuatorType is set to Motor. Measured in units per second.",
type = t.Float,
unmodified = "0",
serializable = true,
},
MotorMaxAcceleration = {
description = "The PrismaticConstraint's maximum acceleration when ActuatorType is set to Motor as the constraint attempts to reach its desired Velocity.",
type = t.Float,
unmodified = "0",
serializable = true,
},
MotorMaxForce = {
description = "The maximum force a PrismaticConstraint with ActuatorType set to Motor can apply when trying to reach its desired Velocity.",
type = t.Float,
unmodified = "0",
serializable = true,
},
},
})
60 changes: 60 additions & 0 deletions assets/data/classes/SpringConstraint.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
const c, t, p = require("@scripts/classes").unpack()

return c({
name = "SpringConstraint",
extends = "Constraint",
description = " Constrains its attachments to maintain a fixed distance using a spring. ",
since = "0.1.0",

properties = {
CurrentLength = {
description = "Read only property that contains the current distance of the constriant.",
type = t.Float,
unmodified = "0",
serializable = false,
writeLevel = "Never",
},
FreeLength = {
description = "Natural resting length of the spring.",
type = t.Float,
unmodified = "0",
serializable = true,
},
MaxForce = {
description = "The maximum force the SpringConstraint can apply on its Attachments.",
type = t.Float,
unmodified = "0",
serializable = true,
},
Stiffness = {
description = "The strength of the spring. The higher this value the more force will be applied when the attachments are separated a different length than the FreeLength.",
type = t.Float,
unmodified = "0",
serializable = true,
},
Damping = {
description = "Damping constant for the SpringConstraint. Multiplied to the velocity of the constraint's Attachments to reduce the spring force applied.",
type = t.Float,
unmodified = "0",
serializable = true,
},
LimitsEnabled = {
description = "Sets wheter the RodConstraint will limit the angles of rod and respective attachments.",
type = t.Bool,
unmodified = "false",
serializable = true,
},
MinLength = {
description = "Maximum angle the RodConstraint will allow between the Rod and Attachment0.",
type = t.Float,
unmodified = "0",
serializable = true,
},
MaxLength = {
description = "Maximum angle the RodConstraint will allow between the Rod and Attachment1.",
type = t.Float,
unmodified = "0",
serializable = true,
},
},
})
Loading