Package com.ngt.jopenmetaverse.shared.protocol.primitives

Examples of com.ngt.jopenmetaverse.shared.protocol.primitives.ConstructionData


        return;
    }

    private PrimMesh GeneratePrimMesh(Primitive prim, DetailLevel lod, boolean viewerMode)
    {
        ConstructionData primData = prim.PrimData;
        int sides = 4;
        int hollowsides = 4;

        float profileBegin = primData.ProfileBegin;
        float profileEnd = primData.ProfileEnd;

        if (ProfileCurve.get((byte)(primData.profileCurve & 0x07)) == ProfileCurve.Circle)
        {
            switch (lod)
            {
                case Low:
                    sides = 6;
                    break;
                case Medium:
                    sides = 12;
                    break;
                default:
                    sides = 24;
                    break;
            }
        }
        else if (ProfileCurve.get((byte)(primData.profileCurve & 0x07)) == ProfileCurve.EqualTriangle)
            sides = 3;
        else if (ProfileCurve.get((byte)(primData.profileCurve & 0x07)) == ProfileCurve.HalfCircle)
        {
            // half circle, prim is a sphere
            switch (lod)
            {
                case Low:
                    sides = 6;
                    break;
                case Medium:
                    sides = 12;
                    break;
                default:
                    sides = 24;
                    break;
            }
            profileBegin = 0.5f * profileBegin + 0.5f;
            profileEnd = 0.5f * profileEnd + 0.5f;
        }

        if ((HoleType)primData.getProfileHole() == HoleType.Same)
            hollowsides = sides;
        else if ((HoleType)primData.getProfileHole() == HoleType.Circle)
        {
            switch (lod)
            {
                case Low:
                    hollowsides = 6;
                    break;
                case Medium:
                    hollowsides = 12;
                    break;
                default:
                    hollowsides = 24;
                    break;
            }
        }
        else if ((HoleType)primData.getProfileHole() == HoleType.Triangle)
            hollowsides = 3;

        PrimMesh newPrim = new PrimMesh(sides, profileBegin, profileEnd, (float)primData.ProfileHollow, hollowsides);
        newPrim.viewerMode = viewerMode;
        newPrim.holeSizeX = primData.PathScaleX;
View Full Code Here


      //JLogger.debug("Got NameValue String: " + nameValue + " $Parsed Values$ " + NameValue.NameValuesToString(nameValues));
     
      //endregion NameValue parsing

      //region Decode Object (primitive) parameters
      ConstructionData data = new ConstructionData();
      data.State = block.State;
      data.Material = Material.get(block.Material);
      data.PathCurve = PathCurve.get(block.PathCurve);
      data.profileCurve = block.ProfileCurve;
      data.PathBegin = Primitive.UnpackBeginCut(block.PathBegin);
View Full Code Here

  /// </summary>
  /// <param name="type">Primitive shape to construct</param>
  /// <returns>Construction data that can be plugged into a <seealso cref="Primitive"/></returns>
  public static ConstructionData BuildBasicShape(PrimType type) throws NotSupportedException
  {
    ConstructionData prim = new ConstructionData();
    prim.PCode = PCode.Prim;
    prim.Material = Material.Wood;

    switch (type)
    {
View Full Code Here

TOP

Related Classes of com.ngt.jopenmetaverse.shared.protocol.primitives.ConstructionData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.