MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / SetProjector

Method SetProjector

Source/Engine/Graphics/RenderView.cpp:170–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170void RenderView::SetProjector(float nearPlane, float farPlane, const Float3& position, const Float3& direction, const Float3& up, float angle)
171{
172 // Copy data
173 Near = nearPlane;
174 Far = farPlane;
175 Position = position;
176
177 // Create projection matrix
178 Matrix::PerspectiveFov(angle * DegreesToRadians, 1.0f, nearPlane, farPlane, Projection);
179 NonJitteredProjection = Projection;
180 Matrix::Invert(Projection, IP);
181
182 // Create view matrix
183 Direction = direction;
184 Matrix::LookAt(Position, Position + Direction, up, View);
185 Matrix::Invert(View, IV);
186
187 // Compute frustum matrix
188 Frustum.SetMatrix(View, Projection);
189 Matrix::Invert(ViewProjection(), IVP);
190 CullingFrustum = Frustum;
191}
192
193void RenderView::CopyFrom(const Camera* camera, const Viewport* viewport)
194{

Callers 1

SetupLightMethod · 0.45

Calls 3

ViewProjectionFunction · 0.85
InvertFunction · 0.50
SetMatrixMethod · 0.45

Tested by

no test coverage detected