Package apple.modelio

Class MDLAsset

  • All Implemented Interfaces:
    NSCopying, NSFastEnumeration, NSObject

    public class MDLAsset
    extends NSObject
    implements NSCopying, NSFastEnumeration
    MDLAsset An MDLAsset represents the contents of a model file. Each asset contains a collection of hierarchies of objects, where each object in the asset is the top level of a hierarchy. Objects include transforms, lights, cameras, and meshes. MDLAssets are typically instantiated from NSURLs that refer to a model resource. The model resource may represented timed information, for example, a series of mesh morphs. If the asset is timed, then the framerate will be non-zero, and the firstFrame and lastFrame properties will indicate the range for which sample data exists. Samples before or after that range will be clamped. Some model resource representations allow continuous sampling, others are discrete. In the discrete case, if a requested sample time is not on a discrete boundary the returned sample will be the sample exactly on the sample time, or if no such is available, the immediately preceding sample. If no time is specified for a sample, the first data will be returned. An asset's bounding box can be queried without traversing the hierarchy of objects. Fast enumeration of an MDLAsset iterates the top level objects contained within.
    • Constructor Detail

      • MDLAsset

        protected MDLAsset​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • alloc

        public static MDLAsset alloc()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • assetWithSCNScene

        public static MDLAsset assetWithSCNScene​(SCNScene scnScene)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • canExportFileExtension

        public static boolean canExportFileExtension​(java.lang.String extension)
        canImportFileExtension: Indicates whether MDLAsset object can export asset to resource with the given extension
        Returns:
        YES is returned if MDLAsset is able is able to export assets to resources with the given extension
      • canImportFileExtension

        public static boolean canImportFileExtension​(java.lang.String extension)
        canImportFileExtension: Indicates whether MDLAsset object can be initialized with resource with the given extension
        Returns:
        YES is returned if MDLAsset is able to load and represent assets with the given extension
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • URL

        public NSURL URL()
        [@property] URL URL used to create the asset If the asset was not created with a URL, nil will be returned.
      • addObject

        public void addObject​(MDLObject object)
        addObject: Add a top level object to an asset. If the object was already in the asset, this has no effect.
      • bufferAllocator

        public MDLMeshBufferAllocator bufferAllocator()
        [@property] bufferAllocator Allocator used to create vertex and index buffers
      • childObjectsOfClass

        public NSArray<? extends MDLObject> childObjectsOfClass​(org.moe.natj.objc.Class objectClass)
        childObjectsOfClass: Inspects an asset's hierarchy for objects of the specified class type This can be used to get references to all MDLMesh objects, MDLLights, etc. if objectClass is not a subclass of MDLObject, an exception will be raised.
        Returns:
        returns an NSArray of all objects in the asset matching the requested class
      • copyWithZone

        public java.lang.Object copyWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • count

        public long count()
        [@property] count The number of top level objects
      • countByEnumeratingWithStateObjectsCount

        public long countByEnumeratingWithStateObjectsCount​(org.moe.natj.general.ptr.VoidPtr state,
                                                            org.moe.natj.general.ptr.Ptr<org.moe.natj.objc.ObjCObject> buffer,
                                                            long len)
        Specified by:
        countByEnumeratingWithStateObjectsCount in interface NSFastEnumeration
      • endTime

        public double endTime()
        [@property] endTime End time bracket of animation data If no animation data was specified by resource or resource incapable of specifying animation data, this value defaults to 0. If the endTime was set explicitly, then the value of endTime will be the greater of the set value and the animated values.
      • exportAssetToURL

        public boolean exportAssetToURL​(NSURL URL)
        exportAssetToURL: Export an asset to the specified URL.
        Returns:
        YES is returned if exporting proceeded successfully,
      • exportAssetToURLError

        public boolean exportAssetToURLError​(NSURL URL,
                                             org.moe.natj.general.ptr.Ptr<NSError> error)
        exportAssetToURL:error: Export an asset to the specified URL.
        Returns:
        YES is returned if exporting proceeded successfully,
      • frameInterval

        public double frameInterval()
        [@property] frameInterval Inherent frame rate of an asset If no framerate was specified by resource or resource uncapable of specifying framerate, this value defaults to 0
      • initWithBufferAllocator

        public MDLAsset initWithBufferAllocator​(MDLMeshBufferAllocator bufferAllocator)
        initWithBufferAllocator: Initialize an empty MDLAsset with a buffer allocator to be used during other operations.
      • initWithURL

        public MDLAsset initWithURL​(NSURL URL)
        initWithURL: Initialize an MDLAsset using the contents of the resource located at the indicated URL Vertex layout (i.e. vertexDescriptor) will be specified by ModelIO depending on attributes of the resource. Buffers will be allocated using a default NSData based allocator Submeshes will be converted to triangle topology.
      • initWithURLVertexDescriptorBufferAllocator

        public MDLAsset initWithURLVertexDescriptorBufferAllocator​(NSURL URL,
                                                                   MDLVertexDescriptor vertexDescriptor,
                                                                   MDLMeshBufferAllocator bufferAllocator)
        initWithURL:vertexDescriptor:bufferAllocator: Initialize an MDLAsset using the contents of the resource located at URL, ensuring that the asset conforms to the supplied vertexDescriptor, and buffers are allocated in the supplied allocator The default behavior is to triangulate any discovered meshes and to conform the mesh to the supplied vertexDescriptor. If nil is passed as the vertexDescriptor, then a vertexDescriptor will be created according to the attributes of the resource. If nil is passed as the bufferAllocator, buffers will be allocated using a default NSData based allocator. Submeshes will be converted to triangle topology.
      • initWithURLVertexDescriptorBufferAllocatorPreserveTopologyError

        public MDLAsset initWithURLVertexDescriptorBufferAllocatorPreserveTopologyError​(NSURL URL,
                                                                                        MDLVertexDescriptor vertexDescriptor,
                                                                                        MDLMeshBufferAllocator bufferAllocator,
                                                                                        boolean preserveTopology,
                                                                                        org.moe.natj.general.ptr.Ptr<NSError> error)
        initWithURL:vertexDescriptor:bufferAllocator:preserveTopology:error: Same as initWithURL:vertexDescriptor:bufferAllocator: except that if preserveTopology is YES, a topology buffer might be created on the submeshes. If all faces in a submesh have the same vertex count, then the submesh will a geometry type corresponding to that vertex count. For example, if all faces have four vertices, then the geometry type will be MDLGeometryTypeQuads. If faces have a varying number of vertices, then the the submesh type will be MDLGeometryTypeVariableTopology, and a faceTopologyBuffer will be created.
      • objectAtIndex

        public MDLObject objectAtIndex​(long index)
        objectAtIndex: return the indexed top level object
      • objectAtIndexedSubscript

        public MDLObject objectAtIndexedSubscript​(long index)
        objectAtIndexedSubscript: return the indexed top level object
      • removeObject

        public void removeObject​(MDLObject object)
        removeObject: Remove a top level object from an asset. If the object not in the asset, this has no effect.
      • setEndTime

        public void setEndTime​(double value)
        [@property] endTime End time bracket of animation data If no animation data was specified by resource or resource incapable of specifying animation data, this value defaults to 0. If the endTime was set explicitly, then the value of endTime will be the greater of the set value and the animated values.
      • setFrameInterval

        public void setFrameInterval​(double value)
        [@property] frameInterval Inherent frame rate of an asset If no framerate was specified by resource or resource uncapable of specifying framerate, this value defaults to 0
      • setStartTime

        public void setStartTime​(double value)
        [@property] startTime Start time bracket of animation data If no animation data was specified by resource or resource incapable of specifying animation data, this value defaults to 0. If startTime was set explicitly, then the value of startTime will be the lesser of the set value and the animated values.
      • startTime

        public double startTime()
        [@property] startTime Start time bracket of animation data If no animation data was specified by resource or resource incapable of specifying animation data, this value defaults to 0. If startTime was set explicitly, then the value of startTime will be the lesser of the set value and the animated values.
      • vertexDescriptor

        public MDLVertexDescriptor vertexDescriptor()
        [@property] vertexDescriptor Vertex descriptor set upon asset initialization Will be nil if there was no descriptor set
      • loadTextures

        public void loadTextures()
        loadTextures Iterates over all material properties on all materials. If they are string values or NSURL values, and can be resolved as textures, then the string and NSURL values will be replaced by MDLTextureSampler values.
      • objectAtPath

        public MDLObject objectAtPath​(java.lang.String path)
        Return the object at the specified path, or nil if none exists there
      • resolver

        public MDLAssetResolver resolver()
        [@property] AssetResolver Resolver asset that helps find associated files The default asset resolver is the RelativeAssetResolver
      • setResolver

        public void setResolver​(MDLAssetResolver value)
        [@property] AssetResolver Resolver asset that helps find associated files The default asset resolver is the RelativeAssetResolver