Please review any and all PUBLIC repositories, groups and associate files. These allow anyone on the Internet to access without authentication. Repository and group owners are responsible for their content and permission settings. Go to your project(s), click on Settings > General and expand the "Visibility, project features, permissions" to change this setting.

Commit ca2a462f authored by Guerrero, Michael J's avatar Guerrero, Michael J

Fixed incorrect transformations.

parent 1aaffc1e
......@@ -34,18 +34,18 @@ public class PlanarReflection : MonoBehaviour
Vector3 cameraForwardPlane = reflectionPlaneObject.InverseTransformDirection(cameraForwardWorld);
Vector3 cameraUpPlane = reflectionPlaneObject.InverseTransformDirection(cameraUpWorld);
Vector3 cameraPosPlane = reflectionPlaneObject.InverseTransformDirection(cameraPosWorld);
Vector3 cameraPosPlane = reflectionPlaneObject.InverseTransformPoint(cameraPosWorld);
cameraForwardPlane.y *= -1f;
cameraUpPlane.y *= -1f;
cameraPosPlane.y *= -1f;
cameraForwardWorld = reflectionPlaneObject.TransformDirection(cameraForwardWorld);
cameraUpWorld = reflectionPlaneObject.TransformDirection(cameraUpWorld);
cameraPosWorld = reflectionPlaneObject.TransformDirection(cameraPosWorld);
cameraForwardWorld = reflectionPlaneObject.TransformDirection(cameraForwardPlane);
cameraUpWorld = reflectionPlaneObject.TransformDirection(cameraUpPlane);
cameraPosWorld = reflectionPlaneObject.TransformPoint(cameraPosPlane);
reflectionCamera.transform.position = cameraPosWorld;
reflectionCamera.transform.LookAt(cameraPosWorld + cameraForwardWorld, cameraPosWorld);
reflectionCamera.transform.LookAt(cameraPosWorld + cameraForwardWorld, cameraUpWorld);
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment