Browse Source

Preserve prefab scale, send scene change on tab change, default to 45 degree FOV on new scenes

Josh Engebretson 10 years ago
parent
commit
7d56fa9b72

+ 1 - 1
Resources/EditorData/AtomicEditor/templates/template_scene.scene

@@ -52,7 +52,7 @@
 		<attribute name="Scale" value="1 1 1" />
 		<attribute name="Scale" value="1 1 1" />
 		<attribute name="Variables" />
 		<attribute name="Variables" />
 		<component type="Camera" id="1973">
 		<component type="Camera" id="1973">
-			<attribute name="FOV" value="90" />
+			<attribute name="FOV" value="45" />
 		</component>
 		</component>
 	</node>
 	</node>
 </scene>
 </scene>

+ 0 - 1
Script/AtomicEditor/ui/HierarchyFrame.ts

@@ -35,7 +35,6 @@ class HierarchyFrame extends Atomic.UIWidget {
 
 
         this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
         this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
 
 
-
         this.subscribeToEvent(EditorEvents.ActiveNodeChange, (data) => {
         this.subscribeToEvent(EditorEvents.ActiveNodeChange, (data) => {
 
 
             if (data.node)
             if (data.node)

+ 6 - 0
Script/AtomicEditor/ui/ResourceFrame.ts

@@ -175,6 +175,12 @@ class ResourceFrame extends ScriptWidget {
 
 
                 if (this.currentResourceEditor != w.editor) {
                 if (this.currentResourceEditor != w.editor) {
 
 
+                    if (w.editor.typeName == "SceneEditor3D") {
+
+                        this.sendEvent(EditorEvents.ActiveSceneChange, { scene: (<Editor.SceneEditor3D> w.editor).scene});
+
+                    }
+
                     this.sendEvent(UIEvents.ResourceEditorChanged, { editor: w.editor });
                     this.sendEvent(UIEvents.ResourceEditorChanged, { editor: w.editor });
 
 
                 }
                 }

+ 1 - 1
Source/Atomic/Scene/PrefabComponent.cpp

@@ -56,7 +56,7 @@ void PrefabComponent::LoadPrefabNode()
 
 
     prefabNode_->SetPosition(Vector3::ZERO);
     prefabNode_->SetPosition(Vector3::ZERO);
     prefabNode_->SetRotation(Quaternion::IDENTITY);
     prefabNode_->SetRotation(Quaternion::IDENTITY);
-    prefabNode_->SetScale(Vector3::ONE);
+    // prefabNode_->SetScale(Vector3::ONE);
 
 
     PODVector<RigidBody*> bodies;
     PODVector<RigidBody*> bodies;
     prefabNode_->GetComponents<RigidBody>(bodies, true);
     prefabNode_->GetComponents<RigidBody>(bodies, true);