Exemplo n.º 1
0
        public WTransformGizmo(WWorld parentWorld)
        {
            m_world = parentWorld;

            SetMode(FTransformMode.Translation);
            SetTransformSpace(FTransformSpace.World);

            string[][] meshNames = new string[][]
            {
                new string[] { "TranslateCenter", "TranslateX", "TranslateY", "TranslateZ", "TranslateLinesXY", "TranslateLinesXZ", "TranslateLinesYZ" },
                new string[] { "RotateX", "RotateY", "RotateZ" },
                new string[] { "ScaleCenter", "ScaleX", "ScaleY", "ScaleZ", "ScaleLinesXY", "ScaleLinesXZ", "ScaleLinesYZ" }
            };

            m_gizmoMeshes = new SimpleObjRenderer[meshNames.Length][];
            for (int i = 0; i < m_gizmoMeshes.Length; i++)
            {
                m_gizmoMeshes[i] = new SimpleObjRenderer[meshNames[i].Length];

                for (int j = 0; j < m_gizmoMeshes[i].Length; j++)
                {
                    Obj obj = new Obj();
                    obj.Load("resources/editor/" + meshNames[i][j] + ".obj");
                    m_gizmoMeshes[i][j] = new SimpleObjRenderer(obj, new OpenTK.Vector4(1, 1, 1, 0.50f));
                    m_gizmoMeshes[i][j].FaceCullingEnabled = false;
                    m_gizmoMeshes[i][j].BlendingEnabled    = true;
                }
            }
        }
Exemplo n.º 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)
                {
                    // 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", new Vector4(1, 1, 1, 1));
            }
        }
Exemplo n.º 3
0
        public override void OnConstruction()
        {
            base.OnConstruction();

            ColorOverrides   = new TevColorOverride();
            m_actorMeshes    = new List <J3D>();
            PropertyChanged += VisibleDOMNode_PropertyChanged;
            IsRendered       = true;

            m_objRender = WResourceManager.LoadObjResource("resources/editor/EditorCube.obj", new OpenTK.Vector4(1, 1, 1, 1));
        }
        public WViewportOrientationWidget()
        {
            string[] meshNames = new string[] { "TranslateCenter", "TranslateX", "TranslateY", "TranslateZ" };

            m_gizmoMeshes = new SimpleObjRenderer[meshNames.Length];
            for (int i = 0; i < m_gizmoMeshes.Length; i++)
            {
                Obj obj = new Obj();
                obj.Load("resources/editor/" + meshNames[i] + ".obj");
                m_gizmoMeshes[i] = new SimpleObjRenderer(obj, new OpenTK.Vector4(1, 1, 1, 1));
            }
        }
Exemplo n.º 5
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");
            }
        }
Exemplo n.º 6
0
 // Constructor
 public TriggerRegion(FourCC fourCC, WWorld world) : base(fourCC, world)
 {
     m_RegionAreaModel = WResourceManager.LoadObjResource("resources/editor/EditorCube.obj", new OpenTK.Vector4(1, 1, 1, 1), true, false);
     DisableRotationAndScaleForRaycasting = true;
 }
Exemplo n.º 7
0
        public override void PostLoad()
        {
            base.PostLoad();

            m_objRender = WResourceManager.LoadObjResource("resources/editor/EditorCube.obj", new OpenTK.Vector4(1, 1, 1, 1));
        }