예제 #1
0
        public override void PostLoad()
        {
            base.PostLoad();

            m_actorMesh = WResourceManager.LoadActorByName(ToString());
            if (m_actorMesh != null)
            {
                // Create and set up some initial lighting options so character's aren't drawn super brightly
                // until we support actually loading room environment lighting and apply it (see below).
                var lightPos       = new Vector4(250, 200, 250, 0);
                var mainLight      = new JStudio.OpenGL.GXLight(lightPos, -lightPos.Normalized(), new Vector4(1, 0, 1, 1), new Vector4(1.075f, 0, 0, 0), new Vector4(1.075f, 0, 0, 0));
                var secondaryLight = new JStudio.OpenGL.GXLight(lightPos, -lightPos.Normalized(), new Vector4(0, 0, 1, 1), new Vector4(1.075f, 0, 0, 0), new Vector4(1.075f, 0, 0, 0));

                Quaternion lightRot    = Quaternion.FromAxisAngle(Vector3.UnitY, (float)Math.PI / 2f);
                Vector3    newLightPos = Vector3.Transform(new Vector3(-500, 0, 0), lightRot) + new Vector3(0, 50, 0);

                secondaryLight.Position = new Vector4(newLightPos, 0);

                m_actorMesh.SetHardwareLight(0, mainLight);
                m_actorMesh.SetHardwareLight(1, secondaryLight);
                m_actorMesh.SetTextureOverride("ZBtoonEX", "resources/textures/ZBtoonEX.png");
                m_actorMesh.SetTextureOverride("ZAtoon", "resources/textures/ZAtoon.png");

                m_objRender = null;
            }

            if (m_actorMesh == null)
            {
                m_objRender = WResourceManager.LoadObjResource("resources/editor/EditorCube.obj");
            }
        }
예제 #2
0
        private void UpdateActorMeshFromNameProperty()
        {
            TStringPropertyValue stringProperty = m_namePropertyValueCache as TStringPropertyValue;

            if (stringProperty != null)
            {
                m_actorMesh = WResourceManager.LoadActorByName((string)stringProperty.GetValue());
                if (m_actorMesh != null)
                {
                    m_actorMesh.SetHardwareLight(0, new JStudio.OpenGL.GXLight(Vector4.Zero, Vector4.UnitX, new Vector4(1, 1, 1, 1), new Vector4(1.875f, 0, 0, 0), new Vector4(1.875f, 0, 0, 0)));
                    m_actorMesh.SetHardwareLight(1, new JStudio.OpenGL.GXLight(Vector4.Zero, Vector4.UnitX, new Vector4(1, 1, 1, 1), new Vector4(1.875f, 0, 0, 0), new Vector4(1.875f, 0, 0, 0)));
                    m_actorMesh.SetTextureOverride("ZBtoonEX", "resources/textures/ZBtoonEX.png");
                    m_actorMesh.SetTextureOverride("ZAtoon", "resources/textures/ZAtoon.png");

                    m_objRender = null;
                }
            }

            if (m_actorMesh == null)
            {
                m_objRender = WResourceManager.LoadObjResource("resources/editor/EditorCube.obj");
            }
        }
예제 #3
0
        private void UpdateModel()
        {
            switch (Type)
            {
            case ChestType.Big_Key:
                m_actorMesh = WResourceManager.LoadActorByName("big_key_chest");
                break;

            case ChestType.Light_wood:
                m_actorMesh = WResourceManager.LoadActorByName("light_wood_chest");
                m_actorMesh.LoadRegisterAnim(@"D:\SZS Tools\dalways\brk\boxa.brk");
                m_actorMesh.SetRegisterAnimation("boxa");

                m_actorMesh.CurrentRegisterAnimation.Tick(20);
                m_actorMesh.CurrentRegisterAnimation.Pause();
                break;

            case ChestType.Metal:
                m_actorMesh = WResourceManager.LoadActorByName("metal_chest");
                m_actorMesh.LoadRegisterAnim(@"D:\SZS Tools\dalways\brk\boxc.brk");
                m_actorMesh.SetRegisterAnimation("boxc");

                m_actorMesh.CurrentRegisterAnimation.Tick(20);
                m_actorMesh.CurrentRegisterAnimation.Pause();
                break;

            case ChestType.Dark_wood:
                m_actorMesh = WResourceManager.LoadActorByName("dark_wood_chest");
                m_actorMesh.LoadRegisterAnim(@"D:\SZS Tools\dalways\brk\boxb.brk");
                m_actorMesh.SetRegisterAnimation("boxb");

                m_actorMesh.CurrentRegisterAnimation.Tick(20);
                m_actorMesh.CurrentRegisterAnimation.Pause();
                break;
            }
        }