コード例 #1
0
        protected void CreateSlabs(EBoundType InBoundType, H1Vector3 InLocation, H1Vector3 InExtent)
        {
            // depending on bound type, define the number of slabs
            Int32 SlabNum = 0;

            // setting transform properties
            Position = InLocation;
            Extent   = InExtent;

            switch (InBoundType)
            {
            case EBoundType.Box:
            {
                // total 3 slabs needed (x, y, z)
                SlabNum = 3;

                Slabs = new H1Slab[SlabNum];

                // x-axis
                H1Vector3 DirectionX = new H1Vector3(1, 0, 0);
                float     ExtentX    = InExtent.X;

                Slabs[0] = new H1Slab(DirectionX, Position, ExtentX);

                // y-axis
                H1Vector3 DirectionY = new H1Vector3(0, 1, 0);
                float     ExtentY    = InExtent.Y;

                Slabs[1] = new H1Slab(DirectionY, Position, ExtentY);

                // z-axis
                H1Vector3 DirectionZ = new H1Vector3(0, 0, 1);
                float     ExtentZ    = InExtent.Z;

                Slabs[2] = new H1Slab(DirectionZ, Position, ExtentZ);

                break;
            }

            default:
                break;
            }
        }
コード例 #2
0
 public H1Bound(EBoundType InType, H1Vector3 InPosition, H1Vector3 InExtent)
 {
     CreateSlabs(InType, InPosition, InExtent);
 }