Restrict accessible of ODECharacter Shell and Body. Add method doc and some error log lines.
parent
71b11f557d
commit
356e8516f0
|
@ -135,10 +135,19 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
| CollisionCategories.Body
|
||||
| CollisionCategories.Character
|
||||
| CollisionCategories.Land);
|
||||
internal IntPtr Body = IntPtr.Zero;
|
||||
/// <summary>
|
||||
/// Body for dynamics simulation
|
||||
/// </summary>
|
||||
internal IntPtr Body { get; private set; }
|
||||
|
||||
private OdeScene _parent_scene;
|
||||
internal IntPtr Shell = IntPtr.Zero;
|
||||
internal IntPtr Amotor = IntPtr.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// Collision geometry
|
||||
/// </summary>
|
||||
internal IntPtr Shell { get; private set; }
|
||||
|
||||
private IntPtr Amotor = IntPtr.Zero;
|
||||
private d.Mass ShellMass;
|
||||
|
||||
private int m_eventsubscription = 0;
|
||||
|
@ -1024,6 +1033,13 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
/// <param name="tensor"></param>
|
||||
private void CreateOdeStructures(float npositionX, float npositionY, float npositionZ, float tensor)
|
||||
{
|
||||
if (!(Shell == IntPtr.Zero && Body == IntPtr.Zero && Amotor == IntPtr.Zero))
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[ODE CHARACTER]: Creating ODE structures for {0} even though some already exist. Shell = {1}, Body = {2}, Amotor = {3}",
|
||||
Name, Shell, Body, Amotor);
|
||||
}
|
||||
|
||||
int dAMotorEuler = 1;
|
||||
// _parent_scene.waitForSpaceUnlock(_parent_scene.space);
|
||||
if (CAPSULE_LENGTH <= 0)
|
||||
|
@ -1141,6 +1157,14 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
/// </summary>
|
||||
internal void DestroyOdeStructures()
|
||||
{
|
||||
// Create avatar capsule and related ODE data
|
||||
if (Shell == IntPtr.Zero || Body == IntPtr.Zero || Amotor == IntPtr.Zero)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[ODE CHARACTER]: Destroying ODE structures for {0} even though some are already null. Shell = {1}, Body = {2}, Amotor = {3}",
|
||||
Name, Shell, Body, Amotor);
|
||||
}
|
||||
|
||||
// destroy avatar capsule and related ODE data
|
||||
if (Amotor != IntPtr.Zero)
|
||||
{
|
||||
|
@ -1266,15 +1290,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
{
|
||||
if (m_tainted_isPhysical)
|
||||
{
|
||||
// Create avatar capsule and related ODE data
|
||||
if (!(Shell == IntPtr.Zero && Body == IntPtr.Zero && Amotor == IntPtr.Zero))
|
||||
{
|
||||
m_log.Warn("[ODE CHARACTER]: re-creating the following avatar ODE data for " + Name + ", even though it already exists - "
|
||||
+ (Shell!=IntPtr.Zero ? "Shell ":"")
|
||||
+ (Body!=IntPtr.Zero ? "Body ":"")
|
||||
+ (Amotor!=IntPtr.Zero ? "Amotor ":""));
|
||||
}
|
||||
|
||||
CreateOdeStructures(_position.X, _position.Y, _position.Z, m_tensor);
|
||||
_parent_scene.AddCharacter(this);
|
||||
}
|
||||
|
|
|
@ -1522,7 +1522,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
chr.CollidingGround = false;
|
||||
chr.CollidingObj = false;
|
||||
|
||||
// test the avatar's geometry for collision with the space
|
||||
// Test the avatar's geometry for collision with the space
|
||||
// This will return near and the space that they are the closest to
|
||||
// And we'll run this again against the avatar and the space segment
|
||||
// This will return with a bunch of possible objects in the space segment
|
||||
|
|
Loading…
Reference in New Issue