|
@@ -1,39 +1,51 @@
|
|
return {
|
|
return {
|
|
tag = 'drawing',
|
|
tag = 'drawing',
|
|
summary = 'Draw a capsule.',
|
|
summary = 'Draw a capsule.',
|
|
- description = 'TODO',
|
|
|
|
|
|
+ description = [[
|
|
|
|
+ Draws a capsule. A capsule is shaped like a cylinder with a hemisphere on each end.
|
|
|
|
+ ]],
|
|
arguments = {
|
|
arguments = {
|
|
transform = {
|
|
transform = {
|
|
- type = 'TransformXY2',
|
|
|
|
|
|
+ type = 'Mat4',
|
|
description = [[
|
|
description = [[
|
|
- The transform to apply to the capsule. The x and y scale is the radius, the z scale is the
|
|
|
|
- length.
|
|
|
|
|
|
+ The transform of the capsule. Can also be provided as position, radius, length, and
|
|
|
|
+ rotation using a mix of `Vectors` or numbers. When using a `Vec3` for the scale, the X and
|
|
|
|
+ Y components are used for the radius and the Z component is used for the length.
|
|
]]
|
|
]]
|
|
},
|
|
},
|
|
p1 = {
|
|
p1 = {
|
|
- type = 'Point3',
|
|
|
|
|
|
+ type = 'Vec3',
|
|
description = 'The starting point of the capsule.'
|
|
description = 'The starting point of the capsule.'
|
|
},
|
|
},
|
|
p2 = {
|
|
p2 = {
|
|
- type = 'Point3',
|
|
|
|
|
|
+ type = 'Vec3',
|
|
description = 'The ending point of the capsule.'
|
|
description = 'The ending point of the capsule.'
|
|
},
|
|
},
|
|
|
|
+ radius = {
|
|
|
|
+ type = 'number',
|
|
|
|
+ default = '1.0',
|
|
|
|
+ description = 'The radius of the capsule.'
|
|
|
|
+ },
|
|
segments = {
|
|
segments = {
|
|
type = 'number',
|
|
type = 'number',
|
|
default = '32',
|
|
default = '32',
|
|
description = 'The number of circular segments to render.'
|
|
description = 'The number of circular segments to render.'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ returns = {},
|
|
variants = {
|
|
variants = {
|
|
{
|
|
{
|
|
arguments = { 'transform', 'segments' },
|
|
arguments = { 'transform', 'segments' },
|
|
returns = {}
|
|
returns = {}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- arguments = { 'p1', 'p2', 'segments' },
|
|
|
|
|
|
+ description = 'Draws a capsule between two points.',
|
|
|
|
+ arguments = { 'p1', 'p2', 'radius', 'segments' },
|
|
returns = {}
|
|
returns = {}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- returns = {},
|
|
|
|
- notes = 'TODO'
|
|
|
|
|
|
+ notes = [[
|
|
|
|
+ The length of the capsule does not include the end caps. The local origin of the capsule is in
|
|
|
|
+ the center, and the local z axis points towards the end caps.
|
|
|
|
+ ]]
|
|
}
|
|
}
|