Classes
- Animation
Interpolation helper for animations
- Dynamic
Represents a variable that can dynamically change with time (using requestAnimationFrame)
- MultiDynamic
Wrapper for multiple PSV.utils.Dynamic evolving together
- Slider
Helper to make sliders elements
Methods
-
Adds one or several CSS classes to an element
-
Name Type Description element
HTMLElement className
string -
Applies the inverse of Euler angles to a vector
-
Name Type Description vector
external:THREE.Vector3 euler
external:THREE.Euler -
Parse a CSS-like position into an array of position keywords among top, bottom, left, right and center
-
Name Type Description value
string | Array.<string> options
object optional Name Type Default Description allowCenter
boolean true optional allow "center center"
cssOrder
boolean true optional force CSS order (y axis then x axis)
Returns:
Type Description Array.<string> -
Deeply clones an object
-
Name Type Description src
Object Returns:
Type Description Object -
PSV.utils.createTexture (img)external:THREE.Texture static
Creates a THREE texture from an image
-
Name Type Description img
HTMLImageElement | HTMLCanvasElement Returns:
Type Description external:THREE.Texture -
Transforms a string to dash-case https://github.com/shahata/dasherize
-
Name Type Description str
string Returns:
Type Description string -
Merges the enumerable attributes of two objects
-
Replaces arrays and alters the target object.
Name Type Description target
Object src
Object - Copyright:
- Nicholas Fisher
- Nicholas Fisher
Returns:
Type Description Object target -
Computes the distance between two points
-
Name Type Description p1
PSV.Point p2
PSV.Point Returns:
Type Description number -
Loops over enumerable properties of an object
-
Name Type Description object
Object callback
function -
Exits fullscreen mode
-
-
Returns the first non null non undefined parameter
-
Name Type Description values
* Returns:
Type Description * -
Builds an Error with name 'AbortError'
-
Returns:
Type Description Error -
Computes the angle between the current position and a target position
-
Name Type Description position1
PSV.Position position2
PSV.Position Returns:
Type Description number -
Gets the closest parent (can by itself)
-
Name Type Description el
HTMLElement | SVGElement selector
string Returns:
Type Description HTMLElement -
Gets the position of an element in the viewer without reflow
-
Will gives the same result as getBoundingClientRect() as soon as there are no CSS transforms
Name Type Description el
HTMLElement Returns:
Type Description Object -
Compute the shortest offset between two longitudes
-
Name Type Description from
number to
number Returns:
Type Description number -
Gets an element style
-
Name Type Description elt
HTMLElement prop
string Returns:
Type Description * -
Returns the value of a given attribute in the panorama metadata
-
Name Type Description data
string attr
string Returns:
(number) -
Returns the distance between two points on a sphere of radius one http://www.movable-type.co.uk/scripts/latlong.html
-
Name Type Description p1
Array.<number> p2
Array.<number> Returns:
Type Description number -
Searches if an element has a particular parent at any level including itself
-
Name Type Description el
HTMLElement parent
HTMLElement Returns:
Type Description boolean -
Tests if an Error has name 'AbortError'
-
Name Type Description err
Error Returns:
Type Description boolean -
Name Type Description obj
object Returns:
Type Description boolean -
Checks if an object is a {PSV.ExtendedPosition}, ie has x/y or longitude/latitude
-
Name Type Description object
object Returns:
Type Description boolean -
Detects if fullscreen is enabled
-
Name Type Description elt
HTMLElement Returns:
Type Description boolean -
Returns if a valu is null or undefined
-
Name Type Description val
* Returns:
Type Description boolean -
Test if an object is a plain object
-
Test if an object is a plain object, i.e. is constructed by the built-in Object constructor and inherits directly from Object.prototype or null. Some built-in objects pass the test, e.g. Math which is a plain object and some host or exotic objects may pass also. http://stackoverflow.com/a/5878101/1207670
Name Type Description obj
* Returns:
Type Description boolean -
Displays a warning in the console
-
Name Type Description message
string -
Normalize mousewheel values accross browsers
-
From Facebook's Fixed Data Table https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js
Name Type Description event
WheelEvent - Copyright:
Returns:
Type Description Object -
Parses an angle value in radians or degrees and returns a normalized value in radians
-
Name Type Default Description angle
string | number eg: 3.14, 3.14rad, 180deg
zeroCenter
boolean false optional normalize between -Pi - Pi instead of 0 - 2*Pi
halfCircle
boolean zeroCenter optional normalize between -Pi/2 - Pi/2 instead of -Pi - Pi
Throws:
-
when the angle cannot be parsed
- Type
- PSV.PSVError
Returns:
Type Description number -
-
PSV.utils.parsePosition (value)PSV.Point static
Translate CSS values like "top center" or "10% 50%" as top and left positions
-
The implementation is as close as possible to the "background-position" specification https://developer.mozilla.org/en-US/docs/Web/CSS/background-position
Name Type Description value
string | PSV.Point Returns:
Type Description PSV.Point -
Parses an speed
-
Name Type Description speed
string | number The speed, in radians/degrees/revolutions per second/minute
Throws:
-
when the speed cannot be parsed
- Type
- PSV.PSVError
Returns:
Type Description number radians per second -
-
Returns the plugin constructor from the imported object For retrocompatibility with previous default exports
-
-
Removes one or several CSS classes to an element
-
Name Type Description element
HTMLElement className
string -
Enters fullscreen mode
-
Name Type Description elt
HTMLElement -
Computes the sum of an array
-
Name Type Description array
Array.<number> Returns:
Type Description number -
Returns a function, that, when invoked, will only be triggered at most once during a given window of time.
-
Name Type Description func
function wait
number - Copyright:
- underscore.js - modified by Clément Prévost http://stackoverflow.com/a/27078401
Returns:
Type Description function -
Toggles a CSS class
-
Name Type Description element
HTMLElement | SVGElement className
string active
boolean optional forced state