CppSceneObjectClassFile.h.template 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #ifndef _SCENEOBJECT_H_
  3. #include "scene/sceneObject.h"
  4. #endif
  5. class @ : public SceneObject
  6. {
  7. typedef SceneObject Parent;
  8. private:
  9. enum MaskBits
  10. {
  11. TransformMask = Parent::NextFreeMask << 0,
  12. NextFreeMask = Parent::NextFreeMask << 1
  13. };
  14. protected:
  15. public:
  16. @();
  17. virtual ~@();
  18. // Declare this object as a ConsoleObject so that we can
  19. // instantiate it into the world and network it
  20. DECLARE_CONOBJECT(@);
  21. // Handle when we are added to the scene and removed from the scene
  22. bool onAdd();
  23. void onRemove();
  24. // Set up any fields that we want to be editable (like position)
  25. static void initPersistFields();
  26. // Allows the object to update its editable settings
  27. // from the server object to the client
  28. virtual void inspectPostApply();
  29. // Override this so that we can dirty the network flag when it is called
  30. void setTransform( const MatrixF &mat );
  31. // This function handles sending the relevant data from the server
  32. // object to the client object
  33. U32 packUpdate( NetConnection *conn, U32 mask, BitStream *stream );
  34. // This function handles receiving relevant data from the server
  35. // object and applying it to the client object
  36. void unpackUpdate( NetConnection *conn, BitStream *stream );
  37. virtual void interpolateTick( F32 delta );
  38. virtual void processTick();
  39. virtual void advanceTime( F32 timeDelta );
  40. };