Scene.lua 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. -- Generated by: /home/godlike/src/anki/buildd/Bin/GltfImporter droid.gltf /home/godlike/src/anki/Samples/SkeletalAnimation/Assets/ -rpath Assets -texrpath Assets
  2. local scene = getSceneGraph()
  3. local events = getEventManager()
  4. node = scene:newModelNode("droid.001")
  5. node:getSceneNodeBase():getModelComponent():loadModelResource("Assets/Mesh_Robot.001.ankimdl")
  6. node:getSceneNodeBase():getSkinComponent():loadSkeletonResource("Assets/Armature.002.ankiskel")
  7. trf = Transform.new()
  8. trf:setOrigin(Vec4.new(0.000000, 0.000000, 0.000000, 0))
  9. rot = Mat3x4.new()
  10. rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
  11. trf:setRotation(rot)
  12. trf:setScale(1.000000)
  13. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
  14. node = scene:newGlobalIlluminationProbeNode("Cube")
  15. comp = node:getSceneNodeBase():getGlobalIlluminationProbeComponent()
  16. comp:setBoxVolumeSize(Vec3.new(19.286558, 19.286558, 19.286558))
  17. trf = Transform.new()
  18. trf:setOrigin(Vec4.new(0.000000, 11.057286, 0.000000, 0))
  19. rot = Mat3x4.new()
  20. rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
  21. trf:setRotation(rot)
  22. trf:setScale(1.000000)
  23. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
  24. node = scene:newReflectionProbeNode("Cube.001")
  25. comp = node:getSceneNodeBase():getReflectionProbeComponent()
  26. comp:setBoxVolumeSize(Vec3.new(18.543777, 18.543777, 18.543777))
  27. trf = Transform.new()
  28. trf:setOrigin(Vec4.new(0.000000, 11.057286, 0.000000, 0))
  29. rot = Mat3x4.new()
  30. rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
  31. trf:setRotation(rot)
  32. trf:setScale(1.000000)
  33. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
  34. node = scene:newModelNode("room")
  35. node:getSceneNodeBase():getModelComponent():loadModelResource("Assets/room_room.ankimdl")
  36. trf = Transform.new()
  37. trf:setOrigin(Vec4.new(0.000000, 11.142166, 0.000000, 0))
  38. rot = Mat3x4.new()
  39. rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
  40. trf:setRotation(rot)
  41. trf:setScale(9.000000)
  42. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
  43. node = scene:newPointLightNode("Lamp_Orientation")
  44. lcomp = node:getSceneNodeBase():getLightComponent()
  45. lcomp:setDiffuseColor(Vec4.new(100.000000, 100.000000, 100.000000, 1))
  46. lcomp:setShadowEnabled(1)
  47. lcomp:setRadius(100.000000)
  48. trf = Transform.new()
  49. trf:setOrigin(Vec4.new(4.076245, 5.903862, -1.005454, 0))
  50. rot = Mat3x4.new()
  51. rot:setAll(-0.290865, -0.771101, 0.566393, 0.000000, -0.055189, 0.604525, 0.794672, 0.000000, -0.955171, 0.199883, -0.218391, 0.000000)
  52. trf:setRotation(rot)
  53. trf:setScale(1.000000)
  54. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
  55. node = scene:newPerspectiveCameraNode("Camera_Orientation")
  56. scene:setActiveCameraNode(node:getSceneNodeBase())
  57. frustumc = node:getSceneNodeBase():getFrustumComponent()
  58. frustumc:setPerspective(0.100000, 100.000000, getMainRenderer():getAspectRatio() * 0.750416, 0.750416)
  59. frustumc:setShadowCascadesDistancePower(1.5)
  60. frustumc:setEffectiveShadowDistance(100.000000)
  61. trf = Transform.new()
  62. trf:setOrigin(Vec4.new(5.526846, 8.527484, -6.015655, 0))
  63. rot = Mat3x4.new()
  64. rot:setAll(-0.712312, -0.312519, 0.628445, 0.000000, 0.000000, 0.895396, 0.445271, 0.000000, -0.701863, 0.317172, -0.637801, 0.000000)
  65. trf:setRotation(rot)
  66. trf:setScale(1.000000)
  67. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
  68. node = scene:newModelNode("room.001")
  69. node:getSceneNodeBase():getModelComponent():loadModelResource("Assets/room.001_room.red.ankimdl")
  70. trf = Transform.new()
  71. trf:setOrigin(Vec4.new(0.000000, 11.142166, 0.000000, 0))
  72. rot = Mat3x4.new()
  73. rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
  74. trf:setRotation(rot)
  75. trf:setScale(9.000000)
  76. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
  77. node = scene:newModelNode("room.002")
  78. node:getSceneNodeBase():getModelComponent():loadModelResource("Assets/room.002_room.green.ankimdl")
  79. trf = Transform.new()
  80. trf:setOrigin(Vec4.new(0.000000, 11.142166, 0.000000, 0))
  81. rot = Mat3x4.new()
  82. rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
  83. trf:setRotation(rot)
  84. trf:setScale(9.000000)
  85. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
  86. node = scene:newModelNode("room.003")
  87. node:getSceneNodeBase():getModelComponent():loadModelResource("Assets/room.003_room.blue.ankimdl")
  88. trf = Transform.new()
  89. trf:setOrigin(Vec4.new(0.000000, 11.142166, 0.000000, 0))
  90. rot = Mat3x4.new()
  91. rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
  92. trf:setRotation(rot)
  93. trf:setScale(9.000000)
  94. node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)