mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
Mantis#2796. Thank you kindly, Gerhard for a patch that addresses:
On a call of llVolumeDetect(1) (or any other number !=0) volume detection is enabled. Together with VD, the phantom flag is set to the GUI. On a call of llVolumeDetect(0), vd detection is switched of again, also the phantom state is removed. On a call to llSetState(STATE_PHANTOM, false) while VD is active, also VD is switched off. The same is true for unchecking the phantom flag via GUI. This allows to take back VD without the need to script just by removing the phantom flag. Things missing in this patch: persistance of the volume-detection flag. This needs more discussion and will be included in another patch soon.
This commit is contained in:
@@ -127,6 +127,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
private bool m_isphysical = false;
|
||||
private bool m_isSelected = false;
|
||||
|
||||
internal bool m_isVolumeDetect = false; // If true, this prim only detects collisions but doesn't collide actively
|
||||
|
||||
private bool m_throttleUpdates = false;
|
||||
private int throttleCounter = 0;
|
||||
public int m_interpenetrationcount = 0;
|
||||
@@ -2226,7 +2228,10 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
public override void SetVolumeDetect(int param)
|
||||
{
|
||||
|
||||
lock (_parent_scene.OdeLock)
|
||||
{
|
||||
m_isVolumeDetect = (param!=0);
|
||||
}
|
||||
}
|
||||
|
||||
public override PhysicsVector CenterOfMass
|
||||
|
||||
@@ -797,7 +797,25 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
#endregion
|
||||
|
||||
if (contacts[i].depth >= 0f && !checkDupe(contacts[i], p2.PhysicsActorType))
|
||||
// Logic for collision handling
|
||||
// Note, that if *all* contacts are skipped (VolumeDetect)
|
||||
// The prim still detects (and forwards) collision events but
|
||||
// appears to be phantom for the world
|
||||
Boolean skipThisContact = false;
|
||||
|
||||
if (contacts[i].depth < 0f)
|
||||
skipThisContact = true;
|
||||
|
||||
if (checkDupe(contacts[i], p2.PhysicsActorType))
|
||||
skipThisContact = true;
|
||||
|
||||
if ((p1 is OdePrim) && (((OdePrim)p1).m_isVolumeDetect))
|
||||
skipThisContact = true; // No collision on volume detect prims
|
||||
|
||||
if ((p2 is OdePrim) && (((OdePrim)p2).m_isVolumeDetect))
|
||||
skipThisContact = true; // No collision on volume detect prims
|
||||
|
||||
if (!skipThisContact)
|
||||
{
|
||||
// If we're colliding against terrain
|
||||
if (name1 == "Terrain" || name2 == "Terrain")
|
||||
|
||||
Reference in New Issue
Block a user