在Cocos3D中调用扩展方法

时间:2014-02-09 15:41:43

标签: objective-c cocos3d

我是Objective C的新手,我正在尝试使用Cocos3d创建一些3D模型我找到了这个文档:

/**
 * This CC3Mesh extension adds a number of methods for populating the mesh of
 * a mesh programatically to create various parametric shapes and surfaces.
 *
 * To use the methods in this extension, instantiate a CC3Mesh, and then invoke one of
 * the methods in this extension  to populate the mesh vertices.
 */
@interface CC3Mesh (ParametricShapes)

这是我想要调用的方法:

-(void) populateAsTriangle: (CC3Face) face
             withTexCoords: (ccTex2F*) texCoords
           andTessellation: (GLuint) divsPerSide;

现在我有了这个:

    NSString *meshName = [NSString stringWithFormat:@"%@", 
                               [vertex objectForKey:@"meshName"]];
    CC3Mesh *mesh = [[CC3Mesh alloc] initWithName:meshName];

现在,如何从my * mesh对象中调用方法populateAsTriangle?

感谢。

1 个答案:

答案 0 :(得分:0)

请务必导入您引用的CC3Mesh扩展程序所在的文件:

#import "CC3ParametricMeshes.h"