Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collision Object Callbacks #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HaydnTrigg
Copy link
Contributor

Remove player_rumble_clips from collision_object by adding swept collision callback
Collision object trigger passes in the collision object rather than the data pointer

Remove player_rumble_clips from collision_object by adding swept collision callback
Collision object trigger passes in the collision object rather than the data pointer
@mwpenny mwpenny added the refactoring Structural changes to code label Oct 31, 2024
Copy link
Owner

@mwpenny mwpenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate the cleanup you're doing. Other areas have my attention right now and improvements like this are helpful.

if (object->body->flags & RigidBodyIsPlayer) {
playerHandleLandingRumble(-velocityDot);
}
if (object->sweptCollide) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: can you move this back into the if body? We should only get here if the objects are moving toward each other (i.e., not already handled/separated).

@@ -141,10 +141,17 @@ void playerRender(void* data, struct DynamicRenderDataList* renderList, struct R
);
}

void playerHandleSweptCollision(struct CollisionObject* object, float velocityDot) {
// struct Player* player = object->data;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: commented out code can be removed (looks like it's from before you updated the function signature).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Structural changes to code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants