(v. 0.5.3373) DrawContext doesn't have Camera

Tried to build with the latest version and I get

E3104: Fuse.DrawContext does not contain a member called 'Camera'. Could you be missing a package reference?

I’m trying to get the camera with (Entity)dc.Camera .

Documents still says it should be there and I haven’t seen a release log saying it’s moved.

So what’s going on? :slight_smile:

There is now DrawContext.Viewport that has the transform matrices in it. I’m hoping it’s just those matrices which you are looking for. You can’t get at the camera Entity anymore through DrawContext, you’ll have to find a different way to get at that if you want it.

Well I used to have access to Camera entity and therefor could change the camera.Transform.Position and set camera.Transform.LookAt plus camera.Frustum.FovRadians . This is all needed.

But since I add those things to my Scene

<Entity ux:Name="CameraEntity">
  <Frustum FovDegrees="120" ZNear="10" ZFar="3000" />
  <Transform3D Position="0, 0, 0" RotationDegrees="0, 0, 0" Scaling="1, 1, 1" />

I can point to them.

It was much nicer when the camera was available at DrawContext. Now when I need a camera position I’ll have to either pass it along my rendering pipelines as an extra by extending the DrawContext or make a static variable for it.

I can survive with this, but it was just nicer before.

Yes, I can understand that it was perhaps easier before when doing 3D, as I did the same thing in the project I’m working on. But we decided that to make the framework more generic, during the blending of 2D/3D that a high-level camera didn’t always make sense – it’s something a Scene has, but not a UI layout really. Instead the Frustum is the core concept that unifies them.