Fence.js 753 B

12345678910111213141516171819202122232425262728293031323334
  1. var game = Atomic.game;
  2. var node = self.node;
  3. Fence = self;
  4. var idle = true;
  5. node.position = [0, 0, 0];
  6. node.scale = [6, 6, 6];
  7. function start() {
  8. var cache = game.cache;
  9. var model = node.createComponent("StaticModel");
  10. model.setModel(cache.getResource("Model", "Models/Fence.mdl"));
  11. model.setMaterial(cache.getResource("Material", "Materials/Fence.xml"));
  12. model.castShadows = true;
  13. var body = node.createComponent("RigidBody");
  14. body.isKinematic = true;
  15. body.collisionEventMode = Atomic.COLLISION_ALWAYS;
  16. var shape = node.createComponent("CollisionShape");
  17. shape.setTriangleMesh(model.getModel());
  18. shape.size = [1, 1, 1];
  19. shape.position = [0, 0, 0];
  20. }
  21. function update(timeStep) {
  22. }