Prechádzať zdrojové kódy

Some renaming and refactoring in scene

Panagiotis Christopoulos Charitos 7 rokov pred
rodič
commit
825d95aaed
65 zmenil súbory, kde vykonal 641 pridanie a 615 odobranie
  1. 2 2
      samples/common/Framework.cpp
  2. 4 4
      samples/simple_scene/assets/scene.lua
  3. 44 44
      samples/sponza/assets/scene.lua
  4. 3 3
      sandbox/Main.cpp
  5. 21 12
      src/anki/Scene.h
  6. 1 1
      src/anki/event/AnimationEvent.cpp
  7. 1 1
      src/anki/event/JitterMoveEvent.cpp
  8. 2 2
      src/anki/event/LightEvent.cpp
  9. 2 2
      src/anki/scene/BodyNode.cpp
  10. 20 18
      src/anki/scene/CameraNode.cpp
  11. 13 14
      src/anki/scene/CameraNode.h
  12. 1 0
      src/anki/scene/Common.h
  13. 3 3
      src/anki/scene/DecalNode.cpp
  14. 8 6
      src/anki/scene/Forward.h
  15. 31 31
      src/anki/scene/LightNode.cpp
  16. 9 9
      src/anki/scene/LightNode.h
  17. 1 1
      src/anki/scene/Misc.h
  18. 2 2
      src/anki/scene/ModelNode.cpp
  19. 3 3
      src/anki/scene/ModelNode.h
  20. 2 2
      src/anki/scene/OccluderNode.cpp
  21. 20 19
      src/anki/scene/ParticleEmitterNode.cpp
  22. 14 14
      src/anki/scene/ParticleEmitterNode.h
  23. 2 2
      src/anki/scene/PlayerNode.cpp
  24. 9 9
      src/anki/scene/ReflectionProbeNode.cpp
  25. 3 3
      src/anki/scene/ReflectionProbeNode.h
  26. 7 7
      src/anki/scene/ReflectionProxyNode.cpp
  27. 3 3
      src/anki/scene/ReflectionProxyNode.h
  28. 3 3
      src/anki/scene/SceneGraph.cpp
  29. 7 7
      src/anki/scene/SceneGraph.h
  30. 2 2
      src/anki/scene/SceneNode.h
  31. 42 41
      src/anki/scene/SectorNode.cpp
  32. 23 50
      src/anki/scene/SectorNode.h
  33. 2 2
      src/anki/scene/StaticGeometryNode.h
  34. 10 10
      src/anki/scene/Visibility.cpp
  35. 1 1
      src/anki/scene/VisibilityInternal.h
  36. 1 1
      src/anki/scene/components/BodyComponent.cpp
  37. 1 1
      src/anki/scene/components/BodyComponent.h
  38. 1 1
      src/anki/scene/components/DecalComponent.cpp
  39. 1 1
      src/anki/scene/components/DecalComponent.h
  40. 1 1
      src/anki/scene/components/FrustumComponent.cpp
  41. 2 2
      src/anki/scene/components/FrustumComponent.h
  42. 1 1
      src/anki/scene/components/LensFlareComponent.cpp
  43. 0 0
      src/anki/scene/components/LensFlareComponent.h
  44. 1 1
      src/anki/scene/components/LightComponent.cpp
  45. 1 1
      src/anki/scene/components/LightComponent.h
  46. 1 1
      src/anki/scene/components/MoveComponent.cpp
  47. 1 1
      src/anki/scene/components/MoveComponent.h
  48. 1 1
      src/anki/scene/components/OccluderComponent.cpp
  49. 1 1
      src/anki/scene/components/OccluderComponent.h
  50. 1 1
      src/anki/scene/components/PlayerControllerComponent.h
  51. 1 1
      src/anki/scene/components/ReflectionProbeComponent.h
  52. 1 1
      src/anki/scene/components/ReflectionProxyComponent.cpp
  53. 1 1
      src/anki/scene/components/ReflectionProxyComponent.h
  54. 1 1
      src/anki/scene/components/RenderComponent.cpp
  55. 1 1
      src/anki/scene/components/RenderComponent.h
  56. 1 1
      src/anki/scene/components/SceneComponent.cpp
  57. 0 0
      src/anki/scene/components/SceneComponent.h
  58. 41 0
      src/anki/scene/components/SectorComponent.h
  59. 1 1
      src/anki/scene/components/SkinComponent.cpp
  60. 1 1
      src/anki/scene/components/SkinComponent.h
  61. 2 2
      src/anki/scene/components/SpatialComponent.cpp
  62. 4 7
      src/anki/scene/components/SpatialComponent.h
  63. 210 210
      src/anki/script/Scene.cpp
  64. 33 33
      src/anki/script/Scene.xml
  65. 7 7
      tools/scene/Exporter.cpp

+ 2 - 2
samples/common/Framework.cpp

@@ -57,11 +57,11 @@ Error SampleApp::userMainLoop(Bool& quit)
 	}
 
 	// move the camera
-	static MoveComponent* mover = &scene.getActiveCamera().getComponent<MoveComponent>();
+	static MoveComponent* mover = &scene.getActiveCameraNode().getComponent<MoveComponent>();
 
 	if(in.getKey(KeyCode::_1) == 1)
 	{
-		mover = &scene.getActiveCamera().getComponent<MoveComponent>();
+		mover = &scene.getActiveCameraNode().getComponent<MoveComponent>();
 	}
 
 	if(in.getKey(KeyCode::F1) == 1)

+ 4 - 4
samples/simple_scene/assets/scene.lua

@@ -5,7 +5,7 @@ local node
 local inst
 local lcomp
 
-node = scene:newSector("sector0", "assets/sector.ankimesh")
+node = scene:newSectorNode("sector0", "assets/sector.ankimesh")
 trf = Transform.new()
 trf:setOrigin(Vec4.new(0, 0, 0, 0))
 rot = Mat3x4.new()
@@ -59,7 +59,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newPointLight("Point")
+node = scene:newPointLightNode("Point")
 lcomp = node:getSceneNodeBase():getLightComponent()
 lcomp:setDiffuseColor(Vec4.new(2, 2, 2, 1))
 lcomp:setSpecularColor(Vec4.new(2, 2, 2, 1))
@@ -73,8 +73,8 @@ trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 lcomp:setShadowEnabled(1)
 
-node = scene:newPerspectiveCamera("Camera")
-scene:setActiveCamera(node:getSceneNodeBase())
+node = scene:newPerspectiveCameraNode("Camera")
+scene:setActiveCameraNode(node:getSceneNodeBase())
 node:setAll(1.5708, 1.0 / getMainRenderer():getAspectRatio() * 1.5708, 0.1, 100)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-0.0971127, 3.80237, 5.98675, 0))

+ 44 - 44
samples/sponza/assets/scene.lua

@@ -5,7 +5,7 @@ local node
 local inst
 local lcomp
 
-node = scene:newSector("Cube0", "assets/Cube.ankimesh")
+node = scene:newSectorNode("Cube0", "assets/Cube.ankimesh")
 trf = Transform.new()
 trf:setOrigin(Vec4.new(0, 10.6707, 0, 0))
 rot = Mat3x4.new()
@@ -14,7 +14,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newParticleEmitter("particles0", "assets/fire.ankipart")
+node = scene:newParticleEmitterNode("particles0", "assets/fire.ankipart")
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-10.7851, 2.17929, 2.47133, 0))
 rot = Mat3x4.new()
@@ -23,7 +23,7 @@ trf:setRotation(rot)
 trf:setScale(0.259678)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newParticleEmitter("particles1", "assets/fire.ankipart")
+node = scene:newParticleEmitterNode("particles1", "assets/fire.ankipart")
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-10.7851, 2.17929, -3.81233, 0))
 rot = Mat3x4.new()
@@ -32,7 +32,7 @@ trf:setRotation(rot)
 trf:setScale(0.259678)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newParticleEmitter("particles2", "assets/fire.ankipart")
+node = scene:newParticleEmitterNode("particles2", "assets/fire.ankipart")
 trf = Transform.new()
 trf:setOrigin(Vec4.new(8.53812, 2.17929, -3.83576, 0))
 rot = Mat3x4.new()
@@ -41,7 +41,7 @@ trf:setRotation(rot)
 trf:setScale(0.259678)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newParticleEmitter("particles3", "assets/fire.ankipart")
+node = scene:newParticleEmitterNode("particles3", "assets/fire.ankipart")
 trf = Transform.new()
 trf:setOrigin(Vec4.new(8.53812, 2.17929, 2.49646, 0))
 rot = Mat3x4.new()
@@ -50,7 +50,7 @@ trf:setRotation(rot)
 trf:setScale(0.259678)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newParticleEmitter("particles4", "assets/smoke.ankipart")
+node = scene:newParticleEmitterNode("particles4", "assets/smoke.ankipart")
 trf = Transform.new()
 trf:setOrigin(Vec4.new(8.53812, 2.74355, -3.84373, 0))
 rot = Mat3x4.new()
@@ -59,7 +59,7 @@ trf:setRotation(rot)
 trf:setScale(0.259678)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newParticleEmitter("particles5", "assets/smoke.ankipart")
+node = scene:newParticleEmitterNode("particles5", "assets/smoke.ankipart")
 trf = Transform.new()
 trf:setOrigin(Vec4.new(8.54605, 2.75212, 2.49232, 0))
 rot = Mat3x4.new()
@@ -68,7 +68,7 @@ trf:setRotation(rot)
 trf:setScale(0.259678)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newParticleEmitter("particles6", "assets/smoke.ankipart")
+node = scene:newParticleEmitterNode("particles6", "assets/smoke.ankipart")
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-10.7866, 2.75212, 2.49232, 0))
 rot = Mat3x4.new()
@@ -77,7 +77,7 @@ trf:setRotation(rot)
 trf:setScale(0.259678)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newParticleEmitter("particles7", "assets/smoke.ankipart")
+node = scene:newParticleEmitterNode("particles7", "assets/smoke.ankipart")
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-10.7866, 2.75212, -3.83125, 0))
 rot = Mat3x4.new()
@@ -86,7 +86,7 @@ trf:setRotation(rot)
 trf:setScale(0.259678)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe0", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe0", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(18.0683, 2.49039, 6.66315, 0))
 rot = Mat3x4.new()
@@ -95,7 +95,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe1", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe1", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(8.05931, 2.49039, 6.66315, 0))
 rot = Mat3x4.new()
@@ -104,7 +104,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe2", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe2", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-1.43904, 2.49039, 6.66315, 0))
 rot = Mat3x4.new()
@@ -113,7 +113,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe3", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe3", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-11.1261, 2.49039, 6.66315, 0))
 rot = Mat3x4.new()
@@ -122,7 +122,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe4", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe4", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-19.0274, 2.49039, 6.66315, 0))
 rot = Mat3x4.new()
@@ -131,7 +131,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe5", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe5", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-19.0274, 2.49039, -8.62114, 0))
 rot = Mat3x4.new()
@@ -140,7 +140,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe6", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe6", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-11.1261, 2.49039, -8.62114, 0))
 rot = Mat3x4.new()
@@ -149,7 +149,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe7", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe7", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-1.43904, 2.49039, -8.62114, 0))
 rot = Mat3x4.new()
@@ -158,7 +158,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe8", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe8", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(8.05931, 2.49039, -8.62114, 0))
 rot = Mat3x4.new()
@@ -167,7 +167,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe9", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe9", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(18.0683, 2.49039, -8.62114, 0))
 rot = Mat3x4.new()
@@ -176,7 +176,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe10", 7.13881)
+node = scene:newReflectionProbeNode("reflprobe10", 7.13881)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(18.9426, 2.49039, -0.625299, 0))
 rot = Mat3x4.new()
@@ -185,7 +185,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe11", 7.13881)
+node = scene:newReflectionProbeNode("reflprobe11", 7.13881)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(8.47687, 2.49039, -0.625299, 0))
 rot = Mat3x4.new()
@@ -194,7 +194,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe12", 7.13881)
+node = scene:newReflectionProbeNode("reflprobe12", 7.13881)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-1.45483, 2.49039, -0.625299, 0))
 rot = Mat3x4.new()
@@ -203,7 +203,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe13", 7.13881)
+node = scene:newReflectionProbeNode("reflprobe13", 7.13881)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-11.5838, 2.49039, -0.625299, 0))
 rot = Mat3x4.new()
@@ -212,7 +212,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe14", 7.13881)
+node = scene:newReflectionProbeNode("reflprobe14", 7.13881)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-19.8456, 2.49039, -0.625299, 0))
 rot = Mat3x4.new()
@@ -221,7 +221,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe15", 7.13881)
+node = scene:newReflectionProbeNode("reflprobe15", 7.13881)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-19.8456, 11.1297, -0.625299, 0))
 rot = Mat3x4.new()
@@ -230,7 +230,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe16", 7.13881)
+node = scene:newReflectionProbeNode("reflprobe16", 7.13881)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(18.9426, 11.1297, -0.625299, 0))
 rot = Mat3x4.new()
@@ -239,7 +239,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe17", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe17", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(18.0683, 11.1297, -8.62114, 0))
 rot = Mat3x4.new()
@@ -248,7 +248,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe18", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe18", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(8.05931, 11.1297, -8.62114, 0))
 rot = Mat3x4.new()
@@ -257,7 +257,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe19", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe19", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-1.43904, 11.1297, -8.62114, 0))
 rot = Mat3x4.new()
@@ -266,7 +266,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe20", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe20", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-11.1261, 11.1297, -8.62114, 0))
 rot = Mat3x4.new()
