本文整理汇总了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类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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("");
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
}
示例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));
}
}
}
}
示例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;
}
示例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));
}
}
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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());
}
}
示例14: 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);
}
示例15: llSetScale
public void llSetScale(LSL_Vector scale)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return;
SetScale(m_host, scale);
}