leberechtreinhold / dba3_tts

A module for playing De Bellis Antiquitatis 3 on Tabletop Simulator
https://steamcommunity.com/sharedfiles/filedetails/?id=2105272640
MIT License
3 stars 2 forks source link

API -- tree models have bounding box too small #19

Open marcpawl opened 3 years ago

marcpawl commented 3 years ago

The sizes of the trees are too small. The look good, so a modelling issue?

Test case:

function set_forest(terrain_obj, terrain_pos, terrain_rotation, terrain_size, table_type) local options = g_terrain[table_type]['forest'] local multiplier = options['multiplier'] local ntrees = math.floor((terrain_size['x'] + terrain_size['z'])*multiplier) for i=1,ntrees do local point = random_point_ellipse(terrain_size['x'] / 2.5, terrain_size['z'] / 2.5) new_pos = rotate_point_relative(point, terrain_pos, terrain_rotation) local model_name = random_element(options['objects']) local obj = spawn_model(model_name, new_pos, math.random(1, 359), minimal_collider, true) Wait.time(function() print(model_name) local bounds = obj.getBounds() local size = bounds.size print(size.x, ' ', size.y, ' ', size.z) end, 3) obj.setLock(true) --terrain_obj.addAttachment(obj) end change_texture_terrain(terrain_obj, random_element(options['texture'])) end

Load the game with the change. Spawn table Arable. Drag a large forest on the table. Lock the table. Wait until the messages are printed in the chat.

Expected would be size close to an inch or more. Actual is very small values, less than 0.01 inches Screen Shot 2021-02-08 at 10 53 57 AM

leberechtreinhold commented 3 years ago

That is inteded. If you check the terrain generation, they get assigned a specific minimal colllider. That way, they do not interfere with gameplay.