@@ -275,7 +275,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe21", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe21", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-19.0274, 11.1297, -8.62114, 0))
 rot = Mat3x4.new()
@@ -284,7 +284,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe22", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe22", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-19.0274, 11.1297, 6.66315, 0))
 rot = Mat3x4.new()
@@ -293,7 +293,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe23", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe23", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-11.1261, 11.1297, 6.66315, 0))
 rot = Mat3x4.new()
@@ -302,7 +302,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe24", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe24", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-1.43904, 11.1297, 6.66315, 0))
 rot = Mat3x4.new()
@@ -311,7 +311,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe25", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe25", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(8.05931, 11.1297, 6.66315, 0))
 rot = Mat3x4.new()
@@ -320,7 +320,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe26", 6.82732)
+node = scene:newReflectionProbeNode("reflprobe26", 6.82732)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(18.0683, 11.1297, 6.66315, 0))
 rot = Mat3x4.new()
@@ -329,7 +329,7 @@ trf:setRotation(rot)
 trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newReflectionProbe("reflprobe27", 35.9169)
+node = scene:newReflectionProbeNode("reflprobe27", 35.9169)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(0, 9.57409, -0.625299, 0))
 rot = Mat3x4.new()
@@ -2687,7 +2687,7 @@ trf:setRotation(rot)
 trf:setScale(0.0170465)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 
-node = scene:newSpotLight("Lamp")
+node = scene:newSpotLightNode("Lamp")
 lcomp = node:getSceneNodeBase():getLightComponent()
 lcomp:setDiffuseColor(Vec4.new(0.951211, 1.37843, 2.00171, 1))
 lcomp:setSpecularColor(Vec4.new(0.951211, 1.37843, 2.00171, 1))
@@ -2703,7 +2703,7 @@ trf:setScale(1)
 node:getSceneNodeBase():getMoveComponent():setLocalTransform(trf)
 lcomp:setShadowEnabled(1)
 
-node = scene:newPointLight("Point")
+node = scene:newPointLightNode("Point")
 lcomp = node:getSceneNodeBase():getLightComponent()
 lcomp:setDiffuseColor(Vec4.new(5.00188, 2.05202, 1.35254, 1))
 lcomp:setSpecularColor(Vec4.new(5.00188, 2.05202, 1.35254, 1))
@@ -2720,7 +2720,7 @@ event = events:newLightEvent(0.0, -1.0, node:getSceneNodeBase())
 event:setIntensityMultiplier(Vec4.new(1.2, 1.3, 1.3, 0))
 event:setFrequency(2, 0.02)
 
-node = scene:newPointLight("Point_001")
+node = scene:newPointLightNode("Point_001")
 lcomp = node:getSceneNodeBase():getLightComponent()
 lcomp:setDiffuseColor(Vec4.new(5.00188, 2.05202, 1.35254, 1))
 lcomp:setSpecularColor(Vec4.new(5.00188, 2.05202, 1.35254, 1))
@@ -2737,7 +2737,7 @@ event = events:newLightEvent(0.0, -1.0, node:getSceneNodeBase())
 event:setIntensityMultiplier(Vec4.new(1.2, 1.3, 1.3, 0))
 event:setFrequency(2, 0.02)
 
-node = scene:newPointLight("Point_002")
+node = scene:newPointLightNode("Point_002")
 lcomp = node:getSceneNodeBase():getLightComponent()
 lcomp:setDiffuseColor(Vec4.new(5.00188, 2.05202, 1.35254, 1))
 lcomp:setSpecularColor(Vec4.new(5.00188, 2.05202, 1.35254, 1))
@@ -2754,7 +2754,7 @@ event = events:newLightEvent(0.0, -1.0, node:getSceneNodeBase())
 event:setIntensityMultiplier(Vec4.new(1.2, 1.3, 1.3, 0))
 event:setFrequency(2, 0.02)
 
-node = scene:newPointLight("Point_003")
+node = scene:newPointLightNode("Point_003")
 lcomp = node:getSceneNodeBase():getLightComponent()
 lcomp:setDiffuseColor(Vec4.new(5.00188, 2.05202, 1.35254, 1))
 lcomp:setSpecularColor(Vec4.new(5.00188, 2.05202, 1.35254, 1))
@@ -2771,8 +2771,8 @@ event = events:newLightEvent(0.0, -1.0, node:getSceneNodeBase())
 event:setIntensityMultiplier(Vec4.new(1.2, 1.3, 1.3, 0))
 event:setFrequency(2, 0.02)
 
-node = scene:newPerspectiveCamera("Camera")
-scene:setActiveCamera(node:getSceneNodeBase())
+node = scene:newPerspectiveCameraNode("Camera")
+scene:setActiveCameraNode(node:getSceneNodeBase())
 node:setAll(1.5708, 1.0 / getMainRenderer():getAspectRatio() * 1.5708, 0.1, 100)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-19.4002, 11.2388, -4.00858, 0))

+ 3 - 3
sandbox/Main.cpp

@@ -70,7 +70,7 @@ Error MyApp::init(int argc, char* argv[])
 
 #if PLAYER
 	SceneGraph& scene = getSceneGraph();
