1
0

VehicleConstants.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSimulator Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using OpenMetaverse;
  29. namespace OpenSim.Region.PhysicsModules.SharedBase
  30. {
  31. public enum Vehicle : int
  32. {
  33. /// <summary>
  34. /// Turns off Vehicle Support
  35. /// </summary>
  36. TYPE_NONE = 0,
  37. /// <summary>
  38. /// No Angular motor, High Left right friction, No Hover, Linear Deflection 1, no angular deflection
  39. /// no vertical attractor, No banking, Identity rotation frame
  40. /// </summary>
  41. TYPE_SLED = 1,
  42. /// <summary>
  43. /// Needs Motors to be driven by timer or control events High left/right friction, No angular friction
  44. /// Linear Motor wins in a second, decays in 60 seconds. Angular motor wins in a second, decays in 8/10ths of a second
  45. /// linear deflection 2 seconds
  46. /// Vertical Attractor locked UP
  47. /// </summary>
  48. TYPE_CAR = 2,
  49. TYPE_BOAT = 3,
  50. TYPE_AIRPLANE = 4,
  51. TYPE_BALLOON = 5,
  52. LINEAR_FRICTION_TIMESCALE = 16,
  53. /// <summary>
  54. /// vector of timescales for exponential decay of angular velocity about three axis
  55. /// </summary>
  56. ANGULAR_FRICTION_TIMESCALE = 17,
  57. /// <summary>
  58. /// linear velocity vehicle will try for
  59. /// </summary>
  60. LINEAR_MOTOR_DIRECTION = 18,
  61. /// <summary>
  62. /// Offset from center of mass where linear motor forces are added
  63. /// </summary>
  64. LINEAR_MOTOR_OFFSET = 20,
  65. /// <summary>
  66. /// angular velocity that vehicle will try for
  67. /// </summary>
  68. ANGULAR_MOTOR_DIRECTION = 19,
  69. HOVER_HEIGHT = 24,
  70. HOVER_EFFICIENCY = 25,
  71. HOVER_TIMESCALE = 26,
  72. BUOYANCY = 27,
  73. LINEAR_DEFLECTION_EFFICIENCY = 28,
  74. LINEAR_DEFLECTION_TIMESCALE = 29,
  75. LINEAR_MOTOR_TIMESCALE = 30,
  76. LINEAR_MOTOR_DECAY_TIMESCALE = 31,
  77. /// <summary>
  78. /// slide between 0 and 1
  79. /// </summary>
  80. ANGULAR_DEFLECTION_EFFICIENCY = 32,
  81. ANGULAR_DEFLECTION_TIMESCALE = 33,
  82. ANGULAR_MOTOR_TIMESCALE = 34,
  83. ANGULAR_MOTOR_DECAY_TIMESCALE = 35,
  84. VERTICAL_ATTRACTION_EFFICIENCY = 36,
  85. VERTICAL_ATTRACTION_TIMESCALE = 37,
  86. BANKING_EFFICIENCY = 38,
  87. BANKING_MIX = 39,
  88. BANKING_TIMESCALE = 40,
  89. REFERENCE_FRAME = 44,
  90. BLOCK_EXIT = 45,
  91. ROLL_FRAME = 46
  92. }
  93. [Flags]
  94. public enum VehicleFlag
  95. {
  96. NO_DEFLECTION_UP = 1,
  97. LIMIT_ROLL_ONLY = 2,
  98. HOVER_WATER_ONLY = 4,
  99. HOVER_TERRAIN_ONLY = 8,
  100. HOVER_GLOBAL_HEIGHT = 16,
  101. HOVER_UP_ONLY = 32,
  102. LIMIT_MOTOR_UP = 64,
  103. MOUSELOOK_STEER = 128,
  104. MOUSELOOK_BANK = 256,
  105. CAMERA_DECOUPLED = 512,
  106. NO_X = 1024,
  107. NO_Y = 2048,
  108. NO_Z = 4096,
  109. LOCK_HOVER_HEIGHT = 8192,
  110. NO_DEFLECTION = 16392,
  111. LOCK_ROTATION = 32784
  112. }
  113. public struct VehicleData
  114. {
  115. public Vehicle m_type;
  116. public VehicleFlag m_flags;
  117. // Linear properties
  118. public Vector3 m_linearMotorDirection;
  119. public Vector3 m_linearFrictionTimescale;
  120. public float m_linearMotorDecayTimescale;
  121. public float m_linearMotorTimescale;
  122. public Vector3 m_linearMotorOffset;
  123. //Angular properties
  124. public Vector3 m_angularMotorDirection;
  125. public float m_angularMotorTimescale;
  126. public float m_angularMotorDecayTimescale;
  127. public Vector3 m_angularFrictionTimescale;
  128. //Deflection properties
  129. public float m_angularDeflectionEfficiency;
  130. public float m_angularDeflectionTimescale;
  131. public float m_linearDeflectionEfficiency;
  132. public float m_linearDeflectionTimescale;
  133. //Banking properties
  134. public float m_bankingEfficiency;
  135. public float m_bankingMix;
  136. public float m_bankingTimescale;
  137. //Hover and Buoyancy properties
  138. public float m_VhoverHeight;
  139. public float m_VhoverEfficiency;
  140. public float m_VhoverTimescale;
  141. public float m_VehicleBuoyancy;
  142. //Attractor properties
  143. public float m_verticalAttractionEfficiency;
  144. public float m_verticalAttractionTimescale;
  145. // Axis
  146. public Quaternion m_referenceFrame;
  147. }
  148. }