How to use the decentraland-ecs/src.Vector3 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.90.scene-boundaries / game.ts View on Github external
let shapeComponent = sharkEntity.getComponent(GLTFShape)
    shapeComponent.visible = !shapeComponent.visible
  })
)
engine.addEntity(sharkVisibilityTrigger)

// PUSHABLE COLLIDING NPC
let npcEntity = configureShapeEntityPositions([new Vector3(16, 0, 0)], 0.7, new GLTFShape('models/Avatar_Idle.glb'))

let npcLeftMovementTrigger = new Entity()
npcLeftMovementTrigger.addComponentOrReplace(new BoxShape());
npcLeftMovementTrigger.setParent(npcEntity)
npcLeftMovementTrigger.addComponent(
  new Transform({
    position: new Vector3(-0.25, 3, 0),
    scale: new Vector3(0.3, 0.5, 2)
  })
)
npcLeftMovementTrigger.addComponent(
  new OnClick(e => {
    npcEntity.getComponent(Transform).position.x += 1
  })
)
engine.addEntity(npcLeftMovementTrigger)

let npcRightMovementTrigger = new Entity()
npcRightMovementTrigger.addComponentOrReplace(new BoxShape());
npcRightMovementTrigger.setParent(npcEntity)
npcRightMovementTrigger.addComponent(
  new Transform({
    position: new Vector3(0.25, 3, 0),
    scale: new Vector3(0.3, 0.5, 2)
github decentraland / explorer / kernel / public / test-scenes / -103.102.nft / game.ts View on Github external
import { NFTShape, Entity, engine, Transform, Vector3, Color3 } from 'decentraland-ecs/src'

const entity = new Entity()
const shapeComponent = new NFTShape('ethereum://0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/558536')
entity.addComponent(shapeComponent)
entity.addComponent(
  new Transform({
    position: new Vector3(3, 1.5, 4)
  })
)
engine.addEntity(entity)

const entity2 = new Entity()
const shapeComponent2 = new NFTShape('ethereum://0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/558536', Color3.Green())
entity2.addComponent(shapeComponent2)
entity2.addComponent(
  new Transform({
    position: new Vector3(5, 1.5, 4)
  })
)
engine.addEntity(entity2)
github decentraland / explorer / public / test-parcels / 145.133.tree-scene / game.ts View on Github external
import { Entity, GLTFShape, engine, Vector3, Transform } from 'decentraland-ecs/src'

const entity = new Entity()
entity.addComponent(new GLTFShape('models/Tree_Scene.glb'))
entity.addComponent(new Transform({ position: new Vector3(8, 0, 8) }))
engine.addEntity(entity)