-
Notifications
You must be signed in to change notification settings - Fork 8
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
Rough dynamic collision setup #24
Conversation
public: | ||
/* 0x00 */ mVec3_c mCenter; | ||
/* 0x0C */ f32 mRadius; | ||
/* 0x10 */ f32 field_0x10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why a sphere is characterized by another float in additon to the radius.
mVec3_c b = *mRail.getPntPosForIndex(0); | ||
mVec3_c c = *mRail.getPntPosForIndex(1); | ||
|
||
fn_80337EF0(&unk, b, c, scale.x * 100.0f); | ||
f32 d; | ||
if (fn_8032BFB0(&unk, a, q, d, 0)) { | ||
if (cM3d_Len3dSqPntAndSegLine(&unk, a, &q, &d, nullptr)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is evidence the old cM3d code still uses vector types that aren't mVec3_c - this creates copies of the vector with implicit copy constructors (using GPRs rather than FPRs).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I find more interesting is the address of it. its already closer to the Collision code and is disconnected from the m code. I think it is safe to it was a minimal effort port xD
mVec3_c mMin; | ||
mVec3_c mMax; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mVec3_c here and below is an unfounded assumption.
ce819b0
to
942f4ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good at a glance. I think it can be said it does use mVec at least because it references mVec3_c::Zero
66850aa
to
170c159
Compare
Largely based on TP code - since SComponent has been absorbed by other libraries there's no longer a split between cCcd and dCcd so all names are made up again, but this matches the vtables and multiple inheritance stuff and allows us to match some simple actors with collision \o/