-	SceneNode& cam = scene.getActiveCamera();
+	SceneNode& cam = scene.getActiveCameraNode();
 
 	PlayerNode* pnode;
 	ANKI_CHECK(scene.newSceneNode<PlayerNode>(
@@ -104,11 +104,11 @@ Error MyApp::userMainLoop(Bool& quit)
 	}
 
 	// move the camera
-	static MoveComponent* mover = &scene.getActiveCamera().getComponent<MoveComponent>();
+	static MoveComponent* mover = &scene.getActiveCameraNode().getComponent<MoveComponent>();
 
 	if(in.getKey(KeyCode::_1))
 	{
-		mover = scene.getActiveCamera().tryGetComponent<MoveComponent>();
+		mover = scene.getActiveCameraNode().tryGetComponent<MoveComponent>();
 	}
 	if(in.getKey(KeyCode::_2))
 	{

+ 21 - 12
src/anki/Scene.h

@@ -6,22 +6,31 @@
 #pragma once
 
 #include <anki/scene/SceneGraph.h>
-#include <anki/scene/LensFlareComponent.h>
-#include <anki/scene/BodyComponent.h>
-#include <anki/scene/Sector.h>
+#include <anki/scene/SectorNode.h>
 #include <anki/scene/ModelNode.h>
 #include <anki/scene/StaticGeometryNode.h>
-#include <anki/scene/ParticleEmitter.h>
-#include <anki/scene/Camera.h>
-#include <anki/scene/Light.h>
+#include <anki/scene/ParticleEmitterNode.h>
+#include <anki/scene/CameraNode.h>
+#include <anki/scene/LightNode.h>
 #include <anki/scene/StaticCollisionNode.h>
 #include <anki/scene/BodyNode.h>
-#include <anki/scene/ReflectionProbe.h>
-#include <anki/scene/ReflectionProbeComponent.h>
-#include <anki/scene/ReflectionProxy.h>
-#include <anki/scene/ReflectionProxyComponent.h>
+#include <anki/scene/ReflectionProbeNode.h>
+#include <anki/scene/ReflectionProxyNode.h>
 #include <anki/scene/PlayerNode.h>
 #include <anki/scene/OccluderNode.h>
-#include <anki/scene/OccluderComponent.h>
-#include <anki/scene/DecalComponent.h>
 #include <anki/scene/DecalNode.h>
+
+#include <anki/scene/components/MoveComponent.h>
+#include <anki/scene/components/RenderComponent.h>
+#include <anki/scene/components/OccluderComponent.h>
+#include <anki/scene/components/LensFlareComponent.h>
+#include <anki/scene/components/PlayerControllerComponent.h>
+#include <anki/scene/components/SkinComponent.h>
+#include <anki/scene/components/ReflectionProbeComponent.h>
+#include <anki/scene/components/DecalComponent.h>
+#include <anki/scene/components/SceneComponent.h>
+#include <anki/scene/components/LightComponent.h>
+#include <anki/scene/components/BodyComponent.h>
+#include <anki/scene/components/SpatialComponent.h>
+#include <anki/scene/components/ReflectionProxyComponent.h>
+#include <anki/scene/components/FrustumComponent.h>

+ 1 - 1
src/anki/event/AnimationEvent.cpp

@@ -6,7 +6,7 @@
 #include <anki/event/AnimationEvent.h>
 #include <anki/resource/Animation.h>
 #include <anki/scene/SceneNode.h>
-#include <anki/scene/MoveComponent.h>
+#include <anki/scene/components/MoveComponent.h>
 #include <anki/resource/ResourceManager.h>
 
 namespace anki

+ 1 - 1
src/anki/event/JitterMoveEvent.cpp

@@ -5,7 +5,7 @@
 
 #include <anki/event/JitterMoveEvent.h>
 #include <anki/scene/SceneNode.h>
-#include <anki/scene/MoveComponent.h>
+#include <anki/scene/components/MoveComponent.h>
 #include <anki/util/Functions.h>
 
 namespace anki

+ 2 - 2
src/anki/event/LightEvent.cpp

@@ -4,8 +4,8 @@
 // http://www.anki3d.org/LICENSE
 
 #include <anki/event/LightEvent.h>
-#include <anki/scene/Light.h>
-#include <anki/scene/LensFlareComponent.h>
+#include <anki/scene/LightNode.h>
+#include <anki/scene/components/LensFlareComponent.h>
 
 namespace anki
 {

+ 2 - 2
src/anki/scene/BodyNode.cpp

@@ -4,8 +4,8 @@
 // http://www.anki3d.org/LICENSE
 
 #include <anki/scene/BodyNode.h>
-#include <anki/scene/BodyComponent.h>
-#include <anki/scene/MoveComponent.h>
+#include <anki/scene/components/BodyComponent.h>
+#include <anki/scene/components/MoveComponent.h>
 #include <anki/scene/SceneGraph.h>
 #include <anki/physics/PhysicsWorld.h>
 #include <anki/resource/ResourceManager.h>

+ 20 - 18
src/anki/scene/Camera.cpp → src/anki/scene/CameraNode.cpp

@@ -3,7 +3,9 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/Camera.h>
+#include <anki/scene/CameraNode.h>
+#include <anki/scene/components/FrustumComponent.h>
+#include <anki/scene/components/MoveComponent.h>
 
 namespace anki
 {
@@ -12,7 +14,7 @@ namespace anki
 class CameraMoveFeedbackComponent : public SceneComponent
 {
 public:
-	CameraMoveFeedbackComponent(Camera* node)
+	CameraMoveFeedbackComponent(CameraNode* node)
 		: SceneComponent(SceneComponentType::NONE, node)
 	{
 	}
@@ -24,7 +26,7 @@ public:
 		MoveComponent& move = node.getComponent<MoveComponent>();
 		if(move.getTimestamp() == getGlobalTimestamp())
 		{
-			Camera& cam = static_cast<Camera&>(node);
+			CameraNode& cam = static_cast<CameraNode&>(node);
 			cam.onMoveComponentUpdate(move);
 		}
 
@@ -36,7 +38,7 @@ public:
 class CameraFrustumFeedbackComponent : public SceneComponent
 {
 public:
-	CameraFrustumFeedbackComponent(Camera* node)
+	CameraFrustumFeedbackComponent(CameraNode* node)
 		: SceneComponent(SceneComponentType::NONE, node)
 	{
 	}
@@ -48,7 +50,7 @@ public:
 		FrustumComponent& fr = node.getComponent<FrustumComponent>();
 		if(fr.getTimestamp() == getGlobalTimestamp())
 		{
-			Camera& cam = static_cast<Camera&>(node);
+			CameraNode& cam = static_cast<CameraNode&>(node);
 			cam.onFrustumComponentUpdate(fr);
 		}
 
@@ -56,13 +58,13 @@ public:
 	}
 };
 
-Camera::Camera(SceneGraph* scene, Type type, CString name)
+CameraNode::CameraNode(SceneGraph* scene, Type type, CString name)
 	: SceneNode(scene, name)
 	, m_type(type)
 {
 }
 
-Error Camera::init(Frustum* frustum)
+Error CameraNode::init(Frustum* frustum)
 {
 	// Move component
 	newComponent<MoveComponent>(this);
@@ -90,11 +92,11 @@ Error Camera::init(Frustum* frustum)
 	return Error::NONE;
 }
 
-Camera::~Camera()
+CameraNode::~CameraNode()
 {
 }
 
-void Camera::lookAtPoint(const Vec3& point)
+void CameraNode::lookAtPoint(const Vec3& point)
 {
 	MoveComponent& move = getComponent<MoveComponent>();
 
@@ -108,14 +110,14 @@ void Camera::lookAtPoint(const Vec3& point)
 	move.setLocalRotation(rot);
 }
 
-void Camera::onFrustumComponentUpdate(FrustumComponent& fr)
+void CameraNode::onFrustumComponentUpdate(FrustumComponent& fr)
 {
 	// Spatial
 	SpatialComponent& sp = getComponent<SpatialComponent>();
 	sp.markForUpdate();
 }
 
-void Camera::onMoveComponentUpdate(MoveComponent& move)
+void CameraNode::onMoveComponentUpdate(MoveComponent& move)
 {
 	// Frustum
 	FrustumComponent& fr = getComponent<FrustumComponent>();
@@ -128,27 +130,27 @@ void Camera::onMoveComponentUpdate(MoveComponent& move)
 	sp.setSpatialOrigin(move.getWorldTransform().getOrigin());
 }
 
-PerspectiveCamera::PerspectiveCamera(SceneGraph* scene, CString name)
-	: Camera(scene, Type::PERSPECTIVE, name)
+PerspectiveCameraNode::PerspectiveCameraNode(SceneGraph* scene, CString name)
+	: CameraNode(scene, Type::PERSPECTIVE, name)
 {
 }
 
-PerspectiveCamera::~PerspectiveCamera()
+PerspectiveCameraNode::~PerspectiveCameraNode()
 {
 }
 
-void PerspectiveCamera::setAll(F32 fovX, F32 fovY, F32 near, F32 far)
+void PerspectiveCameraNode::setAll(F32 fovX, F32 fovY, F32 near, F32 far)
 {
 	m_frustum.setAll(fovX, fovY, near, far);
 	getComponent<FrustumComponent>().markShapeForUpdate();
 }
 
-OrthographicCamera::OrthographicCamera(SceneGraph* scene, CString name)
-	: Camera(scene, Type::ORTHOGRAPHIC, name)
+OrthographicCameraNode::OrthographicCameraNode(SceneGraph* scene, CString name)
+	: CameraNode(scene, Type::ORTHOGRAPHIC, name)
 {
 }
 
-OrthographicCamera::~OrthographicCamera()
+OrthographicCameraNode::~OrthographicCameraNode()
 {
 }
 

+ 13 - 14
src/anki/scene/Camera.h → src/anki/scene/CameraNode.h

@@ -6,9 +6,8 @@
 #pragma once
 
 #include <anki/scene/SceneNode.h>
-#include <anki/scene/SpatialComponent.h>
-#include <anki/scene/MoveComponent.h>
-#include <anki/scene/FrustumComponent.h>
+#include <anki/Math.h>
+#include <anki/collision/Frustum.h>
 
 namespace anki
 {
@@ -17,7 +16,7 @@ namespace anki
 /// @{
 
 /// Camera SceneNode interface class
-class Camera : public SceneNode
+class CameraNode : public SceneNode
 {
 	friend class CameraMoveFeedbackComponent;
 	friend class CameraFrustumFeedbackComponent;
@@ -31,9 +30,9 @@ public:
 		COUNT
 	};
 
-	Camera(SceneGraph* scene, Type type, CString name);
+	CameraNode(SceneGraph* scene, Type type, CString name);
 
-	virtual ~Camera();
+	virtual ~CameraNode();
 
 	ANKI_USE_RESULT Error init(Frustum* frustum);
 
@@ -55,16 +54,16 @@ private:
 };
 
 /// Perspective camera
-class PerspectiveCamera : public Camera
+class PerspectiveCameraNode : public CameraNode
 {
 public:
-	PerspectiveCamera(SceneGraph* scene, CString name);
+	PerspectiveCameraNode(SceneGraph* scene, CString name);
 
-	~PerspectiveCamera();
+	~PerspectiveCameraNode();
 
 	ANKI_USE_RESULT Error init()
 	{
-		return Camera::init(&m_frustum);
+		return CameraNode::init(&m_frustum);
 	}
 
 	void setAll(F32 fovX, F32 fovY, F32 near, F32 far);
@@ -74,16 +73,16 @@ private:
 };
 
 /// Orthographic camera
-class OrthographicCamera : public Camera
+class OrthographicCameraNode : public CameraNode
 {
 public:
-	OrthographicCamera(SceneGraph* scene, CString name);
+	OrthographicCameraNode(SceneGraph* scene, CString name);
 
-	~OrthographicCamera();
+	~OrthographicCameraNode();
 
 	ANKI_USE_RESULT Error init()
 	{
-		return Camera::init(&m_frustum);
+		return CameraNode::init(&m_frustum);
 	}
 
 private:

+ 1 - 0
src/anki/scene/Common.h

@@ -7,6 +7,7 @@
 
 #include <anki/util/Allocator.h>
 #include <anki/util/String.h>
+#include <anki/scene/Forward.h>
 
 namespace anki
 {

+ 3 - 3
src/anki/scene/DecalNode.cpp

@@ -4,9 +4,9 @@
 // http://www.anki3d.org/LICENSE
 
 #include <anki/scene/DecalNode.h>
-#include <anki/scene/DecalComponent.h>
-#include <anki/scene/MoveComponent.h>
-#include <anki/scene/SpatialComponent.h>
+#include <anki/scene/components/DecalComponent.h>
+#include <anki/scene/components/MoveComponent.h>
+#include <anki/scene/components/SpatialComponent.h>
 
 namespace anki
 {

+ 8 - 6
src/anki/scene/Forward.h

@@ -9,6 +9,7 @@ namespace anki
 {
 
 // Components
+class SceneComponent;
 class FrustumComponent;
 class InstanceComponent;
 class MoveComponent;
@@ -18,17 +19,18 @@ class DecalComponent;
 class PortalComponent;
 class SectorComponent;
 class ReflectionProxyComponent;
+class ReflectionProbeComponent;
 
 // Nodes
 class SceneNode;
-class Light;
-class PointLight;
-class SpotLight;
-class Camera;
-class Path;
+class LightNode;
+class PointLightNode;
+class SpotLightNode;
+class CameraNode;
+class SectorNode;
+class PortalNode;
 
 // Other
 class SceneGraph;
-class Sector;
 
 } // end namespace anki

+ 31 - 31
src/anki/scene/Light.cpp → src/anki/scene/LightNode.cpp

@@ -3,17 +3,17 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/Light.h>
-#include <anki/scene/LensFlareComponent.h>
-#include <anki/scene/MoveComponent.h>
-#include <anki/scene/SpatialComponent.h>
-#include <anki/scene/FrustumComponent.h>
+#include <anki/scene/LightNode.h>
+#include <anki/scene/components/LensFlareComponent.h>
+#include <anki/scene/components/MoveComponent.h>
+#include <anki/scene/components/SpatialComponent.h>
+#include <anki/scene/components/FrustumComponent.h>
 
 namespace anki
 {
 
 /// Feedback component.
-class Light::MovedFeedbackComponent : public SceneComponent
+class LightNode::MovedFeedbackComponent : public SceneComponent
 {
 public:
 	MovedFeedbackComponent(SceneNode* node)
@@ -24,7 +24,7 @@ public:
 	Error update(SceneNode& node, Second, Second, Bool& updated) override
 	{
 		updated = false;
-		Light& lnode = static_cast<Light&>(node);
+		LightNode& lnode = static_cast<LightNode&>(node);
 
 		const MoveComponent& move = node.getComponentAt<MoveComponent>(0);
 		if(move.getTimestamp() == node.getGlobalTimestamp())
@@ -38,7 +38,7 @@ public:
 };
 
 /// Feedback component.
-class Light::LightChangedFeedbackComponent : public SceneComponent
+class LightNode::LightChangedFeedbackComponent : public SceneComponent
 {
 public:
 	LightChangedFeedbackComponent(SceneNode* node)
@@ -49,7 +49,7 @@ public:
 	Error update(SceneNode& node, Second, Second, Bool& updated) override
 	{
 		updated = false;
-		Light& lnode = static_cast<Light&>(node);
+		LightNode& lnode = static_cast<LightNode&>(node);
 
 		LightComponent& light = node.getComponentAt<LightComponent>(getIndex() - 1);
 		if(light.getTimestamp() == node.getGlobalTimestamp())
@@ -62,16 +62,16 @@ public:
 	}
 };
 
-Light::Light(SceneGraph* scene, CString name)
+LightNode::LightNode(SceneGraph* scene, CString name)
 	: SceneNode(scene, name)
 {
 }
 
-Light::~Light()
+LightNode::~LightNode()
 {
 }
 
-Error Light::init(LightComponentType type, CollisionShape* shape)
+Error LightNode::init(LightComponentType type, CollisionShape* shape)
 {
 	// Move component
 	newComponent<MoveComponent>(this);
@@ -91,7 +91,7 @@ Error Light::init(LightComponentType type, CollisionShape* shape)
 	return Error::NONE;
 }
 
-void Light::frameUpdateCommon()
+void LightNode::frameUpdateCommon()
 {
 	// Update frustum comps shadow info
 	const LightComponent& lc = getComponent<LightComponent>();
@@ -112,7 +112,7 @@ void Light::frameUpdateCommon()
 	(void)err;
 }
 
-void Light::onMoveUpdateCommon(const MoveComponent& move)
+void LightNode::onMoveUpdateCommon(const MoveComponent& move)
 {
 	// Update the spatial
 	SpatialComponent& sp = getComponent<SpatialComponent>();
@@ -130,7 +130,7 @@ void Light::onMoveUpdateCommon(const MoveComponent& move)
 	getComponent<LightComponent>().updateWorldTransform(move.getWorldTransform());
 }
 
-void Light::onShapeUpdateCommon(LightComponent& light)
+void LightNode::onShapeUpdateCommon(LightComponent& light)
 {
 	// Update the frustums
 	Error err = iterateComponentsOfType<FrustumComponent>([&](FrustumComponent& fr) -> Error {
@@ -145,7 +145,7 @@ void Light::onShapeUpdateCommon(LightComponent& light)
 	sp.markForUpdate();
 }
 
-Error Light::loadLensFlare(const CString& filename)
+Error LightNode::loadLensFlare(const CString& filename)
 {
 	ANKI_ASSERT(tryGetComponent<LensFlareComponent>() == nullptr);
 
@@ -161,22 +161,22 @@ Error Light::loadLensFlare(const CString& filename)
 	return Error::NONE;
 }
 
-PointLight::PointLight(SceneGraph* scene, CString name)
-	: Light(scene, name)
+PointLightNode::PointLightNode(SceneGraph* scene, CString name)
+	: LightNode(scene, name)
 {
 }
 
-PointLight::~PointLight()
+PointLightNode::~PointLightNode()
 {
 	m_shadowData.destroy(getSceneAllocator());
 }
 
-Error PointLight::init()
+Error PointLightNode::init()
 {
-	return Light::init(LightComponentType::POINT, &m_sphereW);
+	return LightNode::init(LightComponentType::POINT, &m_sphereW);
 }
 
-void PointLight::onMoveUpdate(const MoveComponent& move)
+void PointLightNode::onMoveUpdate(const MoveComponent& move)
 {
 	onMoveUpdateCommon(move);
 
@@ -198,7 +198,7 @@ void PointLight::onMoveUpdate(const MoveComponent& move)
 	m_sphereW.setCenter(move.getWorldTransform().getOrigin());
 }
 
-void PointLight::onShapeUpdate(LightComponent& light)
+void PointLightNode::onShapeUpdate(LightComponent& light)
 {
 	for(ShadowCombo& c : m_shadowData)
 	{
@@ -210,7 +210,7 @@ void PointLight::onShapeUpdate(LightComponent& light)
 	onShapeUpdateCommon(light);
 }
 
-Error PointLight::frameUpdate(Second prevUpdateTime, Second crntTime)
+Error PointLightNode::frameUpdate(Second prevUpdateTime, Second crntTime)
 {
 	if(getComponent<LightComponent>().getShadowEnabled() && m_shadowData.isEmpty())
 	{
@@ -253,14 +253,14 @@ Error PointLight::frameUpdate(Second prevUpdateTime, Second crntTime)
 	return Error::NONE;
 }
 
-SpotLight::SpotLight(SceneGraph* scene, CString name)
-	: Light(scene, name)
+SpotLightNode::SpotLightNode(SceneGraph* scene, CString name)
+	: LightNode(scene, name)
 {
 }
 
-Error SpotLight::init()
+Error SpotLightNode::init()
 {
-	ANKI_CHECK(Light::init(LightComponentType::SPOT, &m_frustum));
+	ANKI_CHECK(LightNode::init(LightComponentType::SPOT, &m_frustum));
 
 	FrustumComponent* fr = newComponent<FrustumComponent>(this, &m_frustum);
 	fr->setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::NONE);
@@ -268,7 +268,7 @@ Error SpotLight::init()
 	return Error::NONE;
 }
 
-void SpotLight::onMoveUpdate(const MoveComponent& move)
+void SpotLightNode::onMoveUpdate(const MoveComponent& move)
 {
 	// Update the frustums
 	Error err = iterateComponentsOfType<FrustumComponent>([&](FrustumComponent& fr) -> Error {
@@ -283,14 +283,14 @@ void SpotLight::onMoveUpdate(const MoveComponent& move)
 	onMoveUpdateCommon(move);
 }
 
-void SpotLight::onShapeUpdate(LightComponent& light)
+void SpotLightNode::onShapeUpdate(LightComponent& light)
 {
 	onShapeUpdateCommon(light);
 	m_frustum.setAll(
 		light.getOuterAngle(), light.getOuterAngle(), LightComponent::FRUSTUM_NEAR_PLANE, light.getDistance());
 }
 
-Error SpotLight::frameUpdate(Second prevUpdateTime, Second crntTime)
+Error SpotLightNode::frameUpdate(Second prevUpdateTime, Second crntTime)
 {
 	frameUpdateCommon();
 	return Error::NONE;

+ 9 - 9
src/anki/scene/Light.h → src/anki/scene/LightNode.h

@@ -7,7 +7,7 @@
 
 #include <anki/scene/SceneNode.h>
 #include <anki/scene/Forward.h>
-#include <anki/scene/LightComponent.h>
+#include <anki/scene/components/LightComponent.h>
 #include <anki/resource/TextureResource.h>
 #include <anki/Collision.h>
 
@@ -18,12 +18,12 @@ namespace anki
 /// @{
 
 /// Light scene node. It can be spot or point.
-class Light : public SceneNode
+class LightNode : public SceneNode
 {
 public:
-	Light(SceneGraph* scene, CString name);
+	LightNode(SceneGraph* scene, CString name);
 
-	~Light();
+	~LightNode();
 
 	ANKI_USE_RESULT Error init(LightComponentType type, CollisionShape* shape);
 
@@ -48,11 +48,11 @@ private:
 };
 
 /// Point light
-class PointLight : public Light
+class PointLightNode : public LightNode
 {
 public:
-	PointLight(SceneGraph* scene, CString name);
-	~PointLight();
+	PointLightNode(SceneGraph* scene, CString name);
+	~PointLightNode();
 
 	ANKI_USE_RESULT Error init();
 
@@ -74,10 +74,10 @@ private:
 };
 
 /// Spot light
-class SpotLight : public Light
+class SpotLightNode : public LightNode
 {
 public:
-	SpotLight(SceneGraph* scene, CString name);
+	SpotLightNode(SceneGraph* scene, CString name);
 
 	ANKI_USE_RESULT Error init();
 

+ 1 - 1
src/anki/scene/Misc.h

@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include <anki/scene/SpatialComponent.h>
+#include <anki/scene/components/SpatialComponent.h>
 
 namespace anki
 {

+ 2 - 2
src/anki/scene/ModelNode.cpp

@@ -5,8 +5,8 @@
 
 #include <anki/scene/ModelNode.h>
 #include <anki/scene/SceneGraph.h>
-#include <anki/scene/BodyComponent.h>
-#include <anki/scene/SkinComponent.h>
+#include <anki/scene/components/BodyComponent.h>
+#include <anki/scene/components/SkinComponent.h>
 #include <anki/scene/Misc.h>
 #include <anki/resource/Model.h>
 #include <anki/resource/ResourceManager.h>

+ 3 - 3
src/anki/scene/ModelNode.h

@@ -6,9 +6,9 @@
 #pragma once
 
 #include <anki/scene/SceneNode.h>
-#include <anki/scene/RenderComponent.h>
-#include <anki/scene/MoveComponent.h>
-#include <anki/scene/SpatialComponent.h>
+#include <anki/scene/components/RenderComponent.h>
+#include <anki/scene/components/MoveComponent.h>
+#include <anki/scene/components/SpatialComponent.h>
 #include <anki/resource/Model.h>
 #include <anki/collision/Obb.h>
 

+ 2 - 2
src/anki/scene/OccluderNode.cpp

@@ -5,8 +5,8 @@
 
 #include <anki/scene/OccluderNode.h>
 #include <anki/scene/SceneGraph.h>
-#include <anki/scene/MoveComponent.h>
-#include <anki/scene/OccluderComponent.h>
+#include <anki/scene/components/MoveComponent.h>
+#include <anki/scene/components/OccluderComponent.h>
 #include <anki/resource/MeshLoader.h>
 
 namespace anki

+ 20 - 19
src/anki/scene/ParticleEmitter.cpp → src/anki/scene/ParticleEmitterNode.cpp

@@ -3,7 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/ParticleEmitter.h>
+#include <anki/scene/ParticleEmitterNode.h>
 #include <anki/scene/SceneGraph.h>
 #include <anki/scene/Misc.h>
 #include <anki/resource/Model.h>
@@ -37,7 +37,8 @@ static Vec3 getRandom(const Vec3& initial, const Vec3& deviation)
 	}
 }
 
-void ParticleBase::revive(const ParticleEmitter& pe, const Transform& trf, Second /*prevUpdateTime*/, Second crntTime)
+void ParticleBase::revive(
+	const ParticleEmitterNode& pe, const Transform& trf, Second /*prevUpdateTime*/, Second crntTime)
 {
 	ANKI_ASSERT(isDead());
 	const ParticleEmitterProperties& props = pe;
@@ -47,7 +48,7 @@ void ParticleBase::revive(const ParticleEmitter& pe, const Transform& trf, Secon
 	m_timeOfBirth = crntTime;
 }
 
-void ParticleSimple::simulate(const ParticleEmitter& pe, Second prevUpdateTime, Second crntTime)
+void ParticleSimple::simulate(const ParticleEmitterNode& pe, Second prevUpdateTime, Second crntTime)
 {
 	Second dt = crntTime - prevUpdateTime;
 
@@ -59,7 +60,7 @@ void ParticleSimple::simulate(const ParticleEmitter& pe, Second prevUpdateTime,
 	m_velocity += m_acceleration * dt;
 }
 
-void ParticleSimple::revive(const ParticleEmitter& pe, const Transform& trf, Second prevUpdateTime, Second crntTime)
+void ParticleSimple::revive(const ParticleEmitterNode& pe, const Transform& trf, Second prevUpdateTime, Second crntTime)
 {
 	ParticleBase::revive(pe, trf, prevUpdateTime, crntTime);
 	m_velocity = Vec4(0.0);
@@ -97,7 +98,7 @@ Particle::~Particle()
 }
 
 
-void Particle::revive(const ParticleEmitter& pe,
+void Particle::revive(const ParticleEmitterNode& pe,
 	F32 prevUpdateTime, F32 crntTime)
 {
 	ParticleBase::revive(pe, prevUpdateTime, crntTime);
@@ -164,12 +165,12 @@ void Particle::revive(const ParticleEmitter& pe,
 class ParticleEmitterRenderComponent : public RenderComponent
 {
 public:
-	const ParticleEmitter& getNode() const
+	const ParticleEmitterNode& getNode() const
 	{
-		return static_cast<const ParticleEmitter&>(getSceneNode());
+		return static_cast<const ParticleEmitterNode&>(getSceneNode());
 	}
 
-	ParticleEmitterRenderComponent(ParticleEmitter* node)
+	ParticleEmitterRenderComponent(ParticleEmitterNode* node)
 		: RenderComponent(node, node->m_particleEmitterResource->getMaterial())
 	{
 	}
@@ -184,7 +185,7 @@ public:
 class MoveFeedbackComponent : public SceneComponent
 {
 public:
-	MoveFeedbackComponent(ParticleEmitter* node)
+	MoveFeedbackComponent(ParticleEmitterNode* node)
 		: SceneComponent(SceneComponentType::NONE, node)
 	{
 	}
@@ -196,19 +197,19 @@ public:
 		MoveComponent& move = node.getComponent<MoveComponent>();
 		if(move.getTimestamp() == node.getGlobalTimestamp())
 		{
-			static_cast<ParticleEmitter&>(node).onMoveComponentUpdate(move);
+			static_cast<ParticleEmitterNode&>(node).onMoveComponentUpdate(move);
 		}
 
 		return Error::NONE;
 	}
 };
 
-ParticleEmitter::ParticleEmitter(SceneGraph* scene, CString name)
+ParticleEmitterNode::ParticleEmitterNode(SceneGraph* scene, CString name)
 	: SceneNode(scene, name)
 {
 }
 
-ParticleEmitter::~ParticleEmitter()
+ParticleEmitterNode::~ParticleEmitterNode()
 {
 	// Delete simple particles
 	if(m_simulationType == SimulationType::SIMPLE)
@@ -222,7 +223,7 @@ ParticleEmitter::~ParticleEmitter()
 	m_particles.destroy(getSceneAllocator());
 }
 
-Error ParticleEmitter::init(const CString& filename)
+Error ParticleEmitterNode::init(const CString& filename)
 {
 	// Load resource
 	ANKI_CHECK(getResourceManager().loadResource(filename, m_particleEmitterResource));
@@ -266,11 +267,11 @@ Error ParticleEmitter::init(const CString& filename)
 	return Error::NONE;
 }
 
-void ParticleEmitter::drawCallback(RenderQueueDrawContext& ctx, ConstWeakArray<void*> userData)
+void ParticleEmitterNode::drawCallback(RenderQueueDrawContext& ctx, ConstWeakArray<void*> userData)
 {
 	ANKI_ASSERT(userData.getSize() == 1);
 
-	const ParticleEmitter& self = *static_cast<const ParticleEmitter*>(userData[0]);
+	const ParticleEmitterNode& self = *static_cast<const ParticleEmitterNode*>(userData[0]);
 
 	// Early exit
 	if(ANKI_UNLIKELY(self.m_aliveParticlesCount == 0))
@@ -314,7 +315,7 @@ void ParticleEmitter::drawCallback(RenderQueueDrawContext& ctx, ConstWeakArray<v
 	}
 }
 
-void ParticleEmitter::onMoveComponentUpdate(MoveComponent& move)
+void ParticleEmitterNode::onMoveComponentUpdate(MoveComponent& move)
 {
 	m_identityRotation = move.getWorldTransform().getRotation() == Mat3x4::getIdentity();
 
@@ -323,7 +324,7 @@ void ParticleEmitter::onMoveComponentUpdate(MoveComponent& move)
 	sp.markForUpdate();
 }
 
-void ParticleEmitter::createParticlesSimulation(SceneGraph* scene)
+void ParticleEmitterNode::createParticlesSimulation(SceneGraph* scene)
 {
 #if 0
 	collShape = getSceneAllocator().newInstance<btSphereShape>(particle.size);
@@ -351,7 +352,7 @@ void ParticleEmitter::createParticlesSimulation(SceneGraph* scene)
 #endif
 }
 
-void ParticleEmitter::createParticlesSimpleSimulation()
+void ParticleEmitterNode::createParticlesSimpleSimulation()
 {
 	m_particles.create(getSceneAllocator(), m_maxNumOfParticles);
 
@@ -366,7 +367,7 @@ void ParticleEmitter::createParticlesSimpleSimulation()
 	}
 }
 
-Error ParticleEmitter::frameUpdate(Second prevUpdateTime, Second crntTime)
+Error ParticleEmitterNode::frameUpdate(Second prevUpdateTime, Second crntTime)
 {
 	// - Deactivate the dead particles
 	// - Calc the AABB

+ 14 - 14
src/anki/scene/ParticleEmitter.h → src/anki/scene/ParticleEmitterNode.h

@@ -6,15 +6,15 @@
 #pragma once
 
 #include <anki/scene/SceneNode.h>
-#include <anki/scene/MoveComponent.h>
-#include <anki/scene/SpatialComponent.h>
-#include <anki/scene/RenderComponent.h>
+#include <anki/scene/components/MoveComponent.h>
+#include <anki/scene/components/SpatialComponent.h>
+#include <anki/scene/components/RenderComponent.h>
 #include <anki/resource/ParticleEmitterResource.h>
 
 namespace anki
 {
 
-class ParticleEmitter;
+class ParticleEmitterNode;
 
 /// @addtogroup scene
 /// @{
@@ -22,7 +22,7 @@ class ParticleEmitter;
 /// Particle base
 class ParticleBase
 {
-	friend class ParticleEmitter;
+	friend class ParticleEmitterNode;
 
 public:
 	ParticleBase()
@@ -76,10 +76,10 @@ public:
 	}
 
 	/// Revive the particle
-	virtual void revive(const ParticleEmitter& pe, const Transform& trf, Second prevUpdateTime, Second crntTime);
+	virtual void revive(const ParticleEmitterNode& pe, const Transform& trf, Second prevUpdateTime, Second crntTime);
 
 	/// Only relevant for non-bullet simulations
-	virtual void simulate(const ParticleEmitter& pe, Second prevUpdateTime, Second crntTime)
+	virtual void simulate(const ParticleEmitterNode& pe, Second prevUpdateTime, Second crntTime)
 	{
 		(void)pe;
 		(void)prevUpdateTime;
@@ -103,9 +103,9 @@ public:
 	{
 	}
 
-	void revive(const ParticleEmitter& pe, const Transform& trf, Second prevUpdateTime, Second crntTime) override;
+	void revive(const ParticleEmitterNode& pe, const Transform& trf, Second prevUpdateTime, Second crntTime) override;
 
-	void simulate(const ParticleEmitter& pe, Second prevUpdateTime, Second crntTime) override;
+	void simulate(const ParticleEmitterNode& pe, Second prevUpdateTime, Second crntTime) override;
 
 	const Vec4& getPosition() const override
 	{
@@ -137,7 +137,7 @@ public:
 		body->setActivationState(DISABLE_SIMULATION);
 	}
 
-	void revive(const ParticleEmitter& pe,
+	void revive(const ParticleEmitterNode& pe,
 		F32 prevUpdateTime, F32 crntTime);
 
 private:
@@ -146,7 +146,7 @@ private:
 #endif
 
 /// The particle emitter scene node. This scene node emitts
-class ParticleEmitter : public SceneNode, private ParticleEmitterProperties
+class ParticleEmitterNode : public SceneNode, private ParticleEmitterProperties
 {
 	friend class ParticleBase;
 	friend class Particle;
@@ -155,9 +155,9 @@ class ParticleEmitter : public SceneNode, private ParticleEmitterProperties
 	friend class MoveFeedbackComponent;
 
 public:
-	ParticleEmitter(SceneGraph* scene, CString name);
+	ParticleEmitterNode(SceneGraph* scene, CString name);
 
-	~ParticleEmitter();
+	~ParticleEmitterNode();
 
 	ANKI_USE_RESULT Error init(const CString& filename);
 
@@ -182,7 +182,7 @@ private:
 	Second m_timeLeftForNextEmission = 0.0;
 	Obb m_obb;
 
-	// Opt: We dont have to make extra calculations if the ParticleEmitter's rotation is the identity
+	// Opt: We dont have to make extra calculations if the ParticleEmitterNode's rotation is the identity
 	Bool8 m_identityRotation = true;
 
 	U32 m_aliveParticlesCount = 0;

+ 2 - 2
src/anki/scene/PlayerNode.cpp

@@ -5,8 +5,8 @@
 
 #include <anki/scene/PlayerNode.h>
 #include <anki/scene/SceneGraph.h>
-#include <anki/scene/MoveComponent.h>
-#include <anki/scene/PlayerControllerComponent.h>
+#include <anki/scene/components/MoveComponent.h>
+#include <anki/scene/components/PlayerControllerComponent.h>
 #include <anki/physics/PhysicsPlayerController.h>
 #include <anki/physics/PhysicsWorld.h>
 #include <anki/input/Input.h>

+ 9 - 9
src/anki/scene/ReflectionProbe.cpp → src/anki/scene/ReflectionProbeNode.cpp

@@ -3,10 +3,10 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/ReflectionProbe.h>
-#include <anki/scene/ReflectionProbeComponent.h>
-#include <anki/scene/MoveComponent.h>
-#include <anki/scene/FrustumComponent.h>
+#include <anki/scene/ReflectionProbeNode.h>
+#include <anki/scene/components/ReflectionProbeComponent.h>
+#include <anki/scene/components/MoveComponent.h>
+#include <anki/scene/components/FrustumComponent.h>
 #include <anki/scene/SceneGraph.h>
 #include <anki/scene/SceneGraph.h>
 #include <anki/renderer/LightShading.h>
@@ -34,7 +34,7 @@ public:
 		if(move.getTimestamp() == node.getGlobalTimestamp())
 		{
 			// Move updated
-			ReflectionProbe& dnode = static_cast<ReflectionProbe&>(node);
+			ReflectionProbeNode& dnode = static_cast<ReflectionProbeNode&>(node);
 			dnode.onMoveUpdate(move);
 		}
 
@@ -42,11 +42,11 @@ public:
 	}
 };
 
-ReflectionProbe::~ReflectionProbe()
+ReflectionProbeNode::~ReflectionProbeNode()
 {
 }
 
-Error ReflectionProbe::init(F32 radius)
+Error ReflectionProbeNode::init(F32 radius)
 {
 	// Move component first
 	newComponent<MoveComponent>(this);
@@ -98,7 +98,7 @@ Error ReflectionProbe::init(F32 radius)
 	return Error::NONE;
 }
 
-void ReflectionProbe::onMoveUpdate(MoveComponent& move)
+void ReflectionProbeNode::onMoveUpdate(MoveComponent& move)
 {
 	// Update frustum components
 	U count = 0;
@@ -127,7 +127,7 @@ void ReflectionProbe::onMoveUpdate(MoveComponent& move)
 	reflc.setPosition(move.getWorldTransform().getOrigin());
 }
 
-Error ReflectionProbe::frameUpdate(Second prevUpdateTime, Second crntTime)
+Error ReflectionProbeNode::frameUpdate(Second prevUpdateTime, Second crntTime)
 {
 	// Check the reflection probe component and if it's marked for rendering enable the frustum components
 	const ReflectionProbeComponent& reflc = getComponent<ReflectionProbeComponent>();

+ 3 - 3
src/anki/scene/ReflectionProbe.h → src/anki/scene/ReflectionProbeNode.h

@@ -17,7 +17,7 @@ namespace anki
 /// @{
 
 /// Probe used in realtime reflections.
-class ReflectionProbe : public SceneNode
+class ReflectionProbeNode : public SceneNode
 {
 	friend class ReflectionProbeMoveFeedbackComponent;
 
@@ -25,12 +25,12 @@ public:
 	const F32 FRUSTUM_NEAR_PLANE = 0.1f / 4.0f;
 	const F32 EFFECTIVE_DISTANCE = 256.0f;
 
-	ReflectionProbe(SceneGraph* scene, CString name)
+	ReflectionProbeNode(SceneGraph* scene, CString name)
 		: SceneNode(scene, name)
 	{
 	}
 
-	~ReflectionProbe();
+	~ReflectionProbeNode();
 
 	ANKI_USE_RESULT Error init(F32 radius);
 

+ 7 - 7
src/anki/scene/ReflectionProxy.cpp → src/anki/scene/ReflectionProxyNode.cpp

@@ -3,10 +3,10 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/ReflectionProxy.h>
-#include <anki/scene/ReflectionProxyComponent.h>
-#include <anki/scene/MoveComponent.h>
-#include <anki/scene/SpatialComponent.h>
+#include <anki/scene/ReflectionProxyNode.h>
+#include <anki/scene/components/ReflectionProxyComponent.h>
+#include <anki/scene/components/MoveComponent.h>
+#include <anki/scene/components/SpatialComponent.h>
 #include <anki/resource/MeshLoader.h>
 #include <anki/util/WeakArray.h>
 
@@ -30,7 +30,7 @@ public:
 		if(move.getTimestamp() == node.getGlobalTimestamp())
 		{
 			// Move updated
-			ReflectionProxy& dnode = static_cast<ReflectionProxy&>(node);
+			ReflectionProxyNode& dnode = static_cast<ReflectionProxyNode&>(node);
 			dnode.onMoveUpdate(move);
 		}
 
@@ -38,7 +38,7 @@ public:
 	}
 };
 
-Error ReflectionProxy::init(const CString& proxyMesh)
+Error ReflectionProxyNode::init(const CString& proxyMesh)
 {
 	// Move component first
 	newComponent<MoveComponent>(this);
@@ -95,7 +95,7 @@ Error ReflectionProxy::init(const CString& proxyMesh)
 	return Error::NONE;
 }
 
-void ReflectionProxy::onMoveUpdate(const MoveComponent& move)
+void ReflectionProxyNode::onMoveUpdate(const MoveComponent& move)
 {
 	const Transform& trf = move.getWorldTransform();
 

+ 3 - 3
src/anki/scene/ReflectionProxy.h → src/anki/scene/ReflectionProxyNode.h

@@ -16,17 +16,17 @@ namespace anki
 /// @{
 
 /// Proxy used in realtime reflections.
-class ReflectionProxy : public SceneNode
+class ReflectionProxyNode : public SceneNode
 {
 	friend class ReflectionProxyMoveFeedbackComponent;
 
 public:
-	ReflectionProxy(SceneGraph* scene, CString name)
+	ReflectionProxyNode(SceneGraph* scene, CString name)
 		: SceneNode(scene, name)
 	{
 	}
 
-	~ReflectionProxy()
+	~ReflectionProxyNode()
 	{
 		m_quadsLSpace.destroy(getSceneAllocator());
 	}

+ 3 - 3
src/anki/scene/SceneGraph.cpp

@@ -4,9 +4,9 @@
 // http://www.anki3d.org/LICENSE
 
 #include <anki/scene/SceneGraph.h>
-#include <anki/scene/Camera.h>
+#include <anki/scene/CameraNode.h>
 #include <anki/scene/ModelNode.h>
-#include <anki/scene/Sector.h>
+#include <anki/scene/SectorNode.h>
 #include <anki/core/Trace.h>
 #include <anki/physics/PhysicsWorld.h>
 #include <anki/resource/ResourceManager.h>
@@ -95,7 +95,7 @@ Error SceneGraph::init(AllocAlignedCallback allocCb,
 	m_maxReflectionProxyDistance = config.getNumber("scene.imageReflectionMaxDistance");
 
 	// Init the default main camera
-	ANKI_CHECK(newSceneNode<PerspectiveCamera>("mainCamera", m_defaultMainCam));
+	ANKI_CHECK(newSceneNode<PerspectiveCameraNode>("mainCamera", m_defaultMainCam));
 	m_defaultMainCam->setAll(toRad(60.0f), toRad(60.0f), 0.1f, 1000.0f);
 	m_mainCam = m_defaultMainCam;
 

+ 7 - 7
src/anki/scene/SceneGraph.h

@@ -22,11 +22,11 @@ namespace anki
 // Forward
 class MainRenderer;
 class ResourceManager;
-class Camera;
+class CameraNode;
 class Input;
 class SectorGroup;
 class ConfigSet;
-class PerspectiveCamera;
+class PerspectiveCameraNode;
 class UpdateSceneNodesCtx;
 
 /// @addtogroup scene
@@ -70,21 +70,21 @@ public:
 		return m_frameAlloc;
 	}
 
-	SceneNode& getActiveCamera()
+	SceneNode& getActiveCameraNode()
 	{
 		ANKI_ASSERT(m_mainCam != nullptr);
 		return *m_mainCam;
 	}
-	const SceneNode& getActiveCamera() const
+	const SceneNode& getActiveCameraNode() const
 	{
 		return *m_mainCam;
 	}
-	void setActiveCamera(SceneNode* cam)
+	void setActiveCameraNode(SceneNode* cam)
 	{
 		m_mainCam = cam;
 		m_activeCameraChangeTimestamp = getGlobalTimestamp();
 	}
-	Timestamp getActiveCameraChangeTimestamp() const
+	Timestamp getActiveCameraNodeChangeTimestamp() const
 	{
 		return m_activeCameraChangeTimestamp;
 	}
@@ -238,7 +238,7 @@ private:
 
 	SceneNode* m_mainCam = nullptr;
 	Timestamp m_activeCameraChangeTimestamp = 0;
-	PerspectiveCamera* m_defaultMainCam = nullptr;
+	PerspectiveCameraNode* m_defaultMainCam = nullptr;
 
 	EventManager m_events;
 	SectorGroup* m_sectors;

+ 2 - 2
src/anki/scene/SceneNode.h

@@ -11,12 +11,12 @@
 #include <anki/util/BitSet.h>
 #include <anki/util/List.h>
 #include <anki/util/Enum.h>
-#include <anki/scene/SceneComponent.h>
+#include <anki/scene/components/SceneComponent.h>
 
 namespace anki
 {
 
-class SceneGraph; // Don't include
+// Forward
 class ResourceManager;
 
 /// @addtogroup scene

+ 42 - 41
src/anki/scene/Sector.cpp → src/anki/scene/SectorNode.cpp

@@ -3,10 +3,11 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/Sector.h>
-#include <anki/scene/SpatialComponent.h>
-#include <anki/scene/FrustumComponent.h>
-#include <anki/scene/MoveComponent.h>
+#include <anki/scene/SectorNode.h>
+#include <anki/scene/components/SectorComponent.h>
+#include <anki/scene/components/SpatialComponent.h>
+#include <anki/scene/components/FrustumComponent.h>
+#include <anki/scene/components/MoveComponent.h>
 #include <anki/scene/SceneGraph.h>
 #include <anki/scene/SoftwareRasterizer.h>
 #include <anki/util/Logger.h>
@@ -20,7 +21,7 @@ template<typename TFunc>
 static void iterateSceneSectors(SceneGraph& scene, TFunc func)
 {
 	scene.getSceneComponentLists().iterateComponents<SectorComponent>([&](SectorComponent& comp) {
-		Sector& s = static_cast<Sector&>(comp.getSceneNode());
+		SectorNode& s = static_cast<SectorNode&>(comp.getSceneNode());
 		if(func(s))
 		{
 			return;
@@ -32,7 +33,7 @@ template<typename TFunc>
 static void iterateScenePortals(SceneGraph& scene, TFunc func)
 {
 	scene.getSceneComponentLists().iterateComponents<PortalComponent>([&](PortalComponent& comp) {
-		Portal& s = static_cast<Portal&>(comp.getSceneNode());
+		PortalNode& s = static_cast<PortalNode&>(comp.getSceneNode());
 		if(func(s))
 		{
 			return;
@@ -119,12 +120,12 @@ void PortalSectorBase::updateTransform(const Transform& trf)
 	m_shape->computeAabb(m_aabb);
 }
 
-Portal::~Portal()
+PortalNode::~PortalNode()
 {
 	auto alloc = getSceneAllocator();
 
 	// Remove from sectors
-	for(Sector* s : m_sectors)
+	for(SectorNode* s : m_sectors)
 	{
 		s->tryRemovePortal(this);
 	}
@@ -132,13 +133,13 @@ Portal::~Portal()
 	m_sectors.destroy(getSceneAllocator());
 }
 
-Error Portal::init(const CString& meshFname)
+Error PortalNode::init(const CString& meshFname)
 {
 	ANKI_CHECK(Base::init(meshFname, false));
 	return Error::NONE;
 }
 
-Error Portal::frameUpdate(Second prevUpdateTime, Second crntTime)
+Error PortalNode::frameUpdate(Second prevUpdateTime, Second crntTime)
 {
 	MoveComponent& move = getComponent<MoveComponent>();
 	if(move.getTimestamp() == getGlobalTimestamp())
@@ -151,10 +152,10 @@ Error Portal::frameUpdate(Second prevUpdateTime, Second crntTime)
 	return Error::NONE;
 }
 
-void Portal::deferredUpdate()
+void PortalNode::deferredUpdate()
 {
 	// Gather the sectors it collides
-	iterateSceneSectors(getSceneGraph(), [&](Sector& sector) -> Bool {
+	iterateSceneSectors(getSceneGraph(), [&](SectorNode& sector) -> Bool {
 		Bool collide = testCollisionShapes(m_aabb, sector.m_aabb);
 
 		// Perform a more detailed test
@@ -179,7 +180,7 @@ void Portal::deferredUpdate()
 	});
 }
 
-void Portal::tryAddSector(Sector* sector)
+void PortalNode::tryAddSector(SectorNode* sector)
 {
 	ANKI_ASSERT(sector);
 
@@ -197,7 +198,7 @@ void Portal::tryAddSector(Sector* sector)
 	m_sectors.pushBack(getSceneAllocator(), sector);
 }
 
-void Portal::tryRemoveSector(Sector* sector)
+void PortalNode::tryRemoveSector(SectorNode* sector)
 {
 	ANKI_ASSERT(sector);
 
@@ -213,12 +214,12 @@ void Portal::tryRemoveSector(Sector* sector)
 	}
 }
 
-Sector::~Sector()
+SectorNode::~SectorNode()
 {
 	auto alloc = getSceneAllocator();
 
 	// Remove portals
-	for(Portal* p : m_portals)
+	for(PortalNode* p : m_portals)
 	{
 		p->tryRemoveSector(this);
 	}
@@ -233,13 +234,13 @@ Sector::~Sector()
 	}
 }
 
-Error Sector::init(const CString& meshFname)
+Error SectorNode::init(const CString& meshFname)
 {
 	ANKI_CHECK(PortalSectorBase::init(meshFname, true));
 	return Error::NONE;
 }
 
-void Sector::tryAddPortal(Portal* portal)
+void SectorNode::tryAddPortal(PortalNode* portal)
 {
 	ANKI_ASSERT(portal);
 
@@ -257,7 +258,7 @@ void Sector::tryAddPortal(Portal* portal)
 	m_portals.pushBack(getSceneAllocator(), portal);
 }
 
-void Sector::tryRemovePortal(Portal* portal)
+void SectorNode::tryRemovePortal(PortalNode* portal)
 {
 	ANKI_ASSERT(portal);
 
@@ -273,7 +274,7 @@ void Sector::tryRemovePortal(Portal* portal)
 	}
 }
 
-void Sector::tryAddSpatialComponent(SpatialComponent* sp)
+void SectorNode::tryAddSpatialComponent(SpatialComponent* sp)
 {
 	ANKI_ASSERT(sp);
 
@@ -297,7 +298,7 @@ void Sector::tryAddSpatialComponent(SpatialComponent* sp)
 	sp->getSectorInfo().pushBack(getSceneAllocator(), this);
 }
 
-void Sector::tryRemoveSpatialComponent(SpatialComponent* sp)
+void SectorNode::tryRemoveSpatialComponent(SpatialComponent* sp)
 {
 	ANKI_ASSERT(sp);
 
@@ -330,7 +331,7 @@ void Sector::tryRemoveSpatialComponent(SpatialComponent* sp)
 	}
 }
 
-List<SpatialComponent*>::Iterator Sector::findSpatialComponent(SpatialComponent* sp)
+List<SpatialComponent*>::Iterator SectorNode::findSpatialComponent(SpatialComponent* sp)
 {
 	ANKI_ASSERT(sp);
 	auto it = m_spatials.getBegin();
@@ -346,7 +347,7 @@ List<SpatialComponent*>::Iterator Sector::findSpatialComponent(SpatialComponent*
 	return it;
 }
 
-Error Sector::frameUpdate(Second prevUpdateTime, Second crntTime)
+Error SectorNode::frameUpdate(Second prevUpdateTime, Second crntTime)
 {
 	MoveComponent& move = getComponent<MoveComponent>();
 	if(move.getTimestamp() == getGlobalTimestamp())
@@ -359,7 +360,7 @@ Error Sector::frameUpdate(Second prevUpdateTime, Second crntTime)
 	return Error::NONE;
 }
 
-void Sector::deferredUpdate()
+void SectorNode::deferredUpdate()
 {
 	// Spatials should get updated
 	for(SpatialComponent* sp : m_spatials)
@@ -367,7 +368,7 @@ void Sector::deferredUpdate()
 		sp->markForUpdate();
 	}
 
-	iterateScenePortals(getSceneGraph(), [&](Portal& portal) -> Bool {
+	iterateScenePortals(getSceneGraph(), [&](PortalNode& portal) -> Bool {
 		Bool collide = testCollisionShapes(m_aabb, portal.m_aabb);
 
 		if(collide)
@@ -401,14 +402,14 @@ void SectorGroup::spatialUpdated(SpatialComponent* sp)
 	m_spatialsDeferredBinning.pushBack(m_scene->getFrameAllocator(), sp);
 }
 
-void SectorGroup::portalUpdated(Portal* portal)
+void SectorGroup::portalUpdated(PortalNode* portal)
 {
 	ANKI_ASSERT(portal);
 	LockGuard<SpinLock> lock(m_portalsUpdatedLock);
 	m_portalsUpdated.pushBack(m_scene->getFrameAllocator(), portal);
 }
 
-void SectorGroup::sectorUpdated(Sector* sector)
+void SectorGroup::sectorUpdated(SectorNode* sector)
 {
 	ANKI_ASSERT(sector);
 	LockGuard<SpinLock> lock(m_sectorsUpdatedLock);
@@ -420,7 +421,7 @@ void SectorGroup::binSpatial(SpatialComponent* sp)
 	ANKI_ASSERT(sp);
 
 	// Iterate all sectors and bin the spatial
-	iterateSceneSectors(*m_scene, [&](Sector& sector) -> Bool {
+	iterateSceneSectors(*m_scene, [&](SectorNode& sector) -> Bool {
 		Bool collide = false;
 		if(!sp->getSingleSector())
 		{
@@ -482,15 +483,15 @@ void SectorGroup::spatialDeleted(SpatialComponent* sp)
 
 void SectorGroup::findVisibleSectors(const FrustumComponent& frc,
 	const SoftwareRasterizer* r,
-	List<const Sector*>& visibleSectors,
+	List<const SectorNode*>& visibleSectors,
 	U& spatialsCount) const
 {
 	// Find the sector the eye is in
 	Sphere eye(frc.getFrustumOrigin(), frc.getFrustum().getNear());
 	Bool eyeInsideASector = false;
-	Sector* sectorEyeIsInside = nullptr;
+	SectorNode* sectorEyeIsInside = nullptr;
 
-	iterateSceneSectors(*m_scene, [&](Sector& sector) -> Bool {
+	iterateSceneSectors(*m_scene, [&](SectorNode& sector) -> Bool {
 		Bool collide = testCollisionShapes(eye, sector.m_aabb);
 
 		if(collide)
@@ -512,7 +513,7 @@ void SectorGroup::findVisibleSectors(const FrustumComponent& frc,
 	{
 		// eye outside all sectors, find those the frustum collides
 
-		iterateSceneSectors(*m_scene, [&](Sector& sector) -> Bool {
+		iterateSceneSectors(*m_scene, [&](SectorNode& sector) -> Bool {
 			if(frc.insideFrustum(sector.getBoundingShape()))
 			{
 				findVisibleSectorsInternal(frc, sector, r, visibleSectors, spatialsCount);
@@ -529,9 +530,9 @@ void SectorGroup::findVisibleSectors(const FrustumComponent& frc,
 }
 
 void SectorGroup::findVisibleSectorsInternal(const FrustumComponent& frc,
-	const Sector& s,
+	const SectorNode& s,
 	const SoftwareRasterizer* r,
-	List<const Sector*>& visibleSectors,
+	List<const SectorNode*>& visibleSectors,
 	U& spatialsCount) const
 {
 	auto alloc = m_scene->getFrameAllocator();
@@ -543,12 +544,12 @@ void SectorGroup::findVisibleSectorsInternal(const FrustumComponent& frc,
 	{
 		if(*it == &s)
 		{
-			// Sector already there, skip
+			// SectorNode already there, skip
 			return;
 		}
 	}
 
-	// Sector not in the list, push it
+	// SectorNode not in the list, push it
 	visibleSectors.pushBack(alloc, &s);
 	spatialsCount += s.m_spatials.getSize();
 
@@ -557,7 +558,7 @@ void SectorGroup::findVisibleSectorsInternal(const FrustumComponent& frc,
 	auto itend = s.m_portals.getEnd();
 	for(; itp != itend; ++itp)
 	{
-		const Portal& p = *(*itp);
+		const PortalNode& p = *(*itp);
 
 		if(frc.insideFrustum(p.getBoundingShape())
 			&& (r == nullptr || r->visibilityTest(p.getBoundingShape(), p.m_aabb)))
@@ -578,7 +579,7 @@ void SectorGroup::findVisibleSectorsInternal(const FrustumComponent& frc,
 void SectorGroup::prepareForVisibilityTests()
 {
 	// Update portals
-	Error err = m_portalsUpdated.iterateForward([](Portal* portal) {
+	Error err = m_portalsUpdated.iterateForward([](PortalNode* portal) {
 		portal->deferredUpdate();
 		return Error::NONE;
 	});
@@ -586,7 +587,7 @@ void SectorGroup::prepareForVisibilityTests()
 	m_portalsUpdated.destroy(m_scene->getFrameAllocator());
 
 	// Update sectors
-	err = m_sectorsUpdated.iterateForward([](Sector* portal) {
+	err = m_sectorsUpdated.iterateForward([](SectorNode* portal) {
 		portal->deferredUpdate();
 		return Error::NONE;
 	});
@@ -608,7 +609,7 @@ void SectorGroup::findVisibleNodes(
 	auto alloc = m_scene->getFrameAllocator();
 
 	// Find visible sectors
-	ListAuto<const Sector*> visSectors(alloc);
+	ListAuto<const SectorNode*> visSectors(alloc);
 	U spatialsCount = 0;
 	findVisibleSectors(frc, r, visSectors, spatialsCount);
 
@@ -629,7 +630,7 @@ void SectorGroup::findVisibleNodes(
 	auto end = visSectors.getEnd();
 	for(; it != end; ++it)
 	{
-		const Sector& s = *(*it);
+		const SectorNode& s = *(*it);
 		for(auto itsp : s.m_spatials)
 		{
 			const SpatialComponent& spc = *itsp;

+ 23 - 50
src/anki/scene/Sector.h → src/anki/scene/SectorNode.h

@@ -6,7 +6,7 @@
 #pragma once
 
 #include <anki/scene/SceneNode.h>
-#include <anki/scene/SceneComponent.h>
+#include <anki/scene/components/SceneComponent.h>
 #include <anki/Collision.h>
 #include <anki/util/WeakArray.h>
 
@@ -14,45 +14,18 @@ namespace anki
 {
 
 // Forward
-class Sector;
 class SectorGroup;
-class FrustumComponent;
-class SpatialComponent;
 class Renderer;
 class SoftwareRasterizer;
 
 /// @addtogroup scene
 /// @{
 
-/// Dummy component to identify a portal.
-class PortalComponent : public SceneComponent
-{
-public:
-	static const SceneComponentType CLASS_TYPE = SceneComponentType::PORTAL;
-
-	PortalComponent(SceneNode* node)
-		: SceneComponent(CLASS_TYPE, node)
-	{
-	}
-};
-
-/// Dummy component to identify a sector.
-class SectorComponent : public SceneComponent
-{
-public:
-	static const SceneComponentType CLASS_TYPE = SceneComponentType::SECTOR;
-
-	SectorComponent(SceneNode* node)
-		: SceneComponent(CLASS_TYPE, node)
-	{
-	}
-};
-
 /// The base for portals and sectors.
 class PortalSectorBase : public SceneNode
 {
-	friend class Portal;
-	friend class Sector;
+	friend class PortalNode;
+	friend class SectorNode;
 
 public:
 	PortalSectorBase(SceneGraph* scene, CString name)
@@ -92,38 +65,38 @@ protected:
 };
 
 /// 2 way portal.
-class Portal : public PortalSectorBase
+class PortalNode : public PortalSectorBase
 {
 	friend class SectorGroup;
 
 public:
 	using Base = PortalSectorBase;
 
-	Portal(SceneGraph* scene, CString name)
+	PortalNode(SceneGraph* scene, CString name)
 		: PortalSectorBase(scene, name)
 	{
 	}
 
-	~Portal();
+	~PortalNode();
 
 	ANKI_USE_RESULT Error init(const CString& modelFname);
 
 	ANKI_USE_RESULT Error frameUpdate(Second prevUpdateTime, Second crntTime) override;
 
 	/// Add reference to sector.
-	void tryAddSector(Sector* sector);
+	void tryAddSector(SectorNode* sector);
 
 	/// Remove reference from sector.
-	void tryRemoveSector(Sector* sector);
+	void tryRemoveSector(SectorNode* sector);
 
 	void deferredUpdate();
 
 private:
-	List<Sector*> m_sectors;
+	List<SectorNode*> m_sectors;
 };
 
 /// A sector. It consists of an octree and some portals
-class Sector : public PortalSectorBase
+class SectorNode : public PortalSectorBase
 {
 	friend class SectorGroup;
 
@@ -131,17 +104,17 @@ public:
 	using Base = PortalSectorBase;
 
 	/// Default constructor
-	Sector(SceneGraph* scene, CString name)
-		: PortalSectorBase(scene, name)
+	SectorNode(SceneGraph* scene, CString name)
+		: Base(scene, name)
 	{
 	}
 
-	~Sector();
+	~SectorNode();
 
 	ANKI_USE_RESULT Error init(const CString& modelFname);
 
-	void tryAddPortal(Portal* portal);
-	void tryRemovePortal(Portal* portal);
+	void tryAddPortal(PortalNode* portal);
+	void tryRemovePortal(PortalNode* portal);
 
 	void tryAddSpatialComponent(SpatialComponent* sp);
 	void tryRemoveSpatialComponent(SpatialComponent* sp);
@@ -151,7 +124,7 @@ public:
 	void deferredUpdate();
 
 private:
-	List<Portal*> m_portals;
+	List<PortalNode*> m_portals;
 	List<SpatialComponent*> m_spatials;
 
 	List<SpatialComponent*>::Iterator findSpatialComponent(SpatialComponent* sp);
@@ -199,8 +172,8 @@ public:
 	void spatialUpdated(SpatialComponent* sp);
 	void spatialDeleted(SpatialComponent* sp);
 
-	void portalUpdated(Portal* portal);
-	void sectorUpdated(Sector* sector);
+	void portalUpdated(PortalNode* portal);
+	void sectorUpdated(SectorNode* sector);
 
 	void prepareForVisibilityTests();
 
@@ -215,21 +188,21 @@ private:
 	List<SpatialComponent*> m_spatialsDeferredBinning;
 	SpinLock m_mtx;
 
-	List<Portal*> m_portalsUpdated;
+	List<PortalNode*> m_portalsUpdated;
 	SpinLock m_portalsUpdatedLock;
-	List<Sector*> m_sectorsUpdated;
+	List<SectorNode*> m_sectorsUpdated;
 	SpinLock m_sectorsUpdatedLock;
 
 	void findVisibleSectors(const FrustumComponent& frc,
 		const SoftwareRasterizer* r,
-		List<const Sector*>& visibleSectors,
+		List<const SectorNode*>& visibleSectors,
 		U& spatialsCount) const;
 
 	/// Recursive method
 	void findVisibleSectorsInternal(const FrustumComponent& frc,
-		const Sector& s,
+		const SectorNode& s,
 		const SoftwareRasterizer* r,
-		List<const Sector*>& visibleSectors,
+		List<const SectorNode*>& visibleSectors,
 		U& spatialsCount) const;
 
 	void binSpatial(SpatialComponent* sp);

+ 2 - 2
src/anki/scene/StaticGeometryNode.h

@@ -7,8 +7,8 @@
 
 #include <anki/scene/Common.h>
 #include <anki/scene/SceneNode.h>
-#include <anki/scene/SpatialComponent.h>
-#include <anki/scene/RenderComponent.h>
+#include <anki/scene/components/SpatialComponent.h>
+#include <anki/scene/components/RenderComponent.h>
 
 namespace anki
 {

+ 10 - 10
src/anki/scene/Visibility.cpp

@@ -6,16 +6,16 @@
 #include <anki/scene/Visibility.h>
 #include <anki/scene/VisibilityInternal.h>
 #include <anki/scene/SceneGraph.h>
-#include <anki/scene/Sector.h>
-#include <anki/scene/FrustumComponent.h>
-#include <anki/scene/LensFlareComponent.h>
-#include <anki/scene/RenderComponent.h>
-#include <anki/scene/ReflectionProbeComponent.h>
-#include <anki/scene/ReflectionProxyComponent.h>
-#include <anki/scene/OccluderComponent.h>
-#include <anki/scene/DecalComponent.h>
-#include <anki/scene/Light.h>
-#include <anki/scene/MoveComponent.h>
+#include <anki/scene/SectorNode.h>
+#include <anki/scene/components/FrustumComponent.h>
+#include <anki/scene/components/LensFlareComponent.h>
+#include <anki/scene/components/RenderComponent.h>
+#include <anki/scene/components/ReflectionProbeComponent.h>
+#include <anki/scene/components/ReflectionProxyComponent.h>
+#include <anki/scene/components/OccluderComponent.h>
+#include <anki/scene/components/DecalComponent.h>
+#include <anki/scene/LightNode.h>
+#include <anki/scene/components/MoveComponent.h>
 #include <anki/renderer/MainRenderer.h>
 #include <anki/util/Logger.h>
 #include <anki/util/ThreadHive.h>

+ 1 - 1
src/anki/scene/VisibilityInternal.h

@@ -6,7 +6,7 @@
 #pragma once
 
 #include <anki/scene/Visibility.h>
-#include <anki/scene/Sector.h>
+#include <anki/scene/SectorNode.h>
 #include <anki/scene/SceneGraph.h>
 #include <anki/scene/SoftwareRasterizer.h>
 #include <anki/util/Thread.h>

+ 1 - 1
src/anki/scene/BodyComponent.cpp → src/anki/scene/components/BodyComponent.cpp

@@ -3,7 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/BodyComponent.h>
+#include <anki/scene/components/BodyComponent.h>
 
 namespace anki
 {

+ 1 - 1
src/anki/scene/BodyComponent.h → src/anki/scene/components/BodyComponent.h

@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include <anki/scene/SceneComponent.h>
+#include <anki/scene/components/SceneComponent.h>
 #include <anki/physics/PhysicsBody.h>
 
 namespace anki

+ 1 - 1
src/anki/scene/DecalComponent.cpp → src/anki/scene/components/DecalComponent.cpp

@@ -3,7 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/DecalComponent.h>
+#include <anki/scene/components/DecalComponent.h>
 #include <anki/scene/SceneGraph.h>
 #include <anki/resource/ResourceManager.h>
 

+ 1 - 1
src/anki/scene/DecalComponent.h → src/anki/scene/components/DecalComponent.h

@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include <anki/scene/SceneComponent.h>
+#include <anki/scene/components/SceneComponent.h>
 #include <anki/resource/TextureAtlas.h>
 #include <anki/collision/Obb.h>
 #include <anki/renderer/RenderQueue.h>

+ 1 - 1
src/anki/scene/FrustumComponent.cpp → src/anki/scene/components/FrustumComponent.cpp

@@ -3,7 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/FrustumComponent.h>
+#include <anki/scene/components/FrustumComponent.h>
 #include <anki/scene/Visibility.h>
 
 namespace anki

+ 2 - 2
src/anki/scene/FrustumComponent.h → src/anki/scene/components/FrustumComponent.h

@@ -6,9 +6,9 @@
 #pragma once
 
 #include <anki/collision/Frustum.h>
-#include <anki/scene/SpatialComponent.h>
+#include <anki/scene/components/SpatialComponent.h>
 #include <anki/scene/Common.h>
-#include <anki/scene/SceneComponent.h>
+#include <anki/scene/components/SceneComponent.h>
 #include <anki/util/BitMask.h>
 
 namespace anki

+ 1 - 1
src/anki/scene/LensFlareComponent.cpp → src/anki/scene/components/LensFlareComponent.cpp

@@ -3,7 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/LensFlareComponent.h>
+#include <anki/scene/components/LensFlareComponent.h>
 #include <anki/scene/SceneGraph.h>
 #include <anki/resource/TextureResource.h>
 #include <anki/resource/ResourceManager.h>

+ 0 - 0
src/anki/scene/LensFlareComponent.h → src/anki/scene/components/LensFlareComponent.h


+ 1 - 1
src/anki/scene/LightComponent.cpp → src/anki/scene/components/LightComponent.cpp

@@ -3,7 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/LightComponent.h>
+#include <anki/scene/components/LightComponent.h>
 
 namespace anki
 {

+ 1 - 1
src/anki/scene/LightComponent.h → src/anki/scene/components/LightComponent.h

@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include <anki/scene/SceneComponent.h>
+#include <anki/scene/components/SceneComponent.h>
 #include <anki/renderer/RenderQueue.h>
 #include <anki/Math.h>
 

+ 1 - 1
src/anki/scene/MoveComponent.cpp → src/anki/scene/components/MoveComponent.cpp

@@ -3,7 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/MoveComponent.h>
+#include <anki/scene/components/MoveComponent.h>
 #include <anki/scene/SceneNode.h>
 
 namespace anki

+ 1 - 1
src/anki/scene/MoveComponent.h → src/anki/scene/components/MoveComponent.h

@@ -6,7 +6,7 @@
 #pragma once
 
 #include <anki/scene/Common.h>
-#include <anki/scene/SceneComponent.h>
+#include <anki/scene/components/SceneComponent.h>
 #include <anki/util/BitMask.h>
 #include <anki/util/Enum.h>
 #include <anki/Math.h>

+ 1 - 1
src/anki/scene/OccluderComponent.cpp → src/anki/scene/components/OccluderComponent.cpp

@@ -3,7 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/OccluderComponent.h>
+#include <anki/scene/components/OccluderComponent.h>
 
 namespace anki
 {

+ 1 - 1
src/anki/scene/OccluderComponent.h → src/anki/scene/components/OccluderComponent.h

@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include <anki/scene/SceneComponent.h>
+#include <anki/scene/components/SceneComponent.h>
 #include <anki/Math.h>
 #include <anki/collision/Aabb.h>
 

+ 1 - 1
src/anki/scene/PlayerControllerComponent.h → src/anki/scene/components/PlayerControllerComponent.h

@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include <anki/scene/SceneComponent.h>
+#include <anki/scene/components/SceneComponent.h>
 #include <anki/physics/PhysicsPlayerController.h>
 
 namespace anki

+ 1 - 1
src/anki/scene/ReflectionProbeComponent.h → src/anki/scene/components/ReflectionProbeComponent.h

@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include <anki/scene/SceneComponent.h>
+#include <anki/scene/components/SceneComponent.h>
 #include <anki/renderer/RenderQueue.h>
 
 namespace anki

+ 1 - 1
src/anki/scene/ReflectionProxyComponent.cpp → src/anki/scene/components/ReflectionProxyComponent.cpp

@@ -3,7 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/ReflectionProxyComponent.h>
+#include <anki/scene/components/ReflectionProxyComponent.h>
 
 namespace anki
 {

+ 1 - 1
src/anki/scene/ReflectionProxyComponent.h → src/anki/scene/components/ReflectionProxyComponent.h

@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include <anki/scene/SceneComponent.h>
+#include <anki/scene/components/SceneComponent.h>
 #include <anki/collision/Plane.h>
 
 namespace anki

+ 1 - 1
src/anki/scene/RenderComponent.cpp → src/anki/scene/components/RenderComponent.cpp

@@ -3,7 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/RenderComponent.h>
+#include <anki/scene/components/RenderComponent.h>
 #include <anki/scene/SceneNode.h>
 #include <anki/resource/TextureResource.h>
 #include <anki/resource/ResourceManager.h>

+ 1 - 1
src/anki/scene/RenderComponent.h → src/anki/scene/components/RenderComponent.h

@@ -6,7 +6,7 @@
 #pragma once
 
 #include <anki/scene/Common.h>
-#include <anki/scene/SceneComponent.h>
+#include <anki/scene/components/SceneComponent.h>
 #include <anki/resource/Material.h>
 #include <anki/core/StagingGpuMemoryManager.h>
 #include <anki/renderer/RenderQueue.h>

+ 1 - 1
src/anki/scene/SceneComponent.cpp → src/anki/scene/components/SceneComponent.cpp

@@ -3,7 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/SceneComponent.h>
+#include <anki/scene/components/SceneComponent.h>
 #include <anki/scene/SceneNode.h>
 #include <anki/scene/SceneGraph.h>
 

+ 0 - 0
src/anki/scene/SceneComponent.h → src/anki/scene/components/SceneComponent.h


+ 41 - 0
src/anki/scene/components/SectorComponent.h

@@ -0,0 +1,41 @@
+// Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
+// All rights reserved.
+// Code licensed under the BSD License.
+// http://www.anki3d.org/LICENSE
+
+#pragma once
+
+#include <anki/scene/components/SceneComponent.h>
+
+namespace anki
+{
+
+/// @addtogroup scene
+/// @{
+
+/// Dummy component to identify a portal.
+class PortalComponent : public SceneComponent
+{
+public:
+	static const SceneComponentType CLASS_TYPE = SceneComponentType::PORTAL;
+
+	PortalComponent(SceneNode* node)
+		: SceneComponent(CLASS_TYPE, node)
+	{
+	}
+};
+
+/// Dummy component to identify a sector.
+class SectorComponent : public SceneComponent
+{
+public:
+	static const SceneComponentType CLASS_TYPE = SceneComponentType::SECTOR;
+
+	SectorComponent(SceneNode* node)
+		: SceneComponent(CLASS_TYPE, node)
+	{
+	}
+};
+/// @}
+
+} // end namespace anki

+ 1 - 1
src/anki/scene/SkinComponent.cpp → src/anki/scene/components/SkinComponent.cpp

@@ -3,7 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/SkinComponent.h>
+#include <anki/scene/components/SkinComponent.h>
 #include <anki/resource/Skeleton.h>
 #include <anki/resource/Animation.h>
 #include <anki/util/BitSet.h>

+ 1 - 1
src/anki/scene/SkinComponent.h → src/anki/scene/components/SkinComponent.h

@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include <anki/scene/SceneComponent.h>
+#include <anki/scene/components/SceneComponent.h>
 #include <anki/resource/Forward.h>
 #include <anki/util/Forward.h>
 #include <anki/Math.h>

+ 2 - 2
src/anki/scene/SpatialComponent.cpp → src/anki/scene/components/SpatialComponent.cpp

@@ -3,9 +3,9 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#include <anki/scene/SpatialComponent.h>
+#include <anki/scene/components/SpatialComponent.h>
 #include <anki/scene/SceneNode.h>
-#include <anki/scene/Sector.h>
+#include <anki/scene/SectorNode.h>
 #include <anki/scene/SceneGraph.h>
 
 namespace anki

+ 4 - 7
src/anki/scene/SpatialComponent.h → src/anki/scene/components/SpatialComponent.h

@@ -6,7 +6,7 @@
 #pragma once
 
 #include <anki/scene/Common.h>
-#include <anki/scene/SceneComponent.h>
+#include <anki/scene/components/SceneComponent.h>
 #include <anki/Collision.h>
 #include <anki/util/BitMask.h>
 #include <anki/util/Enum.h>
@@ -15,9 +15,6 @@
 namespace anki
 {
 
-// Forward
-class Sector;
-
 /// @addtogroup scene
 /// @{
 
@@ -42,12 +39,12 @@ public:
 		return m_aabb;
 	}
 
-	List<Sector*>& getSectorInfo()
+	List<SectorNode*>& getSectorInfo()
 	{
 		return m_sectorInfo;
 	}
 
-	const List<Sector*>& getSectorInfo() const
+	const List<SectorNode*>& getSectorInfo() const
 	{
 		return m_sectorInfo;
 	}
@@ -131,7 +128,7 @@ private:
 	BitMask<Flag> m_flags;
 	Aabb m_aabb; ///< A faster shape
 	Vec4 m_origin = Vec4(MAX_F32, MAX_F32, MAX_F32, 0.0);
-	List<Sector*> m_sectorInfo;
+	List<SectorNode*> m_sectorInfo;
 };
 /// @}
 

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 210 - 210
src/anki/script/Scene.cpp


+ 33 - 33
src/anki/script/Scene.xml

@@ -210,7 +210,7 @@ static SceneGraph* getSceneGraph(lua_State* l)
 				</method>
 			</methods>
 		</class>
-		<class name="PerspectiveCamera">
+		<class name="PerspectiveCameraNode">
 			<methods>
 				<method name="getSceneNodeBase">
 					<overrideCall>SceneNode&amp; ret = *self;</overrideCall>
@@ -226,7 +226,7 @@ static SceneGraph* getSceneGraph(lua_State* l)
 				</method>
 			</methods>
 		</class>
-		<class name="PointLight">
+		<class name="PointLightNode">
 			<methods>
 				<method name="getSceneNodeBase">
 					<overrideCall>SceneNode&amp; ret = *self;</overrideCall>
@@ -240,7 +240,7 @@ static SceneGraph* getSceneGraph(lua_State* l)
 				</method>
 			</methods>
 		</class>
-		<class name="SpotLight">
+		<class name="SpotLightNode">
 			<methods>
 				<method name="getSceneNodeBase">
 					<overrideCall>SceneNode&amp; ret = *self;</overrideCall>
@@ -256,7 +256,7 @@ static SceneGraph* getSceneGraph(lua_State* l)
 				</method>
 			</methods>
 		</class>
-		<class name="Portal">
+		<class name="PortalNode">
 			<methods>
 				<method name="getSceneNodeBase">
 					<overrideCall>SceneNode&amp; ret = *self;</overrideCall>
@@ -264,7 +264,7 @@ static SceneGraph* getSceneGraph(lua_State* l)
 				</method>
 			</methods>
 		</class>
-		<class name="Sector">
+		<class name="SectorNode">
 			<methods>
 				<method name="getSceneNodeBase">
 					<overrideCall>SceneNode&amp; ret = *self;</overrideCall>
@@ -272,7 +272,7 @@ static SceneGraph* getSceneGraph(lua_State* l)
 				</method>
 			</methods>
 		</class>
-		<class name="ParticleEmitter">
+		<class name="ParticleEmitterNode">
 			<methods>
 				<method name="getSceneNodeBase">
 					<overrideCall>SceneNode&amp; ret = *self;</overrideCall>
@@ -280,7 +280,7 @@ static SceneGraph* getSceneGraph(lua_State* l)
 				</method>
 			</methods>
 		</class>
-		<class name="ReflectionProbe">
+		<class name="ReflectionProbeNode">
 			<methods>
 				<method name="getSceneNodeBase">
 					<overrideCall>SceneNode&amp; ret = *self;</overrideCall>
@@ -288,7 +288,7 @@ static SceneGraph* getSceneGraph(lua_State* l)
 				</method>
 			</methods>
 		</class>
-		<class name="ReflectionProxy">
+		<class name="ReflectionProxyNode">
 			<methods>
 				<method name="getSceneNodeBase">
 					<overrideCall>SceneNode&amp; ret = *self;</overrideCall>
@@ -314,12 +314,12 @@ static SceneGraph* getSceneGraph(lua_State* l)
 		</class>
 		<class name="SceneGraph">
 			<methods>
-				<method name="newPerspectiveCamera">
-					<overrideCall><![CDATA[PerspectiveCamera* ret = newSceneNode<PerspectiveCamera>(self, arg0);]]></overrideCall>
+				<method name="newPerspectiveCameraNode">
+					<overrideCall><![CDATA[PerspectiveCameraNode* ret = newSceneNode<PerspectiveCameraNode>(self, arg0);]]></overrideCall>
 					<args>
 						<arg>const CString&amp;</arg>
 					</args>
-					<return>PerspectiveCamera*</return>
+					<return>PerspectiveCameraNode*</return>
 				</method>
 				<method name="newModelNode">
 					<overrideCall><![CDATA[ModelNode* ret = newSceneNode<ModelNode>(self, arg0, arg1);]]></overrideCall>
@@ -329,19 +329,19 @@ static SceneGraph* getSceneGraph(lua_State* l)
 					</args>
 					<return>ModelNode*</return>
 				</method>
-				<method name="newPointLight">
-					<overrideCall><![CDATA[PointLight* ret = newSceneNode<PointLight>(self, arg0);]]></overrideCall>
+				<method name="newPointLightNode">
+					<overrideCall><![CDATA[PointLightNode* ret = newSceneNode<PointLightNode>(self, arg0);]]></overrideCall>
 					<args>
 						<arg>const CString&amp;</arg>
 					</args>
-					<return>PointLight*</return>
+					<return>PointLightNode*</return>
 				</method>
-				<method name="newSpotLight">
-					<overrideCall><![CDATA[SpotLight* ret = newSceneNode<SpotLight>(self, arg0);]]></overrideCall>
+				<method name="newSpotLightNode">
+					<overrideCall><![CDATA[SpotLightNode* ret = newSceneNode<SpotLightNode>(self, arg0);]]></overrideCall>
 					<args>
 						<arg>const CString&amp;</arg>
 					</args>
-					<return>SpotLight*</return>
+					<return>SpotLightNode*</return>
 				</method>
 				<method name="newStaticCollisionNode">
 					<overrideCall><![CDATA[StaticCollisionNode* ret = newSceneNode<StaticCollisionNode>(self, arg0, arg1, arg2);]]></overrideCall>
@@ -352,45 +352,45 @@ static SceneGraph* getSceneGraph(lua_State* l)
 					</args>
 					<return>StaticCollisionNode*</return>
 				</method>
-				<method name="newPortal">
-					<overrideCall><![CDATA[Portal* ret = newSceneNode<Portal>(self, arg0, arg1);]]></overrideCall>
+				<method name="newPortalNode">
+					<overrideCall><![CDATA[PortalNode* ret = newSceneNode<PortalNode>(self, arg0, arg1);]]></overrideCall>
 					<args>
 						<arg>const CString&amp;</arg>
 						<arg>const CString&amp;</arg>
 					</args>
-					<return>Portal*</return>
+					<return>PortalNode*</return>
 				</method>
-				<method name="newSector">
-					<overrideCall><![CDATA[Sector* ret = newSceneNode<Sector>(self, arg0, arg1);]]></overrideCall>
+				<method name="newSectorNode">
+					<overrideCall><![CDATA[SectorNode* ret = newSceneNode<SectorNode>(self, arg0, arg1);]]></overrideCall>
 					<args>
 						<arg>const CString&amp;</arg>
 						<arg>const CString&amp;</arg>
 					</args>
-					<return>Sector*</return>
+					<return>SectorNode*</return>
 				</method>
-				<method name="newParticleEmitter">
-					<overrideCall><![CDATA[ParticleEmitter* ret = newSceneNode<ParticleEmitter>(self, arg0, arg1);]]></overrideCall>
+				<method name="newParticleEmitterNode">
+					<overrideCall><![CDATA[ParticleEmitterNode* ret = newSceneNode<ParticleEmitterNode>(self, arg0, arg1);]]></overrideCall>
 					<args>
 						<arg>const CString&amp;</arg>
 						<arg>const CString&amp;</arg>
 					</args>
-					<return>ParticleEmitter*</return>
+					<return>ParticleEmitterNode*</return>
 				</method>
-				<method name="newReflectionProbe">
-					<overrideCall><![CDATA[ReflectionProbe* ret = newSceneNode<ReflectionProbe>(self, arg0, arg1);]]></overrideCall>
+				<method name="newReflectionProbeNode">
+					<overrideCall><![CDATA[ReflectionProbeNode* ret = newSceneNode<ReflectionProbeNode>(self, arg0, arg1);]]></overrideCall>
 					<args>
 						<arg>const CString&amp;</arg>
 						<arg>F32</arg>
 					</args>
-					<return>ReflectionProbe*</return>
+					<return>ReflectionProbeNode*</return>
 				</method>
-				<method name="newReflectionProxy">
-					<overrideCall><![CDATA[ReflectionProxy* ret = newSceneNode<ReflectionProxy>(self, arg0, arg1);]]></overrideCall>
+				<method name="newReflectionProxyNode">
+					<overrideCall><![CDATA[ReflectionProxyNode* ret = newSceneNode<ReflectionProxyNode>(self, arg0, arg1);]]></overrideCall>
 					<args>
 						<arg>const CString&amp;</arg>
 						<arg>const CString&amp;</arg>
 					</args>
-					<return>ReflectionProxy*</return>
+					<return>ReflectionProxyNode*</return>
 				</method>
 				<method name="newOccluderNode">
 					<overrideCall><![CDATA[OccluderNode* ret = newSceneNode<OccluderNode>(self, arg0, arg1);]]></overrideCall>
@@ -407,7 +407,7 @@ static SceneGraph* getSceneGraph(lua_State* l)
 					</args>
 					<return>DecalNode*</return>
 				</method>
-				<method name="setActiveCamera">
+				<method name="setActiveCameraNode">
 					<args>
 						<arg>SceneNode*</arg>
 					</args>

+ 7 - 7
tools/scene/Exporter.cpp

@@ -463,7 +463,7 @@ void Exporter::exportLight(const aiLight& light)
 		return;
 	}
 
-	file << "\nnode = scene:new" << ((light.mType == aiLightSource_POINT) ? "Point" : "Spot") << "Light(\""
+	file << "\nnode = scene:new" << ((light.mType == aiLightSource_POINT) ? "Point" : "Spot") << "LightNode(\""
 		 << light.mName.C_Str() << "\")\n";
 
 	file << "lcomp = node:getSceneNodeBase():getLightComponent()\n";
@@ -708,7 +708,7 @@ void Exporter::exportCamera(const aiCamera& cam)
 	LOGI("Exporting camera %s", cam.mName.C_Str());
 
 	// Write the main node
-	file << "\nnode = scene:newPerspectiveCamera(\"" << cam.mName.C_Str() << "\")\n";
+	file << "\nnode = scene:newPerspectiveCameraNode(\"" << cam.mName.C_Str() << "\")\n";
 
 	file << "scene:setActiveCamera(node:getSceneNodeBase())\n";
 
@@ -1014,7 +1014,7 @@ void Exporter::exportAll()
 
 		std::string name = getMeshName(getMeshAt(meshIndex));
 		std::string fname = m_rpath + name + ".ankimesh";
-		file << "\nnode = scene:newPortal(\"" << name << i << "\", \"" << fname << "\")\n";
+		file << "\nnode = scene:newPortalNode(\"" << name << i << "\", \"" << fname << "\")\n";
 
 		writeNodeTransform("node", portal.m_transform);
 		++i;
@@ -1031,7 +1031,7 @@ void Exporter::exportAll()
 
 		std::string name = getMeshName(getMeshAt(meshIndex));
 		std::string fname = m_rpath + name + ".ankimesh";
-		file << "\nnode = scene:newSector(\"" << name << i << "\", \"" << fname << "\")\n";
+		file << "\nnode = scene:newSectorNode(\"" << name << i << "\", \"" << fname << "\")\n";
 
 		writeNodeTransform("node", sector.m_transform);
 		++i;
@@ -1044,7 +1044,7 @@ void Exporter::exportAll()
 	for(const ParticleEmitter& p : m_particleEmitters)
 	{
 		std::string name = "particles" + std::to_string(i);
-		file << "\nnode = scene:newParticleEmitter(\"" << name << "\", \"" << p.m_filename << "\")\n";
+		file << "\nnode = scene:newParticleEmitterNode(\"" << name << "\", \"" << p.m_filename << "\")\n";
 
 		writeNodeTransform("node", p.m_transform);
 		++i;
@@ -1057,7 +1057,7 @@ void Exporter::exportAll()
 	for(const ReflectionProbe& probe : m_reflectionProbes)
 	{
 		std::string name = "reflprobe" + std::to_string(i);
-		file << "\nnode = scene:newReflectionProbe(\"" << name << "\", " << probe.m_radius << ")\n";
+		file << "\nnode = scene:newReflectionProbeNode(\"" << name << "\", " << probe.m_radius << ")\n";
 
 		aiMatrix4x4 trf;
 		aiMatrix4x4::Translation(probe.m_position, trf);
@@ -1076,7 +1076,7 @@ void Exporter::exportAll()
 		exportMesh(mesh, nullptr, 4);
 
 		std::string name = "reflproxy" + std::to_string(i);
-		file << "\nnode = scene:newReflectionProxy(\"" << name << "\", \"" << m_rpath << mesh.mName.C_Str()
+		file << "\nnode = scene:newReflectionProxyNode(\"" << name << "\", \"" << m_rpath << mesh.mName.C_Str()
 			 << ".ankimesh\")\n";
 
 		writeNodeTransform("node", proxy.m_transform);

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov