SolidSceneNode.cpp 717 B

12345678910111213141516171819202122232425262728293031
  1. #include "SolidSceneNode.h"
  2. using namespace Crown;
  3. SolidSceneNode::SolidSceneNode(Scene* creator, SceneNode* parent, const Vec3& position, const Angles& axis, bool visible, int collisionGroupId) :
  4. PhysicNode(creator, parent, position, axis, visible, collisionGroupId)
  5. {
  6. //This code should go in SceneNode? (when moving it there, check also the factory methods in Scene, such as AddCamera, AddSceneNode...)
  7. if (parent == NULL)
  8. {
  9. creator->GetRootSceneNode()->AddChild(this);
  10. }
  11. }
  12. SolidSceneNode::~SolidSceneNode()
  13. {
  14. }
  15. void SolidSceneNode::OnRegisterForRendering()
  16. {
  17. if (this->IsVisible())
  18. {
  19. if (mCreator)
  20. mCreator->RegisterNodeForRendering(this, RP_GUI);
  21. SceneNode::OnRegisterForRendering();
  22. }
  23. }