entity.c 2.3 KB

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