hkp1dAngularFollowCamCinfo.h
上传用户:yisoukefu
上传日期:2020-08-09
资源大小:39506k
文件大小:4k
源码类别:

其他游戏

开发平台:

Visual C++

  1. /* 
  2.  * 
  3.  * Confidential Information of Telekinesys Research Limited (t/a Havok). Not for disclosure or distribution without Havok's
  4.  * prior written consent. This software contains code, techniques and know-how which is confidential and proprietary to Havok.
  5.  * Level 2 and Level 3 source code contains trade secrets of Havok. Havok Software (C) Copyright 1999-2009 Telekinesys Research Limited t/a Havok. All Rights Reserved. Use of this software is subject to the terms of an end user license agreement.
  6.  * 
  7.  */
  8. #ifndef HK_1D_ANGULAR_FOLLOW_COM_CINFO
  9. #define HK_1D_ANGULAR_FOLLOW_COM_CINFO
  10. /// All the parameters needed to construct a hkp1dAngularFollowCam
  11. class hkp1dAngularFollowCamCinfo 
  12. {
  13. public:
  14. HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR(HK_MEMORY_CLASS_CAMERA, hkp1dAngularFollowCamCinfo);
  15. hkp1dAngularFollowCamCinfo();
  16. struct CameraSet
  17. {
  18. public:
  19. HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR( HK_MEMORY_CLASS_VEHICLE, hkp1dAngularFollowCamCinfo::CameraSet );
  20. /// The resting position of the camera in unrotated space. Default: ( 0.0f, 12.0f, 5.5f)
  21. hkVector4 m_positionUS;
  22. /// The position in unrotated space. Default: (0, 0, 0)
  23. hkVector4 m_lookAtUS;
  24. /// The field of view (f.o.v.) in radians. Default: 1.0
  25. hkReal m_fov;
  26. /// m_velocity [m/sec] defines the velocity for which this parameter set gets a weight of 1.0f. Default: 0.0
  27. /// Normally the hkReal parameters are interpolated from two parameter sets.
  28. /// The m_velocity parameter of set 1 defines the velocity
  29. /// for which set 1 gets a weight of 1.0f.
  30. /// Example: Set0.m_velocity = 10.0f and Set1.m_velocity = 20.0f.<br>
  31. /// In this case for:
  32. ///   - velocities < 10  Set0 is used.
  33. ///   - velocities 10-20  Set0 and Set1 are interpolated
  34. ///   - velocities >20   Set1 is used
  35. hkReal m_velocity;
  36. /// This parameter defines the magnitude of the influence of the velocity for the camera direction. Default 0.01
  37. /// Normally the camera direction is based on the direction the car. 
  38. /// However in some situations the camera should also use the velocity
  39. /// direction. So this parameter is a factor to the current velocity
  40. /// to be added to the direction of the car to calculate the ideal
  41. /// camera direction.
  42. hkReal m_speedInfluenceOnCameraDirection;
  43. /// The angular speed the camera follows the car. Default 4.0
  44. /// m_angularRelaxation is used to make the yaw angle of the camera follow
  45. /// the direction of the car. Values from 1.0f to 10.0f are a good choice
  46. hkReal m_angularRelaxation;
  47. /// Construct with default values
  48. CameraSet();
  49. };
  50. public:
  51. /// An extra angular add-on to the yaw angle (needed if the internal angle calculation has an offset)
  52. hkReal m_yawCorrection;
  53. /// This member can be set to -1.0f (instead of 1.0f) to reverse the camera yaw angle
  54. hkReal m_yawSignCorrection;
  55. /// A normalized vector pointing up in world space.
  56. hkVector4 m_upDirWS;
  57. /// A normalized vector pointing forward in the local space of the rigid body
  58. hkVector4 m_rigidBodyForwardDir;
  59. /// Two parameters sets for the car values.
  60. /// Depending on the velocity of the car, the parameters actually 
  61. /// used are calculated by interpolating between these two sets
  62. /// using the following formula:<br>
  63. /// hkReal f1 = min (1.0f, current_velocity / set[1].m_velocity);<br>
  64. /// hkReal f0 = 1.0f - f1;<br>
  65. /// set = f0 * m_set[0] + f1 * m_set[1]
  66. CameraSet m_set[2];
  67. };
  68. #endif /* HK_1D_ANGULAR_FOLLOW_COM_CINFO */
  69. /*
  70. * Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20090216)
  71. * Confidential Information of Havok.  (C) Copyright 1999-2009
  72. * Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
  73. * Logo, and the Havok buzzsaw logo are trademarks of Havok.  Title, ownership
  74. * rights, and intellectual property rights in the Havok software remain in
  75. * Havok and/or its suppliers.
  76. * Use of this software for evaluation purposes is subject to and indicates
  77. * acceptance of the End User licence Agreement for this product. A copy of
  78. * the license is included with this software and is also available at www.havok.com/tryhavok.
  79. */