cosmetics
This commit is contained in:
@@ -15935,10 +15935,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||||||
|
|
||||||
private ContactResult[] ObjectIntersection(Vector3 rayStart, Vector3 rayEnd, bool includePhysical, bool includeNonPhysical, bool includePhantom)
|
private ContactResult[] ObjectIntersection(Vector3 rayStart, Vector3 rayEnd, bool includePhysical, bool includeNonPhysical, bool includePhantom)
|
||||||
{
|
{
|
||||||
Ray ray = new(rayStart, Vector3.Normalize(rayEnd - rayStart));
|
|
||||||
List<ContactResult> contacts = new();
|
|
||||||
|
|
||||||
Vector3 ab = rayEnd - rayStart;
|
Vector3 ab = rayEnd - rayStart;
|
||||||
|
Ray ray = new(rayStart, Vector3.Normalize(ref ab));
|
||||||
|
List<ContactResult> contacts = new();
|
||||||
|
|
||||||
World.ForEachSOG(delegate(SceneObjectGroup group)
|
World.ForEachSOG(delegate(SceneObjectGroup group)
|
||||||
{
|
{
|
||||||
@@ -15997,7 +15996,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||||||
if (d2 > 0)
|
if (d2 > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ray = new Ray(rayStart, Vector3.Normalize(rayEnd - rayStart));
|
ray = new Ray(rayStart, Vector3.Normalize(ref ab));
|
||||||
EntityIntersection intersection = group.TestIntersection(ray, true, false);
|
EntityIntersection intersection = group.TestIntersection(ray, true, false);
|
||||||
// Miss.
|
// Miss.
|
||||||
if (!intersection.HitTF)
|
if (!intersection.HitTF)
|
||||||
@@ -16995,7 +16994,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||||||
|
|
||||||
// Transform hit and normal to region coordinate system
|
// Transform hit and normal to region coordinate system
|
||||||
Vector3 posHit = rayTrans.PositionPart + (posHitProj * rayTrans.ScalePart) * rayTrans.RotationPart;
|
Vector3 posHit = rayTrans.PositionPart + (posHitProj * rayTrans.ScalePart) * rayTrans.RotationPart;
|
||||||
Vector3 normal = Vector3.Normalize((normalProj * rayTrans.ScalePart) * rayTrans.RotationPart);
|
|
||||||
|
Vector3 normal = (normalProj * rayTrans.ScalePart) * rayTrans.RotationPart;
|
||||||
|
normal.Normalize();
|
||||||
|
|
||||||
// Remove duplicate hits at triangle intersections
|
// Remove duplicate hits at triangle intersections
|
||||||
float distance = Vector3.Distance(rayTrans.Position1Ray, posHit);
|
float distance = Vector3.Distance(rayTrans.Position1Ray, posHit);
|
||||||
|
|||||||
@@ -75,8 +75,9 @@ namespace pCampBot
|
|||||||
|
|
||||||
private void MyTurnToward(Vector3 target)
|
private void MyTurnToward(Vector3 target)
|
||||||
{
|
{
|
||||||
Quaternion between = Vector3.RotationBetween(Vector3.UnitX, Vector3.Normalize(target - Bot.Client.Self.SimPosition));
|
Vector3 localtarget = target - Bot.Client.Self.SimPosition;
|
||||||
Quaternion rot = between ;
|
localtarget.Normalize();
|
||||||
|
Quaternion rot = Vector3.RotationBetween(Vector3.UnitX, localtarget);
|
||||||
|
|
||||||
Bot.Client.Self.Movement.BodyRotation = rot;
|
Bot.Client.Self.Movement.BodyRotation = rot;
|
||||||
Bot.Client.Self.Movement.HeadRotation = rot;
|
Bot.Client.Self.Movement.HeadRotation = rot;
|
||||||
|
|||||||
Reference in New Issue
Block a user