-
Notifications
You must be signed in to change notification settings - Fork 0
[Smoothie] Physical Soft Body
This module allows you to add physics to soft body parts
Note
You call this function for each physical soft body, so if you have two of them you will call this function twice(one for each soft body)
To add some physics to your soft body parts, do the following:
-
Initialize Smoothie and store it in a variable.
For example:local smoothie = require("Smoothie") -
Copy the path to the model part that is the soft body.
For example:models.model.root.Body.Breast -
Use
newPhysicalBody()
For example:local rigbtBreast = smoothie:newPhysicalBody(models.model.root.Body.Breast)
Final example:
local smoothie = require("Smoothie")
local rigbtBreast = smoothie:newPhysicalBody(models.model.root.Body.Breast)The bigger the number, the more the soft body part bounces
setBouncy()Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| value | number | Soft body bouncy | 0.5 |
Returns:
| Type | Description |
|---|---|
| table | Returns self for chaining |
Example:
rigbtBreast:setBouncy(1)Soft body part rotation speed
setSpeed()Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| value | number | Soft body part rotation speed | 150 |
Returns:
| Type | Description |
|---|---|
| table | Returns self for chaining |
Example:
rigbtBreast:setSpeed(300)The maximum angle at which the body part can rotate upward
setTopLimit()Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| value | number | The maximum angle at which the body part can rotate upward | 45 |
Returns:
| Type | Description |
|---|---|
| table | Returns self for chaining |
Example:
rigbtBreast:setTopLimit(35)The maximum angle at which the body part can rotate downwards
setBottomLimit()Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| value | number | The maximum angle at which the body part can rotate downwards | 45 |
Returns:
| Type | Description |
|---|---|
| table | Returns self for chaining |
Example:
rigbtBreast:setBottomLimit(20)The maximum angle at which the body part can turn to the left
setLeftLimit()Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| value | number | The maximum angle at which the body part can turn to the left | 15 |
Returns:
| Type | Description |
|---|---|
| table | Returns self for chaining |
Example:
rigbtBreast:setLeftLimit(25)The maximum angle at which the body part can turn to the right
setRightLimit()Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| value | number | The maximum angle at which the body part can turn to the right | 15 |
Returns:
| Type | Description |
|---|---|
| table | Returns self for chaining |
Example:
rigbtBreast:setRightLimit(15)