mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
ubode: do part of avatar/avatar broadband collision phase in managed code plus cosmetics
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using OpenSim.Framework;
|
||||
using OpenMetaverse;
|
||||
|
||||
@@ -62,6 +62,14 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
|
||||
public bool MouseLook;
|
||||
}
|
||||
|
||||
public struct AABB2D
|
||||
{
|
||||
public float minx;
|
||||
public float miny;
|
||||
public float maxx;
|
||||
public float maxy;
|
||||
}
|
||||
|
||||
public struct ContactPoint
|
||||
{
|
||||
public Vector3 Position;
|
||||
@@ -158,7 +166,7 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
|
||||
|
||||
public abstract class PhysicsActor
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public delegate void RequestTerseUpdate();
|
||||
public delegate void CollisionUpdate(EventArgs e);
|
||||
@@ -201,6 +209,8 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
|
||||
cdata.bounce = 0;
|
||||
}
|
||||
|
||||
public AABB2D _AABB2D;
|
||||
|
||||
public abstract bool Stopped { get; }
|
||||
|
||||
public abstract Vector3 Size { get; set; }
|
||||
@@ -258,38 +268,17 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
|
||||
|
||||
public virtual void RequestPhysicsterseUpdate()
|
||||
{
|
||||
// Make a temporary copy of the event to avoid possibility of
|
||||
// a race condition if the last subscriber unsubscribes
|
||||
// immediately after the null check and before the event is raised.
|
||||
RequestTerseUpdate handler = OnRequestTerseUpdate;
|
||||
|
||||
if (handler != null)
|
||||
{
|
||||
handler();
|
||||
}
|
||||
OnRequestTerseUpdate?.Invoke();
|
||||
}
|
||||
|
||||
public virtual void RaiseOutOfBounds(Vector3 pos)
|
||||
{
|
||||
// Make a temporary copy of the event to avoid possibility of
|
||||
// a race condition if the last subscriber unsubscribes
|
||||
// immediately after the null check and before the event is raised.
|
||||
OutOfBounds handler = OnOutOfBounds;
|
||||
|
||||
if (handler != null)
|
||||
{
|
||||
handler(pos);
|
||||
}
|
||||
OnOutOfBounds?.Invoke(pos);
|
||||
}
|
||||
|
||||
public virtual void SendCollisionUpdate(EventArgs e)
|
||||
{
|
||||
CollisionUpdate handler = OnCollisionUpdate;
|
||||
|
||||
// m_log.DebugFormat("[PHYSICS ACTOR]: Sending collision for {0}", LocalID);
|
||||
|
||||
if (handler != null)
|
||||
handler(e);
|
||||
OnCollisionUpdate?.Invoke(e);
|
||||
}
|
||||
|
||||
public virtual void SetMaterial (int material) { }
|
||||
|
||||
Reference in New Issue
Block a user