Fence03.js 771 B

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