mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
Massive tab and trailing space cleanup
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -67,7 +67,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
StopERP3 = 7 + 512,
|
||||
StopCFM3 = 8 + 512
|
||||
}
|
||||
|
||||
|
||||
public class OdeCharacter : PhysicsActor
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
@@ -121,7 +121,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
private float m_buoyancy = 0f;
|
||||
|
||||
private bool m_freemove = false;
|
||||
|
||||
|
||||
// private string m_name = String.Empty;
|
||||
// other filter control
|
||||
int m_colliderfilter = 0;
|
||||
@@ -155,7 +155,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
public UUID m_uuid;
|
||||
public bool bad = false;
|
||||
|
||||
float mu;
|
||||
float mu;
|
||||
|
||||
// HoverHeight control
|
||||
private float m_PIDHoverHeight;
|
||||
@@ -218,7 +218,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
walkDivisor = walk_divisor;
|
||||
runDivisor = rundivisor;
|
||||
|
||||
m_mass = m_density * m_size.X * m_size.Y * m_size.Z; ; // sure we have a default
|
||||
m_mass = m_density * m_size.X * m_size.Y * m_size.Z; ; // sure we have a default
|
||||
|
||||
PID_D = basePID_D * m_mass * invtimeStep;
|
||||
PID_P = basePID_P * m_mass * invtimeStep;
|
||||
@@ -256,7 +256,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
public override uint LocalID
|
||||
{
|
||||
get { return m_localID; }
|
||||
get { return m_localID; }
|
||||
set { m_localID = value; }
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Got a NaN AvatarSize from Scene on a Character");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// This creates the Avatar's physical Surrogate at the position supplied
|
||||
@@ -636,7 +636,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_targetVelocity;
|
||||
return m_targetVelocity;
|
||||
}
|
||||
set
|
||||
{
|
||||
@@ -774,7 +774,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
PID_D = basePID_D * m_mass / _parent_scene.ODE_STEPSIZE;
|
||||
PID_P = basePID_P * m_mass / _parent_scene.ODE_STEPSIZE;
|
||||
|
||||
|
||||
Body = d.BodyCreate(_parent_scene.world);
|
||||
|
||||
_zeroFlag = false;
|
||||
@@ -900,7 +900,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
x = tx * cos - y * sin;
|
||||
y = tx * sin + y * cos;
|
||||
}
|
||||
|
||||
|
||||
public bool Collide(IntPtr me, IntPtr other, bool reverse, ref d.ContactGeom contact,
|
||||
ref d.ContactGeom altContact , ref bool useAltcontact, ref bool feetcollision)
|
||||
{
|
||||
@@ -944,7 +944,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/*
|
||||
d.AABB aabb;
|
||||
d.GeomGetAABB(other,out aabb);
|
||||
@@ -1141,7 +1141,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
n.Y = 0f;
|
||||
n.Z = 1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (depth < 0.2f)
|
||||
@@ -1223,7 +1223,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
break;
|
||||
} // end switch (m_PIDHoverType)
|
||||
|
||||
// don't go underground
|
||||
// don't go underground
|
||||
if (m_targetHoverHeight > terrainheight + 0.5f * (aabb.MaxZ - aabb.MinZ))
|
||||
{
|
||||
float fz = (m_targetHoverHeight - localpos.Z);
|
||||
@@ -1248,7 +1248,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//******************************************
|
||||
if (!m_iscolliding)
|
||||
m_collideNormal.Z = 0;
|
||||
@@ -1495,7 +1495,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
/// Used to copy variables from unmanaged space at heartbeat rate and also trigger scene updates acording
|
||||
/// also outbounds checking
|
||||
/// copy and outbounds now done in move(..) at ode rate
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
public void UpdatePositionAndVelocity()
|
||||
{
|
||||
@@ -1625,7 +1625,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
CollisionEventsThisFrame.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool SubscribedEvents()
|
||||
@@ -1697,7 +1697,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
_position.Z + (m_size.Z - oldsz) * 0.5f);
|
||||
|
||||
// Velocity = Vector3.Zero;
|
||||
m_targetVelocity = Vector3.Zero;
|
||||
m_targetVelocity = Vector3.Zero;
|
||||
|
||||
_parent_scene.actor_name_map[collider] = (PhysicsActor)this;
|
||||
_parent_scene.actor_name_map[capsule] = (PhysicsActor)this;
|
||||
@@ -1717,7 +1717,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
d.BodySetPosition(Body, newPos.X, newPos.Y, newPos.Z);
|
||||
_position = newPos;
|
||||
m_freemove = false;
|
||||
m_pidControllerActive = true;
|
||||
m_pidControllerActive = true;
|
||||
}
|
||||
|
||||
private void changeOrientation(Quaternion newOri)
|
||||
@@ -1772,35 +1772,35 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
private void changeSetTorque(Vector3 newTorque)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void changeAddForce(Vector3 newForce)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void changeAddAngularForce(Vector3 arg)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void changeAngularLock(byte arg)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void changeFloatOnWater(bool arg)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void changeVolumedetetion(bool arg)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void changeSelectedStatus(bool arg)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void changeDisable(bool arg)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void changeBuilding(bool arg)
|
||||
{
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
m_type = vd.m_type;
|
||||
m_flags = vd.m_flags;
|
||||
|
||||
|
||||
|
||||
// Linear properties
|
||||
m_linearMotorDirection = vd.m_linearMotorDirection;
|
||||
|
||||
@@ -761,8 +761,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
roll = (float)Math.Atan2(minuszY, zZ);
|
||||
}
|
||||
return ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal void Step()
|
||||
{
|
||||
IntPtr Body = rootPrim.Body;
|
||||
@@ -797,7 +797,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
Vector3 curLocalAngVel = curAngVel * irotq; // current angular velocity in local
|
||||
|
||||
float ldampZ = 0;
|
||||
|
||||
|
||||
bool mousemode = false;
|
||||
bool mousemodebank = false;
|
||||
|
||||
@@ -852,7 +852,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
m_lmEfect = 0;
|
||||
m_ffactor = 1f;
|
||||
}
|
||||
|
||||
|
||||
// hover
|
||||
if (m_VhoverTimescale < 300 && rootPrim.prim_geom != IntPtr.Zero)
|
||||
{
|
||||
@@ -1001,7 +1001,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
if (broll > halfpi)
|
||||
broll = pi - broll;
|
||||
else if (broll < -halfpi)
|
||||
broll = -pi - broll;
|
||||
broll = -pi - broll;
|
||||
*/
|
||||
broll *= m_bankingEfficiency;
|
||||
if (m_bankingMix != 0)
|
||||
@@ -1054,7 +1054,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
float invamts = 1.0f/m_angularMotorTimescale;
|
||||
float tmp;
|
||||
|
||||
// get out of x == 0 plane
|
||||
// get out of x == 0 plane
|
||||
if(Math.Abs(dirv.X) < 0.001f)
|
||||
dirv.X = 0.001f;
|
||||
|
||||
@@ -1068,7 +1068,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
torque.Y += (tmp - curLocalAngVel.Y) * invamts;
|
||||
torque.Y -= curLocalAngVel.Y * m_amdampY;
|
||||
}
|
||||
else
|
||||
else
|
||||
torque.Y -= curLocalAngVel.Y * m_invtimestep;
|
||||
|
||||
if (Math.Abs(dirv.Y) > 0.01)
|
||||
@@ -1099,7 +1099,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
{
|
||||
if(mousemodebank)
|
||||
torque.X -= curLocalAngVel.X * m_invtimestep;
|
||||
else
|
||||
else
|
||||
torque.Z -= curLocalAngVel.Z * m_invtimestep;
|
||||
}
|
||||
}
|
||||
@@ -1133,11 +1133,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
if (m_angularDeflectionEfficiency > 0)
|
||||
{
|
||||
Vector3 dirv;
|
||||
|
||||
|
||||
if (curLocalVel.X > 0.01f)
|
||||
dirv = curLocalVel;
|
||||
else if (curLocalVel.X < -0.01f)
|
||||
// use oposite
|
||||
// use oposite
|
||||
dirv = -curLocalVel;
|
||||
else
|
||||
{
|
||||
@@ -1167,7 +1167,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
torque.Z -= curLocalAngVel.Z * m_amdampZ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
force *= dmass.mass;
|
||||
|
||||
force += rootPrim.m_force;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
AssetOK = 0x0f, // 00001111
|
||||
|
||||
NeedMask = 0x30, // 00110000
|
||||
needMesh = 0x10, // 00010000
|
||||
needMesh = 0x10, // 00010000
|
||||
needAsset = 0x20, // 00100000
|
||||
|
||||
FailMask = 0xC0, // 11000000
|
||||
@@ -287,7 +287,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
public bool needsMeshing(ODEPhysRepData repData)
|
||||
{
|
||||
PrimitiveBaseShape pbs = repData.pbs;
|
||||
// check sculpts or meshs
|
||||
// check sculpts or meshs
|
||||
if (pbs.SculptEntry)
|
||||
{
|
||||
if (meshSculptedPrim)
|
||||
@@ -462,7 +462,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
repData.meshState = MeshState.MeshFailed;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repData.meshState = MeshState.AssetOK;
|
||||
@@ -525,7 +525,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
}
|
||||
|
||||
mesh = m_mesher.CreateMesh(actor.Name, pbs, size, clod, true, convex, true);
|
||||
|
||||
|
||||
if (mesh == null)
|
||||
{
|
||||
if (pbs.SculptEntry)
|
||||
@@ -607,7 +607,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
else if (_pbs.PathCurve == (byte)Extrusion.Curve1)
|
||||
{
|
||||
//a tube
|
||||
//a tube
|
||||
|
||||
volume *= 0.78539816339e-2f * (float)(200 - _pbs.PathScaleX);
|
||||
tmp = 1.0f - 2.0e-2f * (float)(200 - _pbs.PathScaleY);
|
||||
@@ -857,7 +857,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
// this is crude aproximation
|
||||
profileBegin = (float)_pbs.ProfileBegin * 2.0e-5f;
|
||||
profileEnd = 1.0f - (float)_pbs.ProfileEnd * 2.0e-5f;
|
||||
volume *= (profileEnd - profileBegin);
|
||||
volume *= (profileEnd - profileBegin);
|
||||
|
||||
repData.volume = volume;
|
||||
}
|
||||
|
||||
@@ -11,16 +11,16 @@ using OpenSim.Region.Framework.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ubODEPhysicsScene")]
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ubODEPhysicsScene")]
|
||||
class ubOdeModule : INonSharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private static Dictionary<Scene, ODEScene> m_scenes = new Dictionary<Scene, ODEScene>();
|
||||
private bool m_Enabled = false;
|
||||
private IConfigSource m_config;
|
||||
private IConfigSource m_config;
|
||||
private bool OSOdeLib;
|
||||
|
||||
|
||||
|
||||
#region INonSharedRegionModule
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
if(m_scenes.ContainsKey(scene)) // ???
|
||||
return;
|
||||
ODEScene newodescene = new ODEScene(scene, m_config, Name, Version, OSOdeLib);
|
||||
ODEScene newodescene = new ODEScene(scene, m_config, Name, Version, OSOdeLib);
|
||||
m_scenes[scene] = newodescene;
|
||||
}
|
||||
|
||||
@@ -100,13 +100,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
|
||||
if(m_scenes.ContainsKey(scene))
|
||||
{
|
||||
m_scenes[scene].RegionLoaded();
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
* ODEDynamics.cs contains methods dealing with Prim Physical motion
|
||||
* (dynamics) and the associated settings. Old Linear and angular
|
||||
* motors for dynamic motion have been replace with MoveLinear()
|
||||
* and MoveAngular(); 'Physical' is used only to switch ODE dynamic
|
||||
* and MoveAngular(); 'Physical' is used only to switch ODE dynamic
|
||||
* simualtion on/off; VEHICAL_TYPE_NONE/VEHICAL_TYPE_<other> is to
|
||||
* switch between 'VEHICLE' parameter use and general dynamics
|
||||
* settings use.
|
||||
@@ -107,7 +107,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
private float m_targetHoverHeight;
|
||||
private float m_groundHeight;
|
||||
private float m_waterHeight;
|
||||
private float m_buoyancy; //KF: m_buoyancy should be set by llSetBuoyancy() for non-vehicle.
|
||||
private float m_buoyancy; //KF: m_buoyancy should be set by llSetBuoyancy() for non-vehicle.
|
||||
|
||||
private int body_autodisable_frames;
|
||||
public int bodydisablecontrol = 0;
|
||||
@@ -143,7 +143,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
private UUID? m_assetID;
|
||||
private MeshState m_meshState;
|
||||
|
||||
|
||||
public ODEScene _parent_scene;
|
||||
|
||||
/// <summary>
|
||||
@@ -888,7 +888,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
m_lastVelocity = _velocity;
|
||||
if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE)
|
||||
m_vehicle.Stop();
|
||||
m_vehicle.Stop();
|
||||
|
||||
if(Body != IntPtr.Zero)
|
||||
d.BodySetLinearVel(Body, 0, 0, 0); // stop it
|
||||
@@ -980,7 +980,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
{
|
||||
// m_log.DebugFormat("[axislock]: <{0},{1},{2}>", axis.X, axis.Y, axis.Z);
|
||||
AddChange(changes.AngLock, axislock);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void SubscribeEvents(int ms)
|
||||
@@ -1464,7 +1464,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
IntPtr vertices, indices;
|
||||
int vertexCount, indexCount;
|
||||
int vertexStride, triStride;
|
||||
|
||||
|
||||
IMesh mesh = m_mesh;
|
||||
|
||||
if (mesh == null)
|
||||
@@ -1529,7 +1529,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
m_OBB = _size * 0.5f;
|
||||
m_physCost = 0.1f;
|
||||
m_streamCost = 1.0f;
|
||||
|
||||
|
||||
_parent_scene.mesher.ReleaseMesh(mesh);
|
||||
m_meshState = MeshState.MeshFailed;
|
||||
m_mesh = null;
|
||||
@@ -1830,7 +1830,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
if (childrenPrim.Count == 0)
|
||||
{
|
||||
collide_geom = prim_geom;
|
||||
m_targetSpace = _parent_scene.ActiveSpace;
|
||||
m_targetSpace = _parent_scene.ActiveSpace;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1911,7 +1911,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
d.BodySetLinearVel(Body, _velocity.X, _velocity.Y, _velocity.Z);
|
||||
_zeroFlag = false;
|
||||
bodydisablecontrol = 0;
|
||||
}
|
||||
}
|
||||
_parent_scene.addActiveGroups(this);
|
||||
}
|
||||
|
||||
@@ -2011,7 +2011,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
d.Matrix3 mat = new d.Matrix3();
|
||||
d.Quaternion quat = new d.Quaternion();
|
||||
|
||||
d.Mass tmpdmass = new d.Mass { };
|
||||
d.Mass tmpdmass = new d.Mass { };
|
||||
d.Mass objdmass = new d.Mass { };
|
||||
|
||||
d.BodyGetMass(Body, out tmpdmass);
|
||||
@@ -2039,7 +2039,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
// subtract current prim inertia from object
|
||||
DMassSubPartFromObj(ref tmpdmass, ref objdmass);
|
||||
|
||||
// back prim own inertia
|
||||
// back prim own inertia
|
||||
tmpdmass = primdMass;
|
||||
|
||||
// update to new position and orientation
|
||||
@@ -2444,7 +2444,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
MakeBody();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region changes
|
||||
|
||||
private void changeadd()
|
||||
@@ -3011,7 +3011,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
primVolume = repData.volume;
|
||||
|
||||
CreateGeom();
|
||||
CreateGeom();
|
||||
|
||||
if (prim_geom != IntPtr.Zero)
|
||||
{
|
||||
@@ -3145,7 +3145,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z);
|
||||
}
|
||||
//resetCollisionAccounting();
|
||||
//resetCollisionAccounting();
|
||||
}
|
||||
_velocity = newVel;
|
||||
}
|
||||
@@ -3171,7 +3171,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
d.BodySetAngularVel(Body, newAngVel.X, newAngVel.Y, newAngVel.Z);
|
||||
}
|
||||
//resetCollisionAccounting();
|
||||
//resetCollisionAccounting();
|
||||
}
|
||||
m_rotationalVelocity = newAngVel;
|
||||
}
|
||||
@@ -3316,7 +3316,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
// let vehicles sleep
|
||||
if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE)
|
||||
return;
|
||||
|
||||
|
||||
if (++bodydisablecontrol < 50)
|
||||
return;
|
||||
|
||||
@@ -3414,7 +3414,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
break;
|
||||
} // end switch (m_PIDHoverType)
|
||||
|
||||
// don't go underground unless volumedetector
|
||||
// don't go underground unless volumedetector
|
||||
|
||||
if (m_targetHoverHeight > m_groundHeight || m_isVolumeDetect)
|
||||
{
|
||||
@@ -3526,7 +3526,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
d.BodySetLinearVel(Body, 0, 0, 0); // stop it
|
||||
d.BodySetAngularVel(Body, 0, 0, 0); // stop it
|
||||
d.BodySetPosition(Body, lpos.X, lpos.Y, lpos.Z); // put it somewhere
|
||||
d.BodySetPosition(Body, lpos.X, lpos.Y, lpos.Z); // put it somewhere
|
||||
m_lastposition = _position;
|
||||
m_lastorientation = _orientation;
|
||||
|
||||
@@ -3635,7 +3635,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
_orientation.X = ori.X;
|
||||
_orientation.Y = ori.Y;
|
||||
_orientation.Z = ori.Z;
|
||||
_orientation.W = ori.W;
|
||||
_orientation.W = ori.W;
|
||||
}
|
||||
|
||||
// update velocities and aceleration
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CurrentRayFilter = req.filter;
|
||||
CurrentMaxCount = req.Count;
|
||||
|
||||
@@ -279,7 +279,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
/// Method that actually initiates the raycast with spaces
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
///
|
||||
///
|
||||
|
||||
private void NoContacts(ODERayRequest req)
|
||||
{
|
||||
@@ -488,7 +488,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
newcontactgeom = (d.ContactGeom)Marshal.PtrToStructure(contactptr, typeof(d.ContactGeom));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// This is the standard Near. g1 is the ray
|
||||
private void near(IntPtr space, IntPtr g1, IntPtr g2)
|
||||
{
|
||||
@@ -530,7 +530,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
uint col1 = d.GeomGetCollideBits(g1);
|
||||
uint col2 = d.GeomGetCollideBits(g2);
|
||||
*/
|
||||
|
||||
|
||||
uint ID = 0;
|
||||
PhysicsActor p2 = null;
|
||||
|
||||
@@ -671,7 +671,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
{
|
||||
d.GeomDestroy(Plane);
|
||||
Plane = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
light = 7 // compatibility with old viewers
|
||||
}
|
||||
|
||||
|
||||
public enum changes : int
|
||||
{
|
||||
Add = 0, // arg null. finishs the prim creation. should be used internally only ( to remove later ?)
|
||||
@@ -182,7 +182,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
const float comumContactERP = 0.75f;
|
||||
const float comumContactCFM = 0.0001f;
|
||||
const float comumContactSLIP = 0f;
|
||||
|
||||
|
||||
float frictionMovementMult = 0.8f;
|
||||
|
||||
float TerrainBounce = 0.1f;
|
||||
@@ -241,7 +241,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
/// </summary>
|
||||
private List<PhysicsActor> _collisionEventPrim = new List<PhysicsActor>();
|
||||
private List<PhysicsActor> _collisionEventPrimRemove = new List<PhysicsActor>();
|
||||
|
||||
|
||||
private HashSet<OdeCharacter> _badCharacter = new HashSet<OdeCharacter>();
|
||||
public Dictionary<IntPtr, PhysicsActor> actor_name_map = new Dictionary<IntPtr, PhysicsActor>();
|
||||
|
||||
@@ -262,7 +262,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
private IntPtr TerrainGeom;
|
||||
private float[] TerrainHeightFieldHeight;
|
||||
private GCHandle TerrainHeightFieldHeightsHandler = new GCHandle();
|
||||
|
||||
|
||||
private int m_physicsiterations = 15;
|
||||
private const float m_SkipFramesAtms = 0.40f; // Drop frames gracefully at a 400 ms lag
|
||||
// private PhysicsActor PANull = new NullPhysicsActor();
|
||||
@@ -330,7 +330,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
EngineType = pname;
|
||||
PhysicsSceneName = EngineType + "/" + pscene.RegionInfo.RegionName;
|
||||
EngineName = pname + " " + pversion;
|
||||
m_config = psourceconfig;
|
||||
m_config = psourceconfig;
|
||||
m_OSOdeLib = pOSOdeLib;
|
||||
|
||||
// m_OSOdeLib = false; //debug
|
||||
@@ -343,7 +343,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
base.Initialise(m_frameWorkScene.PhysicsRequestAsset,
|
||||
(m_frameWorkScene.Heightmap != null ? m_frameWorkScene.Heightmap.GetFloatsSerialised() : new float[m_frameWorkScene.RegionInfo.RegionSizeX * m_frameWorkScene.RegionInfo.RegionSizeY]),
|
||||
(float)m_frameWorkScene.RegionInfo.RegionSettings.WaterHeight);
|
||||
(float)m_frameWorkScene.RegionInfo.RegionSettings.WaterHeight);
|
||||
}
|
||||
|
||||
public void RegionLoaded()
|
||||
@@ -354,7 +354,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
m_log.ErrorFormat("[ubOde] No mesher. module disabled");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
m_meshWorker = new ODEMeshWorker(this, m_log, mesher, physicsconfig);
|
||||
m_frameWorkScene.PhysicsEnabled = true;
|
||||
}
|
||||
@@ -394,7 +394,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
}
|
||||
catch
|
||||
{
|
||||
// i must RtC#FM
|
||||
// i must RtC#FM
|
||||
// i did!
|
||||
}
|
||||
|
||||
@@ -674,7 +674,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
/// <param name="space">The space that contains the geoms. Remember, spaces are also geoms</param>
|
||||
/// <param name="g1">a geometry or space</param>
|
||||
/// <param name="g2">another geometry or space</param>
|
||||
///
|
||||
///
|
||||
|
||||
private void near(IntPtr space, IntPtr g1, IntPtr g2)
|
||||
{
|
||||
@@ -784,7 +784,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
if (count == 0)
|
||||
return;
|
||||
|
||||
// try get physical actors
|
||||
// try get physical actors
|
||||
PhysicsActor p1;
|
||||
PhysicsActor p2;
|
||||
|
||||
@@ -1135,10 +1135,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
chr.IsColliding = false;
|
||||
// chr.CollidingGround = false; not done here
|
||||
chr.CollidingObj = false;
|
||||
|
||||
|
||||
if(chr.Body == IntPtr.Zero || chr.collider == IntPtr.Zero )
|
||||
continue;
|
||||
|
||||
|
||||
// do colisions with static space
|
||||
d.SpaceCollide2(chr.collider, StaticSpace, IntPtr.Zero, nearCallback);
|
||||
|
||||
@@ -1160,7 +1160,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
foreach (OdePrim aprim in _activeprims)
|
||||
{
|
||||
aprim.CollisionScore = 0;
|
||||
aprim.IsColliding = false;
|
||||
aprim.IsColliding = false;
|
||||
}
|
||||
}
|
||||
lock (_activegroups)
|
||||
@@ -1170,7 +1170,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
foreach (OdePrim aprim in _activegroups)
|
||||
{
|
||||
if(!aprim.m_outbounds && d.BodyIsEnabled(aprim.Body) &&
|
||||
aprim.collide_geom != IntPtr.Zero)
|
||||
aprim.collide_geom != IntPtr.Zero)
|
||||
{
|
||||
d.SpaceCollide2(StaticSpace, aprim.collide_geom, IntPtr.Zero, nearCallback);
|
||||
d.SpaceCollide2(GroundSpace, aprim.collide_geom, IntPtr.Zero, nearCallback);
|
||||
@@ -1251,7 +1251,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
size, feetOffset, avDensity, avMovementDivisorWalk, avMovementDivisorRun);
|
||||
newAv.Flying = isFlying;
|
||||
newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset;
|
||||
|
||||
|
||||
return newAv;
|
||||
}
|
||||
|
||||
@@ -1301,7 +1301,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
public void addActivePrim(OdePrim activatePrim)
|
||||
{
|
||||
// adds active prim..
|
||||
// adds active prim..
|
||||
lock (_activeprims)
|
||||
{
|
||||
if (!_activeprims.Contains(activatePrim))
|
||||
@@ -1324,7 +1324,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
OdePrim newPrim;
|
||||
lock (OdeLock)
|
||||
{
|
||||
|
||||
|
||||
newPrim = new OdePrim(name, this, position, size, rotation, pbs, isphysical, isPhantom, shapeType, localID);
|
||||
}
|
||||
return newPrim;
|
||||
@@ -1372,7 +1372,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
{
|
||||
// lock (OdeLock)
|
||||
{
|
||||
|
||||
|
||||
OdePrim p = (OdePrim)prim;
|
||||
p.setPrimForRemoval();
|
||||
}
|
||||
@@ -1423,7 +1423,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
_prims[prim.LocalID] = prim;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool haveActor(PhysicsActor actor)
|
||||
{
|
||||
if (actor is OdePrim)
|
||||
@@ -1531,14 +1531,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
x = (int)(pos.X * spacesPerMeterX);
|
||||
if (x > spaceGridMaxX)
|
||||
return staticPrimspaceOffRegion[1];
|
||||
|
||||
|
||||
y = (int)(pos.Y * spacesPerMeterY);
|
||||
if (y > spaceGridMaxY)
|
||||
return staticPrimspaceOffRegion[3];
|
||||
|
||||
return staticPrimspace[x, y];
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1628,7 +1628,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
TimeSpan timedif = now - m_lastframe;
|
||||
float timeStep = (float)timedif.TotalSeconds;
|
||||
m_lastframe = now;
|
||||
|
||||
|
||||
// acumulate time so we can reduce error
|
||||
step_time += timeStep;
|
||||
|
||||
@@ -1654,7 +1654,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
}
|
||||
|
||||
ODEchangeitem item;
|
||||
|
||||
|
||||
// d.WorldSetQuickStepNumIterations(world, curphysiteractions);
|
||||
|
||||
int loopstartMS = Util.EnvironmentTickCount();
|
||||
@@ -1662,9 +1662,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
int changestimeMS = 0;
|
||||
int maxChangestime = (int)(reqTimeStep * 500f); // half the time
|
||||
int maxLoopTime = (int)(reqTimeStep * 1200f); // 1.2 the time
|
||||
|
||||
|
||||
d.AllocateODEDataForThread(~0U);
|
||||
|
||||
|
||||
if (ChangesQueue.Count > 0)
|
||||
{
|
||||
while (ChangesQueue.Dequeue(out item))
|
||||
@@ -1726,7 +1726,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
aprim.Move();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
m_rayCastManager.ProcessQueuedRequests();
|
||||
|
||||
collision_optimized();
|
||||
@@ -1750,7 +1750,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
{
|
||||
pobj.SendCollisions((int)(odetimestepMS));
|
||||
if(pobj.Body != IntPtr.Zero && !pobj.m_isSelected &&
|
||||
!pobj.m_disabled && !pobj.m_building &&
|
||||
!pobj.m_disabled && !pobj.m_building &&
|
||||
!d.BodyIsEnabled(pobj.Body))
|
||||
sleepers.Add(pobj);
|
||||
}
|
||||
@@ -1900,7 +1900,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix);
|
||||
}
|
||||
|
||||
|
||||
fps = (float)nodeframes * ODE_STEPSIZE / reqTimeStep;
|
||||
|
||||
if(step_time < HalfOdeStep)
|
||||
@@ -2166,7 +2166,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
h0 = (float)heights[iy]; // 0,1
|
||||
h2 = (float)heights[iy+xstep]; // 1,1 vertice
|
||||
norm.X = h0 - h2;
|
||||
norm.Y = h1 - h0;
|
||||
norm.Y = h1 - h0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2214,7 +2214,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
const float thickness = 10f;
|
||||
const int wrap = 0;
|
||||
|
||||
|
||||
|
||||
float hfmin = float.MaxValue;
|
||||
float hfmax = float.MinValue;
|
||||
float val;
|
||||
@@ -2503,7 +2503,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
|
||||
orderedPrims.Sort(compareByCollisionsDesc);
|
||||
topColliders = orderedPrims.Take(25).ToDictionary(p => p.LocalID, p => p.CollisionScore);
|
||||
|
||||
|
||||
return topColliders;
|
||||
}
|
||||
|
||||
@@ -2546,7 +2546,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override List<ContactResult> RaycastWorld(Vector3 position, Vector3 direction, float length, int Count)
|
||||
{
|
||||
List<ContactResult> ourresults = new List<ContactResult>();
|
||||
|
||||
Reference in New Issue
Block a user