From 45c9e5180fd9bd83d68f7a6f55ea7493eabc56b1 Mon Sep 17 00:00:00 2001 From: Persson-dev Date: Sat, 3 Jan 2026 23:33:26 +0100 Subject: [PATCH] basic 3D zombie model --- assets/zombie.fbx | 1721 +++++++++++++++++++ assets/zombie.png | Bin 0 -> 994 bytes include/td/render/Renderer.h | 6 +- include/td/render/loader/FbxLoader.h | 19 + include/td/render/renderer/EntityRenderer.h | 3 +- src/td/render/Renderer.cpp | 9 +- src/td/render/loader/FbxLoader.cpp | 128 ++ src/td/render/renderer/EntityRenderer.cpp | 5 +- xmake.lua | 4 +- 9 files changed, 1887 insertions(+), 8 deletions(-) create mode 100644 assets/zombie.fbx create mode 100644 assets/zombie.png create mode 100644 include/td/render/loader/FbxLoader.h create mode 100644 src/td/render/loader/FbxLoader.cpp diff --git a/assets/zombie.fbx b/assets/zombie.fbx new file mode 100644 index 0000000..8cbc368 --- /dev/null +++ b/assets/zombie.fbx @@ -0,0 +1,1721 @@ +; FBX 7.3.0 project file +; Created by the Blockbench FBX Exporter +; ---------------------------------------------------- +; + +FBXHeaderExtension: { + FBXHeaderVersion: 1003 + FBXVersion: 7300 + EncryptionType: 0 + CreationTimeStamp: { + Version: 1000 + Year: 2026 + Month: 1 + Day: 3 + Hour: 22 + Minute: 8 + Second: 54 + Millisecond: 217 + } + Creator: "Blockbench 5.0.7" + SceneInfo: "SceneInfo::GlobalInfo", "UserData" { + Type: "UserData" + Version: 100 + MetaData: { + Version: 100 + Title: "" + Subject: "" + Author: "" + Keywords: "" + Revision: "" + Comment: "" + } + Properties70: { + P: "DocumentUrl", "KString", "Url", "", "C:\Users\Blockbench\foobar.fbx" + P: "SrcDocumentUrl", "KString", "Url", "", "C:\Users\Blockbench\foobar.fbx" + P: "Original", "Compound", "", "" + P: "Original|ApplicationVendor", "KString", "", "", "Blockbench" + P: "Original|ApplicationName", "KString", "", "", "Blockbench FBX Exporter" + P: "Original|ApplicationVersion", "KString", "", "", "5.0.7" + P: "Original|DateTime_GMT", "DateTime", "", "", "01/01/1970 00:00:00.000" + P: "Original|FileName", "KString", "", "", "/foobar.fbx" + P: "LastSaved", "Compound", "", "" + P: "LastSaved|ApplicationVendor", "KString", "", "", "Blockbench" + P: "LastSaved|ApplicationName", "KString", "", "", "Blockbench FBX Exporter" + P: "LastSaved|ApplicationVersion", "KString", "", "", "5.0.7" + P: "LastSaved|DateTime_GMT", "DateTime", "", "", "01/01/1970 00:00:00.000" + P: "Original|ApplicationNativeFile", "KString", "", "", "" + } + } +} +FileId: "iVFoobar" +CreationTime: "2026-01-03 21:08:54:217" +Creator: "Made with Blockbench" +GlobalSettings: { + Version: 1000 + Properties70: { + P: "UpAxis", "int", "Integer", "",1 + P: "UpAxisSign", "int", "Integer", "",1 + P: "FrontAxis", "int", "Integer", "",2 + P: "FrontAxisSign", "int", "Integer", "",1 + P: "CoordAxis", "int", "Integer", "",0 + P: "CoordAxisSign", "int", "Integer", "",1 + P: "OriginalUpAxis", "int", "Integer", "",-1 + P: "OriginalUpAxisSign", "int", "Integer", "",1 + P: "UnitScaleFactor", "double", "Number", "",1 + P: "OriginalUnitScaleFactor", "double", "Number", "",1 + P: "AmbientColor", "ColorRGB", "Color", "",0,0,0 + P: "DefaultCamera", "KString", "", "", "Producer Perspective" + P: "TimeMode", "enum", "", "",0 + P: "TimeSpanStart", "KTime", "Time", "",0 + P: "TimeSpanStop", "KTime", "Time", "",46186158000 + P: "CustomFrameRate", "double", "Number", "",24 + } +} + +; Documents Description +;------------------------------------------------------------------ + +Documents: { + Count: 1 + Document: 834359721 { + Scene: "Scene" + Properties70: { + P: "SourceObject", "object", "", "" + P: "ActiveAnimStackName", "KString", "", "", "" + } + RootNode: 0 + } +} + +; Document References +;------------------------------------------------------------------ + +References: + +; Object definitions +;------------------------------------------------------------------ + +Definitions: { + Version: 100 + Count: 64 + ObjectType: "GlobalSettings" { + Count: 1 + } + ObjectType: "Model" { + Count: 17 + PropertyTemplate: "FbxNode" { + Properties70: { + P: "QuaternionInterpolate", "enum", "", "",0 + P: "RotationOffset", "Vector3D", "Vector", "",0,0,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "ScalingOffset", "Vector3D", "Vector", "",0,0,0 + P: "ScalingPivot", "Vector3D", "Vector", "",0,0,0 + P: "TranslationActive", "bool", "", "",0 + P: "TranslationMin", "Vector3D", "Vector", "",0,0,0 + P: "TranslationMax", "Vector3D", "Vector", "",0,0,0 + P: "TranslationMinX", "bool", "", "",0 + P: "TranslationMinY", "bool", "", "",0 + P: "TranslationMinZ", "bool", "", "",0 + P: "TranslationMaxX", "bool", "", "",0 + P: "TranslationMaxY", "bool", "", "",0 + P: "TranslationMaxZ", "bool", "", "",0 + P: "RotationOrder", "enum", "", "",5 + P: "RotationSpaceForLimitOnly", "bool", "", "",0 + P: "RotationStiffnessX", "double", "Number", "",0 + P: "RotationStiffnessY", "double", "Number", "",0 + P: "RotationStiffnessZ", "double", "Number", "",0 + P: "AxisLen", "double", "Number", "",10 + P: "PreRotation", "Vector3D", "Vector", "",0,0,0 + P: "PostRotation", "Vector3D", "Vector", "",0,0,0 + P: "RotationActive", "bool", "", "",0 + P: "RotationMin", "Vector3D", "Vector", "",0,0,0 + P: "RotationMax", "Vector3D", "Vector", "",0,0,0 + P: "RotationMinX", "bool", "", "",0 + P: "RotationMinY", "bool", "", "",0 + P: "RotationMinZ", "bool", "", "",0 + P: "RotationMaxX", "bool", "", "",0 + P: "RotationMaxY", "bool", "", "",0 + P: "RotationMaxZ", "bool", "", "",0 + P: "InheritType", "enum", "", "",0 + P: "ScalingActive", "bool", "", "",0 + P: "ScalingMin", "Vector3D", "Vector", "",0,0,0 + P: "ScalingMax", "Vector3D", "Vector", "",1,1,1 + P: "ScalingMinX", "bool", "", "",0 + P: "ScalingMinY", "bool", "", "",0 + P: "ScalingMinZ", "bool", "", "",0 + P: "ScalingMaxX", "bool", "", "",0 + P: "ScalingMaxY", "bool", "", "",0 + P: "ScalingMaxZ", "bool", "", "",0 + P: "GeometricTranslation", "Vector3D", "Vector", "",0,0,0 + P: "GeometricRotation", "Vector3D", "Vector", "",0,0,0 + P: "GeometricScaling", "Vector3D", "Vector", "",1,1,1 + P: "MinDampRangeX", "double", "Number", "",0 + P: "MinDampRangeY", "double", "Number", "",0 + P: "MinDampRangeZ", "double", "Number", "",0 + P: "MaxDampRangeX", "double", "Number", "",0 + P: "MaxDampRangeY", "double", "Number", "",0 + P: "MaxDampRangeZ", "double", "Number", "",0 + P: "MinDampStrengthX", "double", "Number", "",0 + P: "MinDampStrengthY", "double", "Number", "",0 + P: "MinDampStrengthZ", "double", "Number", "",0 + P: "MaxDampStrengthX", "double", "Number", "",0 + P: "MaxDampStrengthY", "double", "Number", "",0 + P: "MaxDampStrengthZ", "double", "Number", "",0 + P: "PreferedAngleX", "double", "Number", "",0 + P: "PreferedAngleY", "double", "Number", "",0 + P: "PreferedAngleZ", "double", "Number", "",0 + P: "LookAtProperty", "object", "", "" + P: "UpVectorProperty", "object", "", "" + P: "Show", "bool", "", "",1 + P: "NegativePercentShapeSupport", "bool", "", "",1 + P: "DefaultAttributeIndex", "int", "Integer", "",-1 + P: "Freeze", "bool", "", "",0 + P: "LODBox", "bool", "", "",0 + P: "Lcl Translation", "Lcl Translation", "", "A",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "Lcl Scaling", "Lcl Scaling", "", "A",1,1,1 + P: "Visibility", "Visibility", "", "A",1 + P: "Visibility Inheritance", "Visibility Inheritance", "", "",1 + } + } + } + ObjectType: "Geometry" { + Count: 7 + PropertyTemplate: "FbxMesh" { + Properties70: { + P: "Color", "ColorRGB", "Color", "",0.8,0.8,0.8 + P: "BBoxMin", "Vector3D", "Vector", "",0,0,0 + P: "BBoxMax", "Vector3D", "Vector", "",0,0,0 + P: "Primary Visibility", "bool", "", "",1 + P: "Casts Shadows", "bool", "", "",1 + P: "Receive Shadows", "bool", "", "",1 + } + } + } + ObjectType: "Material" { + Count: 1 + PropertyTemplate: "FbxSurfaceLambert" { + Properties70: { + P: "ShadingModel", "KString", "", "", "Lambert" + P: "MultiLayer", "bool", "", "",0 + P: "EmissiveColor", "Color", "", "A",0,0,0 + P: "EmissiveFactor", "Number", "", "A",1 + P: "AmbientColor", "Color", "", "A",0.2,0.2,0.2 + P: "AmbientFactor", "Number", "", "A",1 + P: "DiffuseColor", "Color", "", "A",0.8,0.8,0.8 + P: "DiffuseFactor", "Number", "", "A",1 + P: "Bump", "Vector3D", "Vector", "",0,0,0 + P: "NormalMap", "Vector3D", "Vector", "",0,0,0 + P: "BumpFactor", "double", "Number", "",1 + P: "TransparentColor", "Color", "", "A",0,0,0 + P: "TransparencyFactor", "Number", "", "A",0 + P: "DisplacementColor", "ColorRGB", "Color", "",0,0,0 + P: "DisplacementFactor", "double", "Number", "",1 + P: "VectorDisplacementColor", "ColorRGB", "Color", "",0,0,0 + P: "VectorDisplacementFactor", "double", "Number", "",1 + } + } + } + ObjectType: "Texture" { + Count: 1 + PropertyTemplate: "FbxFileTexture" { + Properties70: { + P: "TextureTypeUse", "enum", "", "",0 + P: "Texture alpha", "Number", "", "A",1 + P: "CurrentMappingType", "enum", "", "",0 + P: "WrapModeU", "enum", "", "",0 + P: "WrapModeV", "enum", "", "",0 + P: "UVSwap", "bool", "", "",0 + P: "PremultiplyAlpha", "bool", "", "",1 + P: "Translation", "Vector", "", "A",0,0,0 + P: "Rotation", "Vector", "", "A",0,0,0 + P: "Scaling", "Vector", "", "A",1,1,1 + P: "TextureRotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "TextureScalingPivot", "Vector3D", "Vector", "",0,0,0 + P: "CurrentTextureBlendMode", "enum", "", "",1 + P: "UVSet", "KString", "", "", "default" + P: "UseMaterial", "bool", "", "",0 + P: "UseMipMap", "bool", "", "",0 + } + } + } + ObjectType: "Video" { + Count: 1 + PropertyTemplate: "FbxVideo" { + Properties70: { + P: "ImageSequence", "bool", "", "",0 + P: "ImageSequenceOffset", "int", "Integer", "",0 + P: "FrameRate", "double", "Number", "",0 + P: "LastFrame", "int", "Integer", "",0 + P: "Width", "int", "Integer", "",0 + P: "Height", "int", "Integer", "",0 + P: "Path", "KString", "XRefUrl", "", "" + P: "StartFrame", "int", "Integer", "",0 + P: "StopFrame", "int", "Integer", "",0 + P: "PlaySpeed", "double", "Number", "",0 + P: "Offset", "KTime", "Time", "",0 + P: "InterlaceMode", "enum", "", "",0 + P: "FreeRunning", "bool", "", "",0 + P: "Loop", "bool", "", "",0 + P: "AccessMode", "enum", "", "",0 + } + } + } + ObjectType: "AnimationStack" { + Count: 2 + PropertyTemplate: "FbxAnimStack" { + Properties70: { + P: "Description", "KString", "", "", "" + P: "LocalStart", "KTime", "Time", "",0 + P: "LocalStop", "KTime", "Time", "",0 + P: "ReferenceStart", "KTime", "Time", "",0 + P: "ReferenceStop", "KTime", "Time", "",0 + } + } + } + ObjectType: "AnimationLayer" { + Count: 2 + PropertyTemplate: "FbxAnimLayer" { + Properties70: { + P: "Weight", "Number", "", "A",100 + P: "Mute", "bool", "", "",0 + P: "Solo", "bool", "", "",0 + P: "Lock", "bool", "", "",0 + P: "Color", "ColorRGB", "Color", "",0.8,0.8,0.8 + P: "BlendMode", "enum", "", "",0 + P: "RotationAccumulationMode", "enum", "", "",0 + P: "ScaleAccumulationMode", "enum", "", "",0 + P: "BlendModeBypass", "ULongLong", "", "",0 + } + } + } + ObjectType: "AnimationCurveNode" { + Count: 8 + PropertyTemplate: "FbxAnimCurveNode" { + Properties70: { + P: "d", "Compound", "", "" + } + } + } + ObjectType: "AnimationCurve" { + Count: 24 + } +} + +; Object properties +;------------------------------------------------------------------ + +Objects: { + Model: 77819442, "Model::waist", "Null" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",0,75,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Model: 73828569, "Model::body", "Null" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",0,75,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Model: 78808991, "Model::head", "Null" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",0,0,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Model: 75648558, "Model::hat", "Null" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",0,0,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Model: 71451861, "Model::rightArm", "Null" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",31.25,-12.5,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Model: 76099182, "Model::rightItem", "Null" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",6.25,-43.75,6.25 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Model: 74505323, "Model::leftArm", "Null" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",-31.25,-12.5,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Model: 71393980, "Model::leftItem", "Null" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",-6.25,-43.75,6.25 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Model: 76008544, "Model::rightLeg", "Null" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",11.875,-75,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Model: 70295505, "Model::leftLeg", "Null" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",-11.875,-75,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Model: 72855409, "Model::body_1", "Mesh" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",0,-150,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + P: "DefaultAttributeIndex", "int", "Integer", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Geometry: 73224442, "Geometry::body_1", "Mesh" { + Vertices: *24 { + a: 25,150,12.5,25,150,-12.5,25,75,12.5,25,75,-12.5,-25,150,-12.5,-25,150,12.5,-25,75,-12.5,-25,75,12.5 + } + PolygonVertexIndex: *24 { + a: 3,6,4,-2,2,3,1,-1,7,2,0,-6,6,7,5,-5,5,0,1,-5,6,3,2,-8 + } + GeometryVersion: 124 + LayerElementNormal: 0 { + Version: 101 + Name: "" + MappingInformationType: "ByPolygon" + ReferenceInformationType: "Direct" + Normals: *18 { + a: 0,0,-1,1,0,0,0,0,1,-1,0,0,0,1,0,0,-1,0 + } + } + LayerElementUV: 0 { + Version: 101 + Name: "" + MappingInformationType: "ByPolygonVertex" + ReferenceInformationType: "Direct" + UV: *48 { + a: 0.3125,0,0.4375,0,0.4375,0.375,0.3125,0.375,0.25,0,0.3125,0,0.3125,0.375,0.25,0.375,0.5,0,0.625,0,0.625,0.375,0.5,0.375,0.4375,0,0.5,0,0.5,0.375,0.4375,0.375,0.4375,0.5,0.3125,0.5,0.3125,0.375,0.4375,0.375,0.5625,0.375,0.4375,0.375,0.4375,0.5,0.5625,0.5 + } + } + LayerElementMaterial: 0 { + Version: 101 + Name: "" + MappingInformationType: "AllSame" + ReferenceInformationType: "IndexToDirect" + Materials: *1 { + a: 0 + } + } + Layer: 0 { + Version: 100 + LayerElement: { + Type: "LayerElementNormal" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementMaterial" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementUV" + TypedIndex: 0 + } + } + } + Model: 78792842, "Model::head_1", "Mesh" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",0,-150,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + P: "DefaultAttributeIndex", "int", "Integer", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Geometry: 78934101, "Geometry::head_1", "Mesh" { + Vertices: *24 { + a: 25,200,25,25,200,-25,25,150,25,25,150,-25,-25,200,-25,-25,200,25,-25,150,-25,-25,150,25 + } + PolygonVertexIndex: *24 { + a: 3,6,4,-2,2,3,1,-1,7,2,0,-6,6,7,5,-5,5,0,1,-5,6,3,2,-8 + } + GeometryVersion: 124 + LayerElementNormal: 0 { + Version: 101 + Name: "" + MappingInformationType: "ByPolygon" + ReferenceInformationType: "Direct" + Normals: *18 { + a: 0,0,-1,1,0,0,0,0,1,-1,0,0,0,1,0,0,-1,0 + } + } + LayerElementUV: 0 { + Version: 101 + Name: "" + MappingInformationType: "ByPolygonVertex" + ReferenceInformationType: "Direct" + UV: *48 { + a: 0.125,0.5,0.25,0.5,0.25,0.75,0.125,0.75,0,0.5,0.125,0.5,0.125,0.75,0,0.75,0.375,0.5,0.5,0.5,0.5,0.75,0.375,0.75,0.25,0.5,0.375,0.5,0.375,0.75,0.25,0.75,0.25,1,0.125,1,0.125,0.75,0.25,0.75,0.375,0.75,0.25,0.75,0.25,1,0.375,1 + } + } + LayerElementMaterial: 0 { + Version: 101 + Name: "" + MappingInformationType: "AllSame" + ReferenceInformationType: "IndexToDirect" + Materials: *1 { + a: 0 + } + } + Layer: 0 { + Version: 100 + LayerElement: { + Type: "LayerElementNormal" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementMaterial" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementUV" + TypedIndex: 0 + } + } + } + Model: 76608387, "Model::hat_1", "Mesh" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",0,-150,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + P: "DefaultAttributeIndex", "int", "Integer", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Geometry: 72262289, "Geometry::hat_1", "Mesh" { + Vertices: *24 { + a: 28.125,203.125,28.125,28.125,203.125,-28.125,28.125,146.875,28.125,28.125,146.875,-28.125,-28.125,203.125,-28.125,-28.125,203.125,28.125,-28.125,146.875,-28.125,-28.125,146.875,28.125 + } + PolygonVertexIndex: *24 { + a: 3,6,4,-2,2,3,1,-1,7,2,0,-6,6,7,5,-5,5,0,1,-5,6,3,2,-8 + } + GeometryVersion: 124 + LayerElementNormal: 0 { + Version: 101 + Name: "" + MappingInformationType: "ByPolygon" + ReferenceInformationType: "Direct" + Normals: *18 { + a: 0,0,-1,1,0,0,0,0,1,-1,0,0,0,1,0,0,-1,0 + } + } + LayerElementUV: 0 { + Version: 101 + Name: "" + MappingInformationType: "ByPolygonVertex" + ReferenceInformationType: "Direct" + UV: *48 { + a: 0.625,0.5,0.75,0.5,0.75,0.75,0.625,0.75,0.5,0.5,0.625,0.5,0.625,0.75,0.5,0.75,0.875,0.5,1,0.5,1,0.75,0.875,0.75,0.75,0.5,0.875,0.5,0.875,0.75,0.75,0.75,0.75,1,0.625,1,0.625,0.75,0.75,0.75,0.875,0.75,0.75,0.75,0.75,1,0.875,1 + } + } + LayerElementMaterial: 0 { + Version: 101 + Name: "" + MappingInformationType: "AllSame" + ReferenceInformationType: "IndexToDirect" + Materials: *1 { + a: 0 + } + } + Layer: 0 { + Version: 100 + LayerElement: { + Type: "LayerElementNormal" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementMaterial" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementUV" + TypedIndex: 0 + } + } + } + Model: 76277951, "Model::rightArm_1", "Mesh" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",-31.25,-137.5,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + P: "DefaultAttributeIndex", "int", "Integer", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Geometry: 70088550, "Geometry::rightArm_1", "Mesh" { + Vertices: *24 { + a: 50,150,12.5,50,150,-12.5,50,75,12.5,50,75,-12.5,25,150,-12.5,25,150,12.5,25,75,-12.5,25,75,12.5 + } + PolygonVertexIndex: *24 { + a: 3,6,4,-2,2,3,1,-1,7,2,0,-6,6,7,5,-5,5,0,1,-5,6,3,2,-8 + } + GeometryVersion: 124 + LayerElementNormal: 0 { + Version: 101 + Name: "" + MappingInformationType: "ByPolygon" + ReferenceInformationType: "Direct" + Normals: *18 { + a: 0,0,-1,1,0,0,0,0,1,-1,0,0,0,1,0,0,-1,0 + } + } + LayerElementUV: 0 { + Version: 101 + Name: "" + MappingInformationType: "ByPolygonVertex" + ReferenceInformationType: "Direct" + UV: *48 { + a: 0.6875,0,0.75,0,0.75,0.375,0.6875,0.375,0.625,0,0.6875,0,0.6875,0.375,0.625,0.375,0.8125,0,0.875,0,0.875,0.375,0.8125,0.375,0.75,0,0.8125,0,0.8125,0.375,0.75,0.375,0.75,0.5,0.6875,0.5,0.6875,0.375,0.75,0.375,0.8125,0.375,0.75,0.375,0.75,0.5,0.8125,0.5 + } + } + LayerElementMaterial: 0 { + Version: 101 + Name: "" + MappingInformationType: "AllSame" + ReferenceInformationType: "IndexToDirect" + Materials: *1 { + a: 0 + } + } + Layer: 0 { + Version: 100 + LayerElement: { + Type: "LayerElementNormal" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementMaterial" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementUV" + TypedIndex: 0 + } + } + } + Model: 79102864, "Model::leftArm_1", "Mesh" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",31.25,-137.5,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + P: "DefaultAttributeIndex", "int", "Integer", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Geometry: 74222666, "Geometry::leftArm_1", "Mesh" { + Vertices: *24 { + a: -25,150,12.5,-25,150,-12.5,-25,75,12.5,-25,75,-12.5,-50,150,-12.5,-50,150,12.5,-50,75,-12.5,-50,75,12.5 + } + PolygonVertexIndex: *24 { + a: 3,6,4,-2,2,3,1,-1,7,2,0,-6,6,7,5,-5,5,0,1,-5,6,3,2,-8 + } + GeometryVersion: 124 + LayerElementNormal: 0 { + Version: 101 + Name: "" + MappingInformationType: "ByPolygon" + ReferenceInformationType: "Direct" + Normals: *18 { + a: 0,0,-1,1,0,0,0,0,1,-1,0,0,0,1,0,0,-1,0 + } + } + LayerElementUV: 0 { + Version: 101 + Name: "" + MappingInformationType: "ByPolygonVertex" + ReferenceInformationType: "Direct" + UV: *48 { + a: 0.75,0,0.6875,0,0.6875,0.375,0.75,0.375,0.8125,0,0.75,0,0.75,0.375,0.8125,0.375,0.875,0,0.8125,0,0.8125,0.375,0.875,0.375,0.6875,0,0.625,0,0.625,0.375,0.6875,0.375,0.6875,0.5,0.75,0.5,0.75,0.375,0.6875,0.375,0.75,0.375,0.8125,0.375,0.8125,0.5,0.75,0.5 + } + } + LayerElementMaterial: 0 { + Version: 101 + Name: "" + MappingInformationType: "AllSame" + ReferenceInformationType: "IndexToDirect" + Materials: *1 { + a: 0 + } + } + Layer: 0 { + Version: 100 + LayerElement: { + Type: "LayerElementNormal" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementMaterial" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementUV" + TypedIndex: 0 + } + } + } + Model: 75314468, "Model::rightLeg_1", "Mesh" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",-11.875,-75,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + P: "DefaultAttributeIndex", "int", "Integer", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Geometry: 74379548, "Geometry::rightLeg_1", "Mesh" { + Vertices: *24 { + a: 24.375,75,12.5,24.375,75,-12.5,24.375,0,12.5,24.375,0,-12.5,-0.6250000000000006,75,-12.5,-0.6250000000000006,75,12.5,-0.6250000000000006,0,-12.5,-0.6250000000000006,0,12.5 + } + PolygonVertexIndex: *24 { + a: 3,6,4,-2,2,3,1,-1,7,2,0,-6,6,7,5,-5,5,0,1,-5,6,3,2,-8 + } + GeometryVersion: 124 + LayerElementNormal: 0 { + Version: 101 + Name: "" + MappingInformationType: "ByPolygon" + ReferenceInformationType: "Direct" + Normals: *18 { + a: 0,0,-1,1,0,0,0,0,1,-1,0,0,0,1,0,0,-1,0 + } + } + LayerElementUV: 0 { + Version: 101 + Name: "" + MappingInformationType: "ByPolygonVertex" + ReferenceInformationType: "Direct" + UV: *48 { + a: 0.0625,0,0.125,0,0.125,0.375,0.0625,0.375,0,0,0.0625,0,0.0625,0.375,0,0.375,0.1875,0,0.25,0,0.25,0.375,0.1875,0.375,0.125,0,0.1875,0,0.1875,0.375,0.125,0.375,0.125,0.5,0.0625,0.5,0.0625,0.375,0.125,0.375,0.1875,0.375,0.125,0.375,0.125,0.5,0.1875,0.5 + } + } + LayerElementMaterial: 0 { + Version: 101 + Name: "" + MappingInformationType: "AllSame" + ReferenceInformationType: "IndexToDirect" + Materials: *1 { + a: 0 + } + } + Layer: 0 { + Version: 100 + LayerElement: { + Type: "LayerElementNormal" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementMaterial" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementUV" + TypedIndex: 0 + } + } + } + Model: 76620132, "Model::leftLeg_1", "Mesh" { + Version: 232 + Properties70: { + P: "RotationActive", "bool", "", "",1 + P: "InheritType", "enum", "", "",1 + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Translation", "Lcl Translation", "", "A",11.875,-75,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "RotationOrder", "enum", "", "",0 + P: "DefaultAttributeIndex", "int", "Integer", "",0 + } + Shading: Y + Culling: "CullingOff" + } + Geometry: 77556196, "Geometry::leftLeg_1", "Mesh" { + Vertices: *24 { + a: 0.6250000000000006,75,12.5,0.6250000000000006,75,-12.5,0.6250000000000006,0,12.5,0.6250000000000006,0,-12.5,-24.375,75,-12.5,-24.375,75,12.5,-24.375,0,-12.5,-24.375,0,12.5 + } + PolygonVertexIndex: *24 { + a: 3,6,4,-2,2,3,1,-1,7,2,0,-6,6,7,5,-5,5,0,1,-5,6,3,2,-8 + } + GeometryVersion: 124 + LayerElementNormal: 0 { + Version: 101 + Name: "" + MappingInformationType: "ByPolygon" + ReferenceInformationType: "Direct" + Normals: *18 { + a: 0,0,-1,1,0,0,0,0,1,-1,0,0,0,1,0,0,-1,0 + } + } + LayerElementUV: 0 { + Version: 101 + Name: "" + MappingInformationType: "ByPolygonVertex" + ReferenceInformationType: "Direct" + UV: *48 { + a: 0.125,0,0.0625,0,0.0625,0.375,0.125,0.375,0.1875,0,0.125,0,0.125,0.375,0.1875,0.375,0.25,0,0.1875,0,0.1875,0.375,0.25,0.375,0.0625,0,0,0,0,0.375,0.0625,0.375,0.0625,0.5,0.125,0.5,0.125,0.375,0.0625,0.375,0.125,0.375,0.1875,0.375,0.1875,0.5,0.125,0.5 + } + } + LayerElementMaterial: 0 { + Version: 101 + Name: "" + MappingInformationType: "AllSame" + ReferenceInformationType: "IndexToDirect" + Materials: *1 { + a: 0 + } + } + Layer: 0 { + Version: 100 + LayerElement: { + Type: "LayerElementNormal" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementMaterial" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementUV" + TypedIndex: 0 + } + } + } + Material: 70466606, "Material::m", "" { + Version: 102 + ShadingModel: "lambert" + MultiLayer: 0 + Properties70: { + P: "Emissive", "Vector3D", "Vector", "",0,0,0 + P: "Ambient", "Vector3D", "Vector", "",0.2,0.2,0.2 + P: "Diffuse", "Vector3D", "Vector", "",0.8,0.8,0.8 + P: "Opacity", "double", "Number", "",1 + } + } + Texture: 78150717, "Texture::m", "" { + Type: "TextureVideoClip" + Version: 202 + TextureName: "Texture::m" + Media: "Video::m" + FileName: "" + RelativeFilename: "" + ModelUVTranslation: 0,0 + ModelUVScaling: 1,1 + Texture_Alpha_Source: "None" + Cropping: 0,0,0,0 + } + Video: 77167900, "Video::m", "Clip" { + Type: "Clip" + Properties70: { + P: "Path", "KString", "XRefUrl", "", "m" + } + UseMipMap: 0 + Filename: "" + RelativeFilename: "" + Content: "iVBORw0KGgoAAAANSUhEUgAAAEAAAAAgCAYAAACinX6EAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAOMSURBVGje5VhNaxNRFJ3fkZ0LSzbiB1ikgtlpW4ILFxEaNymILUGkQinaRZfiKm66KEh3Qnf9I/lPz5zXOeOZkzeZBINMxsLh3bx7M80579773pssq/l7cfwgPD98GDiqrWMK8GWb/kcyeydPCwFoK9EU4GuFAK/Pt0ukaasoz95slcD51ggAqACArn5rBeBKMws0I7QEUgK0ogRSqw4BvBG2VgCtd61/EvdS0AYIXyt6QNXWx1LQctBdYyME0K1Nu73v76ltzle/6hm+Y1AgxDZmn3fS/IFK4PjbIMK3RG+I+hzdPVJjozLACVCEDz8G4ePlMHz5+T6czMZPl+/iXGo7XHRo4naqfaVxNa5pjBErfnC+G4kTnMOoW6I3SB1dLGZII/d5/ljMgWin04kgeX6GT8XSrNEsoM8baKNKwLu37vmsfcbys5Je1AvUpzGNKQECB5jUau2ePon2/szez+cx5+mM7+IZvntoZmimNa4J+uqkzvq0fc/3DKo6GPlzG3cuGOxNg6Lb7ZZQ+4DpNGwf3E8CvkfdzwtR+/zb2/iciJntmdUIAfxeQKxFAJLPsfZtddME8BPmf1cCf3338B+w8/h7eLnzqwDmtu4NC6gPyC4u/mA4DNn1dchubuZOl5iLPo0HMJd/J5IDYGv81dUdYJsAtf51CgA7KcDR0R1gk8jsxxedHkRITuMBkqVfRUgJ5nF1/lUFcIK1AigZFSAXYW51NZ4CkLCS5/ivBMDKVwkAnwqAz8yUmPYkA9vJ6Opjvipe49T2eKQ6swZ2nX8ZAUhokQD0c6Rd/GPCVzAlgMczUzxzpMkRPIYT7sf9RFErAFdSBdAV1r6g87RLZLymVQDaKhjsGgH0YoZ+wgsZRlzJ9RYLYI5A3FICKCnPAJ1L+ecIefqrGADjmbZVQuXxfrwGMV7PMXKedxj4356+iuRhr00AjVtqF0jVP7u6NkEXy8Tw6zRXlwLQxwxhaTBupSZYJYDXvWJOgKpmxs9VgnnpmABMc5JnKeiLWQqwUgn0er0AVBHkPOPG43EJBSE92OhKOrGUAH4WkDl90wSyJE8h/DZK4ktnQL/fL8iR4GQyCV/PzqKtPsS6ADwncHQBi0whwRlpPVfM+XPhOK+XHb6fZPrD1ldv9KMHLJ0BIKUAKZIH3D8ajUpQAVLbqJYSiC2KZ4yWor5u4ys6fS+pPYJvrtkEMdbx/w1lxzkXWEm9iwAAAABJRU5ErkJggg==" + } + AnimationStack: 75923119, "AnimStack::animation.m.attack_bare_hand", "" { + Properties70: { + P: "LocalStop", "KTime", "Time", "",0 + P: "ReferenceStop", "KTime", "Time", "",0 + } + } + AnimationLayer: 73264519, "AnimLayer::animation.m.attack_bare_hand", "" { + } + AnimationCurveNode: 75013773, "AnimCurveNode::animation.m.attack_bare_hand.R", "" { + Properties70: { + P: "d|X", "Number", "", "A",1 + P: "d|Y", "Number", "", "A",1 + P: "d|Z", "Number", "", "A",1 + } + } + AnimationCurve: 71601841, "AnimCurve::animation.m.attack_bare_hand.RX", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 90 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurve: 70289965, "AnimCurve::animation.m.attack_bare_hand.RY", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: -5.730000019073486 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurve: 79775636, "AnimCurve::animation.m.attack_bare_hand.RZ", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: -5.730000019073486 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurveNode: 74657291, "AnimCurveNode::animation.m.attack_bare_hand.R", "" { + Properties70: { + P: "d|X", "Number", "", "A",1 + P: "d|Y", "Number", "", "A",1 + P: "d|Z", "Number", "", "A",1 + } + } + AnimationCurve: 73412353, "AnimCurve::animation.m.attack_bare_hand.RX", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 90 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurve: 77670384, "AnimCurve::animation.m.attack_bare_hand.RY", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 5.730000019073486 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurve: 71791207, "AnimCurve::animation.m.attack_bare_hand.RZ", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 5.730000019073486 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationStack: 71692432, "AnimStack::animation.m.swimming", "" { + Properties70: { + P: "LocalStop", "KTime", "Time", "",0 + P: "ReferenceStop", "KTime", "Time", "",0 + } + } + AnimationLayer: 76223534, "AnimLayer::animation.m.swimming", "" { + } + AnimationCurveNode: 72576097, "AnimCurveNode::animation.m.swimming.R", "" { + Properties70: { + P: "d|X", "Number", "", "A",1 + P: "d|Y", "Number", "", "A",1 + P: "d|Z", "Number", "", "A",1 + } + } + AnimationCurve: 76418823, "AnimCurve::animation.m.swimming.RX", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurve: 76634510, "AnimCurve::animation.m.swimming.RY", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurve: 73812945, "AnimCurve::animation.m.swimming.RZ", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurveNode: 70181297, "AnimCurveNode::animation.m.swimming.P", "" { + Properties70: { + P: "d|X", "Number", "", "A",1 + P: "d|Y", "Number", "", "A",1 + P: "d|Z", "Number", "", "A",1 + } + } + AnimationCurve: 71485255, "AnimCurve::animation.m.swimming.PX", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurve: 78583318, "AnimCurve::animation.m.swimming.PY", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 75 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurve: 72862003, "AnimCurve::animation.m.swimming.PZ", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurveNode: 76454434, "AnimCurveNode::animation.m.swimming.R", "" { + Properties70: { + P: "d|X", "Number", "", "A",1 + P: "d|Y", "Number", "", "A",1 + P: "d|Z", "Number", "", "A",1 + } + } + AnimationCurve: 71857695, "AnimCurve::animation.m.swimming.RX", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurve: 75622011, "AnimCurve::animation.m.swimming.RY", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurve: 79073166, "AnimCurve::animation.m.swimming.RZ", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurveNode: 70350102, "AnimCurveNode::animation.m.swimming.R", "" { + Properties70: { + P: "d|X", "Number", "", "A",1 + P: "d|Y", "Number", "", "A",1 + P: "d|Z", "Number", "", "A",1 + } + } + AnimationCurve: 77578194, "AnimCurve::animation.m.swimming.RX", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurve: 77349443, "AnimCurve::animation.m.swimming.RY", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurve: 74044518, "AnimCurve::animation.m.swimming.RZ", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurveNode: 78570917, "AnimCurveNode::animation.m.swimming.R", "" { + Properties70: { + P: "d|X", "Number", "", "A",1 + P: "d|Y", "Number", "", "A",1 + P: "d|Z", "Number", "", "A",1 + } + } + AnimationCurve: 79486268, "AnimCurve::animation.m.swimming.RX", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurve: 70343377, "AnimCurve::animation.m.swimming.RY", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurve: 76445396, "AnimCurve::animation.m.swimming.RZ", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurveNode: 72889701, "AnimCurveNode::animation.m.swimming.R", "" { + Properties70: { + P: "d|X", "Number", "", "A",1 + P: "d|Y", "Number", "", "A",1 + P: "d|Z", "Number", "", "A",1 + } + } + AnimationCurve: 76280645, "AnimCurve::animation.m.swimming.RX", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurve: 71822939, "AnimCurve::animation.m.swimming.RY", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } + AnimationCurve: 75406682, "AnimCurve::animation.m.swimming.RZ", "" { + Default: 0 + KeyVer: 4008 + KeyTime: *1 { + a: 0 + } + KeyValueFloat: *1 { + a: 0 + } + KeyAttrFlags: *1 { + a: 24836 + } + KeyAttrDataFloat: *4 { + a: 0,0,255790911,0 + } + KeyAttrRefCount: *1 { + a: 1 + } + } +} + +; Object connections +;------------------------------------------------------------------ + +Connections: { + + ;Model::waist, Model::RootNode + C: "OO",77819442,0 + + ;Model::body, Model::waist + C: "OO",73828569,77819442 + + ;Model::head, Model::body + C: "OO",78808991,73828569 + + ;Model::hat, Model::head + C: "OO",75648558,78808991 + + ;Model::rightArm, Model::body + C: "OO",71451861,73828569 + + ;Model::rightItem, Model::rightArm + C: "OO",76099182,71451861 + + ;Model::leftArm, Model::body + C: "OO",74505323,73828569 + + ;Model::leftItem, Model::leftArm + C: "OO",71393980,74505323 + + ;Model::rightLeg, Model::body + C: "OO",76008544,73828569 + + ;Model::leftLeg, Model::body + C: "OO",70295505,73828569 + + ;Model::body_1, Model::body + C: "OO",72855409,73828569 + + ;Geometry::body_1, Model::body_1 + C: "OO",73224442,72855409 + + ;Material::m, Model::body_1 + C: "OO",70466606,72855409 + + ;Model::head_1, Model::head + C: "OO",78792842,78808991 + + ;Geometry::head_1, Model::head_1 + C: "OO",78934101,78792842 + + ;Material::m, Model::head_1 + C: "OO",70466606,78792842 + + ;Model::hat_1, Model::hat + C: "OO",76608387,75648558 + + ;Geometry::hat_1, Model::hat_1 + C: "OO",72262289,76608387 + + ;Material::m, Model::hat_1 + C: "OO",70466606,76608387 + + ;Model::rightArm_1, Model::rightArm + C: "OO",76277951,71451861 + + ;Geometry::rightArm_1, Model::rightArm_1 + C: "OO",70088550,76277951 + + ;Material::m, Model::rightArm_1 + C: "OO",70466606,76277951 + + ;Model::leftArm_1, Model::leftArm + C: "OO",79102864,74505323 + + ;Geometry::leftArm_1, Model::leftArm_1 + C: "OO",74222666,79102864 + + ;Material::m, Model::leftArm_1 + C: "OO",70466606,79102864 + + ;Model::rightLeg_1, Model::rightLeg + C: "OO",75314468,76008544 + + ;Geometry::rightLeg_1, Model::rightLeg_1 + C: "OO",74379548,75314468 + + ;Material::m, Model::rightLeg_1 + C: "OO",70466606,75314468 + + ;Model::leftLeg_1, Model::leftLeg + C: "OO",76620132,70295505 + + ;Geometry::leftLeg_1, Model::leftLeg_1 + C: "OO",77556196,76620132 + + ;Material::m, Model::leftLeg_1 + C: "OO",70466606,76620132 + + ;Texture::m, Material::m + C: "OP",78150717,70466606, "DiffuseColor" + + ;Video::m, Texture::m + C: "OO",77167900,78150717 + + ;AnimLayer::animation.m.attack_bare_hand, AnimStack::animation.m.attack_bare_hand + C: "OO",73264519,75923119 + + ;AnimCurveNode::animation.m.attack_bare_hand.R, Model::leftArm + C: "OP",75013773,74505323, "Lcl Rotation" + + ;AnimCurveNode::animation.m.attack_bare_hand.R, AnimLayer::animation.m.attack_bare_hand + C: "OO",75013773,73264519 + + ;AnimCurve::animation.m.attack_bare_hand.RX, AnimCurveNode::animation.m.attack_bare_hand.R + C: "OP",71601841,75013773, "d|X" + + ;AnimCurve::animation.m.attack_bare_hand.RY, AnimCurveNode::animation.m.attack_bare_hand.R + C: "OP",70289965,75013773, "d|Y" + + ;AnimCurve::animation.m.attack_bare_hand.RZ, AnimCurveNode::animation.m.attack_bare_hand.R + C: "OP",79775636,75013773, "d|Z" + + ;AnimCurveNode::animation.m.attack_bare_hand.R, Model::rightArm + C: "OP",74657291,71451861, "Lcl Rotation" + + ;AnimCurveNode::animation.m.attack_bare_hand.R, AnimLayer::animation.m.attack_bare_hand + C: "OO",74657291,73264519 + + ;AnimCurve::animation.m.attack_bare_hand.RX, AnimCurveNode::animation.m.attack_bare_hand.R + C: "OP",73412353,74657291, "d|X" + + ;AnimCurve::animation.m.attack_bare_hand.RY, AnimCurveNode::animation.m.attack_bare_hand.R + C: "OP",77670384,74657291, "d|Y" + + ;AnimCurve::animation.m.attack_bare_hand.RZ, AnimCurveNode::animation.m.attack_bare_hand.R + C: "OP",71791207,74657291, "d|Z" + + ;AnimLayer::animation.m.swimming, AnimStack::animation.m.swimming + C: "OO",76223534,71692432 + + ;AnimCurveNode::animation.m.swimming.R, Model::body + C: "OP",72576097,73828569, "Lcl Rotation" + + ;AnimCurveNode::animation.m.swimming.R, AnimLayer::animation.m.swimming + C: "OO",72576097,76223534 + + ;AnimCurve::animation.m.swimming.RX, AnimCurveNode::animation.m.swimming.R + C: "OP",76418823,72576097, "d|X" + + ;AnimCurve::animation.m.swimming.RY, AnimCurveNode::animation.m.swimming.R + C: "OP",76634510,72576097, "d|Y" + + ;AnimCurve::animation.m.swimming.RZ, AnimCurveNode::animation.m.swimming.R + C: "OP",73812945,72576097, "d|Z" + + ;AnimCurveNode::animation.m.swimming.P, Model::body + C: "OP",70181297,73828569, "Lcl Translation" + + ;AnimCurveNode::animation.m.swimming.P, AnimLayer::animation.m.swimming + C: "OO",70181297,76223534 + + ;AnimCurve::animation.m.swimming.PX, AnimCurveNode::animation.m.swimming.P + C: "OP",71485255,70181297, "d|X" + + ;AnimCurve::animation.m.swimming.PY, AnimCurveNode::animation.m.swimming.P + C: "OP",78583318,70181297, "d|Y" + + ;AnimCurve::animation.m.swimming.PZ, AnimCurveNode::animation.m.swimming.P + C: "OP",72862003,70181297, "d|Z" + + ;AnimCurveNode::animation.m.swimming.R, Model::leftArm + C: "OP",76454434,74505323, "Lcl Rotation" + + ;AnimCurveNode::animation.m.swimming.R, AnimLayer::animation.m.swimming + C: "OO",76454434,76223534 + + ;AnimCurve::animation.m.swimming.RX, AnimCurveNode::animation.m.swimming.R + C: "OP",71857695,76454434, "d|X" + + ;AnimCurve::animation.m.swimming.RY, AnimCurveNode::animation.m.swimming.R + C: "OP",75622011,76454434, "d|Y" + + ;AnimCurve::animation.m.swimming.RZ, AnimCurveNode::animation.m.swimming.R + C: "OP",79073166,76454434, "d|Z" + + ;AnimCurveNode::animation.m.swimming.R, Model::leftLeg + C: "OP",70350102,70295505, "Lcl Rotation" + + ;AnimCurveNode::animation.m.swimming.R, AnimLayer::animation.m.swimming + C: "OO",70350102,76223534 + + ;AnimCurve::animation.m.swimming.RX, AnimCurveNode::animation.m.swimming.R + C: "OP",77578194,70350102, "d|X" + + ;AnimCurve::animation.m.swimming.RY, AnimCurveNode::animation.m.swimming.R + C: "OP",77349443,70350102, "d|Y" + + ;AnimCurve::animation.m.swimming.RZ, AnimCurveNode::animation.m.swimming.R + C: "OP",74044518,70350102, "d|Z" + + ;AnimCurveNode::animation.m.swimming.R, Model::rightArm + C: "OP",78570917,71451861, "Lcl Rotation" + + ;AnimCurveNode::animation.m.swimming.R, AnimLayer::animation.m.swimming + C: "OO",78570917,76223534 + + ;AnimCurve::animation.m.swimming.RX, AnimCurveNode::animation.m.swimming.R + C: "OP",79486268,78570917, "d|X" + + ;AnimCurve::animation.m.swimming.RY, AnimCurveNode::animation.m.swimming.R + C: "OP",70343377,78570917, "d|Y" + + ;AnimCurve::animation.m.swimming.RZ, AnimCurveNode::animation.m.swimming.R + C: "OP",76445396,78570917, "d|Z" + + ;AnimCurveNode::animation.m.swimming.R, Model::rightLeg + C: "OP",72889701,76008544, "Lcl Rotation" + + ;AnimCurveNode::animation.m.swimming.R, AnimLayer::animation.m.swimming + C: "OO",72889701,76223534 + + ;AnimCurve::animation.m.swimming.RX, AnimCurveNode::animation.m.swimming.R + C: "OP",76280645,72889701, "d|X" + + ;AnimCurve::animation.m.swimming.RY, AnimCurveNode::animation.m.swimming.R + C: "OP",71822939,72889701, "d|Y" + + ;AnimCurve::animation.m.swimming.RZ, AnimCurveNode::animation.m.swimming.R + C: "OP",75406682,72889701, "d|Z" +} + +; Takes section +;------------------------------------------------------------------ + +Takes: { + Current: "" + Take: "animation.m.attack_bare_hand" { + FileName: "animation.m.attack_bare_hand.tak" + LocalTime: 0,0 + ReferenceTime: 0,0 + } + Take: "animation.m.swimming" { + FileName: "animation.m.swimming.tak" + LocalTime: 0,0 + ReferenceTime: 0,0 + } +} diff --git a/assets/zombie.png b/assets/zombie.png new file mode 100644 index 0000000000000000000000000000000000000000..47ad7e8da091932c8bd0bf3571f92b5d9860da14 GIT binary patch literal 994 zcmV<810DQ{P)Px&j7da6RA}DiSWRmaQ52ouk(~=mHsS|Zq=MOLTY?K0 z5gIosh%G^+LMhrsm*OgJx+q9@LU;Wm`A^TB*E!>vlQ)?JgG|Q4;oZD@GtD{g-uvF0 zEUWo@ar_`WKYSQCs;y%R@MW9+M>2aSPYVHPE726-YlQ%>&$mmYX{#vD-fWe?`PK*k zr~rVjerpBbN;3;IBeVok0<@w8QmYODyb-om0Iheee-ign&;|%!D|$fH*2hxNa?o94 zBLvW`O}oAC@2PFhSHJ2RzGF}z#5QK1chdZUO5ph0Ai}pqZ;1LF-91ucqcXq=P=pUZ z2I1r7Fnsy>KAgTFr_+fbd47gZ#nPF2bk1q z?Vdh~_WsP?&*w4c>5T8<8NPdHW@x50t_k|;q|W-Zeb4s{syZ0?a~pRq80<}hqTB73 zQ2T)CG;AN-PXfM2-OmeA`~2J6_?(ED?U~gG0sLM-tVIBl&$0Gxb<+g!6Xt(c0)Kt? z@E@@A_nw(boJs1L|4F8*LR4B7Q{$Zl@tPM4UAK8*)3mwzXc17K_X)zuwf zn*g=`bqWAGDZtUu9bl8l?8g_K9z;k^;{lSTUqwg>=5clYRRwT@wE`#^6(AR3Zgn-D z0+6th=lHJ#z{*z%0G|qg&&-sV_9O$_$>{21zA9eh)b@C!I>2^|VupUg z3mHaS$@LZsV2(iCQUWL`&j6iE`R53E`l}cK6ida zbCPE%=!;njuu=*1dc6Qt5#&7M#^Z4b1tC4y=t?@VlmLDfkU4$R1hOPgA^bK<;!9^h zzuzy&k>F%931837qOCr}x&S;UaC8BSOd-J;X+2lW`E%houa_OZpJe*O)>m)zqX#UV z0U)ISDUt`=KN^inPytfgsFo6lEsAH1mZH9H<10FSFR49(Z?4${G1l?_4Q0nU7g$NX QivR!s07*qoM6N<$f+tGN3;+NC literal 0 HcmV?d00001 diff --git a/include/td/render/Renderer.h b/include/td/render/Renderer.h index 3bb5e64..f0ea52a 100644 --- a/include/td/render/Renderer.h +++ b/include/td/render/Renderer.h @@ -1,10 +1,11 @@ #pragma once #include +#include #include +#include #include #include -#include namespace td { namespace render { @@ -15,6 +16,7 @@ class BasicRenderer { virtual ~BasicRenderer() {} void Render(const GL::VertexArray& a_Vao); + void Render(const Model& a_Model); }; template @@ -66,7 +68,7 @@ class RenderPipeline { template Renderer::Renderer(Camera& a_Camera) : m_Shader(std::make_unique()), m_Camera(a_Camera) { - Connect(a_Camera.OnPerspectiveChange, [this](){ + Connect(a_Camera.OnPerspectiveChange, [this]() { m_Shader->Start(); m_Shader->SetProjectionMatrix(m_Camera.GetProjectionMatrix()); }); diff --git a/include/td/render/loader/FbxLoader.h b/include/td/render/loader/FbxLoader.h new file mode 100644 index 0000000..26e9116 --- /dev/null +++ b/include/td/render/loader/FbxLoader.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include +#include +#include + +namespace td { + +struct Model { + std::vector> m_Vaos; +}; + +namespace ModelLoader { + +Model LoadModel(const std::string& fileName); + +} +} \ No newline at end of file diff --git a/include/td/render/renderer/EntityRenderer.h b/include/td/render/renderer/EntityRenderer.h index f0e7249..b7db1e4 100644 --- a/include/td/render/renderer/EntityRenderer.h +++ b/include/td/render/renderer/EntityRenderer.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include @@ -10,7 +11,7 @@ namespace render { class EntityRenderer : public Renderer { private: game::WorldPtr m_World; - std::unique_ptr m_EntityVao; + Model m_EntityModel; public: EntityRenderer(Camera& a_Camera, const game::WorldPtr& a_World); diff --git a/src/td/render/Renderer.cpp b/src/td/render/Renderer.cpp index cc5a032..9e82945 100644 --- a/src/td/render/Renderer.cpp +++ b/src/td/render/Renderer.cpp @@ -8,10 +8,17 @@ namespace render { void BasicRenderer::Render(const GL::VertexArray& a_Vao) { a_Vao.Bind(); glDrawArrays(GL_TRIANGLES, 0, a_Vao.GetVertexCount()); - // glDrawElements(GL_TRIANGLES, a_Vao.GetVertexCount(), GL_UNSIGNED_INT, nullptr); a_Vao.Unbind(); } +void BasicRenderer::Render(const Model& a_Model) { + for (const auto& vao : a_Model.m_Vaos) { + vao->Bind(); + glDrawElements(GL_TRIANGLES, vao->GetVertexCount(), GL_UNSIGNED_INT, nullptr); + vao->Unbind(); + } +} + RenderPipeline::RenderPipeline() { glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); diff --git a/src/td/render/loader/FbxLoader.cpp b/src/td/render/loader/FbxLoader.cpp new file mode 100644 index 0000000..9252156 --- /dev/null +++ b/src/td/render/loader/FbxLoader.cpp @@ -0,0 +1,128 @@ +#include + +#include // C++ importer interface +#include // Post processing flags +#include // Output data structure +#include +#include +#include +#include +#include + +#define VERTEX_SIZE 3 +#define UV_SIZE 2 + +#define VERTEX_POSITION_INDEX 0 +#define VERTEX_UV_INDEX 1 +#define VERTEX_NORMAL_INDEX 2 + +namespace td { +namespace ModelLoader { + +static std::unique_ptr ProcessMesh(aiMesh* mesh, const aiScene* scene, const aiMatrix4x4& transform) { + std::vector positions; + std::vector textureCoords; + std::vector normals; + + std::vector indicies; + + aiFace* faces = mesh->mFaces; + std::size_t faceNumber = mesh->mNumFaces; + + for (std::size_t j = 0; j < faceNumber; j++) { + std::size_t offset = indicies.size(); + std::size_t numIndices = faces[j].mNumIndices; + + indicies.resize(indicies.size() + numIndices); + std::memcpy(indicies.data() + offset, faces[j].mIndices, numIndices * sizeof(unsigned int)); + } + + std::size_t vertNumber = mesh->mNumVertices; + aiVector3D* vertecies = mesh->mVertices; + + for (std::size_t j = 0; j < vertNumber; j++) { + aiVector3D vertex = transform * vertecies[j]; + + positions.push_back(vertex.x); + positions.push_back(vertex.y); + positions.push_back(vertex.z); + } + + if (mesh->HasNormals()) { + aiVector3D* vertexNormals = mesh->mNormals; + + for (std::size_t j = 0; j < vertNumber; j++) { + aiVector3D normal = transform * vertexNormals[j]; + + normals.push_back(normal.x); + normals.push_back(normal.y); + normals.push_back(normal.z); + } + } + + aiVector3D** vertexTexture = mesh->mTextureCoords; + + for (std::size_t j = 0; j < vertNumber; j++) { + textureCoords.push_back(vertexTexture[0][j].x); + textureCoords.push_back(vertexTexture[0][j].y); + } + + GL::VertexBuffer positionVBO(positions, VERTEX_SIZE); + positionVBO.AddVertexAttribPointer(VERTEX_POSITION_INDEX, VERTEX_SIZE, 0); + + GL::VertexBuffer textureVBO(textureCoords, UV_SIZE); + textureVBO.AddVertexAttribPointer(VERTEX_UV_INDEX, UV_SIZE, 0); + + GL::VertexBuffer normalVBO(normals, VERTEX_SIZE); + normalVBO.AddVertexAttribPointer(VERTEX_NORMAL_INDEX, VERTEX_SIZE, 0); + + auto Vao = std::make_unique(GL::ElementBuffer{indicies}); + Vao->Bind(); + Vao->BindVertexBuffer(std::move(positionVBO)); + Vao->BindVertexBuffer(std::move(textureVBO)); + Vao->BindVertexBuffer(std::move(normalVBO)); + Vao->Unbind(); + + return Vao; +} + +static void ProcessNode( + aiNode* node, const aiScene* scene, std::vector>& meshes, const aiMatrix4x4& transform) { + // recursive + for (unsigned int i = 0; i < node->mNumChildren; i++) { + ProcessNode(node->mChildren[i], scene, meshes, transform * node->mTransformation); + } + + for (unsigned int i = 0; i < node->mNumMeshes; i++) { + aiMesh* mesh = scene->mMeshes[node->mMeshes[i]]; + meshes.push_back(ProcessMesh(mesh, scene, transform * node->mTransformation)); + } +} + +Model LoadModel(const std::string& fileName) { + // DataBuffer fileData = utils::AssetsManager::GetAsset(fileName); + sp::DataBuffer fileData; + fileData.ReadFile(fileName); + + Assimp::Importer importer; + + const aiScene* scene = importer.ReadFile(fileName, aiProcess_CalcTangentSpace | aiProcess_Triangulate | aiProcess_SortByPType | + aiProcess_OptimizeGraph | aiProcess_OptimizeMeshes | aiProcess_GlobalScale); + + if (!scene) { + std::cerr << "[ModelLoader] Failed to load model !\n"; + return {}; + } + + // utils::LOGD(utils::Format("[ModelLoader]\tModel nodes : %i", scene->mRootNode->mNumMeshes)); + + Model model; + ProcessNode(scene->mRootNode, scene, model.m_Vaos, {}); + + std::cout << "Loaded " << model.m_Vaos.size() << " vaos !\n"; + + return model; +} + +} // namespace ModelLoader +} // namespace td diff --git a/src/td/render/renderer/EntityRenderer.cpp b/src/td/render/renderer/EntityRenderer.cpp index 6e373f3..645c44e 100644 --- a/src/td/render/renderer/EntityRenderer.cpp +++ b/src/td/render/renderer/EntityRenderer.cpp @@ -1,3 +1,4 @@ +#include "td/render/Renderer.h" #include #include @@ -6,7 +7,7 @@ namespace td { namespace render { EntityRenderer::EntityRenderer(Camera& a_Camera, const game::WorldPtr& a_World) : Renderer(a_Camera), m_World(a_World) { - m_EntityVao = std::make_unique(WorldLoader::LoadMobModel()); + m_EntityModel = ModelLoader::LoadModel("assets/zombie.fbx"); m_Shader->Start(); m_Shader->SetColorEffect({1, 0, 1}); } @@ -23,7 +24,7 @@ void EntityRenderer::Render(float a_Lerp) { float z = Lerp(*mob, a_Lerp, [](const game::Mob& a_Mob) { return static_cast(a_Mob.m_Position.y); }); m_Shader->SetModelPos({x, .001, z}); - Renderer::Render(*m_EntityVao); + Renderer::Render(m_EntityModel); } } diff --git a/xmake.lua b/xmake.lua index 0b93abe..1e47320 100644 --- a/xmake.lua +++ b/xmake.lua @@ -3,7 +3,7 @@ add_rules("mode.debug", "mode.release") add_repositories("persson-repo https://git.ale-pri.com/Persson-dev/xmake-repo.git") add_requires("imgui 1.92.0", {configs = {sdl3 = true, opengl3 = true}}) -add_requires("libsdl3 3.2.16", "splib 2.3.2", "zlib", "glew", "fpm", "enet6") +add_requires("libsdl3 3.2.16", "splib 2.3.2", "zlib", "glew", "fpm", "enet6", "assimp") set_languages("c++20") @@ -21,7 +21,7 @@ target("Tower-Defense2") add_includedirs("include", {public = true}) set_kind("binary") add_files("src/**.cpp") - add_packages("libsdl3", "imgui", "glew", "splib", "zlib", "fpm", "enet6", {public = true}) + add_packages("libsdl3", "imgui", "glew", "splib", "zlib", "fpm", "assimp", "enet6", {public = true}) set_rundir(".") add_defines("TD_GL_LOADER_GLEW")