Drag[en]gine Script Module DragonScript  1.21
Dragengine.Gui.RotateCameraMouseListener Class Reference

Rotate camera director. More...

Inheritance diagram for Dragengine.Gui.RotateCameraMouseListener:
Dragengine.Gui.Events.DefaultMouseListener Dragengine.Gui.Events.MouseListener

Public Member Functions

int getButton ()
 Mouse button to track. More...
 
bool getClampAzimuth ()
 Clamp azimuth. More...
 
ElementCameraDirector getDirector ()
 Camera director to update. More...
 
float getMaximumAzimuth ()
 Maximum azimuth in degrees if clamping is enabled. More...
 
float getMaximumElevation ()
 Maximum elevation in degrees. More...
 
float getMinimumAzimuth ()
 Maximum azimuth in degrees if clamping is enabled. More...
 
float getMinimumElevation ()
 Minimum elevation in degrees. More...
 
int getModifiers ()
 Modifiers to track. More...
 
float getRotationSpeedAzimuth ()
 Azimuth rotation speed in degrees per pixel. More...
 
float getRotationSpeedElevation ()
 Elevation rotation speed in degrees per pixel. More...
 
RotateCameraMouseListener new (ElementCameraDirector director)
 Create mouse listener tracking right mouse button with no modifiers. More...
 
RotateCameraMouseListener new (ElementCameraDirector director, int trackButton, int modifiers)
 Create mouse listener. More...
 
void onButtonPress (MouseEvent event)
 Mouse button pressed. More...
 
void onButtonRelease (MouseEvent event)
 Mouse button release. More...
 
void onMouseMove (MouseEvent event)
 Mouse moved. More...
 
void setClampAzimuth (bool clamp)
 Set to clamp azimuth. More...
 
void setMaximumAzimuth (float azimuth)
 Set maximum azimuth in degrees if clamping is enabled. More...
 
void setMaximumElevation (float elevation)
 Set maximum elevation in degrees. More...
 
void setMinimumAzimuth (float azimuth)
 Set maximum azimuth in degrees if clamping is enabled. More...
 
void setMinimumElevation (float elevation)
 Set minimum elevation in degrees. More...
 
void setRotationSpeedAzimuth (float speed)
 Set azimuth rotation speed in degrees per pixel. More...
 
void setRotationSpeedElevation (float speed)
 Set elevation rotation speed in degrees per pixel. More...
 
- Public Member Functions inherited from Dragengine.Gui.Events.DefaultMouseListener
DefaultMouseListener new ()
 Create default mouse listener. More...
 
void onMouseEnter (MouseEvent event)
 Mouse has entered widget. More...
 
void onMouseLeave (MouseEvent event)
 Mouse has left widget. More...
 
void onMouseWheel (MouseEvent event)
 Mouse wheel moved. More...
 

Protected Member Functions

void onRotate ()
 Camera director has been rotated. More...
 
void onStartRotate ()
 Start rotating camera director. More...
 
void onStopRotate ()
 Stop rotating camera director. More...
 

Detailed Description

Rotate camera director.

Version
1.7

Set mouse button and modifiers required to trigger the listener. Once triggered moving left and right is translated to changes in camera director azimuth while moving up and down is translated to changes in camera director elevation.

The elevation is clamped to the range from -90 to 90 while the azimuth is free to rotate. Optionally the azimuth can be clamped too.

The camera director is not required to have an element assigned.

Member Function Documentation

◆ getButton()

int Dragengine.Gui.RotateCameraMouseListener.getButton ( )

Mouse button to track.

◆ getClampAzimuth()

bool Dragengine.Gui.RotateCameraMouseListener.getClampAzimuth ( )

Clamp azimuth.

◆ getDirector()

ElementCameraDirector Dragengine.Gui.RotateCameraMouseListener.getDirector ( )

Camera director to update.

◆ getMaximumAzimuth()

float Dragengine.Gui.RotateCameraMouseListener.getMaximumAzimuth ( )

Maximum azimuth in degrees if clamping is enabled.

◆ getMaximumElevation()

float Dragengine.Gui.RotateCameraMouseListener.getMaximumElevation ( )

Maximum elevation in degrees.

