Team Fortress 2 Source Code as on 22/4/2020
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.

76 lines
2.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Model eyeposition node, kind of a top level
  4. //
  5. //=============================================================================
  6. #ifndef DMEEYEBALL_H
  7. #define DMEEYEBALL_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "movieobjects/dmedag.h"
  12. /*
  13. $eyeposition 0 83.274592 0
  14. $attachment "eyes" "bip_head" 0 83.274592 1.41954 absolute
  15. $attachment "righteye" "bip_head" -1.425952 83.274592 1.41954 absolute
  16. $attachment "lefteye" "bip_head" 1.425952 83.274592 1.41954 absolute
  17. $cdmaterials "models/player/hvyweapon/"
  18. $model heavy "parts/dmx/heavy_reference_lo.dmx"{
  19. eyeball righteye "bip_head" -1.425952 83.274592 1.41954 "eyeball_r" 1.80
  20. 356 -1 "pupil_r" 0.6
  21. eyeball lefteye "bip_head" 1.425952 83.274592 1.41954 "eyeball_l" 1.80
  22. 356 1 "pupil_l" 0.6
  23. localvar %dummy_eyelid_flex
  24. flexcontroller eyes range -30 30 eyes_updown
  25. flexcontroller eyes range -30 30 eyes_rightleft
  26. }
  27. $model eyeball
  28. (name) Name of eyeball, used to match eyelid rules.
  29. (bone name) Name of bone that the eye is parented to, typically the head.
  30. (X) (Y) (Z) World location of the center of the ball of the eye.
  31. (material name) Material name to use when searching for vertices to consider as the white of the eye (used in dynamically texture mapping the iris and cornea onto the eye).
  32. (diameter) Diameter of the ball of the eye
  33. (angle) Default yaw offset from forward for iris. Humans are typically 2-4 degrees walleyed. Not setting this correctly will result in your either characters appearing cross-eyed, or if youve compensated by misplacing the ball of the eye, them not tracking side to side.
  34. (iris material) no longer used but still in the option list.
  35. (pupil scale) World scale of the iris texture
  36. [edit]
  37. Syntax
  38. eyeball (name) (bone name) (X) (Y) (Z) (material name) (diameter) (angle) (iris material) (pupil scale)
  39. */
  40. //-----------------------------------------------------------------------------
  41. // A class representing a transformation matrix
  42. //-----------------------------------------------------------------------------
  43. class CDmeEyeball : public CDmeDag
  44. {
  45. DEFINE_ELEMENT( CDmeEyeball, CDmeDag );
  46. public:
  47. void GetWorldPosition( Vector &worldPosition );
  48. CDmaVar< float > m_flDiameter; // Diameter of the ball of the eye
  49. CDmaVar< float > m_flYawAngle; // Yaw offset from "forward" for iris. Humans are typically 2-4 degrees walleyed.
  50. CDmaVar< float > m_flPupilScale; // Scale of the iris texture
  51. };
  52. #endif // DMEEYEBALL_H