How to use the decentraland-ecs/src.Quaternion.Euler function in decentraland-ecs

To help you get started, we’ve selected a few decentraland-ecs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github decentraland / explorer / kernel / public / test-scenes / 0.23.video / game.ts View on Github external
() => {
      streamVideo.playing = !streamVideo.playing
    },
    { button: ActionButton.POINTER, hoverText: 'Play Stream' }
  )
)

engine.addEntity(streamEntity)

const localEntity = new Entity()
localEntity.addComponent(new PlaneShape())
localEntity.addComponent(
  new Transform({
    position: new Vector3(15, 4.5, 8),
    scale: new Vector3(16, 9, 1),
    rotation: Quaternion.Euler(0, 270, 0)
  })
)

const localVideo = new VideoTexture(new VideoClip('video1.mp4'))

const localMaterial = new BasicMaterial()
localMaterial.texture = localVideo

localEntity.addComponent(localMaterial)

localEntity.addComponent(
  new OnPointerDown(
    () => {
      localVideo.playing = !localVideo.playing
    },
    { button: ActionButton.POINTER, hoverText: 'Play/Pause Local Video' }