KudanAR - iOS
ARMeshNode Class Reference

#import <ARMeshNode.h>

+ Inheritance diagram for ARMeshNode:
+ Collaboration diagram for ARMeshNode:

Class Methods

(instancetype) + testMeshNodeWithRed:green:blue:
 
(instancetype) + testMeshNodeWithTexture:
 
(instancetype) + meshNodeWithTexture:width:height:
 
(instancetype) + meshNodeWithRed:green:blue:width:height:
 
- Class Methods inherited from ARNode
(instancetype) + nodeWithName:
 

Properties

ARMeshmesh
 
ARMaterialmaterial
 
BOOL cull
 
- Properties inherited from ARNode
NSString * name
 
ARNodeparent
 
NSArray< ARNode * > * children
 
NSArray * descendants
 
ARVector3position
 
ARVector3scale
 
ARQuaternionorientation
 
ARMatrix4localTransform
 
ARMatrix4worldTransform
 
ARMatrix4fullTransform
 
ARQuaternionfullOrientation
 
ARQuaternionworldOrientation
 
ARVector3worldScale
 
ARVector3worldPosition
 
ARVector3fullPosition
 
ARNodeworld
 
NSUInteger childCount
 
BOOL visible
 

Additional Inherited Members

- Instance Methods inherited from ARNode
(void) - addChild:
 
(void) - addChildren:
 
(void) - removeChild:
 
(void) - removeAllChildren
 
(void) - remove
 
(ARNode *) - findChildWithName:
 
(void) - markWorldTransformAsDirty
 
(void) - translateByX:y:z:
 
(void) - translateByX:y:z:transformSpace:
 
(void) - translateByVector:
 
(void) - translateByVector:transformSpace:
 
(void) - scaleByUniform:
 
(void) - scaleByX:y:z:
 
(void) - scaleByVector:
 
(void) - rotateByDegrees:axisX:y:z:
 
(void) - rotateByRadians:axisX:y:z:
 
(void) - rotateByQuaternion:
 
(ARVector3 *) - positionToWorld:
 
(ARVector3 *) - positionToEye:
 
(ARQuaternion *) - orientationToWorld:
 
(ARQuaternion *) - orientationToEye:
 
(CGPoint) - viewPortFromNodePosition:
 
(void) - render
 
(void) - preRender
 
(void) - postRender
 
(void) - addTouchTarget:withAction:
 
(void) - didReceiveTouch
 
(ARVector3 *) - nodeFromViewPort:
 
- Protected Member Functions inherited from ARNode
(typedef) - NS_ENUM
 

Detailed Description

An ARMeshNode is a subclass of ARNode that represents a drawable mesh. The geometry to be used, as well as its shading, is specified via this node.

Method Documentation

+ (instancetype) meshNodeWithRed: (float)  red
green: (float)  green
blue: (float)  blue
width: (float)  width
height: (float)  height 

Creates a mesh with a RGB colour material and dimensions of Width x Height.

Parameters
redColour value between 0..1.
greenColour value between 0..1.
blueColour value between 0..1.
widthMesh width.
heightMesh height.
Returns
ARMeshNode
+ (instancetype) meshNodeWithTexture: (ARTexture *)  texture
width: (float)  width
height: (float)  height 

Creates a mesh with a textured material and dimensions of Width x Height.

Parameters
textureThe texture used to colour the mesh
widthMesh width.
heightMesh height.
Returns
ARMeshNode
+ (instancetype) testMeshNodeWithRed: (float)  red
green: (float)  green
blue: (float)  blue 

Creates a square test mesh with a RGB colour material and dimensions of 10x10.

Parameters
redColour value between 0..1.
greenColour value between 0..1.
blueColour value between 0..1.
Returns
ARMeshNode
+ (instancetype) testMeshNodeWithTexture: (ARTexture *)  texture

Creates a square test mesh with dimensions of 100x100.

Parameters
textureThe texture used to colour the mesh.
Returns
ARMeshNode

Property Documentation

- (BOOL) cull
readwritenonatomicassign

Sets facet culling. The type of facet culling is set in ARMaterial. Default is NO.

- (ARMaterial*) material
readwritenonatomicassign

The material to use for shading the mesh attached to this node. nil materials will not be drawn. Materials can be shared between ARMeshNode objects.

Example of how to set a material:

ARModelImporter *importer = [[ARModelImporter alloc] initWithBundled:@"example.armodel"];
ARModelNode *modelNode = [importer getNode];
ARLightMaterial *lightMaterial = [[ARLightMaterial alloc] init];
lightMaterial.ambient.value = [ARVector3 vectorWithValues:0.7];
lightMaterial.colour.value = [ARVector3 vectorWithValuesX:0.6 y:0.6 z:0.6];
for (ARMeshNode *meshNode in modelNode.meshNodes)
{
meshNode.material = lightMaterial;
}
- (ARMesh*) mesh
readwritenonatomicassign

The mesh geometry to use. Meshes can be shared between ARMeshNode objects.


The documentation for this class was generated from the following file: