public override void RemoveAvatar(PhysicsCharacter actor) { BasicCharacterActor act = (BasicCharacterActor) actor; if (_actors.Contains(act)) { _actors.Remove(act); } }
/// <summary> /// Removes physics plugin scene representation of this agent if it exists. /// </summary> public void RemoveFromPhysicalScene() { try { if (PhysicsActor != null) { if (OnRemovePhysics != null) OnRemovePhysics(); if (m_physicsActor != null) m_scene.PhysicsScene.RemoveAvatar(m_physicsActor); if (m_physicsActor != null) m_physicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; if (m_physicsActor != null) m_physicsActor.OnRequestTerseUpdate -= SendPhysicsTerseUpdateToAllClients; if (m_physicsActor != null) m_physicsActor.OnSignificantMovement -= CheckForSignificantMovement; if (m_physicsActor != null) m_physicsActor.OnPositionAndVelocityUpdate -= PhysicsUpdatePosAndVelocity; if (m_physicsActor != null) m_physicsActor.OnCheckForRegionCrossing -= CheckForBorderCrossing; if (m_physicsActor != null) m_physicsActor.OnOutOfBounds -= OutOfBoundsCall; if (m_physicsActor != null) m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); if (m_physicsActor != null) m_physicsActor.UnSubscribeEvents(); m_physicsActor = null; } } catch { } }
public override void RemoveAvatar(PhysicsCharacter actor) { //MainConsole.Instance.Debug("[PHYSICS]:ODELOCK"); ((AuroraODECharacter) actor).Destroy(); }
/// <summary> /// Adds a physical representation of the avatar to the Physics plugin /// </summary> public void AddToPhysicalScene(bool isFlying, bool AddAvHeightToPosition) { //Make sure we arn't already doing this if (m_creatingPhysicalRepresentation) return; //Set this so we don't do it multiple times m_creatingPhysicalRepresentation = true; IAvatarAppearanceModule appearance = RequestModuleInterface<IAvatarAppearanceModule>(); if (appearance != null) { if (appearance.Appearance.AvatarHeight == 0) appearance.Appearance.SetHeight(); if (appearance.Appearance.AvatarHeight != 0) m_avHeight = appearance.Appearance.AvatarHeight; } PhysicsScene scene = m_scene.PhysicsScene; Vector3 pVec = AbsolutePosition; if (AddAvHeightToPosition) //This is here so that after teleports, you arrive just slightly higher so that you don't fall through the ground/objects pVec.Z += m_avHeight; m_physicsActor = scene.AddAvatar(Name, pVec, Rotation, new Vector3(0f, 0f, m_avHeight), isFlying, LocalId, UUID); scene.AddPhysicsActorTaint(m_physicsActor); m_physicsActor.OnRequestTerseUpdate += SendPhysicsTerseUpdateToAllClients; m_physicsActor.OnSignificantMovement += CheckForSignificantMovement; m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; m_physicsActor.OnPositionAndVelocityUpdate += PhysicsUpdatePosAndVelocity; m_physicsActor.OnCheckForRegionCrossing += CheckForBorderCrossing; m_physicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong m_physicsActor.SubscribeEvents(500); m_physicsActor.Orientation = Rotation; //Tell any events about it if (OnAddPhysics != null) OnAddPhysics(); //All done, reset this m_creatingPhysicalRepresentation = false; }
public override void RemoveAvatar(PhysicsCharacter actor) { }
public override void RemoveAvatar(PhysicsCharacter actor) { // MainConsole.Instance.DebugFormat("{0}: RemoveAvatar", LogHeader); if (actor is BSCharacter) ((BSCharacter) actor).Destroy(); try { lock (m_avatars) m_avatars.Remove(actor.LocalID); } catch (Exception e) { MainConsole.Instance.WarnFormat("{0}: Attempt to remove avatar that is not in physics scene: {1}", LogHeader, e); } }
public abstract void RemoveAvatar(PhysicsCharacter actor);
private void ResetAvatar(PhysicsCharacter physicsObject, PhysicsState physicsState, float direction) { physicsObject.Position = physicsState.Position; physicsObject.ForceSetPosition(physicsState.Position); physicsObject.Orientation = physicsState.Rotation; physicsObject.RotationalVelocity = physicsState.AngularVelocity*direction; physicsObject.Velocity = physicsState.LinearVelocity*direction; physicsObject.ForceSetVelocity(physicsState.LinearVelocity*direction); physicsObject.RequestPhysicsterseUpdate(); }
public void AddAvatar(PhysicsCharacter prm) { PhysicsState state = new PhysicsState { Position = prm.Position, AngularVelocity = prm.RotationalVelocity, LinearVelocity = prm.Velocity, Rotation = prm.Orientation }; m_activePrims[prm.UUID] = state; }