Skip to content

Commit

Permalink
Remove collisionSceneGetPortalRotation()
Browse files Browse the repository at this point in the history
  • Loading branch information
mwpenny committed Apr 6, 2024
1 parent 97b31b4 commit 62c49dd
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
6 changes: 0 additions & 6 deletions src/physics/collision_scene.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,12 +514,6 @@ void collisionSceneGetPortalTransform(int fromPortal, struct Transform* out) {
transformConcat(gCollisionScene.portalTransforms[1 - fromPortal], &inverseA, out);
}

void collisionSceneGetPortalRotation(int fromPortal, struct Quaternion* out) {
struct Quaternion inverse;
quatConjugate(&gCollisionScene.portalTransforms[fromPortal]->rotation, &inverse);
quatMultiply(&gCollisionScene.portalTransforms[1 - fromPortal]->rotation, &inverse, out);
}

void collisionSceneAddDynamicObject(struct CollisionObject* object) {
if (gCollisionScene.dynamicObjectCount < MAX_DYNAMIC_OBJECTS) {
gCollisionScene.dynamicObjects[gCollisionScene.dynamicObjectCount] = object;
Expand Down
1 change: 0 additions & 1 deletion src/physics/collision_scene.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ int collisionSceneRaycast(struct CollisionScene* scene, int roomIndex, struct Ra
int collisionSceneRaycastOnlyDynamic(struct CollisionScene* scene, struct Ray* ray, int collisionLayers, float maxDistance, struct RaycastHit* hit);

void collisionSceneGetPortalTransform(int fromPortal, struct Transform* out);
void collisionSceneGetPortalRotation(int fromPortal, struct Quaternion* out);

void collisionSceneAddDynamicObject(struct CollisionObject* object);
void collisionSceneRemoveDynamicObject(struct CollisionObject* object);
Expand Down
6 changes: 1 addition & 5 deletions src/player/player.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,7 @@ void playerPortalGrabTransform(struct Player* player, struct Vector3* grabPoint,
return;
}
struct Transform pointTransform;
if (grabPoint) {
collisionSceneGetPortalTransform(player->grabbingThroughPortal > 0 ? 0 : 1, &pointTransform);
} else {
collisionSceneGetPortalRotation(player->grabbingThroughPortal > 0 ? 0 : 1, &pointTransform.rotation);
}
collisionSceneGetPortalTransform(player->grabbingThroughPortal > 0 ? 0 : 1, &pointTransform);

for (int i = 0; i < abs(player->grabbingThroughPortal); ++i) {
if (grabPoint) {
Expand Down

0 comments on commit 62c49dd

Please sign in to comment.