sm.construction
The Construction api is used for interacting with the shape construction system.
Constants:
Functions:
sm.construction.constants table
Constants used by the construction system.
- subdivideRatio – The physical size of one block.
- subdivideRatio_2 – The physical size of one block divided by two.
- subdivisions – One dividided by subdivideRatio.
- shapeSpacing – Bias value.
subdivideRatio | 0.25 |
subdivideRatio_2 | 0.125 |
subdivisions | 4 |
shapeSpacing | 0.004 |
sm.construction.buildBlock(uuid, localPosition, shape)
Server only
Builds a block on a shape.
Parameters:
Type | Name | Description |
---|---|---|
Uuid | uuid | The uuid of the block to build. |
Vec3 | localPosition | The position to build the block on. |
Shape | shape | The shape to build on. |
sm.construction.buildBlock(uuid, localPosition, joint)
Server only
Builds a block on a joint.
Parameters:
Type | Name | Description |
---|---|---|
Uuid | uuid | The uuid of the block to build. |
Vec3 | localPosition | The position to build the block on. |
Joint | joint | The joint to build on. |
sm.construction.buildBlock(uuid, localPosition, lift)
Server only
Builds a block a lift.
Parameters:
Type | Name | Description |
---|---|---|
Uuid | uuid | The uuid of the block to build. |
Vec3 | localPosition | The position to build the block on. |
Lift | lift | The lift to build on. |
sm.construction.buildBlock(uuid, localPosition)
Server only
Builds a block on terrain.
Parameters:
Type | Name | Description |
---|---|---|
Uuid | uuid | The uuid of the block to build. |
Vec3 | localPosition | The position to build the block on. |
sm.construction.validateLocalPosition(uuid, localPosition, localNormal, shape)
Validates if a shape can be built on another shape.
Parameters:
Type | Name | Description |
---|---|---|
Uuid | uuid | The uuid of the shape to validate. |
Vec3 | localPosition | The position local to the body. |
Vec3 | localNormal | The normal of the surface to validate placement. |
Shape | shape | The shape to build on. |
Returns:
Type | Description |
---|---|
boolean | True if position is valid. |
sm.construction.validateLocalPosition(uuid, localPosition, localNormal, joint)
Validates if a shape can be built on another joint.
Parameters:
Type | Name | Description |
---|---|---|
Uuid | uuid | The uuid of the shape to validate. |
Vec3 | localPosition | The position local to the body. |
Vec3 | localNormal | The normal of the surface to validate placement. |
Joint | joint | The joint to build on. |
Returns:
Type | Description |
---|---|
boolean | True if position is valid. |
sm.construction.validateLocalPosition(uuid, localPosition, localNormal)
Validates if a shape can be built on terrain.
Parameters:
Type | Name | Description |
---|---|---|
Uuid | uuid | The uuid of the shape to validate. |
Vec3 | localPosition | The position local to the body. |
Vec3 | localNormal | The normal of the surface to validate placement. |
Returns:
Type | Description |
---|---|
boolean | True if position is valid. |