entity.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. class Entity extends ObjectTyped
  2. {
  3. proto native void DisableSimulation(bool disable);
  4. //! Returns whether simulation is disabled
  5. proto native bool GetIsSimulationDisabled();
  6. //! Returns simulation timestamp
  7. proto native int GetSimulationTimeStamp();
  8. //! Return animation phase of animation on object.
  9. proto native float GetAnimationPhase(string animation);
  10. //! Process animation on object. Animation is defined in config file. Wanted animation phase is set to phase.
  11. proto native void SetAnimationPhase(string animation, float phase);
  12. proto int GetNumUserAnimationSourceNames();
  13. proto string GetUserAnimationSourceName(int index);
  14. //! Same as SetAnimationPhase, only ignores any animation and sets the phase immediately
  15. void SetAnimationPhaseNow(string animation, float phase)
  16. {
  17. ResetAnimationPhase(animation, phase);
  18. SetAnimationPhase(animation, phase);
  19. }
  20. proto native void ResetAnimationPhase(string animation, float phase);
  21. /**
  22. \brief callback called from C++ when AnimationPhase has started
  23. */
  24. void OnAnimationPhaseStarted(string animSource, float phase);
  25. //! Returns skeleton's bone index of named proxy selection.
  26. proto native int GetBoneIndex( string proxySelectionName );
  27. //! Returns proxy object that corresponds given bone inside skeleton.
  28. proto native Object GetBoneObject( int boneIndex );
  29. //! Turns on/off invisibility
  30. proto native void SetInvisible(bool invisible);
  31. //! event
  32. void OnInvisibleSet(bool invisible);
  33. /**
  34. \brief On server, entity's transformation is directly changed to targetTransform, on client entity's transformation is interpolated to targetTransform in time deltaT
  35. @param targetTransform
  36. @param deltaT, interpolation time between current transformation and target transformation
  37. \note it's not recommended to call this on client as it can break interpolation process if called on server previously
  38. */
  39. proto void MoveInTime(vector targetTransform[4], float deltaT);
  40. /**
  41. \brief callback called when entity is moved to world and creating its physics representation
  42. */
  43. void OnCreatePhysics();
  44. /**
  45. \brief Client event on transformation update from network
  46. @param pos, world space position
  47. @param ypr, world space orientation in radians in form of Yaw/Pitch/Roll
  48. @return true if visual cut (won't do any interpolation) should be done after calling this callback
  49. */
  50. bool OnNetworkTransformUpdate(out vector pos, out vector ypr);
  51. };