gamelibentities.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. //Generic entities from GameLib (script side of c++ classes)
  2. #ifdef COMPONENT_SYSTEM
  3. class GenericEntity extends IEntity
  4. {
  5. //native method implemented on c++ side
  6. proto native void Show(bool show);
  7. /*!
  8. Finds first occurance of the coresponding component.
  9. \param typeName type of the component
  10. */
  11. proto native GenericComponent FindComponent(typename typeName);
  12. /*!
  13. inserts instance of the script component to the entity.
  14. Calls OnComponentInsert on all entity's components to inform that this new component was inserted. The new instance have to FindScriptComponents in order to work with them.
  15. Calls EOnInit on the component if component sets EV_INIT mask.
  16. Calls EOnActivate on the component if the component is active (default)
  17. \param component instance
  18. */
  19. proto native void InsertComponent(GenericComponent component);
  20. /*!
  21. Removes component from entity. Doesn't delete the entity.
  22. Calls EOnDeactivate on the component.
  23. Calls OnComponentRemove on all entity's components to inform that this new component was removed.
  24. \param component instance
  25. */
  26. proto native void RemoveComponent(GenericComponent component);
  27. /*!
  28. Removes and deletes component from entity.
  29. Calls EOnDeactivate on the component.
  30. Calls OnComponentRemove on all entity's components to inform that this new component was removed.
  31. Calls OnDelete on the component.
  32. \param component instance
  33. */
  34. proto native void DeleteComponent(GenericComponent component);
  35. #ifdef WORKBENCH
  36. /*!
  37. Called after updating world in Workbench. The entity must be selected.
  38. */
  39. void _WB_AfterWorldUpdate(float timeSlice) {};
  40. #endif
  41. }
  42. class GenericWorldEntity extends GenericEntity
  43. {
  44. }
  45. class GenericTerrainEntity extends GenericEntity
  46. {
  47. }
  48. class LightEntity extends GenericEntity
  49. {
  50. /*!
  51. Sets diffuse part of light.
  52. \param color Color of light
  53. */
  54. proto native external void SetDiffuseColor(int color);
  55. proto native external int GetDiffuseColor();
  56. proto native external void SetRadius(float radius);
  57. proto native external float GetRadius();
  58. /*!
  59. Sets cone of light. It's meaningful for LT_SPOT only!
  60. \param angle
  61. */
  62. proto native external void SetConeAngle(float angle);
  63. /*!
  64. Gets cone of light. It's meaningful for LT_SPOT only!
  65. \return Cone of light
  66. */
  67. proto native external float GetConeAngle();
  68. proto native external void SetCastShadow(bool enable);
  69. proto native external bool IsCastShadow(bool enable);
  70. }
  71. class GenericWorldLightEntity extends GenericEntity
  72. {
  73. }
  74. class GenericWorldFogEntity extends GenericEntity
  75. {
  76. }
  77. class BasicEntity extends GenericEntity
  78. {
  79. }
  80. class WorldEntityClass
  81. {
  82. }
  83. class WorldEntity extends GenericWorldEntity
  84. {
  85. }
  86. class ModelEntity extends BasicEntity
  87. {
  88. }
  89. enum CharacterMovement
  90. {
  91. MOVEMENTTYPE_IDLE,
  92. MOVEMENTTYPE_WALK,
  93. MOVEMENTTYPE_RUN,
  94. MOVEMENTTYPE_SPRINT
  95. };
  96. enum CharacterStance
  97. {
  98. STANCE_ERECT,
  99. STANCE_CROUCH,
  100. STANCE_PRONE,
  101. STANCE_ERECT_RAISED,
  102. STANCE_CROUCH_RAISED,
  103. STANCE_PRONE_RAISED
  104. };
  105. class CharacterEntity extends BasicEntity
  106. {
  107. proto native void Teleport(vector transform[4]);
  108. proto native CharacterMovement GetCurrentMovement();
  109. proto native CharacterStance GetCurrentStance();
  110. }
  111. class BasicCamera extends BasicEntity
  112. {
  113. }
  114. class VRHandEntity extends GenericEntity
  115. {
  116. }
  117. #endif