我尝试将 vertexDataTextured ArmandDeBrignac [] 数组的内容复制到 vertexDataTextured MeshVertexData[] 数组中。但它不起作用....我认为问题出在 struct 方法中,有 GLKvector 元素.....?
这是我的头文件:
struct vertexDataTextured
{
GLKVector3 vertex;
GLKVector3 normal;
GLKVector2 texCoord;
};
typedef struct vertexDataTextured vertexDataTextured;
typedef vertexDataTextured* vertexDataTexturedPtr;
vertexDataTextured MeshVertexData[] = {};
vertexDataTextured ArmandDeBrignac[] = {
{/*v:*/{-0.979979, -2.383373, -1.142941}, /*n:*/{0.000000, -0.725242, -0.688467}, /*t:*/{0.794971, 0.247112}},
{/*v:*/{-0.859054, -2.367034, -0.829303}, /*n:*/{0.023591, -0.999512, 0.019593}, /*t:*/{0.786435, 0.224949}},
{/*v:*/{-1.056731, -2.383373, -1.142941}, /*n:*/{-0.337657, -0.631642, -0.697836}, /*t:*/{0.800393, 0.247114}},
{/*v:*/{-0.979979, -2.117816, -1.142941}, /*n:*/{0.000000, 0.500198, -0.865902}, /*t:*/{0.645127, 0.391262}},
{/*v:*/{-0.979979, -2.383373, -1.142941}, /*n:*/{0.000000, -0.725242, -0.688467}, /*t:*/{0.663889, 0.391205}},
{/*v:*/{-1.056731, -2.383373, -1.142941}, /*n:*/{-0.337657, -0.631642, -0.697836}, /*t:*/{0.663906, 0.396627}},
{/*v:*/{-0.993670, -2.036772, 0.915066}, /*n:*/{-0.771722, 0.588244, 0.241585}, /*t:*/{0.293949, 0.430232}},
};
@interface FlaschenManager : NSObject
-(void) getFlaschenID: (NSString* ) Name andTexture: (NSString*) path;
@end
和我的 .m 文件
@implementation FlaschenManager
-(void) getFlaschenID: (NSString* ) Name andTexture: (NSString*) path
{
if ([Name isEqualToString:@"ArmandDeBrignac"])
{
NSLog(@"%@",Name);
MeshVertexData[0].vertex.v[0]=ArmandDeBrignac[0].vertex.v[0];
// MeshVertexData[] = ArmandDeBrignac[];
} else if ([Name isEqualToString:@"Hennessy"])
{
NSLog(@"%@ ", Name);
FlaschenName = Name;
}
}
@end