2018-11-13 05:24:09 +00:00
// Compiled by ClojureScript 1.10.439 {}
2018-11-12 21:18:45 +00:00
goog . provide ( 'quil.middlewares.navigation_3d' ) ;
goog . require ( 'cljs.core' ) ;
goog . require ( 'quil.core' ) ;
2018-11-13 05:24:09 +00:00
quil . middlewares . navigation _3d . missing _navigation _key _error = [ "state map is missing :navigation-3d key. " , "Did you accidentally removed it from the state in " , ":update or any other handler?" ] . join ( '' ) ;
2018-11-12 21:18:45 +00:00
/ * *
* Asserts that state map contains : navigation - 2 d object .
* /
quil . middlewares . navigation _3d . assert _state _has _navigation = ( function quil$middlewares$navigation _3d$assert _state _has _navigation ( state ) {
if ( cljs . core . truth _ ( new cljs . core . Keyword ( null , "navigation-3d" , "navigation-3d" , 682305301 ) . cljs$core$IFn$ _invoke$arity$1 ( state ) ) ) {
return null ;
} else {
throw ( new Error ( quil . middlewares . navigation _3d . missing _navigation _key _error ) ) ;
}
} ) ;
/ * *
* Default position configuration . Check default configuration in
* 'camera' function .
* /
quil . middlewares . navigation _3d . default _position = ( function quil$middlewares$navigation _3d$default _position ( ) {
return new cljs . core . PersistentArrayMap ( null , 3 , [ new cljs . core . Keyword ( null , "position" , "position" , - 2011731912 ) , new cljs . core . PersistentVector ( null , 3 , 5 , cljs . core . PersistentVector . EMPTY _NODE , [ ( quil . core . width . call ( null ) / 2.0 ) , ( quil . core . height . call ( null ) / 2.0 ) , ( ( quil . core . height . call ( null ) / 2.0 ) / quil . core . tan . call ( null , ( ( quil . core . PI * 60.0 ) / 360.0 ) ) ) ] , null ) , new cljs . core . Keyword ( null , "straight" , "straight" , - 1252567854 ) , new cljs . core . PersistentVector ( null , 3 , 5 , cljs . core . PersistentVector . EMPTY _NODE , [ ( 0 ) , ( 0 ) , ( - 1 ) ] , null ) , new cljs . core . Keyword ( null , "up" , "up" , - 269712113 ) , new cljs . core . PersistentVector ( null , 3 , 5 , cljs . core . PersistentVector . EMPTY _NODE , [ ( 0 ) , ( 1 ) , ( 0 ) ] , null ) ] , null ) ;
} ) ;
/ * *
* Rotates vector v by angle with axis .
* Formula is taken from wiki :
* http : //en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle
* /
quil . middlewares . navigation _3d . rotate _by _axis _and _angle = ( function quil$middlewares$navigation _3d$rotate _by _axis _and _angle ( v , axis , angle ) {
2018-11-13 05:24:09 +00:00
var vec _ _1620 = axis ;
var a _x = cljs . core . nth . call ( null , vec _ _1620 , ( 0 ) , null ) ;
var a _y = cljs . core . nth . call ( null , vec _ _1620 , ( 1 ) , null ) ;
var a _z = cljs . core . nth . call ( null , vec _ _1620 , ( 2 ) , null ) ;
var vec _ _1623 = v ;
var x = cljs . core . nth . call ( null , vec _ _1623 , ( 0 ) , null ) ;
var y = cljs . core . nth . call ( null , vec _ _1623 , ( 1 ) , null ) ;
var z = cljs . core . nth . call ( null , vec _ _1623 , ( 2 ) , null ) ;
2018-11-12 21:18:45 +00:00
var cs = quil . core . cos . call ( null , angle ) ;
var _cs = ( ( 1 ) - cs ) ;
var sn = quil . core . sin . call ( null , angle ) ;
var a = ( cs + ( ( a _x * a _x ) * _cs ) ) ;
var b = ( ( ( a _x * a _y ) * _cs ) - ( a _z * sn ) ) ;
var c = ( ( ( a _x * a _z ) * _cs ) + ( a _y * sn ) ) ;
var d = ( ( ( a _x * a _y ) * _cs ) + ( a _z * sn ) ) ;
var e = ( cs + ( ( a _y * a _y ) * _cs ) ) ;
var f = ( ( ( a _y * a _z ) * _cs ) - ( a _x * sn ) ) ;
var g = ( ( ( a _x * a _z ) * _cs ) - ( a _y * sn ) ) ;
var h = ( ( ( a _y * a _z ) * _cs ) + ( a _x * sn ) ) ;
var i = ( cs + ( ( a _z * a _z ) * _cs ) ) ;
return new cljs . core . PersistentVector ( null , 3 , 5 , cljs . core . PersistentVector . EMPTY _NODE , [ ( ( ( a * x ) + ( b * y ) ) + ( c * z ) ) , ( ( ( d * x ) + ( e * y ) ) + ( f * z ) ) , ( ( ( g * x ) + ( h * y ) ) + ( i * z ) ) ] , null ) ;
} ) ;
/ * *
* Rotates nav - 3 d configuration left - right . angle positive - rotate right ,
* negative - left .
* /
quil . middlewares . navigation _3d . rotate _lr = ( function quil$middlewares$navigation _3d$rotate _lr ( nav _3d , angle ) {
return cljs . core . update _in . call ( null , nav _3d , new cljs . core . PersistentVector ( null , 1 , 5 , cljs . core . PersistentVector . EMPTY _NODE , [ new cljs . core . Keyword ( null , "straight" , "straight" , - 1252567854 ) ] , null ) , quil . middlewares . navigation _3d . rotate _by _axis _and _angle , new cljs . core . Keyword ( null , "up" , "up" , - 269712113 ) . cljs$core$IFn$ _invoke$arity$1 ( nav _3d ) , angle ) ;
} ) ;
/ * *
* Vector cross - product : http : //en.wikipedia.org/wiki/Cross_product
* /
2018-11-13 05:24:09 +00:00
quil . middlewares . navigation _3d . cross _product = ( function quil$middlewares$navigation _3d$cross _product ( p _ _1626 , p _ _1627 ) {
var vec _ _1628 = p _ _1626 ;
var u1 = cljs . core . nth . call ( null , vec _ _1628 , ( 0 ) , null ) ;
var u2 = cljs . core . nth . call ( null , vec _ _1628 , ( 1 ) , null ) ;
var u3 = cljs . core . nth . call ( null , vec _ _1628 , ( 2 ) , null ) ;
var vec _ _1631 = p _ _1627 ;
var v1 = cljs . core . nth . call ( null , vec _ _1631 , ( 0 ) , null ) ;
var v2 = cljs . core . nth . call ( null , vec _ _1631 , ( 1 ) , null ) ;
var v3 = cljs . core . nth . call ( null , vec _ _1631 , ( 2 ) , null ) ;
2018-11-12 21:18:45 +00:00
return new cljs . core . PersistentVector ( null , 3 , 5 , cljs . core . PersistentVector . EMPTY _NODE , [ ( ( u2 * v3 ) - ( u3 * v2 ) ) , ( ( u3 * v1 ) - ( u1 * v3 ) ) , ( ( u1 * v2 ) - ( u2 * v1 ) ) ] , null ) ;
} ) ;
/ * *
* Multiply vector v by scalar mult .
* /
quil . middlewares . navigation _3d . v _mult = ( function quil$middlewares$navigation _3d$v _mult ( v , mult ) {
2018-11-13 05:24:09 +00:00
return cljs . core . mapv . call ( null , ( function ( p1 _ _1634 _SHARP _ ) {
return ( p1 _ _1634 _SHARP _ * mult ) ;
2018-11-12 21:18:45 +00:00
} ) , v ) ;
} ) ;
/ * *
* Sum of 2 vectors .
* /
quil . middlewares . navigation _3d . v _plus = ( function quil$middlewares$navigation _3d$v _plus ( v1 , v2 ) {
return cljs . core . mapv . call ( null , cljs . core . _PLUS _ , v1 , v2 ) ;
} ) ;
/ * *
* Returns vector opposite to vector v .
* /
quil . middlewares . navigation _3d . v _opposite = ( function quil$middlewares$navigation _3d$v _opposite ( v ) {
return quil . middlewares . navigation _3d . v _mult . call ( null , v , ( - 1 ) ) ;
} ) ;
/ * *
* Normalize vector , returning vector
* which has same direction but with norm equals to 1.
* /
quil . middlewares . navigation _3d . v _normalize = ( function quil$middlewares$navigation _3d$v _normalize ( v ) {
var norm = quil . core . sqrt . call ( null , cljs . core . apply . call ( null , cljs . core . _PLUS _ , cljs . core . map . call ( null , quil . core . sq , v ) ) ) ;
return quil . middlewares . navigation _3d . v _mult . call ( null , v , ( ( 1 ) / norm ) ) ;
} ) ;
/ * *
* Rotates nav - 3 d configuration up - down .
* /
quil . middlewares . navigation _3d . rotate _ud = ( function quil$middlewares$navigation _3d$rotate _ud ( nav _3d , angle ) {
var axis = quil . middlewares . navigation _3d . cross _product . call ( null , new cljs . core . Keyword ( null , "straight" , "straight" , - 1252567854 ) . cljs$core$IFn$ _invoke$arity$1 ( nav _3d ) , new cljs . core . Keyword ( null , "up" , "up" , - 269712113 ) . cljs$core$IFn$ _invoke$arity$1 ( nav _3d ) ) ;
var rotate = ( ( function ( axis ) {
2018-11-13 05:24:09 +00:00
return ( function ( p1 _ _1635 _SHARP _ ) {
return quil . middlewares . navigation _3d . rotate _by _axis _and _angle . call ( null , p1 _ _1635 _SHARP _ , axis , angle ) ;
2018-11-12 21:18:45 +00:00
} ) ; } ) ( axis ) )
;
return cljs . core . update _in . call ( null , cljs . core . update _in . call ( null , nav _3d , new cljs . core . PersistentVector ( null , 1 , 5 , cljs . core . PersistentVector . EMPTY _NODE , [ new cljs . core . Keyword ( null , "straight" , "straight" , - 1252567854 ) ] , null ) , rotate ) , new cljs . core . PersistentVector ( null , 1 , 5 , cljs . core . PersistentVector . EMPTY _NODE , [ new cljs . core . Keyword ( null , "up" , "up" , - 269712113 ) ] , null ) , rotate ) ;
} ) ;
/ * *
* Mouse handler function which rotates nav - 3 d configuration .
* It uses mouse from event object and pixels - in - 360 to calculate
* angles to rotate .
* /
quil . middlewares . navigation _3d . rotate = ( function quil$middlewares$navigation _3d$rotate ( state , event , pixels _in _360 ) {
quil . middlewares . navigation _3d . assert _state _has _navigation . call ( null , state ) ;
if ( cljs . core . _EQ _ . call ( null , ( 0 ) , new cljs . core . Keyword ( null , "p-x" , "p-x" , - 1721211211 ) . cljs$core$IFn$ _invoke$arity$1 ( event ) , new cljs . core . Keyword ( null , "p-y" , "p-y" , - 530704830 ) . cljs$core$IFn$ _invoke$arity$1 ( event ) ) ) {
return state ;
} else {
var dx = ( new cljs . core . Keyword ( null , "p-x" , "p-x" , - 1721211211 ) . cljs$core$IFn$ _invoke$arity$1 ( event ) - new cljs . core . Keyword ( null , "x" , "x" , 2099068185 ) . cljs$core$IFn$ _invoke$arity$1 ( event ) ) ;
var dy = ( new cljs . core . Keyword ( null , "y" , "y" , - 1757859776 ) . cljs$core$IFn$ _invoke$arity$1 ( event ) - new cljs . core . Keyword ( null , "p-y" , "p-y" , - 530704830 ) . cljs$core$IFn$ _invoke$arity$1 ( event ) ) ;
var angle _lr = quil . core . map _range . call ( null , dx , ( 0 ) , pixels _in _360 , ( 0 ) , quil . core . TWO _PI ) ;
var angle _ud = quil . core . map _range . call ( null , dy , ( 0 ) , pixels _in _360 , ( 0 ) , quil . core . TWO _PI ) ;
return cljs . core . update _in . call ( null , state , new cljs . core . PersistentVector ( null , 1 , 5 , cljs . core . PersistentVector . EMPTY _NODE , [ new cljs . core . Keyword ( null , "navigation-3d" , "navigation-3d" , 682305301 ) ] , null ) , ( ( function ( dx , dy , angle _lr , angle _ud ) {
2018-11-13 05:24:09 +00:00
return ( function ( p1 _ _1636 _SHARP _ ) {
return quil . middlewares . navigation _3d . rotate _ud . call ( null , quil . middlewares . navigation _3d . rotate _lr . call ( null , p1 _ _1636 _SHARP _ , angle _lr ) , angle _ud ) ;
2018-11-12 21:18:45 +00:00
} ) ; } ) ( dx , dy , angle _lr , angle _ud ) )
) ;
}
} ) ;
quil . middlewares . navigation _3d . space = cljs . core . keyword . call ( null , " " ) ;
/ * *
* Keyboard handler function which moves nav - 3 d configuration .
* It uses keyboard key from event object to determing in which
* direction to move .
* /
quil . middlewares . navigation _3d . move = ( function quil$middlewares$navigation _3d$move ( state , event , step _size ) {
quil . middlewares . navigation _3d . assert _state _has _navigation . call ( null , state ) ;
2018-11-13 05:24:09 +00:00
var map _ _1638 = new cljs . core . Keyword ( null , "navigation-3d" , "navigation-3d" , 682305301 ) . cljs$core$IFn$ _invoke$arity$1 ( state ) ;
var map _ _1638 _ _$1 = ( ( ( ( ( ! ( ( map _ _1638 == null ) ) ) ) ? ( ( ( ( ( map _ _1638 . cljs$lang$protocol _mask$partition0$ & ( 64 ) ) ) || ( ( cljs . core . PROTOCOL _SENTINEL === map _ _1638 . cljs$core$ISeq$ ) ) ) ) ? true : false ) : false ) ) ? cljs . core . apply . call ( null , cljs . core . hash _map , map _ _1638 ) : map _ _1638 ) ;
var up = cljs . core . get . call ( null , map _ _1638 _ _$1 , new cljs . core . Keyword ( null , "up" , "up" , - 269712113 ) ) ;
var straight = cljs . core . get . call ( null , map _ _1638 _ _$1 , new cljs . core . Keyword ( null , "straight" , "straight" , - 1252567854 ) ) ;
var temp _ _4655 _ _auto _ _ = ( function ( ) { var pred _ _1640 = cljs . core . _EQ _ ;
var expr _ _1641 = new cljs . core . Keyword ( null , "key" , "key" , - 1516042587 ) . cljs$core$IFn$ _invoke$arity$1 ( event ) ;
if ( cljs . core . truth _ ( pred _ _1640 . call ( null , new cljs . core . Keyword ( null , "w" , "w" , 354169001 ) , expr _ _1641 ) ) ) {
2018-11-12 21:18:45 +00:00
return straight ;
} else {
2018-11-13 05:24:09 +00:00
if ( cljs . core . truth _ ( pred _ _1640 . call ( null , new cljs . core . Keyword ( null , "s" , "s" , 1705939918 ) , expr _ _1641 ) ) ) {
2018-11-12 21:18:45 +00:00
return quil . middlewares . navigation _3d . v _opposite . call ( null , straight ) ;
} else {
2018-11-13 05:24:09 +00:00
if ( cljs . core . truth _ ( pred _ _1640 . call ( null , quil . middlewares . navigation _3d . space , expr _ _1641 ) ) ) {
2018-11-12 21:18:45 +00:00
return quil . middlewares . navigation _3d . v _opposite . call ( null , up ) ;
} else {
2018-11-13 05:24:09 +00:00
if ( cljs . core . truth _ ( pred _ _1640 . call ( null , new cljs . core . Keyword ( null , "z" , "z" , - 789527183 ) , expr _ _1641 ) ) ) {
2018-11-12 21:18:45 +00:00
return up ;
} else {
2018-11-13 05:24:09 +00:00
if ( cljs . core . truth _ ( pred _ _1640 . call ( null , new cljs . core . Keyword ( null , "d" , "d" , 1972142424 ) , expr _ _1641 ) ) ) {
2018-11-12 21:18:45 +00:00
return quil . middlewares . navigation _3d . cross _product . call ( null , straight , up ) ;
} else {
2018-11-13 05:24:09 +00:00
if ( cljs . core . truth _ ( pred _ _1640 . call ( null , new cljs . core . Keyword ( null , "a" , "a" , - 2123407586 ) , expr _ _1641 ) ) ) {
2018-11-12 21:18:45 +00:00
return quil . middlewares . navigation _3d . cross _product . call ( null , up , straight ) ;
} else {
return null ;
}
}
}
}
}
}
} ) ( ) ;
if ( cljs . core . truth _ ( temp _ _4655 _ _auto _ _ ) ) {
var dir = temp _ _4655 _ _auto _ _ ;
2018-11-13 05:24:09 +00:00
return cljs . core . update _in . call ( null , state , new cljs . core . PersistentVector ( null , 2 , 5 , cljs . core . PersistentVector . EMPTY _NODE , [ new cljs . core . Keyword ( null , "navigation-3d" , "navigation-3d" , 682305301 ) , new cljs . core . Keyword ( null , "position" , "position" , - 2011731912 ) ] , null ) , ( ( function ( dir , temp _ _4655 _ _auto _ _ , map _ _1638 , map _ _1638 _ _$1 , up , straight ) {
return ( function ( p1 _ _1637 _SHARP _ ) {
return quil . middlewares . navigation _3d . v _plus . call ( null , p1 _ _1637 _SHARP _ , quil . middlewares . navigation _3d . v _mult . call ( null , dir , step _size ) ) ;
} ) ; } ) ( dir , temp _ _4655 _ _auto _ _ , map _ _1638 , map _ _1638 _ _$1 , up , straight ) )
2018-11-12 21:18:45 +00:00
) ;
} else {
return state ;
}
} ) ;
/ * *
* Custom 'setup' function which creates initial position
* configuration and puts it to the state map .
* /
quil . middlewares . navigation _3d . setup _3d _nav = ( function quil$middlewares$navigation _3d$setup _3d _nav ( user _setup , user _settings ) {
var initial _state = cljs . core . update _in . call ( null , cljs . core . update _in . call ( null , cljs . core . merge . call ( null , quil . middlewares . navigation _3d . default _position . call ( null ) , cljs . core . select _keys . call ( null , user _settings , new cljs . core . PersistentVector ( null , 3 , 5 , cljs . core . PersistentVector . EMPTY _NODE , [ new cljs . core . Keyword ( null , "straight" , "straight" , - 1252567854 ) , new cljs . core . Keyword ( null , "up" , "up" , - 269712113 ) , new cljs . core . Keyword ( null , "position" , "position" , - 2011731912 ) ] , null ) ) ) , new cljs . core . PersistentVector ( null , 1 , 5 , cljs . core . PersistentVector . EMPTY _NODE , [ new cljs . core . Keyword ( null , "straight" , "straight" , - 1252567854 ) ] , null ) , quil . middlewares . navigation _3d . v _normalize ) , new cljs . core . PersistentVector ( null , 1 , 5 , cljs . core . PersistentVector . EMPTY _NODE , [ new cljs . core . Keyword ( null , "up" , "up" , - 269712113 ) ] , null ) , quil . middlewares . navigation _3d . v _normalize ) ;
return cljs . core . update _in . call ( null , user _setup . call ( null ) , new cljs . core . PersistentVector ( null , 1 , 5 , cljs . core . PersistentVector . EMPTY _NODE , [ new cljs . core . Keyword ( null , "navigation-3d" , "navigation-3d" , 682305301 ) ] , null ) , ( ( function ( initial _state ) {
2018-11-13 05:24:09 +00:00
return ( function ( p1 _ _1643 _SHARP _ ) {
return cljs . core . merge . call ( null , initial _state , p1 _ _1643 _SHARP _ ) ;
2018-11-12 21:18:45 +00:00
} ) ; } ) ( initial _state ) )
) ;
} ) ;
/ * *
* Enables navigation in 3 D space . Similar to how it is done in
* shooters : WASD navigation , space is go up , z is go down ,
* drag mouse to look around .
* /
quil . middlewares . navigation _3d . navigation _3d = ( function quil$middlewares$navigation _3d$navigation _3d ( options ) {
var user _settings = new cljs . core . Keyword ( null , "navigation-3d" , "navigation-3d" , 682305301 ) . cljs$core$IFn$ _invoke$arity$1 ( options ) ;
var pixels _in _360 = new cljs . core . Keyword ( null , "pixels-in-360" , "pixels-in-360" , 1789567298 ) . cljs$core$IFn$ _invoke$arity$2 ( user _settings , ( 1000 ) ) ;
var step _size = new cljs . core . Keyword ( null , "step-size" , "step-size" , 1545609922 ) . cljs$core$IFn$ _invoke$arity$2 ( user _settings , ( 20 ) ) ;
var rotate _on = new cljs . core . Keyword ( null , "rotate-on" , "rotate-on" , - 1282225937 ) . cljs$core$IFn$ _invoke$arity$2 ( user _settings , new cljs . core . Keyword ( null , "mouse-dragged" , "mouse-dragged" , - 1220073441 ) ) ;
var draw = new cljs . core . Keyword ( null , "draw" , "draw" , 1358331674 ) . cljs$core$IFn$ _invoke$arity$2 ( options , ( ( function ( user _settings , pixels _in _360 , step _size , rotate _on ) {
return ( function ( state ) {
return null ;
} ) ; } ) ( user _settings , pixels _in _360 , step _size , rotate _on ) )
) ;
var key _pressed = new cljs . core . Keyword ( null , "key-pressed" , "key-pressed" , - 757100364 ) . cljs$core$IFn$ _invoke$arity$2 ( options , ( ( function ( user _settings , pixels _in _360 , step _size , rotate _on , draw ) {
return ( function ( state , _ ) {
return state ;
} ) ; } ) ( user _settings , pixels _in _360 , step _size , rotate _on , draw ) )
) ;
var rotate _on _fn = rotate _on . call ( null , options , ( ( function ( user _settings , pixels _in _360 , step _size , rotate _on , draw , key _pressed ) {
return ( function ( state , _ ) {
return state ;
} ) ; } ) ( user _settings , pixels _in _360 , step _size , rotate _on , draw , key _pressed ) )
) ;
var setup = new cljs . core . Keyword ( null , "setup" , "setup" , 1987730512 ) . cljs$core$IFn$ _invoke$arity$2 ( options , ( ( function ( user _settings , pixels _in _360 , step _size , rotate _on , draw , key _pressed , rotate _on _fn ) {
return ( function ( ) {
return cljs . core . PersistentArrayMap . EMPTY ;
} ) ; } ) ( user _settings , pixels _in _360 , step _size , rotate _on , draw , key _pressed , rotate _on _fn ) )
) ;
return cljs . core . assoc . call ( null , options , new cljs . core . Keyword ( null , "setup" , "setup" , 1987730512 ) , cljs . core . partial . call ( null , quil . middlewares . navigation _3d . setup _3d _nav , setup , user _settings ) , new cljs . core . Keyword ( null , "draw" , "draw" , 1358331674 ) , ( ( function ( user _settings , pixels _in _360 , step _size , rotate _on , draw , key _pressed , rotate _on _fn , setup ) {
return ( function ( state ) {
quil . middlewares . navigation _3d . assert _state _has _navigation . call ( null , state ) ;
2018-11-13 05:24:09 +00:00
var map _ _1644 _1655 = new cljs . core . Keyword ( null , "navigation-3d" , "navigation-3d" , 682305301 ) . cljs$core$IFn$ _invoke$arity$1 ( state ) ;
var map _ _1644 _1656 _ _$1 = ( ( ( ( ( ! ( ( map _ _1644 _1655 == null ) ) ) ) ? ( ( ( ( ( map _ _1644 _1655 . cljs$lang$protocol _mask$partition0$ & ( 64 ) ) ) || ( ( cljs . core . PROTOCOL _SENTINEL === map _ _1644 _1655 . cljs$core$ISeq$ ) ) ) ) ? true : false ) : false ) ) ? cljs . core . apply . call ( null , cljs . core . hash _map , map _ _1644 _1655 ) : map _ _1644 _1655 ) ;
var vec _ _1645 _1657 = cljs . core . get . call ( null , map _ _1644 _1656 _ _$1 , new cljs . core . Keyword ( null , "straight" , "straight" , - 1252567854 ) ) ;
var c _x _1658 = cljs . core . nth . call ( null , vec _ _1645 _1657 , ( 0 ) , null ) ;
var c _y _1659 = cljs . core . nth . call ( null , vec _ _1645 _1657 , ( 1 ) , null ) ;
var c _z _1660 = cljs . core . nth . call ( null , vec _ _1645 _1657 , ( 2 ) , null ) ;
var vec _ _1648 _1661 = cljs . core . get . call ( null , map _ _1644 _1656 _ _$1 , new cljs . core . Keyword ( null , "up" , "up" , - 269712113 ) ) ;
var u _x _1662 = cljs . core . nth . call ( null , vec _ _1648 _1661 , ( 0 ) , null ) ;
var u _y _1663 = cljs . core . nth . call ( null , vec _ _1648 _1661 , ( 1 ) , null ) ;
var u _z _1664 = cljs . core . nth . call ( null , vec _ _1648 _1661 , ( 2 ) , null ) ;
var vec _ _1651 _1665 = cljs . core . get . call ( null , map _ _1644 _1656 _ _$1 , new cljs . core . Keyword ( null , "position" , "position" , - 2011731912 ) ) ;
var p _x _1666 = cljs . core . nth . call ( null , vec _ _1651 _1665 , ( 0 ) , null ) ;
var p _y _1667 = cljs . core . nth . call ( null , vec _ _1651 _1665 , ( 1 ) , null ) ;
var p _z _1668 = cljs . core . nth . call ( null , vec _ _1651 _1665 , ( 2 ) , null ) ;
quil . core . camera . call ( null , p _x _1666 , p _y _1667 , p _z _1668 , ( p _x _1666 + c _x _1658 ) , ( p _y _1667 + c _y _1659 ) , ( p _z _1668 + c _z _1660 ) , u _x _1662 , u _y _1663 , u _z _1664 ) ;
2018-11-12 21:18:45 +00:00
return draw . call ( null , state ) ;
} ) ; } ) ( user _settings , pixels _in _360 , step _size , rotate _on , draw , key _pressed , rotate _on _fn , setup ) )
, new cljs . core . Keyword ( null , "key-pressed" , "key-pressed" , - 757100364 ) , ( ( function ( user _settings , pixels _in _360 , step _size , rotate _on , draw , key _pressed , rotate _on _fn , setup ) {
return ( function ( state , event ) {
return key _pressed . call ( null , quil . middlewares . navigation _3d . move . call ( null , state , event , step _size ) , event ) ;
} ) ; } ) ( user _settings , pixels _in _360 , step _size , rotate _on , draw , key _pressed , rotate _on _fn , setup ) )
, rotate _on , ( ( function ( user _settings , pixels _in _360 , step _size , rotate _on , draw , key _pressed , rotate _on _fn , setup ) {
return ( function ( state , event ) {
return rotate _on _fn . call ( null , quil . middlewares . navigation _3d . rotate . call ( null , state , event , pixels _in _360 ) , event ) ;
} ) ; } ) ( user _settings , pixels _in _360 , step _size , rotate _on , draw , key _pressed , rotate _on _fn , setup ) )
) ;
} ) ;
2018-11-13 05:24:09 +00:00
//# sourceMappingURL=navigation_3d.js.map