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

Add missing collision functions and clean up #245

Merged
merged 1 commit into from
Mar 1, 2025

Conversation

malleoz
Copy link
Contributor

@malleoz malleoz commented Jan 14, 2025

These will be required for ObjectDrivable and (mainly) ObjectKCL. Function signatures are standardized across all collision check funcs (some had float arg out-of-order, some had different variable names). Just like with spheres, I combined the two main collision check functions since they differ only by a few instructions.

@vabold vabold added the P1 Priority: High label Feb 6, 2025
@malleoz malleoz force-pushed the add_other_coursecolmgr_functions branch from c584084 to 944b8dc Compare February 22, 2025 23:09
Comment on lines 589 to 596
KCLTypeMask attrMask = KCL_ATTRIBUTE_TYPE_BIT(prism.attribute);
if (!(attrMask & m_typeMask)) {
return false;
}

if (movement && (attrMask & KCL_TYPE_DIRECTIONAL) && m_movement.dot(fnrm) < 0.0f) {
return false;
}
Copy link
Owner

Choose a reason for hiding this comment

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

The flag checking can be moved to the top of the function for performance gains.

Suggested change
KCLTypeMask attrMask = KCL_ATTRIBUTE_TYPE_BIT(prism.attribute);
if (!(attrMask & m_typeMask)) {
return false;
}
if (movement && (attrMask & KCL_TYPE_DIRECTIONAL) && m_movement.dot(fnrm) < 0.0f) {
return false;
}
if (movement && m_movement.ps_dot(fnrm) > 0.0f) {
return false;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The one expr is dependent on fnrm, so I'll leave that one where it is

These will be required for ObjectDrivable and (mainly) ObjectKCL
@malleoz malleoz force-pushed the add_other_coursecolmgr_functions branch from 944b8dc to 5fe1f5a Compare March 1, 2025 19:55
@vabold vabold merged commit ece0c03 into vabold:main Mar 1, 2025
4 checks passed
@malleoz malleoz deleted the add_other_coursecolmgr_functions branch March 1, 2025 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Priority: High
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants