Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #521 from kragol/project_for_scene_input
Browse files Browse the repository at this point in the history
project(::Scene,::T<:StaticVector) to mirror the to_world method
  • Loading branch information
SimonDanisch authored Oct 12, 2020
2 parents 9e8b7c8 + 31b4482 commit a9e95de
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/camera/projection_math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,16 @@ function to_world(
to_world(zeros(Point{N, T}), prj_view_inv, cam_res)
end

function project(scene::Scene,point::T) where T<:StaticVector
cam = scene.camera
project(
cam.projection[] *
cam.view[] *
transformationmatrix(scene)[],
Vec2(scene.resolution[]), point
)
end

function project(matrix::Mat4f0, p::T, dim4 = 1.0) where T <: VecTypes
p = to_ndim(Vec4f0, to_ndim(Vec3f0, p, 0.0), dim4)
p = matrix * p
Expand Down

2 comments on commit a9e95de

@SimonDanisch
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/22853

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.12.15 -m "<description of version>" a9e95de783434c76f08f2f3da2ec45f1469ad15a
git push origin v0.12.15

Please sign in to comment.