本文整理汇总了C#中Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3.ToVector3方法的典型用法代码示例。如果您正苦于以下问题:C# Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3.ToVector3方法的具体用法?C# Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3.ToVector3怎么用?C# Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3.ToVector3使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3
的用法示例。
在下文中一共展示了Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3.ToVector3方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: osTeleportAgent
// Teleport functions
public DateTime osTeleportAgent(string agent, int regionX, int regionY, LSL_Vector position, LSL_Vector lookat)
{
// High because there is no security check. High griefer potential
//
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.High, "osTeleportAgent", m_host, "OSSL", m_itemID))
return DateTime.Now;
ulong regionHandle = Utils.UIntsToLong(((uint) regionX*Constants.RegionSize),
((uint) regionY*Constants.RegionSize));
UUID agentId = new UUID();
if (UUID.TryParse(agent, out agentId))
{
return TeleportAgent(agentId, regionHandle,
position.ToVector3(),
lookat.ToVector3());
}
return DateTime.Now;
}
示例2: llGetClosestNavPoint
public LSL_List llGetClosestNavPoint(LSL_Vector point, LSL_List options)
{
Vector3 diff = new Vector3(0, 0, 0.1f)*
(Vector3.RotationBetween(m_host.ParentEntity.AbsolutePosition, point.ToVector3()));
return new LSL_List(new LSL_Vector((m_host.ParentEntity.AbsolutePosition + diff)));
}
示例3: llNavigateTo
public void llNavigateTo(LSL_Vector point, LSL_List options)
{
List<Vector3> positions = new List<Vector3>() {point.ToVector3()};
List<TravelMode> travelMode = new List<TravelMode>() {TravelMode.Walk};
IBotManager botManager = World.RequestModuleInterface<IBotManager>();
int flags = 0;
if (options.Length > 0)
flags |= options.GetLSLIntegerItem(0);
if (botManager != null)
botManager.SetBotMap(m_host.ParentEntity.UUID, positions, travelMode, flags, m_host.ParentEntity.OwnerID);
}
示例4: llCastRay
public LSL_List llCastRay(LSL_Vector start, LSL_Vector end, LSL_List options)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID))
return new LSL_List();
LSL_List list = new LSL_List();
Vector3 rayStart = start.ToVector3();
Vector3 rayEnd = end.ToVector3();
Vector3 dir = rayEnd - rayStart;
float dist = Vector3.Mag(dir);
int count = 1;
bool detectPhantom = false;
int dataFlags = 0;
int rejectTypes = 0;
for (int i = 0; i < options.Length; i += 2)
{
if (options.GetLSLIntegerItem(i) == ScriptBaseClass.RC_MAX_HITS)
count = options.GetLSLIntegerItem(i + 1);
else if (options.GetLSLIntegerItem(i) == ScriptBaseClass.RC_DETECT_PHANTOM)
detectPhantom = (options.GetLSLIntegerItem(i + 1) > 0);
else if (options.GetLSLIntegerItem(i) == ScriptBaseClass.RC_DATA_FLAGS)
dataFlags = options.GetLSLIntegerItem(i + 1);
else if (options.GetLSLIntegerItem(i) == ScriptBaseClass.RC_REJECT_TYPES)
rejectTypes = options.GetLSLIntegerItem(i + 1);
}
if (count > 16)
count = 16;
List<ContactResult> results = new List<ContactResult>();
bool checkTerrain = !((rejectTypes & ScriptBaseClass.RC_REJECT_LAND) == ScriptBaseClass.RC_REJECT_LAND);
bool checkAgents = !((rejectTypes & ScriptBaseClass.RC_REJECT_AGENTS) == ScriptBaseClass.RC_REJECT_AGENTS);
bool checkNonPhysical = !((rejectTypes & ScriptBaseClass.RC_REJECT_NONPHYSICAL) == ScriptBaseClass.RC_REJECT_NONPHYSICAL);
bool checkPhysical = !((rejectTypes & ScriptBaseClass.RC_REJECT_PHYSICAL) == ScriptBaseClass.RC_REJECT_PHYSICAL);
if (checkAgents)
{
ContactResult[] agentHits = AvatarIntersection(rayStart, rayEnd);
foreach (ContactResult r in agentHits)
results.Add(r);
}
if (checkPhysical || checkNonPhysical || detectPhantom)
{
ContactResult[] objectHits = ObjectIntersection(rayStart, rayEnd, checkPhysical, checkNonPhysical, detectPhantom);
for (int iter = 0; iter < objectHits.Length; iter++)
{
// Redistance the Depth because the Scene RayCaster returns distance from center to make the rezzing code simpler.
objectHits[iter].Depth = Vector3.Distance(objectHits[iter].Pos, rayStart);
results.Add(objectHits[iter]);
}
}
if (checkTerrain)
{
ContactResult? groundContact = GroundIntersection(rayStart, rayEnd);
if (groundContact != null)
results.Add((ContactResult)groundContact);
}
results.Sort(delegate(ContactResult a, ContactResult b)
{
return a.Depth.CompareTo(b.Depth);
});
int values = 0;
ISceneEntity thisgrp = m_host.ParentEntity;
foreach (ContactResult result in results)
{
if (result.Depth > dist)
continue;
// physics ray can return colisions with host prim
if (m_host.LocalId == result.ConsumerID)
continue;
UUID itemID = UUID.Zero;
int linkNum = 0;
ISceneChildEntity part = World.GetSceneObjectPart(result.ConsumerID);
// It's a prim!
if (part != null)
{
// dont detect members of same object ???
if (part.ParentEntity == thisgrp)
continue;
if ((dataFlags & ScriptBaseClass.RC_GET_ROOT_KEY) == ScriptBaseClass.RC_GET_ROOT_KEY)
itemID = part.ParentEntity.UUID;
else
itemID = part.UUID;
linkNum = part.LinkNum;
//.........这里部分代码省略.........
示例5: llTeleportAgentGlobalCoords
public void llTeleportAgentGlobalCoords(LSL_Key agent, LSL_Vector global_coordinates,
LSL_Vector region_coordinates, LSL_Vector look_at)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return;
UUID invItemID = InventorySelf();
if (invItemID == UUID.Zero)
return;
lock (m_host.TaskInventory)
{
if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero)
{
ShoutError("No permissions to teleport the agent");
return;
}
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) == 0)
{
ShoutError("No permissions to teleport the agent");
return;
}
}
IScenePresence presence = World.GetScenePresence(m_host.OwnerID);
if (presence != null)
{
IEntityTransferModule module = World.RequestModuleInterface<IEntityTransferModule>();
if (module != null)
{
module.Teleport(presence,
Utils.UIntsToLong((uint) global_coordinates.x, (uint) global_coordinates.y),
region_coordinates.ToVector3(), look_at.ToVector3(),
(uint) TeleportFlags.ViaLocation);
}
}
}
示例6: llTeleportAgent
public void llTeleportAgent(LSL_Key avatar, LSL_String landmark, LSL_Vector position, LSL_Vector look_at)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return;
UUID invItemID = InventorySelf();
if (invItemID == UUID.Zero)
return;
lock (m_host.TaskInventory)
{
if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero)
{
ShoutError("No permissions to teleport the agent");
return;
}
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) == 0)
{
ShoutError("No permissions to teleport the agent");
return;
}
}
TaskInventoryItem item = null;
lock (m_host.TaskInventory)
{
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
{
if (inv.Value.Name == landmark)
item = inv.Value;
}
}
if (item == null && landmark != "")
return;
IScenePresence presence = World.GetScenePresence(m_host.OwnerID);
if (presence != null)
{
IEntityTransferModule module = World.RequestModuleInterface<IEntityTransferModule>();
if (module != null)
{
if (landmark == "")
module.Teleport(presence, World.RegionInfo.RegionHandle,
position.ToVector3(), look_at.ToVector3(), (uint) TeleportFlags.ViaLocation);
else
{
AssetLandmark lm = new AssetLandmark(
World.AssetService.Get(item.AssetID.ToString()));
module.Teleport(presence, lm.RegionHandle, lm.Position,
look_at.ToVector3(), (uint) TeleportFlags.ViaLocation);
}
}
}
}
示例7: DropAttachmentAt
protected void DropAttachmentAt(bool checkPerms, LSL_Vector pos, LSL_Rotation rot)
{
if (checkPerms && ShoutErrorOnLackingOwnerPerms(ScriptBaseClass.PERMISSION_ATTACH, "Cannot drop attachment"))
{
return;
}
IAttachmentsModule attachmentsModule = World.RequestModuleInterface<IAttachmentsModule>();
IScenePresence sp = attachmentsModule == null ? null : World.GetScenePresence(m_host.OwnerID);
if (attachmentsModule != null && sp != null)
{
attachmentsModule.DetachSingleAttachmentToGround(m_host.ParentEntity.UUID, sp.ControllingClient, pos.ToVector3(), rot.ToQuaternion());
}
}