AppleSCNGeometry - UBogun/Xojo-iosLib GitHub Wiki
Inherits from AppleSCNAnimatableObject
Memory leak check: not yet done.
Status: incomplete, geometryWithMDLMesh constructor missing, Shadable protocol missing
An SCNGeometry object represents a three-dimensional shape—a collection of vertices, normals and texture coordinates that define a surface, also known as a model or mesh. In SceneKit, geometries attached to SCNNode objects form the visible elements of a scene, and SCNMaterial objects attached to a geometry determine its appearance.
In most cases, you will want to use one of the subclasses of AppleSCNGeometry like AppleSCNBox or -Floor which make using common geometric forms easy.
SCNGeometry includes the AppleSCNAnimatableObject Interface, which means you can use AppleCAAnimations to animate these properties. Convenience methods have not been introduced to this class. Please check out the Animate… methods of the AppleView class to get an idea of how to create own property animations for this class.**
Constructors
Constructor(Sources as AppleArray of AppleSCNGeometrySource, Elements As AppleArray Of AppleSCNGeometryElement): Creates a new geometry built from the specified geometry sources and elements.
Properties
EdgeCreasesElement As AppleSCNGeometryElement: The geometry element identifying which edges of the geometry’s surface should remain sharp after subdivision.
EdgeCreasesSource As AppleSCNGeometrySource: The geometry source specifying the smoothness or sharpness of edges after surface subdivision.
FirstMaterial As AppleSCNMaterial: The first material attached to the geometry. Calling this convenience method is equivalent to retrieving the first object from the geometry’s materials array. This property’s value is nil if the geometry has no attached materials.
GeometryElementsCount As Integer: The number of geometry elements in the geometry. (read-only)
GeometryElements As AppleArray Of AppleSCNGeometryElement: An array of geometry elements that describe the geometry’s shape. (read-only)
GeometrySources As AppleArray Of AppleSCNGeometrySource: An array of geometry sources that provide vertex data for the geometry. (read-only)
LevelsOfDetail As AppleArray of AppleSCNLevelDetail: An array of SCNLevelOfDetail objects for managing the geometry’s appearance when viewed from far away.
Materials As AppleArray Of AppleSCNMaterial: An array of SCNMaterial objects that determine the geometry’s appearance when rendered.
Name As Text: A name associated with the geometry object.
SubDivisionLevel As UInteger: The number of subdivisions SceneKit uses to smooth the geometry’s surface at render time.
Methods
Material (MaterialName As Text) As AppleSCNMaterial: Returns the first material attached to the geometry with the specified name.
InsertMaterial (Material as AppleSCNMaterial, Index as UInteger): Attaches a material to the geometry at the specified index.
RemoveMaterial (Index as UInteger): Removes a material attached to the geometry.
ReplaceMaterial (Index as UInteger, NewMaterial as AppleSCNMaterial): Replaces a material attached to the geometry with another.
GeometryElement (Index As Integer) As AppleSCNGeometryElement: Returns the geometry element at a specified index.
GeometrySources (Semantic As Text) As AppleArray of AppleSCNGeometrySource: Returns the geometry sources for a specified semantic.
BoundingBox (byref min as SCNVector3, byref max as SCNVector3) As Boolean: Gets the minimum and maximum corner points of the object’s bounding box. Returns True if the node has a valid volume.
BoundingSphereCenter (byref center as SCNVector3, byref radius as double) As Boolean: Gets the center point and radius of the object’s bounding sphere. Returns True if the node has a valid volume.
SetBoundingBox (min as SCNVector3, max as SCNVector3): Sets a custom bounding box for the object.
See the AppleSCNAnimatableObject class for more properties and methods of this class.