BasicPhysicsPrim.cs 7.4 KB

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