|
@@ -1,9 +1,20 @@
|
|
Sidebar.Properties.Object3D = function ( signals ) {
|
|
Sidebar.Properties.Object3D = function ( signals ) {
|
|
|
|
|
|
|
|
+ var objects = {
|
|
|
|
+
|
|
|
|
+ 'PerspectiveCamera': THREE.PerspectiveCamera,
|
|
|
|
+ 'PointLight': THREE.PointLight,
|
|
|
|
+ 'DirectionalLight': THREE.DirectionalLight,
|
|
|
|
+ 'Mesh': THREE.Mesh,
|
|
|
|
+ 'Object3D': THREE.Object3D
|
|
|
|
+
|
|
|
|
+ };
|
|
|
|
+
|
|
var container = new UI.Panel();
|
|
var container = new UI.Panel();
|
|
container.setDisplay( 'none' );
|
|
container.setDisplay( 'none' );
|
|
|
|
|
|
- container.add( new UI.Text().setValue( 'OBJECT' ).setColor( '#666' ) );
|
|
|
|
|
|
+ var objectType = new UI.Text().setColor( '#666' );
|
|
|
|
+ container.add( objectType );
|
|
container.add( new UI.Break(), new UI.Break() );
|
|
container.add( new UI.Break(), new UI.Break() );
|
|
|
|
|
|
// name
|
|
// name
|
|
@@ -92,6 +103,16 @@ Sidebar.Properties.Object3D = function ( signals ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function getObjectInstanceName( object ) {
|
|
|
|
+
|
|
|
|
+ for ( var key in objects ) {
|
|
|
|
+
|
|
|
|
+ if ( object instanceof objects[ key ] ) return key;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
// events
|
|
// events
|
|
|
|
|
|
signals.objectSelected.add( function ( object ) {
|
|
signals.objectSelected.add( function ( object ) {
|
|
@@ -102,6 +123,8 @@ Sidebar.Properties.Object3D = function ( signals ) {
|
|
|
|
|
|
container.setDisplay( 'block' );
|
|
container.setDisplay( 'block' );
|
|
|
|
|
|
|
|
+ objectType.setValue( getObjectInstanceName( object ).toUpperCase() );
|
|
|
|
+
|
|
objectName.setValue( object.name );
|
|
objectName.setValue( object.name );
|
|
|
|
|
|
objectPositionX.setValue( object.position.x );
|
|
objectPositionX.setValue( object.position.x );
|