Class TubeSurface

    • Field Detail

      • m_oRadial

        float m_oRadial
      • m_iMedialSamples

        int m_iMedialSamples
      • m_iSliceSamples

        int m_iSliceSamples
      • m_afSin

        float[] m_afSin
      • m_afCos

        float[] m_afCos
      • m_bClosed

        boolean m_bClosed
      • m_bSampleByArcLength

        boolean m_bSampleByArcLength
    • Constructor Detail

      • TubeSurface

        public TubeSurface()
        default constructor, streaming
      • TubeSurface

        public TubeSurface​(Curve3f pkMedial,
                           float oRadial,
                           boolean bClosed,
                           Vector3f rkUpVector,
                           int iMedialSamples,
                           int iSliceSamples,
                           Attributes rkAttr,
                           boolean bSampleByArcLength,
                           boolean bInsideView,
                           Vector2f pkUVMin,
                           Vector2f pkUVMax)
        Construction and destruction. If rkUpVector is not the zero vector, it will be used as 'up' in the frame calculations. If it is the zero vector, the Frenet frame will be used. If bWantColors is 'true', the vertex colors are allocated and set to black. The application needs to assign colors as needed. If either of pkUVMin or pkUVMax is not null, both must be not null. In this case, texture coordinates are generated for the surface.
        Parameters:
        pkMedial -
        oRadial -
        bClosed -
        rkUpVector - If rkUpVector is not the zero vector, it will be used as 'up' in the frame calculations. If it is the zero vector, the Frenet frame will be used.
        iMedialSamples - control tessellation
        iSliceSamples - control tessellation
        rkAttr -
        bSampleByArcLength -
        bInsideView -
        pkUVMin - if not null, generate texture coordinates
        pkUVMax - if not null, generate texture coordinates
    • Method Detail

      • GetMedial

        Curve3f GetMedial()
        member access
      • GetRadial

        float GetRadial()
        member access
      • GetSliceSamples

        int GetSliceSamples()
        member access
      • GetUpVector

        Vector3f GetUpVector()
        member access
      • Index

        int Index​(int iS,
                  int iM)
        member access
      • setRadial

        float setRadial​(float radial)
        member access
      • UpVector

        Vector3f UpVector()
        member access
      • GetTMaxSlice

        public void GetTMaxSlice​(Vector3f[] akSlice)
        Generate vertices for the end slices. @see GetTMinSlice()
        Parameters:
        akSlice - slice list
      • GetTMinSlice

        public void GetTMinSlice​(Vector3f[] akSlice)
        Generate vertices for the end slices. These are useful when you build an open tube and want to attach meshes at the ends to close the tube. The input array must have size (at least) S+1 where S is the number returned by GetSliceSamples. Function GetTMinSlice is used to access the slice corresponding to the medial curve evaluated at its domain minimum, tmin. Function GetTMaxSlice accesses the slice for the domain maximum, tmax. If the curve is closed, the slices are the same.
        Parameters:
        akSlice - slice list
      • UpdateSurface

        public void UpdateSurface()
        If the medial curve is modified, for example if it is control point based and the control points are modified, then you should call this update function to recompute the tube surface geometry.
      • ComputeIndices

        private void ComputeIndices​(boolean bInsideView)
        tessellation support
      • ComputeNormals

        private void ComputeNormals()
        tessellation support
      • ComputeSinCos

        private void ComputeSinCos()
        tessellation support
      • ComputeUVs

        private void ComputeUVs​(Vector2f rkUVMin,
                                Vector2f rkUVMax)
        tessellation support
      • ComputeVertices

        private void ComputeVertices()
        tessellation support