1
0
mirror of https://github.com/thes3m/XNI synced 2024-12-26 13:26:06 +01:00
Matej Jan d5b2897d8b Added 3D Model support.
git-svn-id: http://xni.googlecode.com/svn/XNI@42 ac433895-eea3-a490-d80a-17149a75e588
2010-11-30 23:26:03 +00:00

46 lines
1.1 KiB
Objective-C

//
// ModelBoneReader.m
// XNI
//
// Created by Matej Jan on 29.11.10.
// Copyright 2010 Retronator. All rights reserved.
//
#import "ModelBoneReader.h"
#import "Retronator.Xni.Framework.Content.h"
#import "Retronator.Xni.Framework.Graphics.h"
#import "Retronator.Xni.Framework.Content.Pipeline.Processors.h"
#import "ModelBone+Internal.h"
@implementation ModelBoneReader
- (id) readFromInput:(ContentReader *)input into:(id)existingInstance {
ModelBoneContent *content = input.content;
NSMutableArray *children = [NSMutableArray array];
// Create all children bones.
for (ModelBoneContent *child in content.children) {
ModelBone *childBone = [input readSharedResourceFrom:child];
[children addObject:childBone];
}
// Create this bone.
ModelBone *modelBone = [[[ModelBone alloc] initWithChildren:children
index:content.index
name:content.name
transform:content.transform] autorelease];
// Update children with new parent.
for (ModelBone *child in children) {
[child setParent:modelBone];
}
// Return created bone.
return modelBone;
}
@end