Make contact filtering on portals more accurate the portal surface

This commit is contained in:
James Lambert 2023-09-24 09:23:30 -06:00
parent 55142fe61c
commit 02d3bb6e7e
3 changed files with 5 additions and 5 deletions

View file

@ -186,7 +186,8 @@ int collisionSceneIsTouchingSinglePortal(struct Vector3* contactPoint, struct Ve
return 0;
}
localPoint.x *= (1.0f / PORTAL_X_RADIUS);
localPoint.x *= (2.0f / PORTAL_COVER_WIDTH);
localPoint.y *= (2.0f / PORTAL_COVER_HEIGHT);
localPoint.z = 0.0f;
if (vector3MagSqrd(&localPoint) >= 1.0f) {

View file

@ -8,8 +8,10 @@
#include "defs.h"
#include "point_constraint.h"
#define PORTAL_COVER_HEIGHT 0.708084f
#define PORTAL_COVER_WIDTH 0.84085f
#define PORTAL_THICKNESS 0.11f
#define PORTAL_X_RADIUS 0.5f
struct CollisionScene {
struct CollisionObject* quads;

View file

@ -36,9 +36,6 @@ struct Portal {
struct Quaternion relativeRotation;
};
#define PORTAL_COVER_HEIGHT 0.708084f
#define PORTAL_COVER_WIDTH 0.84085f
#define NO_PORTAL 0xFF
#define PORTAL_RENDER_TYPE_VISIBLE_0 (1 << 0)