Class Model3DPtr


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

      • Model3DPtr

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

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

        public Model3DPtr​(Model3D ptr)
        Do not take ownership of ptr.

        ptr can be null.

        The constructor is implicit on purpose.
    • Method Detail

      • getCPtr

        public static long getCPtr​(Model3DPtr obj)
      • delete

        public void delete()
      • deref

        public Model3D deref()
        The pointer stored in the object.
      • __ref__

        public Model3D __ref__()
        Dereferencing operator.
      • getDeref

        public Model3D getDeref()
        Member access operator.
      • equals

        public boolean equals​(Model3D p)
      • 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
      • optimize

        public void optimize​(double smooth_angle,
                             Model3D.SmoothMethod method)
        optimize vertices and vertice normals

        removes redundant vertices and recalculates all vertice normals based on the face normals
        and the angle between face normals smooth_angle.
        Parameters:
        smooth_angle -
        method -
      • optimize

        public void optimize​(double smooth_angle)
        optimize vertices and vertice normals

        removes redundant vertices and recalculates all vertice normals based on the face normals
        and the angle between face normals smooth_angle.
        Parameters:
        smooth_angle -
      • addGeometry

        public void addGeometry​(Model3D.Material mat,
                                GeometryPtr geom)
        add geometry to this model3d
        Parameters:
        mat - [in] the material properties to use for the geometry.
        geom - [in] the geometry to add.
      • addTriMesh

        public void addTriMesh​(Model3D.Material mat,
                               TriMesh mesh)
        add a triangle mesh to this model3d
        Parameters:
        mat - [in] the material properties to use for the mesh.
        mesh - [in] the mesh geometry.
      • addTriMesh

        public void addTriMesh​(Model3D.Material mat,
                               TriMeshCPtr geom)
        add a triangle mesh to this model3d
        Parameters:
        mat - [in] the material properties to use for the mesh.
        geom - [in] the mesh geometry.
      • addMaterial

        public int addMaterial​(Model3D.Material mat)
        all objects in a model use the materials defined on the model
        Parameters:
        mat - [in] material to add.
        Returns:
        id of the newly added material.
      • getMaterial

        public Model3D.Material getMaterial​(java.lang.String matid)
        get material with string id matid
        Parameters:
        matid - [in] string id
        Returns:
        pointer to Matrial data
      • hasMaterial

        public boolean hasMaterial​(java.lang.String matid)
        check if model has material with id matid
        Parameters:
        matid - [in] string id of material
        Returns:
        true if exists in model
      • removeObject

        public void removeObject​(java.lang.String name)
        remove object with string id name
        Parameters:
        name - [in] name of object to remove
      • scale

        public void scale​(float scale)
      • getTransform

        public Transform3D getTransform()
        get pose of this Model3D
      • setTransform

        public void setTransform​(Transform3D t3d)
        set the pose of this Model3D
      • getName

        public java.lang.String getName()
        get string identifier of this model3d
      • getFilePath

        public java.lang.String getFilePath()
        get filePath of this model3d
      • setName

        public void setName​(java.lang.String name)
        set string identifier of this model3d
      • setFilePath

        public void setFilePath​(java.lang.String name)
        set filePath this model3d
      • getMask

        public int getMask()
        get mask of this model3d
      • setMask

        public void setMask​(int mask)
        set mask of this model3d
      • toGeometryData

        public GeometryDataPtr toGeometryData()
        convert this model3d to a geometry. Notice that geometry does not hold any
        color information.
        Returns:
        a geometry of this model3d
      • isDynamic

        public boolean isDynamic()
        true if data in the model are expected to change
      • setDynamic

        public void setDynamic​(boolean dynamic)
        set to true if data in the model are expected to change