本文整理汇总了C#中Universe.ScriptEngine.VirtualScript.LSL_Types.list.GetVector3Item方法的典型用法代码示例。如果您正苦于以下问题:C# Universe.ScriptEngine.VirtualScript.LSL_Types.list.GetVector3Item方法的具体用法?C# Universe.ScriptEngine.VirtualScript.LSL_Types.list.GetVector3Item怎么用?C# Universe.ScriptEngine.VirtualScript.LSL_Types.list.GetVector3Item使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Universe.ScriptEngine.VirtualScript.LSL_Types.list
的用法示例。
在下文中一共展示了Universe.ScriptEngine.VirtualScript.LSL_Types.list.GetVector3Item方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConvertLSLToWindlight
//.........这里部分代码省略.........
break;
}
case ScriptBaseClass.WL_SKY_GLOW: {
LSL_Rotation rot = list.GetQuaternionItem (i + 1);
skyData.glow = rot.ToVector4 ();
break;
}
case ScriptBaseClass.WL_SKY_HAZE_DENSITY: {
LSL_Rotation rot = list.GetQuaternionItem (i + 1);
skyData.haze_density = rot.ToVector4 ();
break;
}
case ScriptBaseClass.WL_SKY_HAZE_HORIZON: {
LSL_Rotation rot = list.GetQuaternionItem (i + 1);
skyData.haze_horizon = rot.ToVector4 ();
break;
}
case ScriptBaseClass.WL_SKY_LIGHT_NORMALS: {
LSL_Rotation rot = list.GetQuaternionItem (i + 1);
skyData.lightnorm = rot.ToVector4 ();
break;
}
case ScriptBaseClass.WL_SKY_MAX_ALTITUDE: {
LSL_Rotation rot = list.GetQuaternionItem (i + 1);
skyData.max_y = rot.ToVector4 ();
break;
}
case ScriptBaseClass.WL_SKY_STAR_BRIGHTNESS: {
LSL_Float f = list.GetLSLFloatItem (i + 1);
skyData.star_brightness = (float)f.value;
break;
}
case ScriptBaseClass.WL_SKY_SUNLIGHT_COLOR: {
LSL_Rotation rot = list.GetQuaternionItem (i + 1);
skyData.sunlight_color = rot.ToVector4 ();
break;
}
case ScriptBaseClass.WL_WATER_BIG_WAVE_DIRECTION: {
var rot = list.GetVector3Item (i + 1);
cycle.Water.wave1Dir = new Vector2 ((float)rot.x.value, (float)rot.y.value);
break;
}
case ScriptBaseClass.WL_WATER_BLUR_MULTIPLIER: {
var f = list.GetLSLFloatItem (i + 1);
cycle.Water.blurMultiplier = (float)f.value;
break;
}
case ScriptBaseClass.WL_WATER_FOG_COLOR: {
LSL_Rotation rot = list.GetQuaternionItem (i + 1);
cycle.Water.waterFogColor = rot.ToVector4 ();
break;
}
case ScriptBaseClass.WL_WATER_FOG_DENSITY: {
var f = list.GetLSLFloatItem (i + 1);
cycle.Water.waterFogDensity = (float)f.value;
break;
}
case ScriptBaseClass.WL_WATER_FRESNEL_OFFSET: {
var f = list.GetLSLFloatItem (i + 1);
cycle.Water.fresnelOffset = (float)f.value;
break;
}
case ScriptBaseClass.WL_WATER_FRESNEL_SCALE: {
var f = list.GetLSLFloatItem (i + 1);
cycle.Water.fresnelScale = (float)f.value;
break;
}
case ScriptBaseClass.WL_WATER_LITTLE_WAVE_DIRECTION: {
var rot = list.GetVector3Item (i + 1);
cycle.Water.wave2Dir = new Vector2 ((float)rot.x.value, (float)rot.y.value);
break;
}
case ScriptBaseClass.WL_WATER_NORMAL_MAP: {
var f = list.GetLSLStringItem (i + 1);
cycle.Water.normalMap = UUID.Parse (f.m_string);
break;
}
case ScriptBaseClass.WL_WATER_NORMAL_SCALE: {
LSL_Vector rot = list.GetVector3Item (i + 1);
cycle.Water.normScale = rot.ToVector3 ();
break;
}
case ScriptBaseClass.WL_WATER_SCALE_ABOVE: {
var f = list.GetLSLFloatItem (i + 1);
cycle.Water.scaleAbove = (float)f.value;
break;
}
case ScriptBaseClass.WL_WATER_SCALE_BELOW: {
var f = list.GetLSLFloatItem (i + 1);
cycle.Water.scaleBelow = (float)f.value;
break;
}
case ScriptBaseClass.WL_WATER_UNDERWATER_FOG_MODIFIER: {
var f = list.GetLSLFloatItem (i + 1);
cycle.Water.underWaterFogMod = (float)f.value;
break;
}
}
}
}
示例2: aaSetEnv
public void aaSetEnv (LSL_String name, LSL_List value)
{
if (!ScriptProtection.CheckThreatLevel (ThreatLevel.VeryHigh, "aaSetEnv", m_host, "AA", m_itemID))
return;
if (!World.Permissions.IsGod (m_host.OwnerID)) {
LSLError ("You do not have god permissions.");
return;
}
if (name == ScriptBaseClass.ENABLE_GRAVITY) {
LSL_Integer enabled = value.GetLSLIntegerItem (0);
float [] grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce ();
m_host.ParentEntity.Scene.PhysicsScene.SetGravityForce (enabled == 1, grav [0], grav [1], grav [2]);
} else if (name == ScriptBaseClass.GRAVITY_FORCE_X) {
LSL_Float f = value.GetLSLFloatItem (0);
float [] grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce ();
m_host.ParentEntity.Scene.PhysicsScene.SetGravityForce (true, (float)f.value, grav [1], grav [2]);
} else if (name == ScriptBaseClass.GRAVITY_FORCE_Y) {
LSL_Float f = value.GetLSLFloatItem (0);
float [] grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce ();
m_host.ParentEntity.Scene.PhysicsScene.SetGravityForce (true, grav [0], (float)f.value, grav [2]);
} else if (name == ScriptBaseClass.GRAVITY_FORCE_Z) {
LSL_Float f = value.GetLSLFloatItem (0);
float [] grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce ();
m_host.ParentEntity.Scene.PhysicsScene.SetGravityForce (true, grav [0], grav [1], (float)f.value);
} else if (name == ScriptBaseClass.ADD_GRAVITY_POINT) {
LSL_Vector pos = value.GetVector3Item (0);
LSL_Float gravForce = value.GetLSLFloatItem (1);
LSL_Float radius = value.GetLSLFloatItem (2);
LSL_Integer ident = value.GetLSLIntegerItem (3);
m_host.ParentEntity.Scene.PhysicsScene.AddGravityPoint (
false,
new Vector3 ((float)pos.x, (float)pos.y, (float)pos.z),
0, 0, 0, (float)gravForce.value, (float)radius.value, ident.value);
} else if (name == ScriptBaseClass.ADD_GRAVITY_FORCE) {
LSL_Vector pos = value.GetVector3Item (0);
LSL_Float xForce = value.GetLSLFloatItem (1);
LSL_Float yForce = value.GetLSLFloatItem (2);
LSL_Float zForce = value.GetLSLFloatItem (3);
LSL_Float radius = value.GetLSLFloatItem (4);
LSL_Integer ident = value.GetLSLIntegerItem (5);
m_host.ParentEntity.Scene.PhysicsScene.AddGravityPoint (
true,
new Vector3 ((float)pos.x, (float)pos.y, (float)pos.z),
(float)xForce, (float)yForce, (float)zForce, 0,
(float)radius.value, ident.value);
} else if (name == ScriptBaseClass.START_TIME_REVERSAL_SAVING) {
IPhysicsStateModule physicsState = World.RequestModuleInterface<IPhysicsStateModule> ();
if (physicsState != null)
physicsState.StartSavingPhysicsTimeReversalStates ();
} else if (name == ScriptBaseClass.STOP_TIME_REVERSAL_SAVING) {
IPhysicsStateModule physicsState = World.RequestModuleInterface<IPhysicsStateModule> ();
if (physicsState != null)
physicsState.StopSavingPhysicsTimeReversalStates ();
} else if (name == ScriptBaseClass.START_TIME_REVERSAL) {
IPhysicsStateModule physicsState = World.RequestModuleInterface<IPhysicsStateModule> ();
if (physicsState != null)
physicsState.StartPhysicsTimeReversal ();
} else if (name == ScriptBaseClass.STOP_TIME_REVERSAL) {
IPhysicsStateModule physicsState = World.RequestModuleInterface<IPhysicsStateModule> ();
if (physicsState != null)
physicsState.StopPhysicsTimeReversal ();
}
}
示例3: llSetKeyframedMotion
public void llSetKeyframedMotion(LSL_List keyframes, LSL_List options)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return;
if (!m_host.IsRoot)
{
Error("llSetKeyframedMotion", "Must be used in the root object!");
return;
}
KeyframeAnimation.Data dataType = KeyframeAnimation.Data.Both;
KeyframeAnimation.Modes currentMode = KeyframeAnimation.Modes.Forward;
for (int i = 0; i < options.Length; i += 2)
{
LSL_Integer option = options.GetLSLIntegerItem(i);
LSL_Integer value = options.GetLSLIntegerItem(i + 1);
if (option == ScriptBaseClass.KFM_COMMAND)
{
m_host.ParentEntity.AddKeyframedMotion(null, (KeyframeAnimation.Commands)value.value);
break; //Its supposed to be the only option in the list
}
if (option == ScriptBaseClass.KFM_MODE)
{
currentMode = (KeyframeAnimation.Modes)value.value;
}
else if (option == ScriptBaseClass.KFM_DATA)
{
dataType = (KeyframeAnimation.Data)value.value;
}
}
List<Vector3> positions = new List<Vector3>();
List<Quaternion> rotations = new List<Quaternion>();
List<float> times = new List<float>();
for (int i = 0; i < keyframes.Length; i += (dataType == KeyframeAnimation.Data.Both ? 3 : 2))
{
if (dataType == KeyframeAnimation.Data.Both ||
dataType == KeyframeAnimation.Data.Translation)
{
LSL_Vector pos = keyframes.GetVector3Item(i);
positions.Add(pos.ToVector3());
}
if (dataType == KeyframeAnimation.Data.Both ||
dataType == KeyframeAnimation.Data.Rotation)
{
LSL_Rotation rot = keyframes.GetQuaternionItem(i + (dataType == KeyframeAnimation.Data.Both ? 1 : 0));
Quaternion quat = rot.ToQuaternion();
quat.Normalize();
rotations.Add(quat);
}
LSL_Float time = keyframes.GetLSLFloatItem(i + (dataType == KeyframeAnimation.Data.Both ? 2 : 1));
times.Add((float)time);
}
KeyframeAnimation animation = new KeyframeAnimation
{
CurrentMode = currentMode,
PositionList = positions.ToArray(),
RotationList = rotations.ToArray(),
TimeList = times.ToArray(),
CurrentAnimationPosition = 0,
InitialPosition = m_host.AbsolutePosition,
InitialRotation = m_host.GetRotationOffset()
};
m_host.ParentEntity.AddKeyframedMotion(animation, KeyframeAnimation.Commands.Play);
}
示例4: llPursue
public void llPursue(LSL_String target, LSL_List options)
{
IBotManager botManager = World.RequestModuleInterface<IBotManager>();
if (botManager != null)
{
float fuzz = 2;
Vector3 offset = Vector3.Zero;
bool requireLOS = false;
// 20131224 not used bool intercept; = false; //Not implemented
for (int i = 0; i < options.Length; i += 2)
{
LSL_Types.LSLInteger opt = options.GetLSLIntegerItem(i);
if (opt == ScriptBaseClass.PURSUIT_FUZZ_FACTOR)
fuzz = (float)options.GetLSLFloatItem(i + 1).value;
if (opt == ScriptBaseClass.PURSUIT_OFFSET)
offset = options.GetVector3Item(i + 1).ToVector3();
if (opt == ScriptBaseClass.REQUIRE_LINE_OF_SIGHT)
requireLOS = options.GetLSLIntegerItem(i + 1) == 1;
// 20131224 not used if (opt == ScriptBaseClass.PURSUIT_INTERCEPT)
// 20131224 not used intercept = options.GetLSLIntegerItem(i + 1) == 1;
}
botManager.FollowAvatar(m_host.ParentEntity.UUID, target.m_string, fuzz, fuzz, requireLOS, offset,
m_host.ParentEntity.OwnerID);
}
}
示例5: SetParticleSystem
private void SetParticleSystem(ISceneChildEntity part, LSL_List rules)
{
if (rules.Length == 0)
{
part.RemoveParticleSystem();
}
else
{
Primitive.ParticleSystem prules = getNewParticleSystemWithSLDefaultValues();
LSL_Vector tempv = new LSL_Vector();
float tempf = 0;
int tmpi = 0;
for (int i = 0; i < rules.Length; i += 2)
{
LSL_Integer rule = rules.GetLSLIntegerItem(i);
if (rule == (int)ScriptBaseClass.PSYS_PART_FLAGS)
{
prules.PartDataFlags =
(Primitive.ParticleSystem.ParticleDataFlags)(uint)rules.GetLSLIntegerItem(i + 1);
}
else if (rule == (int)ScriptBaseClass.PSYS_PART_START_COLOR)
{
tempv = rules.GetVector3Item(i + 1);
prules.PartStartColor.R = (float)tempv.x;
prules.PartStartColor.G = (float)tempv.y;
prules.PartStartColor.B = (float)tempv.z;
}
else if (rule == (int)ScriptBaseClass.PSYS_PART_START_ALPHA)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.PartStartColor.A = tempf;
}
else if (rule == (int)ScriptBaseClass.PSYS_PART_END_COLOR)
{
tempv = rules.GetVector3Item(i + 1);
prules.PartEndColor.R = (float)tempv.x;
prules.PartEndColor.G = (float)tempv.y;
prules.PartEndColor.B = (float)tempv.z;
}
else if (rule == (int)ScriptBaseClass.PSYS_PART_END_ALPHA)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.PartEndColor.A = tempf;
}
else if (rule == (int)ScriptBaseClass.PSYS_PART_START_SCALE)
{
tempv = rules.GetVector3Item(i + 1);
prules.PartStartScaleX = (float)tempv.x;
prules.PartStartScaleY = (float)tempv.y;
}
else if (rule == (int)ScriptBaseClass.PSYS_PART_END_SCALE)
{
tempv = rules.GetVector3Item(i + 1);
prules.PartEndScaleX = (float)tempv.x;
prules.PartEndScaleY = (float)tempv.y;
}
else if (rule == (int)ScriptBaseClass.PSYS_PART_MAX_AGE)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.PartMaxAge = tempf;
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_ACCEL)
{
tempv = rules.GetVector3Item(i + 1);
prules.PartAcceleration.X = (float)tempv.x;
prules.PartAcceleration.Y = (float)tempv.y;
prules.PartAcceleration.Z = (float)tempv.z;
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_PATTERN)
{
tmpi = rules.GetLSLIntegerItem(i + 1);
prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi;
}
// PSYS_SRC_INNERANGLE and PSYS_SRC_ANGLE_BEGIN use the same variables. The
// PSYS_SRC_OUTERANGLE and PSYS_SRC_ANGLE_END also use the same variable. The
// client tells the difference between the two by looking at the 0x02 bit in
// the PartFlags variable.
else if (rule == (int)ScriptBaseClass.PSYS_SRC_INNERANGLE)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.InnerAngle = tempf;
prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_OUTERANGLE)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.OuterAngle = tempf;
prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
//.........这里部分代码省略.........
示例6: SetPrimParams
public void SetPrimParams(IEntity part, LSL_List rules, bool allowOpenSimParams)
{
int idx = 0;
while (idx < rules.Length)
{
int code = rules.GetLSLIntegerItem(idx++);
int remain = rules.Length - idx;
int face;
LSL_Vector v;
if (code == (int)ScriptBaseClass.PRIM_NAME)
{
if (remain < 1)
return;
string name = rules.Data[idx++].ToString();
if (part is ISceneChildEntity)
(part as ISceneChildEntity).Name = name;
}
else if (code == (int)ScriptBaseClass.PRIM_DESC)
{
if (remain < 1)
return;
string desc = rules.Data[idx++].ToString();
if (part is ISceneChildEntity)
(part as ISceneChildEntity).Description = desc;
}
else if (code == (int)ScriptBaseClass.PRIM_ROT_LOCAL)
{
if (remain < 1)
return;
LSL_Rotation lr = rules.GetQuaternionItem(idx++);
if (part is ISceneChildEntity)
SetRot((part as ISceneChildEntity), Rot2Quaternion(lr));
}
else if (code == (int)ScriptBaseClass.PRIM_POSITION)
{
if (remain < 1)
return;
v = rules.GetVector3Item(idx++);
if (part is ISceneChildEntity)
//SetPos(part as ISceneChildEntity, GetPartLocalPos(part as ISceneChildEntity) + v, true);
SetPos(part as ISceneChildEntity, v, true);
else if (part is IScenePresence)
{
(part as IScenePresence).OffsetPosition = new Vector3((float)v.x, (float)v.y, (float)v.z);
(part as IScenePresence).SendTerseUpdateToAllClients();
}
}
else if (code == (int)ScriptBaseClass.PRIM_POS_LOCAL)
{
if (remain < 1)
return;
v = rules.GetVector3Item(idx++);
if (part is ISceneChildEntity)
{
if (((ISceneChildEntity)part).ParentID != 0)
((ISceneChildEntity)part).OffsetPosition = new Vector3((float)v.x, (float)v.y,
(float)v.z);
else
part.AbsolutePosition = new Vector3((float)v.x, (float)v.y, (float)v.z);
}
else if (part is IScenePresence)
{
(part as IScenePresence).OffsetPosition = new Vector3((float)v.x, (float)v.y, (float)v.z);
(part as IScenePresence).SendTerseUpdateToAllClients();
}
}
else if (code == (int)ScriptBaseClass.PRIM_SIZE)
{
if (remain < 1)
return;
v = rules.GetVector3Item(idx++);
if (part is ISceneChildEntity)
SetScale(part as ISceneChildEntity, v);
}
else if (code == (int)ScriptBaseClass.PRIM_ROTATION)
{
if (remain < 1)
return;
LSL_Rotation q = rules.GetQuaternionItem(idx++);
if (part is ISceneChildEntity)
{
// try to let this work as in SL...
if ((part as ISceneChildEntity).ParentID == 0)
{
// special case: If we are root, rotate complete SOG to new rotation
SetRot(part as ISceneChildEntity, Rot2Quaternion(q));
}
//.........这里部分代码省略.........
示例7: botSetMap
public void botSetMap(string keyOfBot, LSL_List positions, LSL_List movementType, LSL_Integer flags)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botSetMap", m_host, "bot", m_itemID)) return;
List<Vector3> PositionsMap = new List<Vector3>();
for (int i = 0; i < positions.Length; i++)
{
LSL_Vector pos = positions.GetVector3Item(i);
PositionsMap.Add(new Vector3((float) pos.x, (float) pos.y, (float) pos.z));
}
List<TravelMode> TravelMap = new List<TravelMode>();
for (int i = 0; i < movementType.Length; i++)
{
LSL_Integer travel = movementType.GetLSLIntegerItem(i);
TravelMap.Add((TravelMode) travel.value);
}
IBotManager manager = World.RequestModuleInterface<IBotManager>();
if (manager != null)
manager.SetBotMap(UUID.Parse(keyOfBot), PositionsMap, TravelMap, flags.value, m_host.OwnerID);
}