Fixes players and objects clipping out of stage with wall/ground portal

- this fix was implemented by simply clamping the x and y of the localPoint
  to -0.1-0.1 and -0.2-0.2 respectively.
- objects can no longer clip through stage
- player can no longer clip through stage

Fixes #13
This commit is contained in:
Weston Salinas 2023-03-26 15:54:18 -05:00
parent 4736414bed
commit e654225970
3 changed files with 7 additions and 3 deletions

View file

@ -124,11 +124,9 @@ Where `/home/james/Blender/blender-2.93.1-linux-x64` is the folder where Blender
- [ ] Ambient background loop - [ ] Ambient background loop
## Current Bug TODO List (Hardware Verified) (High->Low priority) ## Current Bug TODO List (Hardware Verified) (High->Low priority)
- [ ] Player can clip through any level by placing one portal on wall and another portal right next to it on ground. #13
- [ ] Player can clip through chamber 7 by walking back up the stairs (near the top). - [ ] Player can clip through chamber 7 by walking back up the stairs (near the top).
- [ ] player can clip through back of elevator by jumping and strafeing at the back corners while inside. - [ ] player can clip through back of elevator by jumping and strafeing at the back corners while inside.
- [ ] Player can strap themselves in chamber 5 by following instructions issue #75 - [ ] Player can trap themselves in chamber 5 by following instructions issue #75
- [ ] Any grabbable object can be clipped through level by wall/floor portals method.
- [ ] Two wall portals next to eachother can be used to clip any object out of any level by pushing it into corner, then dropping. - [ ] Two wall portals next to eachother can be used to clip any object out of any level by pushing it into corner, then dropping.
- [ ] Glass can be walked through from one side on multiple levels (0,1,4,...) - [ ] Glass can be walked through from one side on multiple levels (0,1,4,...)
- [ ] Passing into a ceiling portal can sometimes mess with the player rotation - [ ] Passing into a ceiling portal can sometimes mess with the player rotation
@ -140,3 +138,5 @@ Where `/home/james/Blender/blender-2.93.1-linux-x64` is the folder where Blender
- [ ] Door at end of room 2, chamber 10 isnt rendered properly - [ ] Door at end of room 2, chamber 10 isnt rendered properly
- [ ] various visual glitches when running NTSC on PAL console #65 - [ ] various visual glitches when running NTSC on PAL console #65
- [ ] various visual glitches when running PAL on NTSC console #65 - [ ] various visual glitches when running PAL on NTSC console #65
- [x] Any grabbable object can be clipped through level by wall/floor portals method.
- [x] Player can clip through any level by placing one portal on wall and another portal right next to it on ground. #13

View file

@ -177,6 +177,9 @@ void rigidBodyTeleport(struct RigidBody* rigidBody, struct Transform* from, stru
transformPointInverseNoScale(from, &rigidBody->transform.position, &localPoint); transformPointInverseNoScale(from, &rigidBody->transform.position, &localPoint);
localPoint.x = clampf(localPoint.x, -0.1, 0.1);
localPoint.y = clampf(localPoint.y, -0.2, 0.2);
transformPoint(to, &localPoint, &rigidBody->transform.position); transformPoint(to, &localPoint, &rigidBody->transform.position);
struct Quaternion inverseARotation; struct Quaternion inverseARotation;

View file

@ -3,6 +3,7 @@
#include "../math/basis.h" #include "../math/basis.h"
#include "../math/transform.h" #include "../math/transform.h"
#include "../math/mathf.h"
#include "./collision.h" #include "./collision.h"
#define KILL_PLANE_Y -10.0f #define KILL_PLANE_Y -10.0f