mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 18:25:33 +08:00
* This is a very icky implementation of physical linkset prim using fixed joints. This will change quite drastically, however it's fun to play with.
* To play with this you must link your prim before setting it physical, otherwise they won't link in the physics engine properly. This will also be fixed. * Currently the linked prim are extremely unstable because I have yet to implement combining of forces with the same normal. This will also be fixed. In fact, the whole PhysicsActor, ODEPrim relationship will be reworked to consider groups from the get-go. * This implementation is better then it crashing your sim, so I'm commiting it for now.
This commit is contained in:
@@ -120,8 +120,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
private int m_update_physics = 1;
|
||||
private int m_update_entitymovement = 1;
|
||||
private int m_update_entities = 20; // Run through all objects checking for updates
|
||||
private int m_update_entitiesquick = 1; // Run through objects that have scheduled updates checking for updates
|
||||
private int m_update_entities = 1; // Run through all objects checking for updates
|
||||
private int m_update_entitiesquick = 200; // Run through objects that have scheduled updates checking for updates
|
||||
private int m_update_presences = 1; // Update scene presence movements
|
||||
private int m_update_events = 1;
|
||||
private int m_update_backup = 200;
|
||||
|
||||
@@ -1758,10 +1758,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
lock (m_parts)
|
||||
{
|
||||
m_rootPart.ApplyPhysics(m_rootPart.ObjectFlags, m_physicalPrim);
|
||||
foreach (SceneObjectPart part in m_parts.Values)
|
||||
{
|
||||
part.ApplyPhysics(m_rootPart.ObjectFlags, m_physicalPrim);
|
||||
|
||||
if (part.LocalID != m_rootPart.LocalID)
|
||||
{
|
||||
part.ApplyPhysics(m_rootPart.ObjectFlags, m_physicalPrim);
|
||||
}
|
||||
// Hack to get the physics scene geometries in the right spot
|
||||
ResetChildPrimPhysicsPositions();
|
||||
|
||||
|
||||
@@ -1306,9 +1306,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
PhysActor.OnRequestTerseUpdate -= PhysicsRequestingTerseUpdate;
|
||||
PhysActor.OnOutOfBounds -= PhysicsOutOfBounds;
|
||||
PhysActor.delink();
|
||||
}
|
||||
|
||||
PhysActor.IsPhysical = UsePhysics;
|
||||
|
||||
|
||||
// If we're not what we're supposed to be in the physics scene, recreate ourselves.
|
||||
//m_parentGroup.Scene.PhysicsScene.RemovePrim(PhysActor);
|
||||
/// that's not wholesome. Had to make Scene public
|
||||
@@ -1331,6 +1334,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
PhysActor.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate;
|
||||
PhysActor.OnOutOfBounds += PhysicsOutOfBounds;
|
||||
if (ParentID != 0 && ParentID != LocalID)
|
||||
{
|
||||
if (ParentGroup.RootPart.PhysActor != null)
|
||||
{
|
||||
PhysActor.link(ParentGroup.RootPart.PhysActor);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user