Class IndexedTriMeshN0_fPtr


  • public class IndexedTriMeshN0_fPtr
    extends java.lang.Object
    Ptr stores a pointer and optionally takes ownership of the value.
    • Constructor Detail

      • IndexedTriMeshN0_fPtr

        public IndexedTriMeshN0_fPtr​(long cPtr,
                                     boolean cMemoryOwn)
      • IndexedTriMeshN0_fPtr

        public IndexedTriMeshN0_fPtr()
        Default constructor yielding a NULL-pointer.
      • IndexedTriMeshN0_fPtr

        public IndexedTriMeshN0_fPtr​(IndexedTriMeshN0_f ptr)
        Do not take ownership of ptr.

        ptr can be null.

        The constructor is implicit on purpose.
    • Method Detail

      • delete

        public void delete()
      • isShared

        public boolean isShared()
        check if this Ptr has shared ownership or none
        ownership
        Returns:
        true if Ptr has shared ownership, false if it has no ownership.
      • isNull

        public boolean isNull()
        checks if the pointer is null
        Returns:
        Returns true if the pointer is null
      • getTriangle

        public Triangle getTriangle​(long i)
      • getTriangle

        public void getTriangle​(long i,
                                Triangle dst)
      • getTriangle

        public void getTriangle​(long i,
                                Triangle_f dst)
      • add

        public void add​(IndexedTriangle triangle)
        Add indexed triangle to the triangle mesh.
        Parameters:
        triangle - [in] the indexed triangle to add.
      • getTriVertex

        public Vector3Df getTriVertex​(long i,
                                      long triIdx)
        get vertex i of triangle at index triIdx.
        Parameters:
        i - [in] should be in interval [0;2]
        triIdx - [in] index of triangle in the triangle mesh
        Returns:
        a reference to the given vertex.
      • getTriangles

        public VectorIndexedTriangle getTriangles()
        get triangle list
        Returns:
        vector of triangles
      • calcFaceArea

        public float calcFaceArea​(long triIdx)
        calculate area of triangle at index triIdx
        Returns:
        the area.
      • calcFaceCentroid

        public Vector3Df calcFaceCentroid​(long triIdx)
        calculate centroid of triangle at index triIdx
        Returns:
        the centroid.
      • calcFaceNormal

        public Vector3Df calcFaceNormal​(long triIdx)
        calculate face normal of triangle at index triIdx
        Returns:
        the face normal.
      • resize

        public void resize​(long nsize)
        Set the number of triangles in the mesh.
        Parameters:
        nsize - [in] the new size of the mesh.
      • getNrTris

        public int getNrTris()
      • getSize

        public long getSize()
      • getTriangleStride

        public short getTriangleStride()
        The stride of a triangle.
        Returns:
        the stride.
      • getIndexSize

        public short getIndexSize()
        The size of the index type used.
        Returns:
        Typically 2 (uint16_t) or 4 (uint32_t).
      • getIndexPtr

        public SWIGTYPE_p_unsigned_char getIndexPtr()
        Pointer to the start of the index array.
        Returns:
        pointer to byte array.
      • size

        public long size()
      • hasVertexNormals

        public boolean hasVertexNormals()
        Check if trimesh has vertex normals defined.
        Returns:
        true if vertex normals are defined.
      • hasFaceNormals

        public boolean hasFaceNormals()
        Check if trimesh has face normals defined.
        Returns:
        true if face normals are defined.
      • getIndices

        public SWIGTYPE_p_void getIndices()
        Get pointer to first element of index array.
        Returns:
        pointer to first element.
      • scale

        public void scale​(double scale)
      • getTriMesh

        public TriMeshPtr getTriMesh​(boolean forceCopy)
      • isConvex

        public boolean isConvex()
      • setConvexEnabled

        public void setConvexEnabled​(boolean isConvex)
      • getVolume

        public double getVolume()
        calculate a volume of this triangle mesh
      • toString

        public java.lang.String toString​(GeometryData.GeometryType type)
        format GeometryType to string
        Parameters:
        type -