This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
////////////////////////////////////////////////////////////////////////////// | |
// arjs-hit-testing | |
////////////////////////////////////////////////////////////////////////////// | |
AFRAME.registerComponent('arjs-portal-door', { | |
schema: { | |
url : { // Url of the content - may be video or image | |
type: 'string', | |
}, | |
doorWidth : { // width of the door | |
type: 'number', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var THREEx = THREEx || {} | |
THREEx.Portal360 = function(videoImageURL, doorWidth, doorHeight){ | |
var doorCenter = new THREE.Group | |
doorCenter.position.y = doorHeight/2 | |
this.object3d = doorCenter | |
////////////////////////////////////////////////////////////////////////////// | |
// build texture360 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Class definitions for types of cars. | |
class Car { | |
} | |
class Sedan { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CarVisitor = { | |
accelerate: function(visitor) { | |
console.log(`Yeah! I am driving a ${visitor.name}.`) | |
}, | |
brake: function(visitor) { | |
console.log(`Brakes failed in ${visitor.name}.`) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface CarVisitor { | |
void accelerate(Sedan sedan), | |
void brake(Hatchback hatchback) | |
} | |
abstract class Cars { | |
abstract void operate(CarVisitor carVisitor); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Car { | |
// Concrete method for operating different types of cars | |
operate(carVisitor) {} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sedan extends Car { | |
constructor(name) { | |
super() | |
this.name = name | |
} | |
operate(visitor=CarVisitor) { | |
visitor.accelerate(this) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CarVisitor = { | |
accelerate: function(visitor) { | |
console.log(`Yeah! I am driving a ${visitor.name}.`) | |
}, | |
brake: function(visitor) { | |
console.log(`Brakes failed in ${visitor.name}.`) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
Expression: { | |
BinaryExpression: { | |
left: { | |
LiteralExpression: { | |
value: 12 | |
} | |
}, | |
operator: '*', | |
right: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* 12 (- 10 20)) |