API for ReactArToolKit component is experimental
| Property | Type | Default | Supported values |
|---|
| { | |
| Expression: { | |
| BinaryExpression: { | |
| left: { | |
| LiteralExpression: { | |
| value: 12 | |
| } | |
| }, | |
| operator: '*', | |
| right: { |
| const CarVisitor = { | |
| accelerate: function(visitor) { | |
| console.log(`Yeah! I am driving a ${visitor.name}.`) | |
| }, | |
| brake: function(visitor) { | |
| console.log(`Brakes failed in ${visitor.name}.`) | |
| } | |
| } |
| class Sedan extends Car { | |
| constructor(name) { | |
| super() | |
| this.name = name | |
| } | |
| operate(visitor=CarVisitor) { | |
| visitor.accelerate(this) | |
| } | |
| } |
| class Car { | |
| // Concrete method for operating different types of cars | |
| operate(carVisitor) {} | |
| } |
| interface CarVisitor { | |
| void accelerate(Sedan sedan), | |
| void brake(Hatchback hatchback) | |
| } | |
| abstract class Cars { | |
| abstract void operate(CarVisitor carVisitor); | |
| } |
| const CarVisitor = { | |
| accelerate: function(visitor) { | |
| console.log(`Yeah! I am driving a ${visitor.name}.`) | |
| }, | |
| brake: function(visitor) { | |
| console.log(`Brakes failed in ${visitor.name}.`) | |
| } | |
| } |
| // Class definitions for types of cars. | |
| class Car { | |
| } | |
| class Sedan { | |
| } |
| var THREEx = THREEx || {} | |
| THREEx.Portal360 = function(videoImageURL, doorWidth, doorHeight){ | |
| var doorCenter = new THREE.Group | |
| doorCenter.position.y = doorHeight/2 | |
| this.object3d = doorCenter | |
| ////////////////////////////////////////////////////////////////////////////// | |
| // build texture360 |
| ////////////////////////////////////////////////////////////////////////////// | |
| // 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', |