Package apple.scenekit
Class SCNGeometry
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.scenekit.SCNGeometry
-
- All Implemented Interfaces:
NSCoding,NSCopying,NSSecureCoding,NSObject,SCNAnimatable,SCNBoundingVolume,SCNShadable
- Direct Known Subclasses:
ARSCNFaceGeometry,ARSCNPlaneGeometry,SCNBox,SCNCapsule,SCNCone,SCNCylinder,SCNFloor,SCNPlane,SCNPyramid,SCNShape,SCNSphere,SCNText,SCNTorus,SCNTube
public class SCNGeometry extends NSObject implements SCNAnimatable, SCNBoundingVolume, SCNShadable, NSCopying, NSSecureCoding
SCNGeometry SCNGeometry is an abstract class that represents the geometry that can be attached to a SCNNode.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
Nested classes/interfaces inherited from interface apple.scenekit.protocol.SCNShadable
SCNShadable.Block_handleBindingOfSymbolUsingBlock, SCNShadable.Block_handleUnbindingOfSymbolUsingBlock
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSCNGeometry(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean_supportsSecureCoding()This property must return YES on all classes that allow secure coding.static booleanaccessInstanceVariablesDirectly()voidaddAnimationForKey(SCNAnimation animation, java.lang.String key)addAnimation:forKey: Adds and runs an animation Only SCNAnimation (preferred), CABasicAnimation, CAKeyframeAnimation and CAAnimationGroup are supported.voidaddAnimationPlayerForKey(SCNAnimationPlayer player, java.lang.String key)addAnimationPlayer:forKey: Add an animation player.static SCNGeometryalloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)CAAnimationanimationForKey(java.lang.String key)animationForKey: Returns the animation with the given identifier This will return nil if no such animation exists.NSArray<java.lang.String>animationKeys()[@property] animationKeys Returns an array containing the keys of all animations currently attached to the receiver.SCNAnimationPlayeranimationPlayerForKey(java.lang.String key)animationPlayerForKey: Returns the animation player with the given identifier This will return nil if no such animation player exists.static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()java.lang.ObjectcopyWithZone(org.moe.natj.general.ptr.VoidPtr zone)static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()SCNGeometryElementedgeCreasesElement()[@property] edgeCreasesElement Specifies the edges creases that control the subdivision.SCNGeometrySourceedgeCreasesSource()[@property] edgeCreasesSource Specifies the crease value of the edges specified by edgeCreasesElement.voidencodeWithCoder(NSCoder coder)SCNMaterialfirstMaterial()[@property] firstMaterial Determines the first material of the geometry.static SCNGeometrygeometry()geometry Creates and returns an empty geometry object.SCNGeometryElementgeometryElementAtIndex(long elementIndex)geometryElementAtIndex: Returns the geometry element at a given index.longgeometryElementCount()[@property] geometryElementCount Returns the number of geometry elements owned by the geometry.NSArray<? extends SCNGeometryElement>geometryElements()[@property] geometryElements The array of geometry elements of the receiver.NSArray<? extends SCNGeometrySource>geometrySources()[@property] geometrySources The array of geometry sources of the receiver.NSArray<? extends SCNGeometrySource>geometrySourcesForSemantic(java.lang.String semantic)geometrySourcesForSemantic: Returns the geometry sources for a given semantic.static SCNGeometrygeometryWithMDLMesh(MDLMesh mdlMesh)static SCNGeometrygeometryWithSourcesElements(NSArray<? extends SCNGeometrySource> sources, NSArray<? extends SCNGeometryElement> elements)geometryWithSources:elements: Creates and returns a new geometry built from geometry sources and geometry elements.booleangetBoundingBoxMinMax(SCNVector3 min, SCNVector3 max)getBoundingBoxMin:max: Fill the min and max vectors with the min and max vertex of the bounding box.booleangetBoundingSphereCenterRadius(SCNVector3 center, org.moe.natj.general.ptr.NFloatPtr radius)getBoundingSphereCenter:radius: Fill the center vector with the center of the bounding sphere and store the radius of the bounding sphere in 'radius'.voidhandleBindingOfSymbolUsingBlock(java.lang.String symbol, SCNShadable.Block_handleBindingOfSymbolUsingBlock block)handleBindingOfSymbol:usingBlock: Sets the block to call at render time to bind the value for the specified symbol of the receiver's SCNProgram.voidhandleUnbindingOfSymbolUsingBlock(java.lang.String symbol, SCNShadable.Block_handleUnbindingOfSymbolUsingBlock block)handleUnbindingOfSymbol:usingBlock: Sets the block to call at render time to unbind the value for the specified symbol of the receiver's SCNProgram.static longhash_static()SCNGeometryinit()SCNGeometryinitWithCoder(NSCoder coder)NS_DESIGNATED_INITIALIZERvoidinsertMaterialAtIndex(SCNMaterial material, long index)insertMaterial:atIndex: Insert a material in the materials array at the specified index.static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)booleanisAnimationForKeyPaused(java.lang.String key)isAnimationForKeyPaused: Returns whether the animation for the specified identifier is paused.static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)NSArray<? extends SCNLevelOfDetail>levelsOfDetail()[@property] levelsOfDetail Determines the receiver's levels of detail.NSArray<? extends SCNMaterial>materials()[@property] materials Specifies the receiver's materials array.SCNMaterialmaterialWithName(java.lang.String name)materialWithName: Return the first material from the materials array of the receiver with the specified name.java.lang.Stringname()[@property] name Determines the name of the receiver.static java.lang.Objectnew_objc()voidpauseAnimationForKey(java.lang.String key)pauseAnimationForKey: Pause the animation with the given identifier.SCNProgramprogram()[@property] program Specifies a custom program used to render the receiver.voidremoveAllAnimations()removeAllAnimations Remove all animations.voidremoveAnimationForKey(java.lang.String key)removeAnimationForKey Remove the animation with the given identifier.voidremoveAnimationForKeyBlendOutDuration(java.lang.String key, double duration)Smoothly remove the animation with the given identifier.voidremoveAnimationForKeyFadeOutDuration(java.lang.String key, double duration)removeAnimationForKey:fadeOutDuration: Smoothly remove the animation with the given identifier.voidremoveMaterialAtIndex(long index)removeMaterialAtIndex: Remove the material at the specified index from the materials array.voidreplaceMaterialAtIndexWithMaterial(long index, SCNMaterial material)replaceMaterialAtIndex:withMaterial: Remove the material at the index 'index' from the materials array of the receiver and insert 'material' in its position.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)voidresumeAnimationForKey(java.lang.String key)resumeAnimationForKey: Resume the animation with the given identifier.voidsetBoundingBoxMinMax(SCNVector3 min, SCNVector3 max)setBoundingBoxMin:max: Override the receiver bounding box with the min and max vectors provided (in local space of the receiver).voidsetEdgeCreasesElement(SCNGeometryElement value)[@property] edgeCreasesElement Specifies the edges creases that control the subdivision.voidsetEdgeCreasesSource(SCNGeometrySource value)[@property] edgeCreasesSource Specifies the crease value of the edges specified by edgeCreasesElement.voidsetFirstMaterial(SCNMaterial value)[@property] firstMaterial Determines the first material of the geometry.voidsetLevelsOfDetail(NSArray<? extends SCNLevelOfDetail> value)[@property] levelsOfDetail Determines the receiver's levels of detail.voidsetMaterials(NSArray<? extends SCNMaterial> value)[@property] materials Specifies the receiver's materials array.voidsetName(java.lang.String value)[@property] name Determines the name of the receiver.voidsetProgram(SCNProgram value)[@property] program Specifies a custom program used to render the receiver.voidsetShaderModifiers(NSDictionary<java.lang.String,java.lang.String> value)[@property] shaderModifiers Dictionary of shader modifiers snippets, targeting entry points.voidsetSpeedForAnimationKey(double speed, java.lang.String key)setSpeed:forAnimationKey: Update the animation speed of the animation with the given identifier.voidsetSubdivisionLevel(long value)[@property] subdivisionLevel Specifies the subdivision level of the receiver.voidsetTessellator(SCNGeometryTessellator value)static voidsetVersion_static(long aVersion)voidsetWantsAdaptiveSubdivision(boolean value)[@property] wantsAdaptiveSubdivision Specifies if the subdivision is adaptive or uniform.NSDictionary<java.lang.String,java.lang.String>shaderModifiers()[@property] shaderModifiers Dictionary of shader modifiers snippets, targeting entry points.longsubdivisionLevel()[@property] subdivisionLevel Specifies the subdivision level of the receiver.static org.moe.natj.objc.Classsuperclass_static()static booleansupportsSecureCoding()SCNGeometryTessellatortessellator()static longversion_static()booleanwantsAdaptiveSubdivision()[@property] wantsAdaptiveSubdivision Specifies if the subdivision is adaptive or uniform.-
Methods inherited from class apple.NSObject
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, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static SCNGeometry alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
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()
-
geometry
public static SCNGeometry geometry()
geometry Creates and returns an empty geometry object. An empty geometry may be used as the lowest level of detail of a geometry.
-
geometryWithMDLMesh
public static SCNGeometry geometryWithMDLMesh(MDLMesh mdlMesh)
-
geometryWithSourcesElements
public static SCNGeometry geometryWithSourcesElements(NSArray<? extends SCNGeometrySource> sources, NSArray<? extends SCNGeometryElement> elements)
geometryWithSources:elements: Creates and returns a new geometry built from geometry sources and geometry elements. A geometry is made of geometry sources (at least vertices) and at least one geometry element. Multiple sources for texture coordinates are accepted. In that case the mappingChannel is implicitly set based on the order of the texture sources, starting at index 0.- Parameters:
sources- An array of geometry sources. If several geometry sources have the same semantic, only the first one is taken into account.elements- An array of geometry elements. The sort order in the array determines the mapping between materials and geometry elements.
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
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()
-
supportsSecureCoding
public static boolean supportsSecureCoding()
-
version_static
public static long version_static()
-
addAnimationForKey
public void addAnimationForKey(SCNAnimation animation, java.lang.String key)
Description copied from interface:SCNAnimatableaddAnimation:forKey: Adds and runs an animation Only SCNAnimation (preferred), CABasicAnimation, CAKeyframeAnimation and CAAnimationGroup are supported. The animation starts playing right away. The animation is automatically removed on completion unless if removedOnCompletion is explicitly set to NO.- Specified by:
addAnimationForKeyin interfaceSCNAnimatable- Parameters:
animation- Added animation.key- May be any string such that only one animation per unique key is added per animatable object.
-
animationForKey
public CAAnimation animationForKey(java.lang.String key)
Description copied from interface:SCNAnimatableanimationForKey: Returns the animation with the given identifier This will return nil if no such animation exists. Attempting to modify any properties of the returned object will result in undefined behavior.- Specified by:
animationForKeyin interfaceSCNAnimatable- Parameters:
key- The identifier for the animation to retrieve.
-
animationKeys
public NSArray<java.lang.String> animationKeys()
Description copied from interface:SCNAnimatable[@property] animationKeys Returns an array containing the keys of all animations currently attached to the receiver.- Specified by:
animationKeysin interfaceSCNAnimatable
-
copyWithZone
public java.lang.Object copyWithZone(org.moe.natj.general.ptr.VoidPtr zone)
- Specified by:
copyWithZonein interfaceNSCopying
-
edgeCreasesElement
public SCNGeometryElement edgeCreasesElement()
[@property] edgeCreasesElement Specifies the edges creases that control the subdivision. Defaults to nil. The primitive type of this geometry element must be SCNGeometryPrimitiveTypeLine. See subdivisionLevel above to control the level of subdivision. See edgeCreasesSource below to specify sharpness of the creases.
-
edgeCreasesSource
public SCNGeometrySource edgeCreasesSource()
[@property] edgeCreasesSource Specifies the crease value of the edges specified by edgeCreasesElement. Defaults to nil. The semantic of this geometry source must be "SCNGeometrySourceSemanticEdgeCrease". The creases values are floating values between 0 and 10, where 0 means smooth and 10 means infinitely sharp. See subdivisionLevel above to control the level of subdivision. See edgeCreasesElement above to specify edges for edge creases.
-
encodeWithCoder
public void encodeWithCoder(NSCoder coder)
- Specified by:
encodeWithCoderin interfaceNSCoding
-
firstMaterial
public SCNMaterial firstMaterial()
[@property] firstMaterial Determines the first material of the geometry. Returns nil if the geometry has no material. This method is here for convenience. It is equivalent to the first object in the "materials" array above.
-
geometryElementAtIndex
public SCNGeometryElement geometryElementAtIndex(long elementIndex)
geometryElementAtIndex: Returns the geometry element at a given index.- Parameters:
elementIndex- The index of the geometry element.
-
geometryElementCount
public long geometryElementCount()
[@property] geometryElementCount Returns the number of geometry elements owned by the geometry.
-
geometryElements
public NSArray<? extends SCNGeometryElement> geometryElements()
[@property] geometryElements The array of geometry elements of the receiver.
-
geometrySources
public NSArray<? extends SCNGeometrySource> geometrySources()
[@property] geometrySources The array of geometry sources of the receiver.
-
geometrySourcesForSemantic
public NSArray<? extends SCNGeometrySource> geometrySourcesForSemantic(java.lang.String semantic)
geometrySourcesForSemantic: Returns the geometry sources for a given semantic. Returns nil if no geometry source is found for the given semantic. May return more than one source, typically for multiple texture coordinate sources.- Parameters:
semantic- The semantic of the geometry sources that should be retrieved.
-
getBoundingBoxMinMax
public boolean getBoundingBoxMinMax(SCNVector3 min, SCNVector3 max)
Description copied from interface:SCNBoundingVolumegetBoundingBoxMin:max: Fill the min and max vectors with the min and max vertex of the bounding box. the returned bounding box is in local space of the receiver.- Specified by:
getBoundingBoxMinMaxin interfaceSCNBoundingVolume- Parameters:
min- A pointer to a SCNVector3 to store the min vertex of the bounding box into.max- A pointer to a SCNVector3 to store the max vertex of the bounding box into.
-
getBoundingSphereCenterRadius
public boolean getBoundingSphereCenterRadius(SCNVector3 center, org.moe.natj.general.ptr.NFloatPtr radius)
Description copied from interface:SCNBoundingVolumegetBoundingSphereCenter:radius: Fill the center vector with the center of the bounding sphere and store the radius of the bounding sphere in 'radius'. the returned bounding sphere is in local space of the receiver.- Specified by:
getBoundingSphereCenterRadiusin interfaceSCNBoundingVolume- Parameters:
center- A pointer to a SCNVector3 to store the center of the bounding sphere into.radius- A pointer to a CGFloat to store the radius of the bounding sphere into.
-
handleBindingOfSymbolUsingBlock
public void handleBindingOfSymbolUsingBlock(java.lang.String symbol, SCNShadable.Block_handleBindingOfSymbolUsingBlock block)Description copied from interface:SCNShadablehandleBindingOfSymbol:usingBlock: Sets the block to call at render time to bind the value for the specified symbol of the receiver's SCNProgram. This method has no effect for symbols declared in shader modifiers. This method can only be used with OpenGL and OpenGLES based programs.- Specified by:
handleBindingOfSymbolUsingBlockin interfaceSCNShadable- Parameters:
symbol- The name of the symbol to bind a value for.block- The block to call to bind the specified symbol.
-
handleUnbindingOfSymbolUsingBlock
public void handleUnbindingOfSymbolUsingBlock(java.lang.String symbol, SCNShadable.Block_handleUnbindingOfSymbolUsingBlock block)Description copied from interface:SCNShadablehandleUnbindingOfSymbol:usingBlock: Sets the block to call at render time to unbind the value for the specified symbol of the receiver's SCNProgram. This method has no effect for symbols declared in shader modifiers. This method can only be used with OpenGL and OpenGLES based programs.- Specified by:
handleUnbindingOfSymbolUsingBlockin interfaceSCNShadable- Parameters:
symbol- The name of the symbol to unbind.block- The block to call to unbind the specified symbol.
-
init
public SCNGeometry init()
-
initWithCoder
public SCNGeometry initWithCoder(NSCoder coder)
Description copied from interface:NSCodingNS_DESIGNATED_INITIALIZER- Specified by:
initWithCoderin interfaceNSCoding
-
insertMaterialAtIndex
public void insertMaterialAtIndex(SCNMaterial material, long index)
insertMaterial:atIndex: Insert a material in the materials array at the specified index.- Parameters:
material- The material to insert.index- Index in the materials array to insert the new material.
-
isAnimationForKeyPaused
public boolean isAnimationForKeyPaused(java.lang.String key)
Description copied from interface:SCNAnimatableisAnimationForKeyPaused: Returns whether the animation for the specified identifier is paused.- Specified by:
isAnimationForKeyPausedin interfaceSCNAnimatable- Parameters:
key- The identifier for the animation to query.
-
levelsOfDetail
public NSArray<? extends SCNLevelOfDetail> levelsOfDetail()
[@property] levelsOfDetail Determines the receiver's levels of detail. Defaults to nil.
-
materialWithName
public SCNMaterial materialWithName(java.lang.String name)
materialWithName: Return the first material from the materials array of the receiver with the specified name.- Parameters:
name- The name of the material to retrieve.
-
materials
public NSArray<? extends SCNMaterial> materials()
[@property] materials Specifies the receiver's materials array. Each geometry element can be rendered using a different material. The index of the material used for a geometry element is equal to the index of that element modulo the number of materials.
-
name
public java.lang.String name()
[@property] name Determines the name of the receiver.
-
pauseAnimationForKey
public void pauseAnimationForKey(java.lang.String key)
Description copied from interface:SCNAnimatablepauseAnimationForKey: Pause the animation with the given identifier.- Specified by:
pauseAnimationForKeyin interfaceSCNAnimatable- Parameters:
key- The identifier for the animation to pause.
-
program
public SCNProgram program()
Description copied from interface:SCNShadable[@property] program Specifies a custom program used to render the receiver. When a program is set, it overrides all the rendering parameters such as material settings and shaderModifiers.- Specified by:
programin interfaceSCNShadable
-
removeAllAnimations
public void removeAllAnimations()
Description copied from interface:SCNAnimatableremoveAllAnimations Remove all animations.- Specified by:
removeAllAnimationsin interfaceSCNAnimatable
-
removeAnimationForKey
public void removeAnimationForKey(java.lang.String key)
Description copied from interface:SCNAnimatableremoveAnimationForKey Remove the animation with the given identifier.- Specified by:
removeAnimationForKeyin interfaceSCNAnimatable- Parameters:
key- The identifier for the animation to remove.
-
removeAnimationForKeyFadeOutDuration
public void removeAnimationForKeyFadeOutDuration(java.lang.String key, double duration)Description copied from interface:SCNAnimatableremoveAnimationForKey:fadeOutDuration: Smoothly remove the animation with the given identifier.- Specified by:
removeAnimationForKeyFadeOutDurationin interfaceSCNAnimatable- Parameters:
key- The identifier for the animation to remove.duration- The fade out duration used to remove the animation.
-
removeMaterialAtIndex
public void removeMaterialAtIndex(long index)
removeMaterialAtIndex: Remove the material at the specified index from the materials array.- Parameters:
index- The index of the material to remove from the 'materials' array.
-
replaceMaterialAtIndexWithMaterial
public void replaceMaterialAtIndexWithMaterial(long index, SCNMaterial material)replaceMaterialAtIndex:withMaterial: Remove the material at the index 'index' from the materials array of the receiver and insert 'material' in its position.- Parameters:
index- The index of the material to replace in the materials array.material- The new material that will replace the previous one.
-
resumeAnimationForKey
public void resumeAnimationForKey(java.lang.String key)
Description copied from interface:SCNAnimatableresumeAnimationForKey: Resume the animation with the given identifier.- Specified by:
resumeAnimationForKeyin interfaceSCNAnimatable- Parameters:
key- The identifier for the animation to resume.
-
setBoundingBoxMinMax
public void setBoundingBoxMinMax(SCNVector3 min, SCNVector3 max)
Description copied from interface:SCNBoundingVolumesetBoundingBoxMin:max: Override the receiver bounding box with the min and max vectors provided (in local space of the receiver). Passing nil as arguments will recompute the original bounding box of the receiver.- Specified by:
setBoundingBoxMinMaxin interfaceSCNBoundingVolume- Parameters:
min- A pointer to a SCNVector3 representing the min vertex of the desired bounding box.max- A pointer to a SCNVector3 representing the max vertex of the desired bounding box.
-
setEdgeCreasesElement
public void setEdgeCreasesElement(SCNGeometryElement value)
[@property] edgeCreasesElement Specifies the edges creases that control the subdivision. Defaults to nil. The primitive type of this geometry element must be SCNGeometryPrimitiveTypeLine. See subdivisionLevel above to control the level of subdivision. See edgeCreasesSource below to specify sharpness of the creases.
-
setEdgeCreasesSource
public void setEdgeCreasesSource(SCNGeometrySource value)
[@property] edgeCreasesSource Specifies the crease value of the edges specified by edgeCreasesElement. Defaults to nil. The semantic of this geometry source must be "SCNGeometrySourceSemanticEdgeCrease". The creases values are floating values between 0 and 10, where 0 means smooth and 10 means infinitely sharp. See subdivisionLevel above to control the level of subdivision. See edgeCreasesElement above to specify edges for edge creases.
-
setFirstMaterial
public void setFirstMaterial(SCNMaterial value)
[@property] firstMaterial Determines the first material of the geometry. Returns nil if the geometry has no material. This method is here for convenience. It is equivalent to the first object in the "materials" array above.
-
setLevelsOfDetail
public void setLevelsOfDetail(NSArray<? extends SCNLevelOfDetail> value)
[@property] levelsOfDetail Determines the receiver's levels of detail. Defaults to nil.
-
setMaterials
public void setMaterials(NSArray<? extends SCNMaterial> value)
[@property] materials Specifies the receiver's materials array. Each geometry element can be rendered using a different material. The index of the material used for a geometry element is equal to the index of that element modulo the number of materials.
-
setName
public void setName(java.lang.String value)
[@property] name Determines the name of the receiver.
-
setProgram
public void setProgram(SCNProgram value)
Description copied from interface:SCNShadable[@property] program Specifies a custom program used to render the receiver. When a program is set, it overrides all the rendering parameters such as material settings and shaderModifiers.- Specified by:
setProgramin interfaceSCNShadable
-
setShaderModifiers
public void setShaderModifiers(NSDictionary<java.lang.String,java.lang.String> value)
Description copied from interface:SCNShadable[@property] shaderModifiers Dictionary of shader modifiers snippets, targeting entry points. The valid keys are the entry points described in the "Shader Modifier Entry Point" constants. The values are the code snippets formatted as described below. Shader modifiers allow you to inject shader code in the standard shaders of SceneKit. This injection is allowed in few controlled entry points, allowing specific kind of tasks in specific context. Each modifier can operate on specific structures along with access to global uniforms, that could be the standard SceneKit uniforms or its own declared uniforms. Shader modifiers can be used to tweak SceneKit rendering by adding custom code at the following entry points: 1. vertex (SCNShaderModifierEntryPointGeometry) 2. surface (SCNShaderModifierEntryPointSurface) 3. lighting (SCNShaderModifierEntryPointLightingModel) 4. fragment (SCNShaderModifierEntryPointFragment) See below for a detailed explanation of these entry points and the context they provide. Shader modifiers can be written in either GLSL or the Metal Shading Language. Metal shaders won't run on iOS 8 and macOS 10.10 or earlier. The structure of a shader modifier is: GLSL | uniform float myGrayAmount = 3.0; // Custom GLSL uniforms declarations are of the form `[uniform type uniformName [= defaultValue]]` | | // Optional global function definitions (for Metal: references to uniforms in global functions are not supported). | float mySin(float t) { | return sin(t); | } | | [#pragma transparent | opaque] | [#pragma body] | | // the shader modifier code snippet itself | vec3 myColor = myGrayAmount; | _output.color.rgb += myColor; Metal Shading Language | #pragma arguments | float myGrayAmount; // Custom Metal uniforms declarations require a #pragma and are of the form `[type name]` | | #pragma declaration | // Optional global function definitions (for Metal: references to uniforms in global functions are not supported). | float mySin(float t) { | return sin(t); | } | | [#pragma transparent | opaque] | [#pragma body] | | // the shader modifier code snippet itself | float3 myColor = myGrayAmount; | _output.color.rgb += myColor; The `#pragma body` directive Is only needed if you declared functions that must not be included in the shader code itself. The `#pragma transparent` directive Forces the rendering to be blended using the following equation: _output.color.rgb + (1 - _output.color.a) * dst.rgb; where `dst` represents the current fragment color. The rgb components must be premultiplied. The `#pragma opaque` directive Forces the rendering to be opaque. It then ignores the alpha component of the fragment. When using Metal, you can also transfer varying values from the vertex shader (geometry shader modifier) to the fragment shader (surface and/or fragment shader modifier): 1. Start by declaring the varying values in at least one of the shader modifiers: Metal Shading Language | #pragma varyings | half3 myVec; 2. Then write the varying values from the vertex shader (geometry shader modifier): Metal Shading Language | #pragma body | out.myVec = _geometry.normal.xyz * 0.5h + 0.5h; 3. Finally read the varying values from the fragment shader (surface and/or fragment shader modifier): Metal Shading Language | _output.color.rgb = saturate(in.myVec); SceneKit declares the following built-in uniforms: GLSL | Metal Shading Language | --------------------------------------------┼-------------------------------------------------------┤ float u_time | float scn_frame.time | The current time, in seconds vec2 u_inverseResolution | float2 scn_frame.inverseResolution | 1.0 / screen size --------------------------------------------┼-------------------------------------------------------┤ mat4 u_viewTransform | float4x4 scn_frame.viewTransform | See SCNViewTransform mat4 u_inverseViewTransform | float4x4 scn_frame.inverseViewTransform | mat4 u_projectionTransform | float4x4 scn_frame.projectionTransform | See SCNProjectionTransform mat4 u_inverseProjectionTransform | float4x4 scn_frame.inverseProjectionTransform | --------------------------------------------┼-------------------------------------------------------┤ mat4 u_normalTransform | float4x4 scn_node.normalTransform | See SCNNormalTransform mat4 u_modelTransform | float4x4 scn_node.modelTransform | See SCNModelTransform mat4 u_inverseModelTransform | float4x4 scn_node.inverseModelTransform | mat4 u_modelViewTransform | float4x4 scn_node.modelViewTransform | See SCNModelViewTransform mat4 u_inverseModelViewTransform | float4x4 scn_node.inverseModelViewTransform | mat4 u_modelViewProjectionTransform | float4x4 scn_node.modelViewProjectionTransform | See SCNModelViewProjectionTransform mat4 u_inverseModelViewProjectionTransform | float4x4 scn_node.inverseModelViewProjectionTransform | --------------------------------------------┼-------------------------------------------------------┤ mat2x3 u_boundingBox; | float2x3 scn_node.boundingBox | The bounding box of the current geometry, in model space, u_boundingBox[0].xyz and u_boundingBox[1].xyz being respectively the minimum and maximum corner of the box. mat2x3 u_worldBoundingBox; | float2x3 scn_node.worldBoundingBox | The bounding box of the current geometry, in world space. When writing shaders using the Metal Shading Language a complete description of the type of the scn_frame variable (SCNSceneBuffer) can be found in theheader file. The type of the scn_node variable is generated at compile time and there's no corresponding header file in the framework. In addition to these built-in uniforms, it is possible to use custom uniforms: The SCNGeometry and SCNMaterial classes are key-value coding compliant classes, which means that you can set values for arbitrary keys. Even if the key `myAmplitude` is not a declared property of the class, you can still set a value for it. Declaring a `myAmplitude` uniform in the shader modifier makes SceneKit observe the reveiver's `myAmplitude` key. Any change to that key will make SceneKit bind the uniform with the new value. The following GLSL and Metal Shading Language types (and their Objective-C counterparts) can be used to declare (and bind) custom uniforms: GLSL | Metal Shading Language | Objective-C | ------------┼------------------------┼---------------------------------------┤ int | int | NSNumber, NSInteger, int | float | float | NSNumber, CGFloat, float, double | vec2 | float2 | CGPoint | vec3 | float3 | SCNVector3 | vec4 | float4 | SCNVector4 | mat4, mat44 | float4x4 | SCNMatrix4 | sampler2D | texture2d | SCNMaterialProperty | samplerCube | texturecube | SCNMaterialProperty (with a cube map) | - | device const T* | MTLBuffer | Feature introduced in macOS 10.13, iOS 11.0 and tvOS 11.0 - | struct {...} | NSData | The entire struct can be set using NSData but it is also possible to set individual members using the member's name as a key and a value compatible with the member's type Common scalar types wrapped into a NSValue are also supported. The following prefixes are reserved by SceneKit and should not be used in custom names: 1. u_ 2. a_ 3. v_ Custom uniforms can be animated using explicit animations. - Specified by:
setShaderModifiersin interfaceSCNShadable
-
setSpeedForAnimationKey
public void setSpeedForAnimationKey(double speed, java.lang.String key)Description copied from interface:SCNAnimatablesetSpeed:forAnimationKey: Update the animation speed of the animation with the given identifier.- Specified by:
setSpeedForAnimationKeyin interfaceSCNAnimatable- Parameters:
speed- The new speed of the animation.key- The identifier for the animation to update.
-
setSubdivisionLevel
public void setSubdivisionLevel(long value)
[@property] subdivisionLevel Specifies the subdivision level of the receiver. Defaults to 0. A subdivision level of 0 means no subdivision. When the `tessellator` property of the receiver is not nil, the refinement is done on the GPU.
-
shaderModifiers
public NSDictionary<java.lang.String,java.lang.String> shaderModifiers()
Description copied from interface:SCNShadable[@property] shaderModifiers Dictionary of shader modifiers snippets, targeting entry points. The valid keys are the entry points described in the "Shader Modifier Entry Point" constants. The values are the code snippets formatted as described below. Shader modifiers allow you to inject shader code in the standard shaders of SceneKit. This injection is allowed in few controlled entry points, allowing specific kind of tasks in specific context. Each modifier can operate on specific structures along with access to global uniforms, that could be the standard SceneKit uniforms or its own declared uniforms. Shader modifiers can be used to tweak SceneKit rendering by adding custom code at the following entry points: 1. vertex (SCNShaderModifierEntryPointGeometry) 2. surface (SCNShaderModifierEntryPointSurface) 3. lighting (SCNShaderModifierEntryPointLightingModel) 4. fragment (SCNShaderModifierEntryPointFragment) See below for a detailed explanation of these entry points and the context they provide. Shader modifiers can be written in either GLSL or the Metal Shading Language. Metal shaders won't run on iOS 8 and macOS 10.10 or earlier. The structure of a shader modifier is: GLSL | uniform float myGrayAmount = 3.0; // Custom GLSL uniforms declarations are of the form `[uniform type uniformName [= defaultValue]]` | | // Optional global function definitions (for Metal: references to uniforms in global functions are not supported). | float mySin(float t) { | return sin(t); | } | | [#pragma transparent | opaque] | [#pragma body] | | // the shader modifier code snippet itself | vec3 myColor = myGrayAmount; | _output.color.rgb += myColor; Metal Shading Language | #pragma arguments | float myGrayAmount; // Custom Metal uniforms declarations require a #pragma and are of the form `[type name]` | | #pragma declaration | // Optional global function definitions (for Metal: references to uniforms in global functions are not supported). | float mySin(float t) { | return sin(t); | } | | [#pragma transparent | opaque] | [#pragma body] | | // the shader modifier code snippet itself | float3 myColor = myGrayAmount; | _output.color.rgb += myColor; The `#pragma body` directive Is only needed if you declared functions that must not be included in the shader code itself. The `#pragma transparent` directive Forces the rendering to be blended using the following equation: _output.color.rgb + (1 - _output.color.a) * dst.rgb; where `dst` represents the current fragment color. The rgb components must be premultiplied. The `#pragma opaque` directive Forces the rendering to be opaque. It then ignores the alpha component of the fragment. When using Metal, you can also transfer varying values from the vertex shader (geometry shader modifier) to the fragment shader (surface and/or fragment shader modifier): 1. Start by declaring the varying values in at least one of the shader modifiers: Metal Shading Language | #pragma varyings | half3 myVec; 2. Then write the varying values from the vertex shader (geometry shader modifier): Metal Shading Language | #pragma body | out.myVec = _geometry.normal.xyz * 0.5h + 0.5h; 3. Finally read the varying values from the fragment shader (surface and/or fragment shader modifier): Metal Shading Language | _output.color.rgb = saturate(in.myVec); SceneKit declares the following built-in uniforms: GLSL | Metal Shading Language | --------------------------------------------┼-------------------------------------------------------┤ float u_time | float scn_frame.time | The current time, in seconds vec2 u_inverseResolution | float2 scn_frame.inverseResolution | 1.0 / screen size --------------------------------------------┼-------------------------------------------------------┤ mat4 u_viewTransform | float4x4 scn_frame.viewTransform | See SCNViewTransform mat4 u_inverseViewTransform | float4x4 scn_frame.inverseViewTransform | mat4 u_projectionTransform | float4x4 scn_frame.projectionTransform | See SCNProjectionTransform mat4 u_inverseProjectionTransform | float4x4 scn_frame.inverseProjectionTransform | --------------------------------------------┼-------------------------------------------------------┤ mat4 u_normalTransform | float4x4 scn_node.normalTransform | See SCNNormalTransform mat4 u_modelTransform | float4x4 scn_node.modelTransform | See SCNModelTransform mat4 u_inverseModelTransform | float4x4 scn_node.inverseModelTransform | mat4 u_modelViewTransform | float4x4 scn_node.modelViewTransform | See SCNModelViewTransform mat4 u_inverseModelViewTransform | float4x4 scn_node.inverseModelViewTransform | mat4 u_modelViewProjectionTransform | float4x4 scn_node.modelViewProjectionTransform | See SCNModelViewProjectionTransform mat4 u_inverseModelViewProjectionTransform | float4x4 scn_node.inverseModelViewProjectionTransform | --------------------------------------------┼-------------------------------------------------------┤ mat2x3 u_boundingBox; | float2x3 scn_node.boundingBox | The bounding box of the current geometry, in model space, u_boundingBox[0].xyz and u_boundingBox[1].xyz being respectively the minimum and maximum corner of the box. mat2x3 u_worldBoundingBox; | float2x3 scn_node.worldBoundingBox | The bounding box of the current geometry, in world space. When writing shaders using the Metal Shading Language a complete description of the type of the scn_frame variable (SCNSceneBuffer) can be found in theheader file. The type of the scn_node variable is generated at compile time and there's no corresponding header file in the framework. In addition to these built-in uniforms, it is possible to use custom uniforms: The SCNGeometry and SCNMaterial classes are key-value coding compliant classes, which means that you can set values for arbitrary keys. Even if the key `myAmplitude` is not a declared property of the class, you can still set a value for it. Declaring a `myAmplitude` uniform in the shader modifier makes SceneKit observe the reveiver's `myAmplitude` key. Any change to that key will make SceneKit bind the uniform with the new value. The following GLSL and Metal Shading Language types (and their Objective-C counterparts) can be used to declare (and bind) custom uniforms: GLSL | Metal Shading Language | Objective-C | ------------┼------------------------┼---------------------------------------┤ int | int | NSNumber, NSInteger, int | float | float | NSNumber, CGFloat, float, double | vec2 | float2 | CGPoint | vec3 | float3 | SCNVector3 | vec4 | float4 | SCNVector4 | mat4, mat44 | float4x4 | SCNMatrix4 | sampler2D | texture2d | SCNMaterialProperty | samplerCube | texturecube | SCNMaterialProperty (with a cube map) | - | device const T* | MTLBuffer | Feature introduced in macOS 10.13, iOS 11.0 and tvOS 11.0 - | struct {...} | NSData | The entire struct can be set using NSData but it is also possible to set individual members using the member's name as a key and a value compatible with the member's type Common scalar types wrapped into a NSValue are also supported. The following prefixes are reserved by SceneKit and should not be used in custom names: 1. u_ 2. a_ 3. v_ Custom uniforms can be animated using explicit animations. - Specified by:
shaderModifiersin interfaceSCNShadable
-
subdivisionLevel
public long subdivisionLevel()
[@property] subdivisionLevel Specifies the subdivision level of the receiver. Defaults to 0. A subdivision level of 0 means no subdivision. When the `tessellator` property of the receiver is not nil, the refinement is done on the GPU.
-
_supportsSecureCoding
public boolean _supportsSecureCoding()
Description copied from interface:NSSecureCodingThis property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.- Specified by:
_supportsSecureCodingin interfaceNSSecureCoding
-
addAnimationPlayerForKey
public void addAnimationPlayerForKey(SCNAnimationPlayer player, java.lang.String key)
Description copied from interface:SCNAnimatableaddAnimationPlayer:forKey: Add an animation player. The animation player is not removed automatically on completion. The animation doesn't start playing immediatelly. Call "play" on the player to start playing it.- Specified by:
addAnimationPlayerForKeyin interfaceSCNAnimatable- Parameters:
player- Added animation player.key- May be any string such that only one animation per unique key is added per animatable object.
-
animationPlayerForKey
public SCNAnimationPlayer animationPlayerForKey(java.lang.String key)
Description copied from interface:SCNAnimatableanimationPlayerForKey: Returns the animation player with the given identifier This will return nil if no such animation player exists.- Specified by:
animationPlayerForKeyin interfaceSCNAnimatable- Parameters:
key- The identifier for the animation player to retrieve.
-
removeAnimationForKeyBlendOutDuration
public void removeAnimationForKeyBlendOutDuration(java.lang.String key, double duration)Description copied from interface:SCNAnimatableSmoothly remove the animation with the given identifier.- Specified by:
removeAnimationForKeyBlendOutDurationin interfaceSCNAnimatable- Parameters:
key- The identifier for the animation to remove.duration- The blend out duration used to remove the animation.
-
setTessellator
public void setTessellator(SCNGeometryTessellator value)
-
setWantsAdaptiveSubdivision
public void setWantsAdaptiveSubdivision(boolean value)
[@property] wantsAdaptiveSubdivision Specifies if the subdivision is adaptive or uniform. Defaults to YES. Adaptive subdivision requires that the `tessellator` property of the receiver is not nil.
-
tessellator
public SCNGeometryTessellator tessellator()
-
wantsAdaptiveSubdivision
public boolean wantsAdaptiveSubdivision()
[@property] wantsAdaptiveSubdivision Specifies if the subdivision is adaptive or uniform. Defaults to YES. Adaptive subdivision requires that the `tessellator` property of the receiver is not nil.
-
-