Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FutureTech Unity Shaders
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MOVES
FutureTech Unity Shaders
Commits
ca2a462f
Commit
ca2a462f
authored
5 years ago
by
Guerrero, Michael J
Browse files
Options
Downloads
Patches
Plain Diff
Fixed incorrect transformations.
parent
1aaffc1e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/PlanarReflection.cs
+5
-5
5 additions, 5 deletions
Code/PlanarReflection.cs
with
5 additions
and
5 deletions
Code/PlanarReflection.cs
+
5
−
5
View file @
ca2a462f
...
...
@@ -34,18 +34,18 @@ public class PlanarReflection : MonoBehaviour
Vector3
cameraForwardPlane
=
reflectionPlaneObject
.
InverseTransformDirection
(
cameraForwardWorld
);
Vector3
cameraUpPlane
=
reflectionPlaneObject
.
InverseTransformDirection
(
cameraUpWorld
);
Vector3
cameraPosPlane
=
reflectionPlaneObject
.
InverseTransform
Direction
(
cameraPosWorld
);
Vector3
cameraPosPlane
=
reflectionPlaneObject
.
InverseTransform
Point
(
cameraPosWorld
);
cameraForwardPlane
.
y
*=
-
1f
;
cameraUpPlane
.
y
*=
-
1f
;
cameraPosPlane
.
y
*=
-
1f
;
cameraForwardWorld
=
reflectionPlaneObject
.
TransformDirection
(
cameraForward
World
);
cameraUpWorld
=
reflectionPlaneObject
.
TransformDirection
(
cameraUp
World
);
cameraPosWorld
=
reflectionPlaneObject
.
Transform
Direction
(
cameraPos
World
);
cameraForwardWorld
=
reflectionPlaneObject
.
TransformDirection
(
cameraForward
Plane
);
cameraUpWorld
=
reflectionPlaneObject
.
TransformDirection
(
cameraUp
Plane
);
cameraPosWorld
=
reflectionPlaneObject
.
Transform
Point
(
cameraPos
Plane
);
reflectionCamera
.
transform
.
position
=
cameraPosWorld
;
reflectionCamera
.
transform
.
LookAt
(
cameraPosWorld
+
cameraForwardWorld
,
camera
Pos
World
);
reflectionCamera
.
transform
.
LookAt
(
cameraPosWorld
+
cameraForwardWorld
,
camera
Up
World
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment