work on first level

This commit is contained in:
James Lambert 2022-06-05 20:11:08 -06:00
parent 7e5c49e094
commit b0e4348420
5 changed files with 6 additions and 5 deletions

View file

@ -28,6 +28,7 @@ void planeProjectPoint(struct Plane* plane, struct Vector3* point, struct Vector
vector3AddScaled(point, &plane->normal, distance, output);
}
// TODO figure out what to do when two points are the same
void calculateBarycentricCoords(struct Vector3* a, struct Vector3* b, struct Vector3* c, struct Vector3* point, struct Vector3* output) {
struct Vector3 v0;
struct Vector3 v1;

View file

@ -7,7 +7,7 @@ int worldCheckDoorwaySides(struct World* world, struct Vector3* position, int cu
for (int i = 0; i < room->doorwayCount; ++i) {
if (planePointDistance(&world->doorways[room->doorwayIndices[i]].quad.plane, position) > 0) {
sideMask |= 1 << 1;
sideMask |= 1 << i;
}
}
@ -20,7 +20,7 @@ int worldCheckDoorwayCrossings(struct World* world, struct Vector3* position, in
for (int i = 0; i < room->doorwayCount; ++i) {
struct Doorway* doorway = &world->doorways[room->doorwayIndices[i]];
int prevSide = (sideMask & (1 << 1)) != 0;
int prevSide = (sideMask & (1 << i)) != 0;
int currSide = planePointDistance(&doorway->quad.plane, position) > 0;
if (prevSide != currSide) {

View file

@ -12,9 +12,9 @@
#include "../audio/soundplayer.h"
#include "../audio/clips.h"
#define GRAB_RAYCAST_DISTANCE 3.5f
#define GRAB_RAYCAST_DISTANCE 2.5f
struct Vector3 gGrabDistance = {0.0f, 0.0f, -2.5f};
struct Vector3 gGrabDistance = {0.0f, 0.0f, -1.5f};
struct Vector3 gCameraOffset = {0.0f, 0.0f, 0.0f};
struct CollisionSphere gPlayerCollider = {

View file

@ -29,7 +29,7 @@
#include "../decor/decor_object_list.h"
#include "signals.h"
struct Vector3 gPortalGunOffset = {0.110957, -0.113587, -0.21916};
struct Vector3 gPortalGunOffset = {0.120957, -0.113587, -0.20916};
struct Vector3 gPortalGunForward = {0.1f, -0.1f, 1.0f};
struct Vector3 gPortalGunUp = {0.0f, 1.0f, 0.0f};