KudanAR - iOS  1.6.0
ARMeshNode Class Reference

#import <ARMeshNode.h>

Inherits ARNode.

Inherited by ARAlphaVideoNode, ARImageNode, ARPointNode, and ARVideoNode.

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 Types inherited from ARNode
enum  TransformSpace { ARNodeTransformSpaceLocal, ARNodeTransformSpaceParent, ARNodeTransformSpaceWorld }
 

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. This class does not specify any of the mesh data, it simply contains an associated ARMesh.

Method Documentation

◆ meshNodeWithRed:green:blue:width:height:

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

Creates a mesh node with an RGB colour material made from the given red, green and blue colour values and dimensinos from the given width and height.

Parameters
redColour value between 0..1.
greenColour value between 0..1.
blueColour value between 0..1.
widthMesh width.
heightMesh height.
Returns
ARMeshNode

◆ meshNodeWithTexture:width:height:

+ (instancetype) meshNodeWithTexture: (ARTexture *)  texture
width: (float)  width
height: (float)  height 

Creates a mesh node with a textured material made from the given texture and dimensions from the given width and height.

Parameters
textureThe texture used to colour the mesh
widthMesh width.
heightMesh height.
Returns
ARMeshNode

◆ testMeshNodeWithRed:green:blue:

+ (instancetype) testMeshNodeWithRed: (float)  red
green: (float)  green
blue: (float)  blue 

Creates a mesh node with 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

◆ testMeshNodeWithTexture:

+ (instancetype) testMeshNodeWithTexture: (ARTexture *)  texture

Creates a mesh node with a square test mesh with dimensions of 100x100.

Parameters
textureThe texture used to colour the mesh.
Returns
ARMeshNode

Property Documentation

◆ cull

- (BOOL) cull
readwritenonatomicassign

Whether or not this mesh node uses face culling. The face culling mode is set in ARMaterial. Default is NO.

◆ material

- (ARMaterial*) material
readwritenonatomicassign

The material to use for shading the mesh attached to this node. If the material is not specified, the shader cannot get any properties to correctly shade the mesh, so it 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;
}

◆ mesh

- (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 files:
ARModelImporter
Definition: ARModelImporter.h:10
ARLightMaterial::ambient
ARMaterialProperty * ambient
Definition: ARLightMaterial.h:52
ARLightMaterial::colour
ARMaterialProperty * colour
Definition: ARLightMaterial.h:25
ARMaterialProperty::value
ARVector3 * value
Definition: ARMaterialProperty.h:14
ARMeshNode
Definition: ARMeshNode.h:13
ARModelNode
Definition: ARModelNode.mm:33
ARVector3
Definition: ARVector3.h:11
ARLightMaterial
Definition: ARLightMaterial.h:21