-
Notifications
You must be signed in to change notification settings - Fork 48
two more coll funcs #232
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
Merged
+565
−41
Merged
two more coll funcs #232
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
87b0252
porting data types
mateusfavarin 64d289c
load vertice data decompiled
mateusfavarin 26dbbec
decompile CalculateTrianglePlane
mateusfavarin 1a7b523
two more functions
mateusfavarin 9d527b4
missing def
mateusfavarin 20e4b41
decompile TestTriangle
mateusfavarin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,19 +27,81 @@ typedef struct CollVertex | |
| { | ||
| SVec3 pos; | ||
| u16 normalDominantAxis; | ||
| Vertex* levVertex; | ||
| const Vertex* levVertex; | ||
| SVec3 triNormal; | ||
| u16 planeDist; | ||
| s16 planeDist; | ||
| } CollVertex; | ||
|
|
||
| typedef struct TestVertex | ||
| { | ||
| SVec3 pos; | ||
| u16 normalDominantAxis; | ||
| SVec3 triNormal; | ||
| u16 planeDist; | ||
| s16 planeDist; | ||
| SVec3 interpolationPoint; | ||
| } TestVertex; | ||
|
|
||
| typedef struct DriverQuadblockCollData | ||
| { | ||
| SVec3 driverPos; | ||
| s16 driverHitRadius; | ||
| s32 driverHitRadiusSquared; | ||
| SVec3 driverNextPos; | ||
| u16 collFlags; | ||
| u16 searchFlags; | ||
| s16 unk0; | ||
| u32 skipCollNoQuadFlagsMatch; | ||
| } DriverQuadblockCollData; | ||
|
|
||
| typedef union CollInputData | ||
| { | ||
| DriverQuadblockCollData quadblock; | ||
| } CollInputData; | ||
|
|
||
| typedef struct CollDCache | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this start at 0x1f800000 or 0x1f800108?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 0x1f800000 |
||
| { | ||
| SVec3 inputNextPos; | ||
| s16 inputHitRadius; | ||
| s32 inputHitRadiusSquared; | ||
| s16 unk0; | ||
| s16 unk1; | ||
| CollInputData collInput; | ||
| const MeshInfo* meshInfo; | ||
| BoundingBox bbox; | ||
| s16 numVerticesTested; | ||
| s16 numTrianglesCollided; | ||
| s16 unk2; | ||
| s16 numInstancesCollided; | ||
| u32 unk3; | ||
| const BSPNode* bspNodes; | ||
| TestVertex collIntersection; | ||
| u8 unk4; | ||
| u8 currTriangleIndex; | ||
| const Quadblock* currQuadblock; | ||
| TestVertex coll; | ||
| s8 barycentricTest; | ||
| u8 collidedTriangleIndex; | ||
| const Quadblock* collidedQuadblock; | ||
| s32 speedScale; | ||
| u8 unk6[0x44]; | ||
| const Vertex* collidedVertices[NUM_VERTICES_TRIANGLE]; | ||
| const CollVertex* currTestVertices[NUM_VERTICES_TRIANGLE]; | ||
| SVec3 deltaInterpolationIntersection; | ||
| s16 unk7; | ||
| u16 quadblockThirdIndex; | ||
| u16 quadblockFourthIndex; | ||
| CollVertex quadblockCollVertices[NUM_VERTICES_QUADBLOCK]; | ||
| u32 stepFlags; | ||
| s16 normalScale; | ||
| u8 normalBitshift; | ||
| u8 lodShift; | ||
| } CollDCache; | ||
|
|
||
| #define DCACHE_COLL (*(CollDCache*) 0x1f800000) | ||
|
|
||
| void COLL_ProjectPointToEdge(SVec3* out, const SVec3* v1, const SVec3* v2, const SVec3* point); | ||
| s32 COLL_BarycentricTest(TestVertex* t, const CollVertex* v1, const CollVertex* v2, const CollVertex* v3); | ||
| void COLL_LoadQuadblockData_LowLOD(CollDCache* cache, Quadblock* quadblock); | ||
| void COLL_LoadQuadblockData_HighLOD(CollDCache* cache, Quadblock* quadblock); | ||
| void COLL_TestTriangle(CollDCache* cache, const CollVertex* v1, const CollVertex* v2, const CollVertex* v3); | ||
|
|
||
| extern u32 e_ignoreCollisionDoorFlagTerrain; // 0x8008d728 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #pragma once | ||
|
|
||
| #include <ctr/macros.h> | ||
|
|
||
| typedef enum StepFlags | ||
| { | ||
| STEPFLAGS_OUT_OF_BOUNDS = 0x4000, | ||
| } StepFlags; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can const-ifying be done elsewhere too?
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 think we can const-fy most of these scratchpad pointers as they seem to be used for read only purposes. As for data in other headers, they need to be analyzed in a case by case scenario, which means decompiling a ton of functions before making such decisions