POSCharacter.cs 7.8 KB

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