17 m_previousRenderTime = 0;
31 double viewAngle = 45;
36 float frontClippingDistance = 0.1;
37 float backClippingDistance = 500;
47 assert(!m_pViewManager);
51 m_pViewManager->
SetFrustrum(viewAngle, frontClippingDistance, backClippingDistance);
52 m_previousRenderTime = 0;
70 delete m_pViewManager;
80 assert(m_pViewManager);
82 m_pViewManager->
Add(&rROI);
91 assert(m_pViewManager);
93 m_pViewManager->
Remove(&rROI);
95 if (m_pPointOfView == &rROI) {
111 m_pPointOfView = &rROI;
113 assert(m_pViewManager);
128 assert(m_pViewManager);
130 if (m_pPointOfView == &rROI) {
150 assert(m_pViewManager);
151 m_pViewManager->
Update(m_previousRenderTime, p_und);
153 return m_previousRenderTime;
[AI] Represents a 3D view for rendering and managing LEGO game objects in a 3D scene.
BOOL Create(const CreateStruct &rCreateStruct, Tgl::Renderer *pRenderer)
[AI] Initializes the 3D view with the specified surface creation parameters and renderer interface.
BOOL Add(ViewROI &rROI)
[AI] Adds a ViewROI (renderable object instance) to the scene.
BOOL SetPointOfView(ViewROI &rROI)
[AI] Sets the current point of view to the specified ViewROI and updates the camera transformation.
void Destroy() override
[AI] Cleans up resources allocated by the view, including the ViewManager, unset the point of view,...
~Lego3DView() override
[AI] Destroys the Lego3DView instance and all associated resources via Destroy().
BOOL Moved(ViewROI &rROI)
[AI] Notifies the view that a ViewROI has moved.
ViewROI * Pick(unsigned long x, unsigned long y)
[AI] Picks (selects) a ViewROI in the scene by screen-space coordinates.
BOOL Remove(ViewROI &rROI)
[AI] Removes a ViewROI from the scene.
void Destroy() override
[AI] Safely removes all lights from the scene, deletes them, and nulls pointers.
BOOL Create(const TglSurface::CreateStruct &rCreateStruct, Tgl::Renderer *pRenderer)
[AI] Initializes scene, camera, and three types of lights (sun, directional, ambient) using supplied ...
Tgl::Group * GetScene() const
[AI] Accessor for the root scene group.
Tgl::Camera * GetCamera() const
[AI] Accessor for the view's main camera.
4x4 Matrix class with virtual interface for manipulation and transformation.
void GetLocalTransform(Matrix4 &p_transform)
Retrieves the local-to-world transformation, or if there is a parent, computes the transform relative...
Tgl::View * GetView() const
[AI] Gets the current view/camera for this surface.
virtual double Render()
[AI] Renders a single frame and returns the render time for that frame.
unsigned long GetWidth() const
[AI] Returns the width (in pixels) of the rendered surface.
unsigned long GetHeight() const
[AI] Returns the height (in pixels) of the rendered surface.
virtual Result SetTransformation(FloatMatrix4 &)=0
[AI] Sets the transformation matrix for the camera.
[AI] Main interface/factory for rendering resources and scene graphs.
virtual Result SetFrustrum(float frontClippingDistance, float backClippingDistance, float degrees)=0
[AI] Sets front and back clipping planes and view field in degrees.
[AI] Manages all ViewROI objects that are rendered in a given scene, handles frustum culling,...
void SetFrustrum(float fov, float front, float back)
[AI] Sets the projection frustum parameters and marks the frustum as needing recalculation.
void SetPOVSource(const OrientableROI *point_of_view)
[AI] Sets the OrientableROI to use as the camera's point-of-view; updates the transformation matrix a...
ViewROI * Pick(Tgl::View *p_view, unsigned long x, unsigned long y)
[AI] Using a screen coordinate and viewport, finds the ViewROI (if any) under the given coordinates b...
void Update(float p_previousRenderTime, float)
[AI] Performs the per-frame update: applies frustum/view updates if needed and recurses the ROI graph...
void SetResolution(int width, int height)
[AI] Sets the viewport resolution and marks the frustum as needing recalculation.
void Remove(ViewROI *p_roi)
[AI] Removes a single ViewROI from the managed ROI list, also detaching any associated LOD data from ...
void Add(ViewROI *p_roi)
[AI] Adds a ViewROI object to the list of managed ROI objects.
[AI] ViewROI objects represent viewable and placeable objects in the scene, each holding their own tr...
#define DECOMP_SIZE_ASSERT(T, S)
int Succeeded(Result result)
[AI] Returns whether a Tgl::Result indicates success.
Result
[AI] Result type used throughout the Tgl API to report operation success or failure.
float FloatMatrix4[4][4]
[AI] Represents a 4x4 matrix of single-precision floating point values.
[AI] Contains initialization parameters for creating a TglSurface and its underlying DDraw/D3D resour...
BOOL m_isWideViewAngle
[AI] Enables wide or default field-of-view projection.