コード例 #1
0
ファイル: MapFactory.cs プロジェクト: oggy83/OculusWalkerDemo
        private static MapLayoutResource _LoadLayout(int id)
        {
            var pathFormat = "Map/m{0}/m{0}.blend";
            var scene      = BlenderScene.FromFile(String.Format(pathFormat, id));

            return(MapLayoutResource.FromScene("parts", scene));
        }
コード例 #2
0
        public PlayerEntity()
            : base("player")
        {
            var entitySys = EntitySystem.GetInstance();
            var mapSys    = MapSystem.GetInstance();

            //var path = "Chr/c9000/test.blend";
            //var searchPath = "Chr/c9000";
            var path       = "Chr/c9100/c9100.blend";
            var searchPath = "Chr/c9100";
            var scene      = BlenderScene.FromFile(path);

            if (scene != null)
            {
                var drawModel = DrawModel.FromScene(path + "/draw", scene, searchPath);
                var animRes   = AnimResource.FromBlenderScene(path + "/anim", scene);
                //var debugModel = DrawModel.CreateTangentFrame(path + "/debug", scene);

                if (drawModel.BoneArray.Length != 0)
                {
                    var skeletonC = new SkeletonComponent(drawModel.BoneArray);
                    AddComponent(skeletonC);
                }

                var layoutC = new LayoutComponent();
                layoutC.Transform = Matrix.Identity;
                AddComponent(layoutC);

                //var markerC = new ModelMarkerComponent(scene);
                //AddComponent(markerC);

                var modelC = new ModelComponent(GameEntityComponent.UpdateLines.Draw);
                modelC.ModelContext.EnableCastShadow = true;
                modelC.ModelContext.DrawModel        = drawModel;
                //modelC.ModelContext.DebugModel = debugModel;
                AddComponent(modelC);

                var animC = new AnimComponent(animRes);
                AddComponent(animC);

                var behaviorC = new ChrBehaviorComponent();
                AddComponent(behaviorC);

                var minimapC = new MinimapComponent();
                AddComponent(minimapC);

                MapLocation startLocation = mapSys.GetStartInfo();
                //var inputC = new GodViewInputComponent();
                var inputC = new FpsInputComponent(startLocation);
                AddComponent(inputC);
            }
        }
コード例 #3
0
        private DrawModel _LoadParts(int modelId)
        {
            var pathFormat = "Parts/p{0}/p{0}.blend";
            var scene      = BlenderScene.FromFile(String.Format(pathFormat, modelId));

            var drawModel = DrawModel.FromScene("p" + modelId + "/draw", scene);

            m_drawModelList.Add(new _ModelInfo()
            {
                Model = drawModel, ModelId = modelId
            });
            return(drawModel);
        }