NAP
Public Member Functions | Public Attributes | List of all members
ZoomPanController Class Reference

#include <zoompancontroller.h>

Public Member Functions

virtual void getDependentComponents (std::vector< rtti::TypeInfo > &components) const override
 
- Public Member Functions inherited from Component
virtual const rtti::TypeInfo getInstanceType () const =0
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual bool init (utility::ErrorState &errorState)
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Public Attributes

nap::ResourcePtr< RenderWindowmRenderWindow = nullptr
 Property: 'Window' The window that displays the texture. More...
 
float mZoomSpeed = 1.0f
 Property: "ZoomSpeed" The speed with which to zoom. More...
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 

Description

2D texture zoom and pan camera controller.

Allows for freely moving around and zooming into a 2D texture using an orthographic camera. Use the 'frameTexture' function to adjust the scale and position of your texture, ensuring it fits perfectly in the viewport.

This component updates the projection and transform matrix of an orthographic camera, based on pointer input events. It therefore requires the following components to be present on the same entity.

After calling 'frameTexture':

Not calling 'frameTexture' allows you to use your own texture scale and orthographic camera settings. Note that for the component to work properly it can't have any parent transform, if it does the the result is undefined.

Inheritance diagram for ZoomPanController:
[legend]
Collaboration diagram for ZoomPanController:
[legend]

Member Function Documentation

◆ getDependentComponents()

virtual void getDependentComponents ( std::vector< rtti::TypeInfo > &  components) const
overridevirtual

Get a list of all component types that this component is dependent on (i.e. must be initialized before this one)

Parameters
componentsthe components this object depends on

Reimplemented from Component.

Member Data Documentation

◆ mRenderWindow

nap::ResourcePtr<RenderWindow> mRenderWindow = nullptr

Property: 'Window' The window that displays the texture.

◆ mZoomSpeed

float mZoomSpeed = 1.0f

Property: "ZoomSpeed" The speed with which to zoom.