Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.2 KiB

  1. //============ Copyright (c) Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===============================================================================//
  8. #ifndef WORLDNODE_SCHEMA_H
  9. #define WORLDNODE_SCHEMA_H
  10. #ifdef COMPILER_MSVC
  11. #pragma once
  12. #endif
  13. #include <tier0/platform.h>
  14. #include <mathlib/vector.h>
  15. #include <mathlib/vector4d.h>
  16. #include <mathlib/mathlib.h>
  17. #include <mathlib/vmatrix.h>
  18. #include "rendersystem/schema/renderable.g.h"
  19. //--------------------------------------------------------------------------------------
  20. // Light data
  21. //--------------------------------------------------------------------------------------
  22. schema struct WorldPointLightData_t
  23. {
  24. Vector m_vOrigin;
  25. Vector4D m_vColorNRadius;
  26. Vector m_vAttenuation;
  27. };
  28. schema struct WorldHemiLightData_t
  29. {
  30. Vector4D m_vTransform0; // Direction is z column
  31. Vector4D m_vTransform1; // Direction is z column
  32. Vector4D m_vTransform2; // Direction is z column
  33. Vector4D m_vColorNRadius;
  34. Vector m_vAttenuation;
  35. };
  36. schema struct WorldSpotLightData_t
  37. {
  38. Vector4D m_vTransform0; // Direction is z column
  39. Vector4D m_vTransform1; // Direction is z column
  40. Vector4D m_vTransform2; // Direction is z column
  41. Vector4D m_vColorNRadius;
  42. Vector4D m_vAttenuationNCosSpot;
  43. };
  44. schema struct SceneObject_t
  45. {
  46. Vector4D m_vTransform[3];
  47. CResourceReference< Renderable_t > m_Renderable;
  48. };
  49. schema struct WorldNode_t
  50. {
  51. CResourceArray< SceneObject_t > m_SceneObjects; // List of scene objects in this node
  52. CResourceArray< WorldPointLightData_t > m_PointLights; // TODO: These should actually become scene objects
  53. CResourceArray< WorldHemiLightData_t > m_HemiLights; // TODO: These should actually become scene objects
  54. CResourceArray< WorldSpotLightData_t > m_SpotLights; // TODO: These should actually become scene objects
  55. };
  56. class CWorldNode; // Forward declaration of associated runtime class
  57. DEFINE_RESOURCE_CLASS_TYPE( WorldNode_t, CWorldNode, RESOURCE_TYPE_WORLD_NODE );
  58. typedef const ResourceBinding_t< CWorldNode > *HWorldNode;
  59. typedef CStrongHandle< CWorldNode > HWorldNodeStrong;
  60. #define WORLD_NODE_HANDLE_INVALID ( (HWorldNode)0 )
  61. #endif // WORLDNODE_SCHEMA_H