Constructor
new ControlsBase(renderer, lookAtopt, enableVRopt)
- Source:
 
Properties:
| Name | Type | Description | 
|---|---|---|
renderer | 
            
            Lore.Renderer | A Lore.Renderer instance.  | 
        
camera | 
            
            Lore.CameraBase | A Lore.CameraBase extending object.  | 
        
canvas | 
            
            HTMLElement | A canvas HTMLElement.  | 
        
lowFps | 
            
            Number | The FPS limit when throttling FPS.  | 
        
highFps | 
            
            Number | The FPS limit when not throttling FPS.  | 
        
touchMode | 
            
            String | The current touch mode.  | 
        
lookAt | 
            
            Lore.Vector3f | The current lookat associated with these controls.  | 
        
Creates an instance of ControlsBase.
Parameters:
| Name | Type | Attributes | Default | Description | 
|---|---|---|---|---|
renderer | 
            
            Lore.Renderer | An instance of a Lore renderer.  | 
        ||
lookAt | 
            
            Boolean | 
                
                    <optional> | 
            
            
                
                
                    new Lore.Vector3f()
                
                 | 
            
            The look at vector of the controls.  | 
        
enableVR | 
            
            Boolean | 
                
                    <optional> | 
            
            
                
                
                    false
                
                 | 
            
            Whether or not to track phone spatial information using the WebVR API.  | 
        
Methods
addEventListener(eventName, callback)
- Source:
 
Adds an event listener to this controls instance.
Parameters:
| Name | Type | Description | 
|---|---|---|
eventName | 
            
            String | The name of the event that is to be listened for.  | 
        
callback | 
            
            function | A callback function to be called on the event being fired.  | 
        
getLookAt() → {Lore.Vector3f}
- Source:
 
Returns the current look at vector associated with this controls.
Returns:
The current look at vector.
- Type
 - Lore.Vector3f
 
initWebVR()
- Source:
 
Initialiizes WebVR, if the API is available and the device suppports it.
raiseEvent(eventName, data)
- Source:
 
Raises an event.
Parameters:
| Name | Type | Description | 
|---|---|---|
eventName | 
            
            String | The name of the event to be raised.  | 
        
data | 
            
            * | The data to be supplied to the callback function.  | 
        
removeEventListener(eventName, callback)
- Source:
 
Remove an event listener from this controls instance.
Parameters:
| Name | Type | Description | 
|---|---|---|
eventName | 
            
            String | The name of the event that is to be listened for.  | 
        
callback | 
            
            function | A callback function to be called on the event being fired.  | 
        
setLookAt(lookAt) → {Lore.OrbitalControls}
- Source:
 
Sets the lookat vector, which is the center of the orbital camera sphere.
Parameters:
| Name | Type | Description | 
|---|---|---|
lookAt | 
            
            Lore.Vector3f | The lookat vector.  | 
        
Returns:
Returns itself.
- Type
 - Lore.OrbitalControls
 
update(e, source) → {Lore.ControlsBase}
- Source:
 
Update the camera (on mouse move, touch drag, mousewheel scroll, ...).
Parameters:
| Name | Type | Description | 
|---|---|---|
e | 
            
            * | A mouse or touch events data.  | 
        
source | 
            
            String | The source of the input ('left', 'middle', 'right', 'wheel', ...).  | 
        
Returns:
Returns itself.
- Type
 - Lore.ControlsBase