Пример #1
0
 public void AddChild(X3DControl child)
 {
     if (child != null)
     {
         Children.Add(child);
     }
 }
Пример #2
0
        public override void Render(StringBuilder sb)
        {
            //<Sound>
            // < AudioClip url = '"sound/soft.wav"' loop = 'true' enabled = 'true' volume = '0.2' />
            //</ Sound >
            X3DControl audioclip = new X3DControl();

            audioclip.TagName = "AudioClip";
            AddChild(audioclip);
            audioclip.AddProperty("url", Url);
            audioclip.AddProperty("loop", Loop.ToSlamString());
            audioclip.AddProperty("slm:effect", Effect.ToSlamString());
            audioclip.AddProperty("enabled", Enabled.ToSlamString());
            audioclip.AddProperty("volume", Volume.ToSlamString());

            base.Render(sb);
        }
Пример #3
0
        public override void Render(StringBuilder sb)
        {
            X3DControl shape  = new X3DControl();// <Cube  slm:href='holochatspace/holochatspace.x3d' slm:target='_blank'/>
            string     prefix = "";

            var tagName = ShapeType.ToString();

            if (ShapeType == ShapeType.Prefab || ShapeType == ShapeType.Empty)
            {
                prefix = "slm:";
            }
            shape.TagName = prefix + tagName;
            shape.AddProperty("name", Name);
            shape.AddProperty("group", Group);
            shape.AddProperty("bundle", Bundle);
            shape.AddProperty("item", Item);
            shape.AddProperty("slm:href", Url);
            shape.AddProperty("slm:formfield", FormField);
            shape.AddProperty("slm:formvalue", FormValue);
            shape.AddProperty("slm:walkfloor", WalkFloor.ToSlamString());
            shape.AddProperty("length", RectLength.ToSlamString());
            shape.AddProperty("height", RectHeight.ToSlamString());
            shape.AddProperty("slm:favorite", Favorite.ToSlamString());
            shape.AddProperty("slm:history", History.ToSlamString());
            shape.AddProperty("slm:toolTip", ToolTip);
            if (Target != Target.None)
            {
                shape.AddProperty("slm:target", Target.ToString());
            }
            shape.AddProperty("slm:hidden", Hidden.ToSlamString());
            if (ShapeType == ShapeType.Text)
            {
                shape.AddProperty("string", Text);
                if (InputType != InputType.None)
                {
                    shape.AddProperty("slm:input", InputType.ToString());
                }
            }
            switch (FaceCamera)
            {
            case FaceCamera.face:
                shape.AddProperty("slm:facecamera", "face");
                break;

            case FaceCamera.back:
                shape.AddProperty("slm:facecamera", "back");
                break;

            case FaceCamera.back_lock_y:
                shape.AddProperty("slm:facecamera", "back/lock-y");
                break;

            case FaceCamera.face_lock_y:
                shape.AddProperty("slm:facecamera", "face/lock-y");
                break;

            case FaceCamera.parent_back:
                shape.AddProperty("slm:facecamera", "parent/back");
                break;

            case FaceCamera.parent_face:
                shape.AddProperty("slm:facecamera", "parent/face");
                break;

            case FaceCamera.parent_back_lock_y:
                shape.AddProperty("slm:facecamera", "parent/back/lock-y");
                break;

            case FaceCamera.parent_face_lock_y:
                shape.AddProperty("slm:facecamera", "parent/face/lock-y");
                break;
            }
            AddChild(shape);
            AddChild(Appearance);
            AddChild(IndexedTriangleSet);
            shape.AddChild(FontStyle);
            base.Render(sb);
        }