work on hole cutting algorithm

change default controls
This commit is contained in:
James Lambert 2023-09-20 20:28:25 -06:00
parent 43ea3e4f1e
commit d99fd21ad6
3 changed files with 14 additions and 27 deletions

View file

@ -141,18 +141,18 @@ That will generate the rom at `/build/portal64.z64`
<br />
## Current New Feature TODO List
- [ ] Change default controls
- [ ] investigate failed portal hole in test chamber 04
- [ ] increaes collider height
- [ ] ball velocity in test chamber 11
- [ ] clear sleeping object physics flag so buttons in savefiles remain pressed after loading
- [ ] rumble pak support?
- [ ] Investigate crash after falling into death water on test chamber 8
- [ ] Add particle effects (shooting portal gun, energy pellet)
- [ ] Add auto save checkpoints
- [ ] Correct elevator timing
- [ ] Adding loading notice between levels #45
- [ ] pausing while glados is speaking can end her speech early
- [x] Change default controls
- [x] Add particle effects (shooting portal gun, energy pellet)
- [x] increaes collider height
- [x] test chamber 11 is broken
- [x] test chamber 4 has an inverted indicator light sign
- [x] test chamber 4 door doesnt close

View file

@ -6,20 +6,20 @@
#include "../savefile/savefile.h"
unsigned char gDefaultControllerSettings[ControllerActionSourceCount] = {
[ControllerActionSourceAButton] = ControllerActionJump,
[ControllerActionSourceBButton] = ControllerActionUseItem,
[ControllerActionSourceAButton] = ControllerActionOpenPortal1,
[ControllerActionSourceBButton] = ControllerActionOpenPortal0,
[ControllerActionSourceCUpButton] = ControllerActionMove,
[ControllerActionSourceCRightButton] = ControllerActionNone,
[ControllerActionSourceCDownButton] = ControllerActionNone,
[ControllerActionSourceCLeftButton] = ControllerActionNone,
[ControllerActionSourceDUpButton] = ControllerActionMove,
[ControllerActionSourceDUpButton] = ControllerActionLookForward,
[ControllerActionSourceDRightButton] = ControllerActionNone,
[ControllerActionSourceDDownButton] = ControllerActionNone,
[ControllerActionSourceDDownButton] = ControllerActionLookBackward,
[ControllerActionSourceDLeftButton] = ControllerActionNone,
[ControllerActionSourceStartButton] = ControllerActionPause,
[ControllerActionSourceLTrig] = ControllerActionOpenPortal1,
[ControllerActionSourceRTrig] = ControllerActionOpenPortal1,
[ControllerActionSourceZTrig] = ControllerActionOpenPortal0,
[ControllerActionSourceLTrig] = ControllerActionDuck,
[ControllerActionSourceRTrig] = ControllerActionJump,
[ControllerActionSourceZTrig] = ControllerActionUseItem,
[ControllerActionSourceJoystick] = ControllerActionRotate,
};

View file

@ -235,23 +235,18 @@ int portalSurfaceFindNextLoop(struct PortalSurfaceBuilder* surfaceBuilder, struc
#define MAX_INTERSECT_LOOPS 20
int portalSurfaceIsPointOnLine(struct Vector2s16* pointA, struct Vector2s16* edgeA, struct Vector2s16* edgeDir) {
struct Vector2s16 originOffset;
struct Vector2s16 endpointOffset;
if (edgeDir->equalTest == 0) {
return 0;
}
vector2s16Add(edgeA, edgeDir, &endpointOffset);
vector2s16Sub(&endpointOffset, pointA, &endpointOffset);
struct Vector2s16 originOffset;
vector2s16Sub(edgeA, pointA, &originOffset);
int crossProduct = vector2s16Cross(&originOffset, &endpointOffset);
int dotProduct = vector2s16Dot(&originOffset, edgeDir);
int crossProduct = vector2s16Cross(&originOffset, edgeDir);
int edgeDirLength = vector2s16MagSqr(edgeDir);
s64 angleCheck = (s64)crossProduct * 50LL / (s64)edgeDirLength;
return angleCheck == 0;
return dotProduct >= 0 && dotProduct <= edgeDirLength && abs(crossProduct) * 100 < edgeDirLength;
}
enum IntersectionType {
@ -658,14 +653,6 @@ struct Vector2s16* portalSurfaceIntersectEdgeWithLoop(struct PortalSurfaceBuilde
if (intersectType == IntersectionTypePoint) {
int newPointIndex;
if (vector2s16DistSqr(&intersectionPoint, pointA) <= COLLAPSE_DISTANCE * COLLAPSE_DISTANCE) {
intersectionPoint = *pointA;
}
if (vector2s16DistSqr(&intersectionPoint, pointB) <= COLLAPSE_DISTANCE * COLLAPSE_DISTANCE) {
intersectionPoint = *pointB;
}
if (intersectionPoint.equalTest == edgeA->equalTest) {
newPointIndex = edge->pointIndex;
currentEdge = portalSurfaceFindCurrentFace(surfaceBuilder, pointA, currentEdge);