‹›
Current project

Separate visual mesh

Give an imported Soft Body a detailed visual while physics stays simple. Both models need matching origin, axes, size and readable buffers before freeze(). The visual may have open/decorative parts. Binding uses rest geometry and follows current deformation even when assigned later. Initial physics scale/rotation also applies to the visual.

Example#

GML
if (!soft.set_visual_model(model_visual)) {
    show_debug_message(jolt_get_error());
}
soft.set_renderer(o_control_bbmod_renderer.renderer);

Usage and limits#

set_visual_model(model,max_distance) binds visual points to nearby physics triangles with fixed weights and surface offsets. Default maximum distance is a quarter of the physics bounds diagonal. Invalid binding returns false and preserves the prior visual. set_visual_model(undefined) restores the physics mesh. Imported closed models and imported cloth support this feature.

Visual limits are 32768 split vertices and 32768 triangles; physics remains 4096/8192. UV, material groups and normal splits are retained; normals/tangents are recalculated. Skinning, vertex colors, UV2 and batch IDs are unsupported. Extra visual detail has no extra collision. Binding and native CPU deformation have a cost: do not rebind every Step. Source geometry is unchanged and shared materials must remain valid.

API reference#

Public function and method signatures. Call methods on the returned instance; parameters with defaults are optional.

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
JoltBBMODModel.has_visual_modelJoltBBMODModel.has_visual_model()Boolean: live object with a bound visual skin; false after destruction/detachment.
JoltBBMODModel.set_visual_modelJoltBBMODModel.set_visual_model(model=undefined,max_distance=undefined)Boolean; static loaded BBMOD model before freeze, matching rest origin/axes/units. At most 32768 triangles and position/normal vertices. max_distance in (0, 10000] m; default one quarter of physics bbox diagonal. Failure preserves the previous skin. undefined restores the physics mesh. Does not alter particles/attachments or the source model.