29 using System.Collections.Generic;
30 using System.Reflection;
35 using OpenSim.Framework;
38 namespace OpenSim.
Region.PhysicsModules.SharedBase
42 public delegate
void RaycastCallback(
bool hitYN, Vector3 collisionPoint, uint localid,
float distance, Vector3 normal);
43 public delegate
void RayCallback(List<ContactResult> list);
47 public delegate
void SitAvatarCallback(
int status, uint partID, Vector3 offset, Quaternion Orientation);
49 public delegate
void JointMoved(PhysicsJoint joint);
107 public string PhysicsSceneName {
get;
protected set; }
113 public string EngineType {
get;
protected set; }
128 RequestAssetMethod = m;
130 SetWaterLevel(waterHeight);
154 string avName, Vector3 position, Vector3 velocity, Vector3 size,
bool isFlying);
167 uint localID,
string avName, Vector3 position, Vector3 velocity, Vector3 size,
bool isFlying)
169 PhysicsActor ret = AddAvatar(avName, position, velocity, size, isFlying);
172 ret.LocalID = localID;
178 uint localID,
string avName, Vector3 position, Vector3 size,
bool isFlying)
180 PhysicsActor ret = AddAvatar(localID, avName, position, Vector3.Zero, size, isFlying);
185 uint localID,
string avName, Vector3 position, Vector3 size,
float feetOffset,
bool isFlying)
187 PhysicsActor ret = AddAvatar(localID, avName, position, Vector3.Zero, size, isFlying);
204 Vector3 size, Quaternion
rotation,
bool isPhysical, uint localid);
207 uint localid, byte[] sdata)
213 Vector3 size, Quaternion
rotation,
bool isPhysical,
bool isPhantom, uint localid)
215 return AddPrimShape(primName, pbs, position, size, rotation, isPhysical, localid);
220 Vector3 size, Quaternion
rotation,
bool isPhysical,
bool isPhantom, byte shapetype, uint localid)
222 return AddPrimShape(primName, pbs, position, size, rotation, isPhysical, localid);
225 public virtual float TimeDilation
230 public virtual bool SupportsNINJAJoints
232 get {
return false; }
236 Quaternion
rotation,
string parms, List<string> bodyNames,
string trackedBodyName, Quaternion localRotation)
254 if (OnJointMoved != null)
266 if (OnJointDeactivated != null)
268 OnJointDeactivated(joint);
278 if (OnJointErrorMessage != null)
280 OnJointErrorMessage(joint, message);
285 {
return Vector3.Zero; }
288 {
return Vector3.Zero; }
290 public abstract void AddPhysicsActorTaint(
PhysicsActor prim);
300 public abstract float Simulate(
float timeStep);
309 public virtual Dictionary<string, float>
GetStats() {
return null; }
311 public abstract void GetResults();
313 public abstract void SetTerrain(
float[] heightMap);
315 public abstract void SetWaterLevel(
float baseheight);
317 public abstract void DeleteTerrain();
319 public abstract void Dispose();
321 public abstract Dictionary<uint, float> GetTopColliders();
323 public abstract bool IsThreaded {
get; }
363 if (retMethod != null)
364 retMethod(
false, Vector3.Zero, 0, 999999999999f, Vector3.Zero);
369 if (retMethod != null)
370 retMethod(
new List<ContactResult>());
373 public virtual List<ContactResult>
RaycastWorld(Vector3 position, Vector3 direction,
float length,
int Count)
375 return new List<ContactResult>();
390 return new List<ContactResult>();
393 public virtual List<ContactResult>
BoxProbe(Vector3 position, Vector3 size, Quaternion orientation,
int Count,
RayFilterFlags flags)
395 return new List<ContactResult>();
400 return new List<ContactResult>();
405 return new List<ContactResult>();
414 public virtual object Extension(
string pFunct, params
object[] pParams)
virtual bool SupportsCombining()
virtual void RaycastWorld(Vector3 position, Vector3 direction, float length, int Count, RayCallback retMethod)
delegate void JointDeactivated(PhysicsJoint joint)
delegate void JointErrorMessage(PhysicsJoint joint, string message)
virtual bool SupportsRaycastWorldFiltered()
virtual void RemoveAllJointsConnectedToActorThreadLocked(PhysicsActor actor)
void Initialise(RequestAssetDelegate m, float[] terrain, float waterHeight)
virtual Vector3 GetJointAnchor(PhysicsJoint joint)
physicsCrash OnPhysicsCrash
JointDeactivated OnJointDeactivated
virtual void ProcessPreSimulation()
virtual void DoJointDeactivated(PhysicsJoint joint)
virtual List< ContactResult > SphereProbe(Vector3 position, float radius, int Count, RayFilterFlags flags)
delegate void ProbePlaneCallback(List< ContactResult > list)
delegate void RayCallback(List< ContactResult > list)
virtual void DoJointErrorMessage(PhysicsJoint joint, string message)
virtual void RequestJointDeletion(string objectNameInScene)
virtual void DoJointMoved(PhysicsJoint joint)
virtual void CombineTerrain(float[] heightMap, Vector3 pOffset)
virtual List< ContactResult > BoxProbe(Vector3 position, Vector3 size, Quaternion orientation, int Count, RayFilterFlags flags)
virtual PhysicsJoint RequestJointCreation(string objectNameInScene, PhysicsJointType jointType, Vector3 position, Quaternion rotation, string parms, List< string > bodyNames, string trackedBodyName, Quaternion localRotation)
virtual void TriggerPhysicsBasedRestart()
JointErrorMessage OnJointErrorMessage
delegate void RaycastCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal)
virtual object RaycastWorld(Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags filter)
virtual void DumpJointInfo()
Asset class. All Assets are reference by this class or a class derived from this class ...
delegate void JointMoved(PhysicsJoint joint)
virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, byte shapetype, uint localid)
delegate void ProbeBoxCallback(List< ContactResult > list)
delegate void AssetReceivedDelegate(AssetBase asset)
virtual PhysicsActor AddAvatar(uint localID, string avName, Vector3 position, Vector3 size, bool isFlying)
OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion rotation
virtual PhysicsActor AddAvatar(uint localID, string avName, Vector3 position, Vector3 velocity, Vector3 size, bool isFlying)
Add an avatar
virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, uint localid)
delegate void RequestAssetDelegate(UUID assetID, AssetReceivedDelegate callback)
virtual Dictionary< string, float > GetStats()
Get statistics about this scene.
delegate void physicsCrash()
delegate void ProbeSphereCallback(List< ContactResult > list)
virtual void RaycastWorld(Vector3 position, Vector3 direction, float length, RaycastCallback retMethod)
Queue a raycast against the physics scene. The provided callback method will be called when the rayca...
virtual object Extension(string pFunct, params object[] pParams)
virtual int SitAvatar(PhysicsActor actor, Vector3 AbsolutePosition, Vector3 CameraPosition, Vector3 offset, Vector3 AvatarSize, SitAvatarCallback PhysicsSitResponse)
virtual List< ContactResult > RaycastActor(PhysicsActor actor, Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags flags)
virtual PhysicsActor AddPrimShape(string primName, PhysicsActor parent, PrimitiveBaseShape pbs, Vector3 position, uint localid, byte[] sdata)
virtual void UnCombine(PhysicsScene pScene)
delegate void SitAvatarCallback(int status, uint partID, Vector3 offset, Quaternion Orientation)
virtual List< ContactResult > PlaneProbe(PhysicsActor actor, Vector4 plane, int Count, RayFilterFlags flags)
virtual Vector3 GetJointAxis(PhysicsJoint joint)
virtual void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents)
virtual List< ContactResult > RaycastWorld(Vector3 position, Vector3 direction, float length, int Count)
virtual PhysicsActor AddAvatar(uint localID, string avName, Vector3 position, Vector3 size, float feetOffset, bool isFlying)
virtual bool SupportsRayCast()
True if the physics plugin supports raycasting against the physics scene