Skip to content
This repository has been archived by the owner on Oct 28, 2023. It is now read-only.

Refactor cpp and rust(rapier) code #45

Merged
merged 22 commits into from
Oct 24, 2023
Merged

Conversation

Ughuuu
Copy link
Collaborator

@Ughuuu Ughuuu commented Oct 24, 2023

Split the main rust code into smaller logical groups.
Split the cpp code and group it into folders.

Rust code now:
image

Add support for double precision builds in rust code:
image

Also add to SConstruct a define REAL_T_IS_FLOAT to be used in the rapier wrapper to know what type to use as real.

Also remove the global variables used in space:


uint32_t g_query_collision_layer_mask = 0;
ObjectID g_query_canvas_instance_id;
rapier2d::Handle *g_query_exclude = nullptr;
uint32_t g_query_exclude_size = 0;
RID *g_query_exclude_body = nullptr;

and

RapierSpace2D *g_contact_events_space = nullptr;
RapierBody2D *g_contact_events_body1 = nullptr;
RapierBody2D *g_contact_events_body2 = nullptr;
uint32_t g_contact_events_shape1 = 0;
uint32_t g_contact_events_shape2 = 0;

And instead send them to the rapier code and then have the rapier code send them back.

@Ughuuu Ughuuu changed the title Refactor Refactor cpp and rust(rapier) code Oct 24, 2023
@Ughuuu Ughuuu marked this pull request as ready for review October 24, 2023 14:25
@Ughuuu Ughuuu marked this pull request as draft October 24, 2023 14:25
@Ughuuu Ughuuu marked this pull request as ready for review October 24, 2023 14:44
@Ughuuu Ughuuu merged commit 589e4b6 into fabriceci:main Oct 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant