2010-11-30 23:26:03 +00:00
|
|
|
//
|
|
|
|
// ModelMeshReader.m
|
|
|
|
// XNI
|
|
|
|
//
|
|
|
|
// Created by Matej Jan on 23.11.10.
|
|
|
|
// Copyright 2010 Retronator. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "ModelMeshReader.h"
|
|
|
|
|
|
|
|
#import "Retronator.Xni.Framework.Content.h"
|
|
|
|
#import "Retronator.Xni.Framework.Graphics.h"
|
|
|
|
#import "Retronator.Xni.Framework.Content.Pipeline.Processors.h"
|
|
|
|
#import "ModelMesh+Internal.h"
|
|
|
|
|
|
|
|
@implementation ModelMeshReader
|
|
|
|
|
|
|
|
- (id) readFromInput:(ContentReader *)input into:(id)existingInstance {
|
|
|
|
ModelMeshContent *content = input.content;
|
|
|
|
|
2011-02-04 22:19:35 +00:00
|
|
|
NSLog(@"Mesh: %@", content.name);
|
|
|
|
|
2010-11-30 23:26:03 +00:00
|
|
|
// Create all model mesh parts.
|
|
|
|
NSMutableArray *meshParts = [NSMutableArray array];
|
|
|
|
for (ModelMeshPartContent *meshPartContent in content.meshParts) {
|
|
|
|
[meshParts addObject:[input readObjectFrom:meshPartContent]];
|
|
|
|
}
|
|
|
|
|
|
|
|
ModelBone *parentBone = [input readSharedResourceFrom:content.parentBone];
|
|
|
|
|
|
|
|
ModelMesh *mesh = [[[ModelMesh alloc] initWithName:content.name parentBone:parentBone modelMeshParts:meshParts tag:content.tag] autorelease];
|
|
|
|
return mesh;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|