public AddForceCmd(PhysicsActor actor, OpenMetaverse.Vector3 force, OpenMetaverse.Vector3 forceOffset, ForceType type) { Actor = actor; Force = force; Type = type; ForceOffset = forceOffset; }
public override void AddPhysicsActorTaint(PhysicsActor prim) { }
public override void RemovePrim(PhysicsActor prim) { }
public override void RemoveAvatar(PhysicsActor actor) { }
public abstract void AddPhysicsActorTaint(PhysicsActor prim);
public virtual void RemoveAllJointsConnectedToActorThreadLocked(PhysicsActor actor) { return; }
/// <summary> /// Remove a prim. /// </summary> /// <param name="prim"></param> public abstract void RemovePrim(PhysicsActor prim);
private bool GetRootPhysActor(UUID hostID, out SceneObjectGroup containingGroup, out SceneObjectPart rootPart, out PhysicsActor rootPhysActor) { bool ret = false; rootPhysActor = null; containingGroup = null; rootPart = null; SceneObjectPart requestingPart; requestingPart = BaseScene.GetSceneObjectPart(hostID); if (requestingPart != null) { // The type is is always on the root of a linkset. containingGroup = requestingPart.ParentGroup; if (containingGroup != null && !containingGroup.IsDeleted) { rootPart = containingGroup.RootPart; if (rootPart != null) { rootPhysActor = rootPart.PhysActor; if (rootPhysActor != null) { ret = true; } else { m_log.WarnFormat("{0} GetRootAndChildPhysActors: Root part does not have a physics actor. rootName={1}, hostID={2}", LogHeader, rootPart.Name, hostID); } } else { m_log.WarnFormat("{0} GetRootAndChildPhysActors: Root part does not exist. RequestingPartName={1}, hostID={2}", LogHeader, requestingPart.Name, hostID); } } else { m_log.WarnFormat("{0} GetRootAndChildPhysActors: Containing group missing or deleted. hostID={1}", LogHeader, hostID); } } else { m_log.WarnFormat("{0} GetRootAndChildPhysActors: cannot find script object in scene. hostID={1}", LogHeader, hostID); } return ret; }
public override void link(PhysicsActor obj) { }
private void KickOrRideOnPrim(PhysX.ControllerShapeHit hit, PhysicsActor otherActor) { PhysxPrim otherPrimActor = (PhysxPrim)otherActor; //m_log.InfoFormat("dir: {0} {1} {2}", hit.Direction, hit.WorldNormal, hit.WorldPosition); float coeff; if (hit.Direction.Z != 0) { if (otherPrimActor.PhysxExtents.X > MIN_RIDEON_HALF_EXTENTS || otherPrimActor.PhysxExtents.Y > MIN_RIDEON_HALF_EXTENTS || otherPrimActor.PhysxExtents.Z > MIN_RIDEON_HALF_EXTENTS) { _rideOnBehavior.AvatarStandingOn(otherPrimActor); } else { _rideOnBehavior.AvatarNotStandingOnPrim(); } coeff = _mass * Math.Abs(Settings.Instance.Gravity) * MIN_TIMESTEP; } else { if (_rideOnBehavior.IsRideOnPrim(otherPrimActor)) { //dont kick the thing we're riding on coeff = 0; } else { //push the object out of the way at the appropriate rate const float OTHER_PUSH_MULT = 100.0f; coeff = _mass * hit.Length * OTHER_PUSH_MULT; } } //OpenMetaverse.Vector3.Negate(PhysUtil.PhysxVectorToOmv(hit.WorldNormal)) if (coeff != 0.0f) { OpenMetaverse.Vector3 hitVector = PhysUtil.PhysxVectorToOmv(hit.WorldPosition); if (hit.Direction.Z == 0) { //put the hit down the legs hitVector.Z -= _height / 3.0f; } otherActor.AddForceSync(PhysUtil.PhysxVectorToOmv(hit.Direction) * coeff, hitVector, ForceType.GlobalLinearImpulse); } }
public override void LinkToNewParent(PhysicsActor obj, OpenMetaverse.Vector3 localPos, OpenMetaverse.Quaternion localRot) { throw new NotImplementedException(); }
public abstract void AddPhysicsActorTaint(PhysicsActor prim, TaintType taint);
// Find the root and child PhysActors based on the linkNum. // Return 'true' if both are found and returned. private bool GetRootAndChildPhysActors(UUID hostID, int linkNum, out PhysicsActor rootPhysActor, out PhysicsActor childPhysActor) { bool ret = false; rootPhysActor = null; childPhysActor = null; SceneObjectGroup containingGroup; SceneObjectPart rootPart; if (GetRootPhysActor(hostID, out containingGroup, out rootPart, out rootPhysActor)) { SceneObjectPart linkPart = containingGroup.GetLinkNumPart(linkNum); if (linkPart != null) { childPhysActor = linkPart.PhysActor; if (childPhysActor != null) { ret = true; } else { m_log.WarnFormat("{0} GetRootAndChildPhysActors: Link part has no physical actor. rootName={1}, hostID={2}, linknum={3}", LogHeader, rootPart.Name, hostID, linkNum); } } else { m_log.WarnFormat("{0} GetRootAndChildPhysActors: Could not find linknum part. rootName={1}, hostID={2}, linknum={3}", LogHeader, rootPart.Name, hostID, linkNum); } } else { m_log.WarnFormat("{0} GetRootAndChildPhysActors: Root part does not have a physics actor. rootName={1}, hostID={2}", LogHeader, rootPart.Name, hostID); } return ret; }
public abstract void LinkToNewParent(PhysicsActor obj, OpenMetaverse.Vector3 localPos, OpenMetaverse.Quaternion localRot);
/// <summary> /// Remove an avatar. /// </summary> /// <param name="actor"></param> public abstract void RemoveAvatar(PhysicsActor actor);
public abstract void link(PhysicsActor obj);
private bool GetRootPhysActor(UUID hostID, out PhysicsActor rootPhysActor) { SceneObjectGroup containingGroup; SceneObjectPart rootPart; return GetRootPhysActor(hostID, out containingGroup, out rootPart, out rootPhysActor); }