本文整理汇总了C#中Universe.ScriptEngine.VirtualScript.LSL_Types.Vector3类的典型用法代码示例。如果您正苦于以下问题:C# Universe.ScriptEngine.VirtualScript.LSL_Types.Vector3类的具体用法?C# Universe.ScriptEngine.VirtualScript.LSL_Types.Vector3怎么用?C# Universe.ScriptEngine.VirtualScript.LSL_Types.Vector3使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Universe.ScriptEngine.VirtualScript.LSL_Types.Vector3类属于命名空间,在下文中一共展示了Universe.ScriptEngine.VirtualScript.LSL_Types.Vector3类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: botCreateBot
public LSL_String botCreateBot(string firstName, string lastName, string appearanceToClone, LSL_Vector startPos)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botCreateBot", m_host, "bot", m_itemID))
return "";
IBotManager manager = World.RequestModuleInterface<IBotManager>();
if (manager != null)
return
new LSL_String(
manager.CreateAvatar(firstName, lastName, m_host.ParentEntity.Scene,
UUID.Parse(appearanceToClone), m_host.OwnerID,
new Vector3((float) startPos.x, (float) startPos.y, (float) startPos.z)).
ToString());
return new LSL_String("");
}
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:17,代码来源:Bot_API.cs
示例2: llSetLinkColor
public void llSetLinkColor(int linknumber, LSL_Vector color, int face)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return;
List<ISceneChildEntity> parts = GetLinkParts(linknumber);
foreach (ISceneChildEntity part in parts)
part.SetFaceColor(new Vector3((float)color.x, (float)color.y, (float)color.z), face);
}
开发者ID:VirtualReality,项目名称:Universe,代码行数:9,代码来源:LSL_Api.cs
示例3: 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;
}
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:21,代码来源:OS_Api.cs
示例4: osTeleportOwner
public DateTime osTeleportOwner(int regionX, int regionY, LSL_Vector position, LSL_Vector lookat)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "osTeleportOwner", m_host, "OSSL", m_itemID))
return DateTime.Now;
GridRegion regInfo = World.GridService.GetRegionByPosition(World.RegionInfo.AllScopeIDs,
(regionX*Constants.RegionSize),
(regionY*Constants.RegionSize));
// Try to link the region
if (regInfo != null)
{
ulong regionHandle = regInfo.RegionHandle;
return TeleportAgent(m_host.OwnerID, regionHandle,
new Vector3((float) position.x, (float) position.y, (float) position.z),
new Vector3((float) lookat.x, (float) lookat.y, (float) lookat.z));
}
return DateTime.Now;
}
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:18,代码来源:OS_Api.cs
示例5: osNpcMoveTo
public void osNpcMoveTo(LSL_Key npc, LSL_Vector pos)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.High, "osNpcMoveTo", m_host, "OSSL", m_itemID))
return;
IBotManager manager = World.RequestModuleInterface<IBotManager>();
if (manager != null)
{
UUID npcId;
if (!UUID.TryParse(npc.m_string, out npcId))
return;
manager.WalkTo(npcId, pos.ToVector3(), m_host.OwnerID);
}
}
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:15,代码来源:OS_Api.cs
示例6: osCauseDamage
public void osCauseDamage(string avatar, double damage, string regionName, LSL_Vector position,
LSL_Vector lookat)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.High, "osCauseDamage", m_host, "OSSL", m_itemID)) return;
UUID avatarId = new UUID(avatar);
Vector3 pos = m_host.GetWorldPosition();
IScenePresence presence = World.GetScenePresence(avatarId);
if (presence != null)
{
IParcelManagementModule parcelManagement = World.RequestModuleInterface<IParcelManagementModule>();
if (parcelManagement != null)
{
LandData land = parcelManagement.GetLandObject(pos.X, pos.Y).LandData;
if ((land.Flags & (uint) ParcelFlags.AllowDamage) == (uint) ParcelFlags.AllowDamage)
{
ICombatPresence cp = presence.RequestModuleInterface<ICombatPresence>();
cp.IncurDamage(World.GetScenePresence(m_host.OwnerID), damage, regionName,
new Vector3((float) position.x, (float) position.y, (float) position.z),
new Vector3((float) lookat.x, (float) lookat.y, (float) lookat.z));
}
}
}
}
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:25,代码来源:OS_Api.cs
示例7: llSetVelocity
public void llSetVelocity(LSL_Vector force, LSL_Integer local)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return;
Vector3 velocity = new Vector3((float)force.x, (float)force.y, (float)force.z);
if (local == 1)
{
Quaternion grot = m_host.GetWorldRotation();
Quaternion AXgrot = grot;
Vector3 AXimpulsei = velocity;
Vector3 newimpulse = AXimpulsei * AXgrot;
velocity = newimpulse;
}
if (m_host.ParentEntity.RootChild.PhysActor != null)
m_host.ParentEntity.RootChild.PhysActor.Velocity = velocity;
}
开发者ID:VirtualReality,项目名称:Universe,代码行数:16,代码来源:LSL_Api.cs
示例8: llSetVehicleVectorParam
public void llSetVehicleVectorParam(int param, LSL_Vector vec)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return;
if (m_host.ParentEntity != null)
{
if (!m_host.ParentEntity.IsDeleted)
{
m_host.ParentEntity.RootChild.SetVehicleVectorParam(param,
new Vector3((float)vec.x, (float)vec.y,
(float)vec.z));
}
}
}
开发者ID:VirtualReality,项目名称:Universe,代码行数:14,代码来源:LSL_Api.cs
示例9: llSetTorque
public void llSetTorque(LSL_Vector torque, int local)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return;
m_host.SetAngularImpulse(new Vector3((float)torque.x, (float)torque.y, (float)torque.z), local != 0);
}
开发者ID:VirtualReality,项目名称:Universe,代码行数:6,代码来源:LSL_Api.cs
示例10: llSetText
public void llSetText(string text, LSL_Vector color, LSL_Float alpha)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return;
Vector3 av3 = new Vector3(Util.Clip((float)color.x, 0.0f, 1.0f),
Util.Clip((float)color.y, 0.0f, 1.0f),
Util.Clip((float)color.z, 0.0f, 1.0f));
m_host.SetText(text.Length > 254 ? text.Remove(254) : text, av3, Util.Clip((float)alpha, 0.0f, 1.0f));
//m_host.ParentGroup.HasGroupChanged = true;
//m_host.ParentGroup.ScheduleGroupForFullUpdate();
}
开发者ID:VirtualReality,项目名称:Universe,代码行数:11,代码来源:LSL_Api.cs
示例11: llSitTarget
public void llSitTarget(LSL_Vector offset, LSL_Rotation rot)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return;
// LSL quaternions can normalize to 0, normal Quaternions can't.
if (rot.s == 0 && rot.x == 0 && rot.y == 0 && rot.z == 0)
rot.z = 1; // ZERO_ROTATION = 0,0,0,1
m_host.SitTargetPosition = new Vector3((float)offset.x, (float)offset.y, (float)offset.z);
m_host.SitTargetOrientation = Rot2Quaternion(rot);
}
开发者ID:VirtualReality,项目名称:Universe,代码行数:11,代码来源:LSL_Api.cs
示例12: llTarget
public LSL_Integer llTarget(LSL_Vector position, LSL_Float range)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return 0;
return m_host.registerTargetWaypoint(
new Vector3((float)position.x, (float)position.y, (float)position.z), (float)range);
}
开发者ID:VirtualReality,项目名称:Universe,代码行数:7,代码来源:LSL_Api.cs
示例13: 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());
}
}
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:15,代码来源:OS_Api.cs
示例14: llTargetOmega
public void llTargetOmega(LSL_Vector axis, LSL_Float spinrate, LSL_Float gain)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return;
m_host.OmegaAxis = new Vector3((float)axis.x, (float)axis.y, (float)axis.z);
m_host.OmegaGain = gain;
m_host.OmegaSpinRate = spinrate;
m_host.GenerateRotationalVelocityFromOmega();
ScriptData script = ScriptProtection.GetScript(m_itemID);
if (script != null)
script.TargetOmegaWasSet = true;
m_host.ScheduleTerseUpdate();
//m_host.SendTerseUpdateToAllClients();
}
开发者ID:VirtualReality,项目名称:Universe,代码行数:15,代码来源:LSL_Api.cs
示例15: osNpcMoveToTarget
public void osNpcMoveToTarget(LSL_Key npc, LSL_Vector target, int options)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.High, "osNpcMoveToTarget", m_host, "OSSL", m_itemID))
return;
IBotManager manager = World.RequestModuleInterface<IBotManager>();
if (manager != null)
{
UUID npcId;
if (!UUID.TryParse(npc.m_string, out npcId))
return;
Vector3 targetPos = target.ToVector3();
MainConsole.Instance.DebugFormat ("NPC: {0} moving to position: {1}, region: {2}, Options: {3}",
npcId, targetPos, World, options);
manager.MoveToTarget(
npcId,
targetPos,
options,
m_host.OwnerID
);
}
}
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:25,代码来源:OS_Api.cs
示例16: 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)
{
Error("llTeleportAgent", "No permissions to teleport the agent");
return;
}
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) == 0)
{
Error("llTeleportAgent", "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);
}
}
}
}
开发者ID:VirtualReality,项目名称:Universe,代码行数:55,代码来源:LSL_Api.cs
示例17: 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)
{
Error("llTeleportAgentGlobalCoords", "No permissions to teleport the agent");
return;
}
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) == 0)
{
Error("llTeleportAgentGlobalCoords", "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);
}
}
}
开发者ID:VirtualReality,项目名称:Universe,代码行数:38,代码来源:LSL_Api.cs
示例18: osForceDropAttachmentAt
public void osForceDropAttachmentAt(LSL_Vector pos, LSL_Rotation rot)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.High, "osForceDropAttachmentAt", m_host, "OSSL", m_itemID)) return;
DropAttachmentAt(false, pos, rot);
}
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:6,代码来源:OS_Api.cs
示例19: llSetScale
public void llSetScale(LSL_Vector scale)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return;
SetScale(m_host, scale);
}
开发者ID:VirtualReality,项目名称:Universe,代码行数:6,代码来源:LSL_Api.cs
示例20: llSetRegionPos
public LSL_Integer llSetRegionPos(LSL_Vector pos)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID))
return ScriptBaseClass.FALSE;
SetPos(m_host, pos, false);
return ScriptBaseClass.TRUE;
}
开发者ID:VirtualReality,项目名称:Universe,代码行数:9,代码来源:LSL_Api.cs
注:本文中的Universe.ScriptEngine.VirtualScript.LSL_Types.Vector3类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论