本文整理汇总了C#中ISceneChildEntity.UpdateOffSet方法的典型用法代码示例。如果您正苦于以下问题:C# ISceneChildEntity.UpdateOffSet方法的具体用法?C# ISceneChildEntity.UpdateOffSet怎么用?C# ISceneChildEntity.UpdateOffSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISceneChildEntity
的用法示例。
在下文中一共展示了ISceneChildEntity.UpdateOffSet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetPos
protected void SetPos(ISceneChildEntity part, LSL_Vector targetPos)
{
// Capped movemment if distance > 10m (http://wiki.secondlife.com/wiki/LlSetPos)
LSL_Vector currentPos = GetPartLocalPos(part);
float ground = 0;
bool disable_underground_movement = m_ScriptEngine.Config.GetBoolean("DisableUndergroundMovement", true);
ITerrainChannel heightmap = World.RequestModuleInterface<ITerrainChannel>();
if(heightmap != null)
ground = heightmap.GetNormalizedGroundHeight((int)(float)targetPos.x, (int)(float)targetPos.y);
if (part.ParentEntity == null)
{
if (ground != 0 && (targetPos.z < ground) && disable_underground_movement && m_host.AttachmentPoint == 0)
targetPos.z = ground;
LSL_Vector real_vec = SetPosAdjust(currentPos, targetPos);
part.UpdateOffSet(new Vector3((float)real_vec.x, (float)real_vec.y, (float)real_vec.z));
}
else if (part.ParentEntity.RootChild == part)
{
ISceneEntity parent = part.ParentEntity;
if (!part.IsAttachment)
{
if (ground != 0 && (targetPos.z < ground) && disable_underground_movement)
targetPos.z = ground;
}
LSL_Vector real_vec = SetPosAdjust(currentPos, targetPos);
parent.UpdateGroupPosition(new Vector3((float)real_vec.x, (float)real_vec.y, (float)real_vec.z), true);
}
else
{
LSL_Vector rel_vec = SetPosAdjust(currentPos, targetPos);
part.FixOffsetPosition((new Vector3((float)rel_vec.x, (float)rel_vec.y, (float)rel_vec.z)),true);
ISceneEntity parent = part.ParentEntity;
parent.ScheduleGroupTerseUpdate();
}
}