cosmetics

This commit is contained in:
UbitUmarov
2025-06-20 04:38:51 +01:00
parent 157de21332
commit e1b5f3ad81
7 changed files with 25 additions and 14 deletions

View File

@@ -3631,7 +3631,8 @@ namespace OpenSim.Region.Framework.Scenes
if (target is not null && target2 is not null)
{
Vector3 direction = Vector3.Normalize(RayEnd - RayStart);
Vector3 direction = RayEnd - RayStart;
direction.Normalize();
//pos = target2.AbsolutePosition;
//m_log.Info("[OBJECT_REZ]: TargetPos: " + pos.ToString() + ", RayStart: " + RayStart.ToString() + ", RayEnd: " + RayEnd.ToString() + ", Volume: " + Util.GetDistanceTo(RayStart,RayEnd).ToString() + ", mag1: " + Util.GetMagnitude(RayStart).ToString() + ", mag2: " + Util.GetMagnitude(RayEnd).ToString());
@@ -3639,7 +3640,7 @@ namespace OpenSim.Region.Framework.Scenes
// TODO: Raytrace better here
//EntityIntersection ei = m_sceneGraph.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection));
Ray NewRay = new(RayStart,direction);
Ray NewRay = new(RayStart, direction);
// Ray Trace against target here
EntityIntersection ei = target2.TestIntersectionOBB(NewRay, Quaternion.Identity, frontFacesOnly, CopyCenters);
@@ -4798,7 +4799,7 @@ Label_GroupsDone:
{
sp = GetScenePresence(agentID);
if (sp is null)
if (sp is null || sp.IsDeleted)
{
// If there is no scene presence, we may be handling a dead
// client. These can keep an avatar from reentering a region
@@ -4815,7 +4816,7 @@ Label_GroupsDone:
// need to try this again, bc client close may had not done it
m_authenticateHandler?.RemoveCircuit(agentID);
m_clientManager.Remove(agentID);
m_clientManager?.Remove(agentID);
m_capsModule?.RemoveCaps(agentID, 0);
return ret;

View File

@@ -4771,7 +4771,7 @@ namespace OpenSim.Region.Framework.Scenes
return;
CopyFrom(cAgentData);
m_updateAgentReceivedAfterTransferEvent.Set();
m_updateAgentReceivedAfterTransferEvent?.Set();
}
private static Vector3 marker = new(-1f, -1f, -1f);

View File

@@ -368,7 +368,9 @@ namespace OpenSim.Region.PhysicsModule.BulletS
// The step is presumed to be more or less vertical. Thus the Z component should
// be nearly horizontal.
OMV.Vector3 directionFacing = OMV.Vector3.UnitX * m_controllingPrim.RawOrientation;
OMV.Vector3 touchNormal = OMV.Vector3.Normalize(kvp.Value.SurfaceNormal);
OMV.Vector3 touchNormal = kvp.Value.SurfaceNormal;
touchNormal.Normalize();
const float PIOver2 = 1.571f; // Used to make unit vector axis into approx radian angles
// m_physicsScene.DetailLog("{0},BSCharacter.WalkUpStairs,avNormal={1},colNormal={2},diff={3}",
// m_controllingPrim.LocalID, directionFacing, touchNormal,

View File

@@ -945,7 +945,7 @@ namespace OpenSim.Region.PhysicsModule.BulletS
{
get
{
return VehicleVelocity * Quaternion.Inverse(Quaternion.Normalize(VehicleFrameOrientation));
return VehicleVelocity * Quaternion.Inverse(VehicleFrameOrientation);
}
}
@@ -1502,9 +1502,11 @@ namespace OpenSim.Region.PhysicsModule.BulletS
Quaternion justZOrientation = Quaternion.CreateFromAxisAngle(Vector3.UnitZ, currentEulerW.Z);
// Create the axis that is perpendicular to the up vector and the rotated up vector.
Vector3 differenceAxisW = Vector3.Cross(Vector3.UnitZ * justZOrientation, Vector3.UnitZ * VehicleFrameOrientation);
Vector3 UnitZInFrame = Vector3.UnitZ * VehicleFrameOrientation;
Vector3 differenceAxisW = Vector3.Cross(Vector3.UnitZ * justZOrientation, UnitZInFrame);
// Compute the angle between those to vectors.
double differenceAngle = Math.Acos((double)Vector3.Dot(Vector3.UnitZ, Vector3.Normalize(Vector3.UnitZ * VehicleFrameOrientation)));
UnitZInFrame.Normalize();
double differenceAngle = Math.Acos((double)Vector3.Dot(Vector3.UnitZ, UnitZInFrame));
// 'differenceAngle' is the angle to rotate and 'differenceAxis' is the plane to rotate in to get the vehicle vertical
// Reduce the change by the time period it is to change in. Timestep is handled when velocity is applied.
@@ -1537,7 +1539,8 @@ namespace OpenSim.Region.PhysicsModule.BulletS
Vector3 origRotVelW = VehicleRotationalVelocity; // DEBUG DEBUG
// Take a vector pointing up and convert it from world to vehicle relative coords.
Vector3 verticalError = Vector3.Normalize(Vector3.UnitZ * VehicleFrameOrientation);
Vector3 verticalError = Vector3.UnitZ * VehicleFrameOrientation;
verticalError.Normalize();
// If vertical attraction correction is needed, the vector that was pointing up (UnitZ)
// is now:

View File

@@ -358,6 +358,8 @@ namespace OpenSim.Region.PhysicsModule.BulletS
OMV.Quaternion invRootOrientation = OMV.Quaternion.Normalize(OMV.Quaternion.Inverse(LinksetRoot.RawOrientation));
OMV.Vector3 origRootPosition = LinksetRoot.RawPosition;
OMV.Quaternion invRootOrientation = OMV.Quaternion.Inverse(LinksetRoot.RawOrientation);
invRootOrientation.Normalize();
// 'centerDisplacementV' is the vehicle relative distance from the simulator root position to the center-of-mass
OMV.Vector3 centerDisplacementV = (centerOfMassW - LinksetRoot.RawPosition) * invRootOrientation;
@@ -396,7 +398,9 @@ namespace OpenSim.Region.PhysicsModule.BulletS
// Offset the child shape from the center-of-mass and rotate it to root relative.
OMV.Vector3 offsetPos = (cPrim.RawPosition - origRootPosition) * invRootOrientation - centerDisplacementV;
OMV.Quaternion offsetRot = OMV.Quaternion.Normalize(cPrim.RawOrientation) * invRootOrientation;
OMV.Quaternion offsetRot = cPrim.RawOrientation;
offsetRot.Normalize();
offsetRot *= invRootOrientation;
// Add the child shape to the compound shape being built
if (childShape.physShapeInfo.HasPhysicalShape)

View File

@@ -354,7 +354,7 @@ namespace OpenSim.Region.PhysicsModule.BulletS
{
get
{
OMV.Vector3 characterOrientedVelocity = RawVelocity * OMV.Quaternion.Inverse(OMV.Quaternion.Normalize(RawOrientation));
OMV.Vector3 characterOrientedVelocity = RawVelocity * OMV.Quaternion.Inverse(RawOrientation);
return characterOrientedVelocity.X;
}
}
@@ -363,7 +363,7 @@ namespace OpenSim.Region.PhysicsModule.BulletS
{
get
{
OMV.Vector3 characterOrientedVelocity = TargetVelocity * OMV.Quaternion.Inverse(OMV.Quaternion.Normalize(RawOrientation));
OMV.Vector3 characterOrientedVelocity = TargetVelocity * OMV.Quaternion.Inverse(RawOrientation);
return characterOrientedVelocity.X;
}
}

View File

@@ -1000,7 +1000,8 @@ namespace OpenSim.Region.PhysicsModule.BulletS
if (BSParam.UseBulletRaycast)
{
Vector3 posFrom = position;
Vector3 posTo = Vector3.Normalize(direction) * length + position;
direction.Normalize();
Vector3 posTo = direction * length + position;
TaintedObject(DetailLogZero, "BSScene.RaycastWorld1", delegate ()
{