Isle
Loading...
Searching...
No Matches
LegoPointOfViewController Class Reference

[AI] Controller that links mouse actions to manipulation of the user's point of view in the 3D scene. More...

#include <legopointofviewcontroller.h>

Inheritance diagram for LegoPointOfViewController:
Collaboration diagram for LegoPointOfViewController:

Public Member Functions

 LegoPointOfViewController ()
 [AI] Initializes state for coordinating mouse and point-of-view. [AI] More...
 
 ~LegoPointOfViewController () override
 [AI] Destructor; cleans up any owned references. [AI] More...
 
MxResult Tickle () override
 [AI] Called each frame (tick) to update the state of the point of view, potentially responding to input or animation. More...
 
void LeftDown (int p_x, int p_y) override
 [AI] Called when left mouse button is pressed; may start point-of-view manipulation. More...
 
void LeftDrag (int p_x, int p_y) override
 [AI] Called when cursor moves with left mouse button held; typically drags the point of view. More...
 
void LeftUp (int p_x, int p_y) override
 [AI] Called when the left button is released, possibly to end the manipulation and update the camera/entity. More...
 
void RightDown (int p_x, int p_y) override
 [AI] Called when the right mouse button is pressed; often used for alternative camera controls. More...
 
void RightDrag (int p_x, int p_y) override
 [AI] Called when right button is held and cursor is moved, e.g., for rotational camera movement. More...
 
void RightUp (int p_x, int p_y) override
 [AI] Called when the right mouse button is released, possibly to finalize alternative camera/entity action. More...
 
virtual void SetEntity (LegoEntity *p_entity)
 [AI] Assign the entity which this controller operates on, typically to associate the point of view with a specific character or camera. More...
 
MxResult Create (Lego3DView *p_lego3DView)
 [AI] Initializes the controller with a specific 3D view. More...
 
void OnViewSize (int p_width, int p_height)
 [AI] Updates the controller's internal state for a view size change, such as resizing the 3D viewport. More...
 
LegoEntityGetEntity ()
 [AI] Accessor for the currently attached entity. More...
 
LegoNavControllerGetNavController ()
 [AI] Accessor for the navigation controller associated with this point-of-view controller. More...
 
- Public Member Functions inherited from LegoMouseController
 LegoMouseController ()
 [AI] Constructor initializing state of mouse button. [AI] More...
 
 ~LegoMouseController () override
 [AI] Destructor for mouse controller. [AI] More...
 
virtual void LeftDown (int, int)
 [AI] Invoked when the left mouse button is pressed. More...
 
virtual void LeftDrag (int, int)
 [AI] Invoked as the mouse drags while the left button is held. More...
 
virtual void LeftUp (int, int)
 [AI] Invoked when the left mouse button is released. More...
 
virtual void RightDown (int, int)
 [AI] Invoked when the right mouse button is pressed. More...
 
virtual void RightDrag (int, int)
 [AI] Invoked as the mouse drags while the right button is held. More...
 
virtual void RightUp (int, int)
 [AI] Invoked when the right mouse button is released. More...
 
BOOL GetIsButtonDown ()
 [AI] Returns whether any mouse button is currently in the 'down' state. More...
 
MxDouble GetButtonX ()
 [AI] Returns the X coordinate where the last mouse button event occurred. More...
 
MxDouble GetButtonY ()
 [AI] Returns the Y coordinate where the last mouse button event occurred. More...
 
- Public Member Functions inherited from MxCore
 MxCore ()
 [AI] Constructs a new MxCore object and assigns it a unique id. More...
 
