aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs (unfollow)
Commit message (Collapse)AuthorFilesLines
2011-11-05Fix avatar height, removes the hip offset hacknebadon1-3/+0
Author: Mana Janus <mana@mjm-labs.com>
2011-11-05refactor: In sit code, compare against Vector3.Zero and Quaternion.Identity ↵Justin Clark-Casey (justincc)1-12/+12
instead of individual components of a vector/quat
2011-11-05Fix NPC sitting for prims without a sit target.Justin Clark-Casey (justincc)1-9/+11
This is to partially address http://opensimulator.org/mantis/view.php?id=5769 We don't need to call SP.HandleAgentSit() again if we are within 10m since the autopilot won't trigger. By calling it twice, the position of the sitting NPC was wrongly adjusted, ending up near <0,0,0>. However, this change does mean that NPCs further than 10m away will not attempt to autopilot to the prim, though this code was broken anyway (is actually a different mechanism to normal NPC movmeent). Hopefully this can be addressed soon.
2011-11-04On standup, trigger the changed link script event after the avatar has been ↵Justin Clark-Casey (justincc)1-2/+3
fully changed. This was meant to help with the script in http://opensimulator.org/mantis/view.php?id=5772 but it doesn't work. Probably the event is fired before the physics actor has been set up again for the stood avatar. Fixing that would be much more complicated, but processing the event last of all seems like a good idea in any case.
2011-11-03Rename ForEachAvatar back to ForEachScenePresence. The other changesDan Lake1-3/+3
from previous commit which sort out which iterator is used are left intact. A discussion is needed as to what constitutes an avatar vs a ScenePresence.
2011-11-03Renamed ForEachRootScenePresence to ForEachAvatar. Cleaned up calls toDan Lake1-3/+3
the 3 iteration functions so more of them are using the correct iteration for the action they are performing. The 3 iterators that seem to fit all actions within OpenSim at this time are: ForEachAvatar: Perform an action on all avatars (root presences) ForEachClient: Perform an action on all clients (root or child clients) ForEachRootClient: Perform an action on all clients that have an avatar There are still a dozen places or so calling the old ForEachScenePresence that will take a little more refactoring to eliminate.
2011-11-02Changes UpdateFlag in SOP to an enumeration of NONE, TERSE and FULL.Dan Lake1-1/+1
UpdateFlag is now referenced/used only within SOP and SOG. Outsiders are using ScheduleFullUpdate, ScheduleTerseUpdate or ClearUpdateSchedule on SOP consistently now. Also started working toward eliminating those calls to ScheduleFullUpdate, ScheduleTerseUpdate or ClearUpdateSchedule from outside SOP in favor of just setting properties on SOP and let SOP decide if an update should be scheduled. This consolidates the update policy within SOP and the client rather than everywhere that makes changes to SOP. Some places forget to call update while others call it multiple times, "just to be sure". UpdateFlag and Schedule*Update will both be made private shortly. UpdateFlag is intended to be transient and internal to SOP so it has been removed from XML serializer for SOPs.
2011-11-02Fix race condition that would sometimes send or save appearance for the ↵Justin Clark-Casey (justincc)1-2/+3
wrong avatar. In AvatarFactoryModule.HandleAppearanceUpdateTimer(), we loop through appearance save and send requests and dispatch via a FireAndForget thread. If there was more than one request in the save or send queue, then this led to a subtle race condition where the foreach loop would load in the next KeyValuePair before the thread was dispatched. This gave the thread the wrong avatar ID, leaving some avatar appearance cloudy since appearance data was never sent. This change loads the fields into local references so that this doesn't happen.
2011-11-01Add "appearance send" command to allow manual sending of appearance.Justin Clark-Casey (justincc)1-3/+3
2011-10-29Remove the SyncRoot locking from Scene which was only being done around the ↵Justin Clark-Casey (justincc)1-4/+2
main physics loop and ScenePresence position and velocity setting This is no longer necessary with ODECharacter taints (ODEPrim was already not taking part in this). BSCharacter was already tainting.
2011-10-28fetch SOP.RotationOffset once in UpdateRotation() and compare rather than ↵Justin Clark-Casey (justincc)1-1/+1
fetch four separate times. No functional change.
2011-10-27Continuation of previous checkin. Found more places where ↵Dan Lake1-30/+23
ForEachScenePresence can be changed to ForEachRootScenePresence.
2011-10-25Get rid of the pointless null checks on collision listeners. Add warning ↵Justin Clark-Casey (justincc)1-3/+0
about synchronicity for PhysicsActor.OnCollisionUpdate event doc
2011-10-19Removed redundant NotInTransit function from ScenePresence. ↵Dan Lake1-5/+0
IsInTransit=false does the same thing and NotInTransit was not used anywhere.
2011-10-19Moved HaveNeighbor utility function from ScenePresence to Scene. Fixed line ↵Dan Lake1-48/+8
endings from previous commit.
2011-10-19Renamed and rearranged AvatarFactoryModule to eliminate redundant lookups of ↵Dan Lake1-1/+1
scene presence by client ID.
2011-10-17refactor: Use SOP.SitTargetAvatar instead of calling a special ↵Justin Clark-Casey (justincc)1-5/+6
GetAvatarOnSitTarget() which returned exactly the same thing
2011-10-17Implement osNpcSit(). This is still in development so don't trust itJustin Clark-Casey (justincc)1-3/+4
Format is osNpcSit(<npc-uuid>, <target-uuid>, OS_NPC_SIT_IMMEDIATE) e.g. osNpcSit(npc, llGetKey(), OS_NPC_SIT_IMMEDIATE); At the moment, sit only succeeds if the part has a sit target set. NPC immediately sits on the target even if miles away - they do not walk up to it. This method is in development - it may change so please don't trust it yet. Standing will follow shortly since that's kind of important once you're sitting :)
2011-10-14refactor: rename IClientAPI.SendPrimUpdate() to SendEntityUpdate() since it ↵Justin Clark-Casey (justincc)1-1/+1
sends entity updates (including presence ones), not just prims.
2011-10-12remove some mono compiler warningsJustin Clark-Casey (justincc)1-7/+0
2011-10-07Comment out [SCENE PRESENCE] SendAppearanceToAllOtherAgents: log messageJustin Clark-Casey (justincc)1-1/+1
As per earlier discussions with dslake
2011-10-06Fixed line endings from previous commitDan Lake1-47/+47
2011-10-06Refactored "known child region" in ScenePresence. There were 4 differentDan Lake1-67/+67
ways to access the list/dictionary of child regions and locking was inconsistent. There are now public properties which enforce locks. Callers are no longer required to create new copies of lists.
2011-10-06Simplified IsInTransit property on ScenePresence and removed InTransit() ↵Dan Lake1-11/+10
which called IsInTransit=true which called m_inTransit=true. Also removed NotInTransit().
2011-10-06Refactor ScenePresence so gets and sets are through properties. Added ↵Dan Lake1-287/+288
private sets when needed. Removed redundant code when methods replicated what the set already does
2011-10-06Instead of adding stat agentMS in all kinds of places, calculate it instead ↵Justin Clark-Casey (justincc)1-29/+3
in the main Scene.Update() loop, like the other stats Some of the places where agentMS was added were in separate threads launched by the update loop. I don't believe this is correct, since such threads are no longer contributing to frame time. Some of the places were also driven by client input rather than the scene loop. I don't believe it's appropriate to add this kind of stuff to scene loop stats. These changes hopefully have the nice affect of making the broken out frame stats actually add up to the total frame time
2011-10-01Remove unimplementated UpdateMovement() methods from SOG, SOP.Justin Clark-Casey (justincc)1-1/+1
SP still has an implementation but this is now just a public method on SP rather than an abstract one in EntityBase. No point making the code more complex until it actually needs to be,
2011-09-21Commented out new debug statements in ScenePresenceDan Lake1-5/+5
2011-09-22Reinstate option to land an npc when it reaches a target.Justin Clark-Casey (justincc)1-1/+10
This is moved into ScenePresence for now as a general facility
2011-09-21Remove unused and never set SP.PreviousRotationJustin Clark-Casey (justincc)1-8/+0
2011-09-21get rid of an incredibly noisy logging message from the last commitJustin Clark-Casey (justincc)1-1/+1
2011-09-21When calling osNpcMoveTo(), rotate the avatar in the direction of travel.Justin Clark-Casey (justincc)1-2/+21
This stops the npc walking backwards if the target is directly behind. This means that the npc no longer returns to its original rotation once movement has finished. If you want this behaviour, please store and reset the original rotation after movement. This is somewhat to address http://opensimulator.org/mantis/view.php?id=5678
2011-09-20Make debug statements in ScenePresence consistent and add a few moreDan Lake1-10/+14
2011-09-17On setting a new avatar appearance, if height hasn't changed then don't set ↵Justin Clark-Casey (justincc)1-0/+4
that same height in ScenePresence. This prevents unnecessary work in the ODE module, though possibly that should be checking against same size sets itself
2011-09-16Stop the avatar stalling on its first boarder cross when using the ODE pluginJustin Clark-Casey (justincc)1-0/+10
When upgrading the previously child agent to a root, the code was setting the Size parameter on the ODECharacter PhysicsActor. This in turn reset Velocity, which cause the border stall. I'm fixing this by commenting out the Velocity = Vector3.Zero lines since they don't appear to play a useful purpose
2011-09-16minor: I was wrong about OffsetPosition - sometimes it genuinely does return ↵Justin Clark-Casey (justincc)1-0/+4
offset position! Add method doc to explain this.
2011-09-16Remove setter from SP.OffsetPosition, since all sets should flow through ↵Justin Clark-Casey (justincc)1-3/+14
SP.AbsolutePosition OffsetPosition is also misnamed - it returns the absolute position and never contains an offset.
2011-09-13Don't try and delete attachments for child agent closeJustin Clark-Casey (justincc)1-1/+2
2011-09-12eliminate redundant SP.m_regionInfo since it always has the scene.Justin Clark-Casey (justincc)1-8/+6
We were already referencing through the scene in some places.
2011-09-12remove the unused SP.initializeScenePresence()Justin Clark-Casey (justincc)1-23/+2
2011-09-12stop the redundant passing in of RegionInfo to SceneGraph, since the Scene ↵Justin Clark-Casey (justincc)1-4/+4
is always passed in at the same time.
2011-09-12Start locking entire add/remove operations on an ↵Justin Clark-Casey (justincc)1-0/+4
IScenePresence.AttachmentsSyncLock object Attach and detach packets are processed asynchronously when received from a viewer. Bugs like http://opensimulator.org/mantis/view.php?id=5644 indicate that in some situations (such as attaching/detaching entire folders of objects at once), there are race conditions between these threads. Since multiple data structures need to be updated on attach/detach, it's not enough to lock the individual collections. Therefore, this commit introduces a new IScenePresence.AttachmentsSyncLock which add/remove operations lock on.
2011-09-10lock attachments when enumerating through them in ScenePresence.CopyTo().Justin Clark-Casey (justincc)1-20/+24
May have some effect on http://opensimulator.org/mantis/view.php?id=5644
2011-09-10Add extra log information when attachments fail validationJustin Clark-Casey (justincc)1-1/+9
2011-09-05Try disabling the inconsistent attachment state check to see if this ↵Justin Clark-Casey (justincc)1-9/+7
actually has an impact. The code in question is over three years old and just be catching an inconsistency rather than being wholly necessary. This commit still carries out the check and prints all the previous log warnings but a 'failure' no longer prevents avatar region crossing or teleport, and it doesn't give the client the error message. This will have some kind of impact on http://opensimulator.org/mantis/view.php?id=5672
2011-09-03Stop NPCs losing attachments when the source avatar takes them off.Justin Clark-Casey (justincc)1-3/+0
This was happening because we were using the source avatar's item IDs in the clone appearance. Switch to using the asset IDs of attachments instead for NPCs. The InventoryAccessModule and AttachmentModule had to be changed to allow rezzing of an object without an associated inventory item. Hopefully goes some way towards resolving http://opensimulator.org/mantis/view.php?id=5653
2011-08-31move common code into AttachmentsModule.DeleteAttachmentsFromScene()Justin Clark-Casey (justincc)1-13/+1
2011-08-31refactor: move multiple class to set avatar height into associated ↵Justin Clark-Casey (justincc)1-16/+2
SP.AddToPhysicalScene()
2011-08-31get rid of appearance null checks - this is never nullJustin Clark-Casey (justincc)1-35/+15
2011-08-31remove pointless m_attachments == null check since this field is never nullJustin Clark-Casey (justincc)1-1/+1