Fix some small portal rendering bugs

This commit is contained in:
James Lambert 2023-09-23 16:57:39 -06:00
parent 8ff28b0c11
commit 55142fe61c
4 changed files with 11 additions and 5 deletions

View file

@ -142,7 +142,6 @@ That will generate the rom at `/build/portal64.z64`
## Current New Feature TODO List
- [ ] chell is short sometimes
- [ ] near clipping plane when touching portals
- [ ] ball velocity in test chamber 11
- [ ] clear sleeping object physics flag so buttons in savefiles remain pressed after loading
- [ ] rumble pak support?
@ -151,6 +150,7 @@ That will generate the rom at `/build/portal64.z64`
- [ ] Correct elevator timing
- [ ] Adding loading notice between levels #45
- [ ] pausing while glados is speaking can end her speech early
- [x] near clipping plane when touching portals git
- [x] investigate failed portal hole in test chamber 04
- [x] Change default controls
- [x] Add particle effects (shooting portal gun, energy pellet)

View file

@ -101,13 +101,15 @@ void playerRender(void* data, struct DynamicRenderDataList* renderList, struct R
gSPDisplayList(dl++, player->armature.displayList);
gSPEndDisplayList(dl++);
dynamicRenderListAddData(
dynamicRenderListAddDataTouchingPortal(
renderList,
objectRender,
matrix,
DEFAULT_INDEX,
&player->body.transform.position,
armature
armature,
player->body.flags
);
}

View file

@ -148,7 +148,7 @@ void dynamicRenderListAddDataTouchingPortal(
}
float finalTransform[4][4];
guMtxCatF(transformAsFloat, list->portalTransforms[1 - touchingPortalIndex], finalTransform);
guMtxCatF(transformAsFloat, list->portalTransforms[touchingPortalIndex], finalTransform);
guMtxF2L(finalTransform, mtx);
@ -157,7 +157,7 @@ void dynamicRenderListAddDataTouchingPortal(
next->model = model;
next->transform = mtx;
transformPoint(collisionSceneTransformToPortal(1 - touchingPortalIndex), position, &next->position);
transformPoint(collisionSceneTransformToPortal(touchingPortalIndex), position, &next->position);
next->armature = armature;
next->materialIndex = materialIndex;
next->renderStageCullingMask = childCullingMask;

View file

@ -337,6 +337,10 @@ int renderShouldRenderOtherPortal(struct Scene* scene, int visiblePortal, struct
return 0;
}
if ((scene->player.body.flags & (RigidBodyIsTouchingPortalA << visiblePortal)) != 0 && properties->currentDepth == STARTING_RENDER_DEPTH) {
return 1;
}
struct Portal* portal = &scene->portals[visiblePortal];
struct BoundingBoxs16 portalBox;
portalBox.minX = (s16)(portal->collisionObject.boundingBox.min.x * SCENE_SCALE);