virtual ~MxCore ()
 [AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More...
 
virtual MxLong Notify (MxParam &p_param)
 [AI] Virtual callback notification mechanism. More...
 
virtual MxResult Tickle ()
 [AI] Called by tickle managers to allow the object to update itself. More...
 
virtual const char * ClassName () const
 [AI] Returns the runtime class name of this object. More...
 
virtual MxBool IsA (const char *p_name) const
 [AI] Checks whether this object's class type or parents match the given name. More...
 
MxU32 GetId ()
 [AI] Gets the unique (per-process) id assigned to this object instance. More...
 

Protected Member Functions

void AffectPointOfView ()
 [AI] Internal method to compute and apply the effect of user mouse input on the current point of view, entity, or camera, as appropriate. More...
 

Protected Attributes

Lego3DViewm_lego3DView
 [AI] The active 3D view that input actions are translated into. [AI] More...
 
LegoEntitym_entity
 [AI] The entity whose point of view this controller manipulates. [AI] More...
 
MxDouble m_entityOffsetUp
 [AI] Offset along the entity's upward vector (for perspective/camera alignment). [AI] More...
 
LegoNavControllerm_nav
 [AI] Navigation controller used to translate input to navigation/camera changes. [AI] More...
 

Detailed Description

[AI] Controller that links mouse actions to manipulation of the user's point of view in the 3D scene.

[AI]

[AI] Extends LegoMouseController to apply mouse button and drag events to camera or entity point of view control. Connects actions such as dragging or clicking to navigation/camera manipulation, typically inside a 3D game view. Holds references to entity and navigation controller to enable direct manipulation and feedback. [AI]

Definition at line 106 of file legopointofviewcontroller.h.

Constructor & Destructor Documentation

◆ LegoPointOfViewController()

LegoPointOfViewController::LegoPointOfViewController ( )

[AI] Initializes state for coordinating mouse and point-of-view. [AI]

Definition at line 82 of file legopovcontroller.cpp.

◆ ~LegoPointOfViewController()

LegoPointOfViewController::~LegoPointOfViewController ( )
override

[AI] Destructor; cleans up any owned references. [AI]

Definition at line 94 of file legopovcontroller.cpp.

Member Function Documentation

◆ AffectPointOfView()

void LegoPointOfViewController::AffectPointOfView ( )
protected

[AI] Internal method to compute and apply the effect of user mouse input on the current point of view, entity, or camera, as appropriate.

[AI]

Definition at line 135 of file legopovcontroller.cpp.

◆ Create()

MxResult LegoPointOfViewController::Create ( Lego3DView p_lego3DView)

[AI] Initializes the controller with a specific 3D view.

[AI]

Parameters
p_lego3DView[AI] Target 3D view context for rendering and input. [AI]
Returns
[AI] Status of creation. [AI]

Definition at line 104 of file legopovcontroller.cpp.

◆ GetEntity()

LegoEntity * LegoPointOfViewController::GetEntity ( )
inline

[AI] Accessor for the currently attached entity.

[AI]

Definition at line 201 of file legopointofviewcontroller.h.

◆ GetNavController()

LegoNavController * LegoPointOfViewController::GetNavController ( )
inline

[AI] Accessor for the navigation controller associated with this point-of-view controller.

[AI]

Definition at line 206 of file legopointofviewcontroller.h.

◆ LeftDown()

void LegoPointOfViewController::LeftDown ( int  p_x,
int  p_y 
)
overridevirtual

[AI] Called when left mouse button is pressed; may start point-of-view manipulation.

[AI]

Parameters
p_x[AI] X coordinate. [AI]
p_y[AI] Y coordinate. [AI]

Reimplemented from LegoMouseController.

Definition at line 121 of file legopovcontroller.cpp.

◆ LeftDrag()

void LegoPointOfViewController::LeftDrag ( int  p_x,
int  p_y 
)
overridevirtual

[AI] Called when cursor moves with left mouse button held; typically drags the point of view.

[AI]

Parameters
p_x[AI] New X coordinate. [AI]
p_y[AI] New Y coordinate. [AI]

Reimplemented from LegoMouseController.

Definition at line 128 of file legopovcontroller.cpp.

◆ LeftUp()

void LegoPointOfViewController::LeftUp ( int  p_x,
int  p_y 
)
inlineoverridevirtual

[AI] Called when the left button is released, possibly to end the manipulation and update the camera/entity.

[AI]

Parameters
p_x[AI] Release X. [AI]
p_y[AI] Release Y. [AI]

Reimplemented from LegoMouseController.

Definition at line 136 of file legopointofviewcontroller.h.

◆ OnViewSize()

void LegoPointOfViewController::OnViewSize ( int  p_width,
int  p_height 
)

[AI] Updates the controller's internal state for a view size change, such as resizing the 3D viewport.

[AI]

Parameters
p_width[AI] New width in pixels. [AI]
p_height[AI] New height in pixels. [AI]

Definition at line 115 of file legopovcontroller.cpp.

◆ RightDown()

void LegoPointOfViewController::RightDown ( int  p_x,
int  p_y 
)
inlineoverridevirtual

[AI] Called when the right mouse button is pressed; often used for alternative camera controls.

[AI]

Parameters
p_x[AI] X coordinate. [AI]
p_y[AI] Y coordinate. [AI]

Reimplemented from LegoMouseController.

Definition at line 148 of file legopointofviewcontroller.h.

◆ RightDrag()

void LegoPointOfViewController::RightDrag ( int  p_x,
int  p_y 
)
inlineoverridevirtual

[AI] Called when right button is held and cursor is moved, e.g., for rotational camera movement.

[AI]

Parameters
p_x[AI] New X coordinate. [AI]
p_y[AI] New Y coordinate. [AI]

Reimplemented from LegoMouseController.

Definition at line 160 of file legopointofviewcontroller.h.

◆ RightUp()

void LegoPointOfViewController::RightUp ( int  p_x,
int  p_y 
)
inlineoverridevirtual

[AI] Called when the right mouse button is released, possibly to finalize alternative camera/entity action.

[AI]

Parameters
p_x[AI] Release X coordinate. [AI]
p_y[AI] Release Y coordinate. [AI]

Reimplemented from LegoMouseController.

Definition at line 172 of file legopointofviewcontroller.h.

◆ SetEntity()

void LegoPointOfViewController::SetEntity ( LegoEntity p_entity)
virtual

[AI] Assign the entity which this controller operates on, typically to associate the point of view with a specific character or camera.

[AI]

Parameters
p_entity[AI] Pointer to target LegoEntity. [AI]

Definition at line 192 of file legopovcontroller.cpp.

◆ Tickle()

MxResult LegoPointOfViewController::Tickle ( )
overridevirtual

[AI] Called each frame (tick) to update the state of the point of view, potentially responding to input or animation.

[AI]

Returns
[AI] Result indicating status of the tick (success or error). [AI]

Reimplemented from MxCore.

Definition at line 142 of file legopovcontroller.cpp.

Member Data Documentation

◆ m_entity

LegoEntity* LegoPointOfViewController::m_entity
protected

[AI] The entity whose point of view this controller manipulates. [AI]

Definition at line 215 of file legopointofviewcontroller.h.

◆ m_entityOffsetUp

MxDouble LegoPointOfViewController::m_entityOffsetUp
protected

[AI] Offset along the entity's upward vector (for perspective/camera alignment). [AI]

Definition at line 216 of file legopointofviewcontroller.h.

◆ m_lego3DView

Lego3DView* LegoPointOfViewController::m_lego3DView
protected

[AI] The active 3D view that input actions are translated into. [AI]

Definition at line 214 of file legopointofviewcontroller.h.

◆ m_nav

LegoNavController* LegoPointOfViewController::m_nav
protected

[AI] Navigation controller used to translate input to navigation/camera changes. [AI]

Definition at line 217 of file legopointofviewcontroller.h.


The documentation for this class was generated from the following files: