-
-
Notifications
You must be signed in to change notification settings - Fork 5
Initialize DAABBCC
selimanac edited this page Oct 8, 2024
·
11 revisions
All arrays are now pre-allocated, similar to how Defold handles them. Arrays will no longer grow dynamically, so it is your responsibility to set them up upfront. Initialization should only be done once.
max_group_count = 3
max_gameobject_count = 128
max_query_result_count = 32
max_raycast_result_count = 32
There are two ways to initialize DAABBCC
Open your game.project
file using a text editor, copy and paste the settings below, and adjust them as needed.
[daabbcc]
max_group_count = 3
max_gameobject_count = 128
max_query_result_count = 32
max_raycast_result_count = 32
daabbcc.init(max_group_count
, max_gameobject_count
, max_query_count
, max_raycast_count
, [update_frequency]
)
Parameters
-
max_group_count
(uint8) - Maximum number of Groups -
max_gameobject_count
(uint16) - Maximum number of Gameobjects to use withdaabbcc.insert_gameobject()
-
max_query_count
(uint16) - Maximum number of Query result for a single AABB -
max_raycast_count
(uint16) - Maximum number of Raycast result for a single raycast -
update_frequency
(int32)[optional] - Update frequency for Gameobject update. More info
Example
local max_group_count = 3
local max_gameobject_count = 128
local max_query_result_count = 32
local max_raycast_result_count = 32
daabbcc.init(max_group_count, max_gameobject_count, max_query_count, max_raycast_count)
If you find my Defold Extensions useful for your projects, please consider supporting it.
I'd love to hear about your projects! Please share your released projects that use my native extensions. It would be very motivating for me.