Bodies

Tapered Cylinder

Creates a Z-axis cylinder or frustum with independent top and bottom radii.

Use it for cones, truncated cones, tapered pillars, wheels, and other convex solids with circular ends. The body origin is at the middle of the full height. Dynamic, Static, and Kinematic are supported.

Syntax#

Syntax
jolt_tapered_cylinder_create_dynamic(x, y, z, height, top_radius, bottom_radius, options=undefined)
jolt_tapered_cylinder_create_static(x, y, z, height, top_radius, bottom_radius, options=undefined)
jolt_tapered_cylinder_create_kinematic(x, y, z, height, top_radius, bottom_radius, options=undefined)

Arguments#

ArgumentTypeDescription
x, y, zRealWorld-space centre/pivot.
heightRealFinite full local-Z height > 0.
top_radiusRealFinite upper radius >= 0.
bottom_radiusRealFinite lower radius >= 0.
optionsStructOptional shared body options.

Geometry and orientation#

The lower face lies at local Z=-height/2 and the upper face at +height/2. The wrapper supplies half_height=height/2 and rotates Jolt's native Y-axis TaperedCylinder to public Z before applying the body rotation.

Return and behaviour#

Returns a JoltBody or undefined. It supports the standard JoltBody properties, collision layers, sensor mode, contacts, and raycasts; motion-type restrictions still apply to forces, mass, and velocity. Invalid height, radii, positions, or options cancel creation atomically.

Reusable JoltShape#

GML
var shape = jolt_shape_tapered_cylinder(height, top_radius, bottom_radius, cache_key=undefined);
var body = shape.create_dynamic(x, y, z, options);
var static_body = shape.create_static(x, y, z, options);
var kinematic_body = shape.create_kinematic(x, y, z, options);

jolt_shape_load() also accepts a valid TaperedCylinder .jcol asset.

Low-Level / Advanced API#

There is no direct ergonomic low-level GML creator. Prefer the high-level functions or the reusable shape resource.

Example#

GML
// A cone pointing toward local +Z.
var cone = jolt_tapered_cylinder_create_dynamic(2, 0, 5, 3, 0, 0.85, {
    mass: 2,
    friction: 0.6
});

Verified operation contracts#

These contracts distinguish units, return values, errors and lifetime according to the current implementation. Check results: false, 0 and undefined can mean different things for different methods.

Symbol / ownerSignatureOperation contract
jolt_tapered_cylinder_create_dynamicjolt_tapered_cylinder_create_dynamic(x = 0, y = 0, z = 0, height = 1, top_radius = 0.25, bottom_radius = 0.5, options = undefined)Factory for the named motion type, XYZ position defaults 0m plus options. height>0 m, radii>=0, at least one>0. Returns JoltBody/undefined; options failure cleans up the new body. Finite dimensions; set_ changes preserve identity.
jolt_tapered_cylinder_create_kinematicjolt_tapered_cylinder_create_kinematic(x = 0, y = 0, z = 0, height = 1, top_radius = 0.25, bottom_radius = 0.5, options = undefined)Factory for the named motion type, XYZ position defaults 0m plus options. height>0 m, radii>=0, at least one>0. Returns JoltBody/undefined; options failure cleans up the new body. Finite dimensions; set_ changes preserve identity.
jolt_tapered_cylinder_create_staticjolt_tapered_cylinder_create_static(x = 0, y = 0, z = 0, height = 1, top_radius = 0.25, bottom_radius = 0.5, options = undefined)Factory for the named motion type, XYZ position defaults 0m plus options. height>0 m, radii>=0, at least one>0. Returns JoltBody/undefined; options failure cleans up the new body. Finite dimensions; set_ changes preserve identity.