We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b34fc77 commit cf0b8fcCopy full SHA for cf0b8fc
packages/fragments/src/FragmentsModels/src/model/raycast-manager.ts
@@ -154,9 +154,14 @@ export class RaycastManager {
154
}
155
156
private setEnds(camera: THREE.Camera) {
157
- this._n.constant = camera.position.length();
+ if (camera instanceof THREE.OrthographicCamera) {
158
+ this._n.constant = camera.near;
159
+ this._f.constant = camera.far;
160
+ } else {
161
+ this._n.constant = camera.position.length();
162
+ this._f.constant = Infinity;
163
+ }
164
this._f.normal = this._n.normal;
- this._f.constant = Infinity;
165
166
167
private screenToCast(p: Point, element: any, result = new THREE.Vector2()) {
0 commit comments