public class MDLAsset extends NSObject implements NSCopying, NSFastEnumeration
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.
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
MDLAsset(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
void |
addObject(MDLObject object)
addObject:
|
static MDLAsset |
alloc() |
static MDLAsset |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
MDLObjectContainerComponent |
animations()
[@property] animations
|
static MDLAsset |
assetWithSCNScene(SCNScene scnScene) |
static MDLAsset |
assetWithSCNSceneBufferAllocator(SCNScene scnScene,
MDLMeshBufferAllocator bufferAllocator) |
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
MDLMeshBufferAllocator |
bufferAllocator()
[@property] bufferAllocator
|
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
static boolean |
canExportFileExtension(java.lang.String extension)
canImportFileExtension:
|
static boolean |
canImportFileExtension(java.lang.String extension)
canImportFileExtension:
|
NSArray<? extends MDLObject> |
childObjectsOfClass(org.moe.natj.objc.Class objectClass)
childObjectsOfClass:
|
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
java.lang.Object |
copyWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
long |
count()
[@property] count
|
long |
countByEnumeratingWithStateObjectsCount(org.moe.natj.general.ptr.VoidPtr state,
org.moe.natj.general.ptr.Ptr<org.moe.natj.objc.ObjCObject> buffer,
long len) |
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
double |
endTime()
[@property] endTime
|
boolean |
exportAssetToURL(NSURL URL)
exportAssetToURL:
|
boolean |
exportAssetToURLError(NSURL URL,
org.moe.natj.general.ptr.Ptr<NSError> error)
exportAssetToURL:error:
|
double |
frameInterval()
[@property] frameInterval
|
static long |
hash_static() |
MDLAsset |
init() |
MDLAsset |
initWithBufferAllocator(MDLMeshBufferAllocator bufferAllocator)
initWithBufferAllocator:
|
MDLAsset |
initWithURL(NSURL URL)
initWithURL:
|
MDLAsset |
initWithURLVertexDescriptorBufferAllocator(NSURL URL,
MDLVertexDescriptor vertexDescriptor,
MDLMeshBufferAllocator bufferAllocator)
initWithURL:vertexDescriptor:bufferAllocator:
|
MDLAsset |
initWithURLVertexDescriptorBufferAllocatorPreserveTopologyError(NSURL URL,
MDLVertexDescriptor vertexDescriptor,
MDLMeshBufferAllocator bufferAllocator,
boolean preserveTopology,
org.moe.natj.general.ptr.Ptr<NSError> error)
initWithURL:vertexDescriptor:bufferAllocator:preserveTopology:error:
|
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
void |
loadTextures()
loadTextures
|
MDLObjectContainerComponent |
masters() |
static MDLAsset |
new_objc() |
MDLObject |
objectAtIndex(long index)
objectAtIndex:
|
MDLObject |
objectAtIndexedSubscript(long index)
objectAtIndexedSubscript:
|
MDLObject |
objectAtPath(java.lang.String path)
Return the object at the specified path, or nil if none exists there
|
MDLObjectContainerComponent |
originals()
[@property] originals
|
static NSArray<? extends MDLLightProbe> |
placeLightProbesWithDensityHeuristicUsingIrradianceDataSource(float value,
long type,
MDLLightProbeIrradianceDataSource dataSource) |
void |
removeObject(MDLObject object)
removeObject:
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
MDLAssetResolver |
resolver()
[@property] AssetResolver
|
void |
setAnimations(MDLObjectContainerComponent value)
[@property] animations
|
void |
setEndTime(double value)
[@property] endTime
|
void |
setFrameInterval(double value)
[@property] frameInterval
|
void |
setMasters(MDLObjectContainerComponent value) |
void |
setOriginals(MDLObjectContainerComponent value)
[@property] originals
|
void |
setResolver(MDLAssetResolver value)
[@property] AssetResolver
|
void |
setStartTime(double value)
[@property] startTime
|
static void |
setVersion_static(long aVersion) |
double |
startTime()
[@property] startTime
|
static org.moe.natj.objc.Class |
superclass_static() |
NSURL |
URL()
[@property] URL
|
static long |
version_static() |
MDLVertexDescriptor |
vertexDescriptor()
[@property] vertexDescriptor
|
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeypublic static boolean accessInstanceVariablesDirectly()
public static MDLAsset alloc()
public static MDLAsset allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static MDLAsset assetWithSCNSceneBufferAllocator(SCNScene scnScene, MDLMeshBufferAllocator bufferAllocator)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static boolean canExportFileExtension(java.lang.String extension)
Indicates whether MDLAsset object can export asset to resource with the given extension
public static boolean canImportFileExtension(java.lang.String extension)
Indicates whether MDLAsset object can be initialized with resource with the given extension
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public static long hash_static()
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static MDLAsset new_objc()
public static NSArray<? extends MDLLightProbe> placeLightProbesWithDensityHeuristicUsingIrradianceDataSource(float value, long type, MDLLightProbeIrradianceDataSource dataSource)
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static long version_static()
public NSURL URL()
URL used to create the asset
If the asset was not created with a URL, nil will be returned.
public void addObject(MDLObject object)
Add a top level object to an asset.
If the object was already in the asset, this has no effect.
public MDLMeshBufferAllocator bufferAllocator()
Allocator used to create vertex and index buffers
public NSArray<? extends MDLObject> childObjectsOfClass(org.moe.natj.objc.Class objectClass)
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.
public java.lang.Object copyWithZone(org.moe.natj.general.ptr.VoidPtr zone)
copyWithZone in interface NSCopyingpublic long count()
The number of top level objects
public long countByEnumeratingWithStateObjectsCount(org.moe.natj.general.ptr.VoidPtr state,
org.moe.natj.general.ptr.Ptr<org.moe.natj.objc.ObjCObject> buffer,
long len)
countByEnumeratingWithStateObjectsCount in interface NSFastEnumerationpublic double 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.
public boolean exportAssetToURL(NSURL URL)
Export an asset to the specified URL.
public boolean exportAssetToURLError(NSURL URL, org.moe.natj.general.ptr.Ptr<NSError> error)
Export an asset to the specified URL.
public double 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
public MDLAsset initWithBufferAllocator(MDLMeshBufferAllocator bufferAllocator)
Initialize an empty MDLAsset with a buffer allocator to be used during other operations.
public MDLAsset initWithURL(NSURL URL)
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.
public MDLAsset initWithURLVertexDescriptorBufferAllocator(NSURL URL, MDLVertexDescriptor vertexDescriptor, MDLMeshBufferAllocator 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.
public MDLAsset initWithURLVertexDescriptorBufferAllocatorPreserveTopologyError(NSURL URL, MDLVertexDescriptor vertexDescriptor, MDLMeshBufferAllocator bufferAllocator, boolean preserveTopology, org.moe.natj.general.ptr.Ptr<NSError> 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.
public MDLObjectContainerComponent masters()
public MDLObject objectAtIndex(long index)
return the indexed top level object
public MDLObject objectAtIndexedSubscript(long index)
return the indexed top level object
public void removeObject(MDLObject object)
Remove a top level object from an asset.
If the object not in the asset, this has no effect.
public void setEndTime(double value)
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.
public void setFrameInterval(double value)
Inherent frame rate of an asset
If no framerate was specified by resource or resource uncapable of specifying framerate, this value defaults to 0
public void setMasters(MDLObjectContainerComponent value)
public void setStartTime(double value)
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.
public double 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.
public MDLVertexDescriptor vertexDescriptor()
Vertex descriptor set upon asset initialization
Will be nil if there was no descriptor set
public MDLObjectContainerComponent animations()
Animations that can be bound to MDLObjects (@see MDLAnimationBindComponent)
MDLObjectContainerComponentpublic void 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.
public MDLObject objectAtPath(java.lang.String path)
public MDLAssetResolver resolver()
Resolver asset that helps find associated files
The default asset resolver is the RelativeAssetResolver
public void setAnimations(MDLObjectContainerComponent value)
Animations that can be bound to MDLObjects (@see MDLAnimationBindComponent)
MDLObjectContainerComponentpublic void setResolver(MDLAssetResolver value)
Resolver asset that helps find associated files
The default asset resolver is the RelativeAssetResolver
public MDLObjectContainerComponent originals()
Original objects that can be instanced into the asset's object hierarchy
MDLObjectContainerComponentpublic void setOriginals(MDLObjectContainerComponent value)
Original objects that can be instanced into the asset's object hierarchy
MDLObjectContainerComponent