◆ getMinimumAzimuth()

float Dragengine.Gui.RotateCameraMouseListener.getMinimumAzimuth ( )

Maximum azimuth in degrees if clamping is enabled.

◆ getMinimumElevation()

float Dragengine.Gui.RotateCameraMouseListener.getMinimumElevation ( )

Minimum elevation in degrees.

◆ getModifiers()

int Dragengine.Gui.RotateCameraMouseListener.getModifiers ( )

Modifiers to track.

◆ getRotationSpeedAzimuth()

float Dragengine.Gui.RotateCameraMouseListener.getRotationSpeedAzimuth ( )

Azimuth rotation speed in degrees per pixel.

Negative speed rotates in the opposite direction.

◆ getRotationSpeedElevation()

float Dragengine.Gui.RotateCameraMouseListener.getRotationSpeedElevation ( )

Elevation rotation speed in degrees per pixel.

Negative speed rotates in the opposite direction.

◆ new() [1/2]

RotateCameraMouseListener Dragengine.Gui.RotateCameraMouseListener.new ( ElementCameraDirector  director)

Create mouse listener tracking right mouse button with no modifiers.

Parameters
directorCamera director to update.

◆ new() [2/2]

RotateCameraMouseListener Dragengine.Gui.RotateCameraMouseListener.new ( ElementCameraDirector  director,
int  trackButton,
int  modifiers 
)

Create mouse listener.

Parameters
directorCamera director to update.
trackButtonValue from InputEventMouseButton or custom.
modifiersModifiers from InputEventModifier or custom.

◆ onButtonPress()

void Dragengine.Gui.RotateCameraMouseListener.onButtonPress ( MouseEvent  event)

Mouse button pressed.

Captures mouse and starts tracking if button and modifiers match.

Reimplemented from Dragengine.Gui.Events.DefaultMouseListener.

◆ onButtonRelease()

void Dragengine.Gui.RotateCameraMouseListener.onButtonRelease ( MouseEvent  event)

Mouse button release.

If tracking stop tracking and release mouse capture.

Reimplemented from Dragengine.Gui.Events.DefaultMouseListener.

◆ onMouseMove()

void Dragengine.Gui.RotateCameraMouseListener.onMouseMove ( MouseEvent  event)

Mouse moved.

Rotate camera if tracking.

Reimplemented from Dragengine.Gui.Events.DefaultMouseListener.

◆ onRotate()

void Dragengine.Gui.RotateCameraMouseListener.onRotate ( )
protected

Camera director has been rotated.

◆ onStartRotate()

void Dragengine.Gui.RotateCameraMouseListener.onStartRotate ( )
protected

Start rotating camera director.

◆ onStopRotate()

void Dragengine.Gui.RotateCameraMouseListener.onStopRotate ( )
protected

Stop rotating camera director.

◆ setClampAzimuth()

void Dragengine.Gui.RotateCameraMouseListener.setClampAzimuth ( bool  clamp)

Set to clamp azimuth.

◆ setMaximumAzimuth()

void Dragengine.Gui.RotateCameraMouseListener.setMaximumAzimuth ( float  azimuth)

Set maximum azimuth in degrees if clamping is enabled.

◆ setMaximumElevation()

void Dragengine.Gui.RotateCameraMouseListener.setMaximumElevation ( float  elevation)

Set maximum elevation in degrees.

◆ setMinimumAzimuth()

void Dragengine.Gui.RotateCameraMouseListener.setMinimumAzimuth ( float  azimuth)

Set maximum azimuth in degrees if clamping is enabled.

◆ setMinimumElevation()

void Dragengine.Gui.RotateCameraMouseListener.setMinimumElevation ( float  elevation)

Set minimum elevation in degrees.

◆ setRotationSpeedAzimuth()

void Dragengine.Gui.RotateCameraMouseListener.setRotationSpeedAzimuth ( float  speed)

Set azimuth rotation speed in degrees per pixel.

Negative speed rotates in the opposite direction.

◆ setRotationSpeedElevation()

void Dragengine.Gui.RotateCameraMouseListener.setRotationSpeedElevation ( float  speed)

Set elevation rotation speed in degrees per pixel.

Negative speed rotates in the opposite direction.


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