FBXNode
를 생성합니다. 생성된 FBXNode
는 fbxfile.nodes
에 자동으로 삽입됩니다.
만약 parentName == "Objects"
라면, 해당 노드는 FBXNode.uid, FBXNode.subclass 속성을 가지고 있으며 fbxfile.objects
에 등록됩니다. 이 정보는 FBXFile 에서 Connections 노드를 읽을 때 사용됩니다.
new FBXNode(stream, fbxfile, parentName)
stream
FBX 파일이 저장되어 있는 ArrayBuffer
를 읽기 위한 FileStream.
fbxfile
FBXNode
를 저장하기 위한 FBXFile
.
parentName
부모 노드의 이름을 나타내는 string
.
하나의 노드는 다음과 같이 파일에 저장되어 있습니다:
Size (Bytes) Data Type Name
------------ --------- ---------
4 Uint32 EndOffset
4 Uint32 NumProperties
4 Uint32 PropertyListLen
1 Uint8 NameLen
NameLen char Name
? ? Property[n], for n in 0:PropertyListLen
? ? NestedList (Optional)
13 uint8[] NULL-record (Optional)
EndOffset
— 노드 끝의 위치를 나타냅니다. 다시말해 FileStream 으로 현재 노드를 읽고 나면 stream.readBytes == EndOffset
이 된다는 의미입니다. 자식 노드(NestedList)가 있는지 여부를 판별하는데 사용됩니다.NumProperties
— 노드가 가진 속성들의 갯수. 예를 들어 NumProperties == 3
이라면, FBXNode.properties 는 FBXProperty[3]
크기의 배열이 된다는 의미입니다.PropertyListLen
— PropertyList 의 바이트 갯수. FBXProperty 는 FBXProperty.typecode 에 따라서 number
| Float32Array
| Float64Array
| BigInt64Array
| Int32Array
| Uint8Array
자료형이 될 수 있습니다. 고로 NumProperties = 3
이더라도, 파일에 저장되어 있는 PropertyList 의 바이트 갯수는 달라질 수 있습니다. 고로 가장 적합한 이름은 sizeofPropertyList
가 되겠습니다.NameLen
— 노드의 이름의 바이트 갯수. FileStream.readString() 에 넘겨줄 byteCount
인자입니다. PropertyListLen
과 마찬가지로, 가장 적합한 이름은 sizeofName
이 되겠습니다.