How to use the decentraland-ecs/src.GLTFShape 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.20.objects-blocking-click-for-objects-behind-them / game.ts View on Github external
OnPointerUp
} from 'decentraland-ecs/src'

const _scene = new Entity("_scene");
engine.addEntity(_scene);
const transform = new Transform({
  position: new Vector3(0, 0, 0),
  rotation: new Quaternion(0, 0, 0, 1),
  scale: new Vector3(1, 1, 1)
});
_scene.addComponentOrReplace(transform);

const entity = new Entity("entity");
engine.addEntity(entity);
entity.setParent(_scene);
const gltfShape = new GLTFShape(
  "models/FloorBaseGrass_01/FloorBaseGrass_01.glb"
);
gltfShape.withCollisions = true;
gltfShape.visible = true;
entity.addComponentOrReplace(gltfShape);
const transform2 = new Transform({
  position: new Vector3(8, 0, 8),
  rotation: new Quaternion(0, 0, 0, 1),
  scale: new Vector3(1, 1, 1)
});
entity.addComponentOrReplace(transform2);

const cornerStoneBrickWall = new Entity("cornerStoneBrickWall");
engine.addEntity(cornerStoneBrickWall);
cornerStoneBrickWall.setParent(_scene);
const transform3 = new Transform({
github decentraland / explorer / public / test-parcels / 142.134.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)
github decentraland / explorer / public / hell-map / 141.127.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)
github decentraland / explorer / public / hell-map / 138.129.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)