POSCharacter.cs 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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 System.Collections.Generic;
  29. using Nini.Config;
  30. using OpenMetaverse;
  31. using OpenSim.Framework;
  32. using OpenSim.Region.PhysicsModules.SharedBase;
  33. namespace OpenSim.Region.PhysicsModule.POS
  34. {
  35. public class POSCharacter : PhysicsActor
  36. {
  37. private Vector3 _position;
  38. public Vector3 _velocity;
  39. public Vector3 _target_velocity = Vector3.Zero;
  40. public Vector3 _size = Vector3.Zero;
  41. private Vector3 _acceleration;
  42. private Vector3 m_rotationalVelocity = Vector3.Zero;
  43. private bool flying;
  44. private bool isColliding;
  45. public POSCharacter()
  46. {
  47. }
  48. public override int PhysicsActorType
  49. {
  50. get { return (int) ActorTypes.Agent; }
  51. set { return; }
  52. }
  53. public override Vector3 RotationalVelocity
  54. {
  55. get { return m_rotationalVelocity; }
  56. set { m_rotationalVelocity = value; }
  57. }
  58. public override bool SetAlwaysRun
  59. {
  60. get { return false; }
  61. set { return; }
  62. }
  63. public override uint LocalID
  64. {
  65. set { return; }
  66. }
  67. public override bool Grabbed
  68. {
  69. set { return; }
  70. }
  71. public override bool Selected
  72. {
  73. set { return; }
  74. }
  75. public override float Buoyancy
  76. {
  77. get { return 0f; }
  78. set { return; }
  79. }
  80. public override bool IsPhysical
  81. {
  82. get { return false; }
  83. set { return; }
  84. }
  85. public override bool ThrottleUpdates
  86. {
  87. get { return false; }
  88. set { return; }
  89. }
  90. public override bool Flying
  91. {
  92. get { return flying; }
  93. set { flying = value; }
  94. }
  95. public override bool IsColliding
  96. {
  97. get { return isColliding; }
  98. set { isColliding = value; }
  99. }
  100. public override bool CollidingGround
  101. {
  102. get { return false; }
  103. set { return; }
  104. }
  105. public override bool CollidingObj
  106. {
  107. get { return false; }
  108. set { return; }
  109. }
  110. public override bool Stopped
  111. {
  112. get { return false; }
  113. }
  114. public override Vector3 Position
  115. {
  116. get { return _position; }
  117. set { _position = value; }
  118. }
  119. public override Vector3 Size
  120. {
  121. get { return _size; }
  122. set
  123. {
  124. _size = value;
  125. _size.Z = _size.Z / 2.0f;
  126. }
  127. }
  128. public override float Mass
  129. {
  130. get { return 0f; }
  131. }
  132. public override Vector3 Force
  133. {
  134. get { return Vector3.Zero; }
  135. set { return; }
  136. }
  137. public override int VehicleType
  138. {
  139. get { return 0; }
  140. set { return; }
  141. }
  142. public override void VehicleFloatParam(int param, float value)
  143. {
  144. }
  145. public override void VehicleVectorParam(int param, Vector3 value)
  146. {
  147. }
  148. public override void VehicleRotationParam(int param, Quaternion rotation)
  149. {
  150. }
  151. public override void VehicleFlags(int param, bool remove) { }
  152. public override void SetVolumeDetect(int param)
  153. {
  154. }
  155. public override Vector3 CenterOfMass
  156. {
  157. get { return Vector3.Zero; }
  158. }
  159. public override Vector3 GeometricCenter
  160. {
  161. get { return Vector3.Zero; }
  162. }
  163. public override PrimitiveBaseShape Shape
  164. {
  165. set { return; }
  166. }
  167. public override Vector3 Velocity
  168. {
  169. get { return _velocity; }
  170. set { _target_velocity = value; }
  171. }
  172. public override Vector3 Torque
  173. {
  174. get { return Vector3.Zero; }
  175. set { return; }
  176. }
  177. public override float CollisionScore
  178. {
  179. get { return 0f; }
  180. set { }
  181. }
  182. public override Quaternion Orientation
  183. {
  184. get { return Quaternion.Identity; }
  185. set { }
  186. }
  187. public override Vector3 Acceleration
  188. {
  189. get { return _acceleration; }
  190. set { _acceleration = value; }
  191. }
  192. public override bool Kinematic
  193. {
  194. get { return true; }
  195. set { }
  196. }
  197. public override void link(PhysicsActor obj)
  198. {
  199. }
  200. public override void delink()
  201. {
  202. }
  203. public override void LockAngularMotion(byte axislocks)
  204. {
  205. }
  206. public override void AvatarJump(float forceZ) { }
  207. public override void AddForce(Vector3 force, bool pushforce)
  208. {
  209. }
  210. public override void AddAngularForce(Vector3 force, bool pushforce)
  211. {
  212. }
  213. public override void SetMomentum(Vector3 momentum)
  214. {
  215. }
  216. public override void CrossingFailure()
  217. {
  218. }
  219. public override Vector3 PIDTarget
  220. {
  221. set { return; }
  222. }
  223. public override bool PIDActive
  224. {
  225. get { return false; }
  226. set { return; }
  227. }
  228. public override float PIDTau
  229. {
  230. set { return; }
  231. }
  232. public override float PIDHoverHeight
  233. {
  234. set { return; }
  235. }
  236. public override bool PIDHoverActive
  237. {
  238. get { return false; }
  239. set { return; }
  240. }
  241. public override PIDHoverType PIDHoverType
  242. {
  243. set { return; }
  244. }
  245. public override float PIDHoverTau
  246. {
  247. set { return; }
  248. }
  249. public override Quaternion APIDTarget
  250. {
  251. set { return; }
  252. }
  253. public override bool APIDActive
  254. {
  255. set { return; }
  256. }
  257. public override float APIDStrength
  258. {
  259. set { return; }
  260. }
  261. public override float APIDDamping
  262. {
  263. set { return; }
  264. }
  265. public override void SubscribeEvents(int ms)
  266. {
  267. }
  268. public override void UnSubscribeEvents()
  269. {
  270. }
  271. public override bool SubscribedEvents()
  272. {
  273. return false;
  274. }
  275. }
  276. }