From 1102b4d633841e54cc780caccd49698af8357eba Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Thu, 4 Dec 2014 16:40:55 -0800 Subject: [PATCH 1/7] Moving GPU into it's own library --- interface/CMakeLists.txt | 2 +- libraries/gpu/CMakeLists.txt | 52 +++++++++++++++++++ .../gpu}/src/gpu/Batch.cpp | 0 {interface => libraries/gpu}/src/gpu/Batch.h | 4 +- .../gpu}/src/gpu/Context.cpp | 0 .../gpu}/src/gpu/Context.h | 4 +- {interface => libraries/gpu}/src/gpu/Format.h | 2 +- .../gpu}/src/gpu/GLBackend.cpp | 2 +- .../gpu}/src/gpu/GLBackend.h | 6 +-- libraries/gpu/src/gpu/GPUConfig.h | 30 +++++++++++ .../gpu}/src/gpu/Resource.cpp | 0 .../gpu}/src/gpu/Resource.h | 4 +- .../gpu}/src/gpu/Stream.cpp | 0 {interface => libraries/gpu}/src/gpu/Stream.h | 6 +-- 14 files changed, 97 insertions(+), 15 deletions(-) create mode 100644 libraries/gpu/CMakeLists.txt rename {interface => libraries/gpu}/src/gpu/Batch.cpp (100%) rename {interface => libraries/gpu}/src/gpu/Batch.h (98%) rename {interface => libraries/gpu}/src/gpu/Context.cpp (100%) rename {interface => libraries/gpu}/src/gpu/Context.h (94%) rename {interface => libraries/gpu}/src/gpu/Format.h (98%) rename {interface => libraries/gpu}/src/gpu/GLBackend.cpp (99%) rename {interface => libraries/gpu}/src/gpu/GLBackend.h (98%) create mode 100644 libraries/gpu/src/gpu/GPUConfig.h rename {interface => libraries/gpu}/src/gpu/Resource.cpp (100%) rename {interface => libraries/gpu}/src/gpu/Resource.h (98%) rename {interface => libraries/gpu}/src/gpu/Stream.cpp (100%) rename {interface => libraries/gpu}/src/gpu/Stream.h (97%) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index eb788ac49a..38dd02c655 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -107,7 +107,7 @@ endif() add_executable(${TARGET_NAME} MACOSX_BUNDLE ${INTERFACE_SRCS} ${QM}) # link required hifi libraries -link_hifi_libraries(shared octree voxels fbx metavoxels networking entities avatars audio animation script-engine physics) +link_hifi_libraries(shared octree voxels gpu fbx metavoxels networking entities avatars audio animation script-engine physics) # find any optional and required libraries find_package(ZLIB REQUIRED) diff --git a/libraries/gpu/CMakeLists.txt b/libraries/gpu/CMakeLists.txt new file mode 100644 index 0000000000..712e4320b5 --- /dev/null +++ b/libraries/gpu/CMakeLists.txt @@ -0,0 +1,52 @@ +set(TARGET_NAME gpu) + +# use setup_hifi_library macro to setup our project and link appropriate Qt modules +setup_hifi_library() + +include_glm() + +link_hifi_libraries(shared) +if (APPLE) + # link in required OS X frameworks and include the right GL headers + find_library(CoreFoundation CoreFoundation) + find_library(OpenGL OpenGL) + + target_link_libraries(${TARGET_NAME} ${CoreFoundation} ${OpenGL}) + + # install command for OS X bundle + INSTALL(TARGETS ${TARGET_NAME} + BUNDLE DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/install" COMPONENT Runtime + RUNTIME DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/install" COMPONENT Runtime + ) +else (APPLE) + find_package(OpenGL REQUIRED) + + if (${OPENGL_INCLUDE_DIR}) + include_directories(SYSTEM "${OPENGL_INCLUDE_DIR}") + endif () + + target_link_libraries(${TARGET_NAME} "${OPENGL_LIBRARY}") + + # link target to external libraries + if (WIN32) + find_package(GLEW REQUIRED) + include_directories(${GLEW_INCLUDE_DIRS}) + + # we're using static GLEW, so define GLEW_STATIC + add_definitions(-DGLEW_STATIC) + + target_link_libraries(${TARGET_NAME} "${GLEW_LIBRARIES}" "${NSIGHT_LIBRARIES}" opengl32.lib) + + # try to find the Nsight package and add it to the build if we find it + find_package(NSIGHT) + if (NSIGHT_FOUND) + include_directories(${NSIGHT_INCLUDE_DIRS}) + add_definitions(-DNSIGHT_FOUND) + target_link_libraries(${TARGET_NAME} "${NSIGHT_LIBRARIES}") + endif () + + endif() +endif (APPLE) + +# call macro to link our dependencies and bubble them up via a property on our target +link_shared_dependencies() diff --git a/interface/src/gpu/Batch.cpp b/libraries/gpu/src/gpu/Batch.cpp similarity index 100% rename from interface/src/gpu/Batch.cpp rename to libraries/gpu/src/gpu/Batch.cpp diff --git a/interface/src/gpu/Batch.h b/libraries/gpu/src/gpu/Batch.h similarity index 98% rename from interface/src/gpu/Batch.h rename to libraries/gpu/src/gpu/Batch.h index 5304740dd3..601ae63a77 100644 --- a/interface/src/gpu/Batch.h +++ b/libraries/gpu/src/gpu/Batch.h @@ -12,13 +12,13 @@ #define hifi_gpu_Batch_h #include -#include "InterfaceConfig.h" +#include "GPUConfig.h" #include "Transform.h" #include -#include "gpu/Stream.h" +#include "Stream.h" #if defined(NSIGHT_FOUND) #include "nvToolsExt.h" diff --git a/interface/src/gpu/Context.cpp b/libraries/gpu/src/gpu/Context.cpp similarity index 100% rename from interface/src/gpu/Context.cpp rename to libraries/gpu/src/gpu/Context.cpp diff --git a/interface/src/gpu/Context.h b/libraries/gpu/src/gpu/Context.h similarity index 94% rename from interface/src/gpu/Context.h rename to libraries/gpu/src/gpu/Context.h index 8398288cb9..3a0fffb4ef 100644 --- a/interface/src/gpu/Context.h +++ b/libraries/gpu/src/gpu/Context.h @@ -12,9 +12,9 @@ #define hifi_gpu_Context_h #include -#include "InterfaceConfig.h" +#include "GPUConfig.h" -#include "gpu/Resource.h" +#include "Resource.h" namespace gpu { diff --git a/interface/src/gpu/Format.h b/libraries/gpu/src/gpu/Format.h similarity index 98% rename from interface/src/gpu/Format.h rename to libraries/gpu/src/gpu/Format.h index 8faa995924..d216495b4c 100644 --- a/interface/src/gpu/Format.h +++ b/libraries/gpu/src/gpu/Format.h @@ -12,7 +12,7 @@ #define hifi_gpu_Format_h #include -#include "InterfaceConfig.h" +#include "GPUConfig.h" namespace gpu { diff --git a/interface/src/gpu/GLBackend.cpp b/libraries/gpu/src/gpu/GLBackend.cpp similarity index 99% rename from interface/src/gpu/GLBackend.cpp rename to libraries/gpu/src/gpu/GLBackend.cpp index 1f8e7bf99f..85f0dde858 100644 --- a/interface/src/gpu/GLBackend.cpp +++ b/libraries/gpu/src/gpu/GLBackend.cpp @@ -12,7 +12,7 @@ #include -#include "gpu/Batch.h" +#include "Batch.h" using namespace gpu; diff --git a/interface/src/gpu/GLBackend.h b/libraries/gpu/src/gpu/GLBackend.h similarity index 98% rename from interface/src/gpu/GLBackend.h rename to libraries/gpu/src/gpu/GLBackend.h index 0e4b38d89e..5a40e9ca36 100644 --- a/interface/src/gpu/GLBackend.h +++ b/libraries/gpu/src/gpu/GLBackend.h @@ -12,10 +12,10 @@ #define hifi_gpu_GLBackend_h #include -#include "InterfaceConfig.h" +#include "GPUConfig.h" -#include "gpu/Context.h" -#include "gpu/Batch.h" +#include "Context.h" +#include "Batch.h" #include diff --git a/libraries/gpu/src/gpu/GPUConfig.h b/libraries/gpu/src/gpu/GPUConfig.h new file mode 100644 index 0000000000..024cf73112 --- /dev/null +++ b/libraries/gpu/src/gpu/GPUConfig.h @@ -0,0 +1,30 @@ +// +// GPUConfig.h +// libraries/gpu/src/gpu +// +// Created by Sam Gateau on 12/4/14. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#ifndef gpu__GPUConfig__ +#define gpu__GPUConfig__ + +#define GL_GLEXT_PROTOTYPES 1 + +#if defined(APPLE) +#include + +#elif defined(UNIX) +#include +#include + +#elif defined(WIN32) +#include +#include + +#endif + +#endif diff --git a/interface/src/gpu/Resource.cpp b/libraries/gpu/src/gpu/Resource.cpp similarity index 100% rename from interface/src/gpu/Resource.cpp rename to libraries/gpu/src/gpu/Resource.cpp diff --git a/interface/src/gpu/Resource.h b/libraries/gpu/src/gpu/Resource.h similarity index 98% rename from interface/src/gpu/Resource.h rename to libraries/gpu/src/gpu/Resource.h index 52108c215a..6247efe675 100644 --- a/interface/src/gpu/Resource.h +++ b/libraries/gpu/src/gpu/Resource.h @@ -12,9 +12,9 @@ #define hifi_gpu_Resource_h #include -#include "InterfaceConfig.h" +#include "GPUConfig.h" -#include "gpu/Format.h" +#include "Format.h" #include diff --git a/interface/src/gpu/Stream.cpp b/libraries/gpu/src/gpu/Stream.cpp similarity index 100% rename from interface/src/gpu/Stream.cpp rename to libraries/gpu/src/gpu/Stream.cpp diff --git a/interface/src/gpu/Stream.h b/libraries/gpu/src/gpu/Stream.h similarity index 97% rename from interface/src/gpu/Stream.h rename to libraries/gpu/src/gpu/Stream.h index d024182531..93abfeeca3 100644 --- a/interface/src/gpu/Stream.h +++ b/libraries/gpu/src/gpu/Stream.h @@ -12,10 +12,10 @@ #define hifi_gpu_Stream_h #include -#include "InterfaceConfig.h" +#include "GPUConfig.h" -#include "gpu/Resource.h" -#include "gpu/Format.h" +#include "Resource.h" +#include "Format.h" #include #include From da1bb83eb0b34c8ea9c7b50c105c0dad4436f43f Mon Sep 17 00:00:00 2001 From: dev Date: Thu, 4 Dec 2014 17:14:41 -0800 Subject: [PATCH 2/7] compiling the gpu library on mac --- libraries/gpu/CMakeLists.txt | 8 +------- libraries/gpu/src/gpu/GPUConfig.h | 3 ++- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/libraries/gpu/CMakeLists.txt b/libraries/gpu/CMakeLists.txt index 712e4320b5..577f9f7a58 100644 --- a/libraries/gpu/CMakeLists.txt +++ b/libraries/gpu/CMakeLists.txt @@ -8,16 +8,10 @@ include_glm() link_hifi_libraries(shared) if (APPLE) # link in required OS X frameworks and include the right GL headers - find_library(CoreFoundation CoreFoundation) find_library(OpenGL OpenGL) - target_link_libraries(${TARGET_NAME} ${CoreFoundation} ${OpenGL}) + target_link_libraries(${TARGET_NAME} ${OpenGL}) - # install command for OS X bundle - INSTALL(TARGETS ${TARGET_NAME} - BUNDLE DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/install" COMPONENT Runtime - RUNTIME DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/install" COMPONENT Runtime - ) else (APPLE) find_package(OpenGL REQUIRED) diff --git a/libraries/gpu/src/gpu/GPUConfig.h b/libraries/gpu/src/gpu/GPUConfig.h index 024cf73112..0d0a140e62 100644 --- a/libraries/gpu/src/gpu/GPUConfig.h +++ b/libraries/gpu/src/gpu/GPUConfig.h @@ -14,7 +14,8 @@ #define GL_GLEXT_PROTOTYPES 1 -#if defined(APPLE) +#ifdef __APPLE__ +#include #include #elif defined(UNIX) From 16da10bf19f401ed86f3c172275a27f53eb9e3a8 Mon Sep 17 00:00:00 2001 From: dev Date: Thu, 4 Dec 2014 17:15:59 -0800 Subject: [PATCH 3/7] compiling the gpu library on mac --- libraries/gpu/src/gpu/GPUConfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/gpu/src/gpu/GPUConfig.h b/libraries/gpu/src/gpu/GPUConfig.h index 0d0a140e62..faecfd4889 100644 --- a/libraries/gpu/src/gpu/GPUConfig.h +++ b/libraries/gpu/src/gpu/GPUConfig.h @@ -14,7 +14,7 @@ #define GL_GLEXT_PROTOTYPES 1 -#ifdef __APPLE__ +#if defined(__APPLE__) #include #include From 69792178b95f5eb4a1223456fb3052aeff0fed8d Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Fri, 5 Dec 2014 13:43:04 -0800 Subject: [PATCH 4/7] trying to fix the linux compilation --- libraries/gpu/src/gpu/GPUConfig.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libraries/gpu/src/gpu/GPUConfig.h b/libraries/gpu/src/gpu/GPUConfig.h index faecfd4889..393a476182 100644 --- a/libraries/gpu/src/gpu/GPUConfig.h +++ b/libraries/gpu/src/gpu/GPUConfig.h @@ -18,14 +18,15 @@ #include #include -#elif defined(UNIX) -#include -#include - #elif defined(WIN32) #include #include +#else +#include +#include + + #endif #endif From 2c8b1721cc56c08503467819c7261e00cf70ee62 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Fri, 5 Dec 2014 14:06:41 -0800 Subject: [PATCH 5/7] Add warp from right ('O') button on gamepad --- examples/butterflies.js | 2 +- examples/headMove.js | 88 +++++++++++++++++++++++++---------------- 2 files changed, 54 insertions(+), 36 deletions(-) diff --git a/examples/butterflies.js b/examples/butterflies.js index 9bd568d011..069a0d6792 100644 --- a/examples/butterflies.js +++ b/examples/butterflies.js @@ -32,7 +32,7 @@ var startTimeInSeconds = new Date().getTime() / 1000; var NATURAL_SIZE_OF_BUTTERFLY = { x: 1.0, y: 0.4, z: 0.2 }; var lifeTime = 3600; // One hour lifespan -var range = 5.0; // Over what distance in meters do you want the flock to fly around +var range = 7.0; // Over what distance in meters do you want the flock to fly around var frame = 0; var DISTANCE_IN_FRONT_OF_ME = 1.5; diff --git a/examples/headMove.js b/examples/headMove.js index 4d2e4ded07..943664b70f 100644 --- a/examples/headMove.js +++ b/examples/headMove.js @@ -11,6 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +var gamepads = {}; + var debug = false; var willMove = false; @@ -19,7 +21,6 @@ var warpPosition = { x: 0, y: 0, z: 0 }; var hipsToEyes; var restoreCountdownTimer; -var headTurningTimer = 0.0; // Overlays to show target location @@ -62,13 +63,6 @@ function restoreCameraState() { Camera.mode = oldMode; } -function activateWarp() { - if (warpActive) return; - warpActive = true; - - updateWarp(); -} - var WATCH_AVATAR_DISTANCE = 2.5; var sound = SoundCache.getSound("http://public.highfidelity.io/sounds/Footsteps/FootstepW2Right-12db.wav"); @@ -132,6 +126,22 @@ function updateWarp() { }); } +function activateWarp() { + if (warpActive) return; + warpActive = true; + movingWithHead = true; + hipsToEyes = MyAvatar.getEyePosition().y - MyAvatar.position.y; + headStartPosition = MyAvatar.getTrackedHeadPosition(); + headStartDeltaPitch = MyAvatar.getHeadDeltaPitch(); + headStartFinalPitch = MyAvatar.getHeadFinalPitch(); + headStartRoll = MyAvatar.getHeadFinalRoll(); + headStartYaw = MyAvatar.getHeadFinalYaw(); + deltaYaw = 0.0; + warpPosition = MyAvatar.position; + warpPosition.y += hipsToEyes; + updateWarp(); +} + function finishWarp() { if (!warpActive) return; warpActive = false; @@ -152,6 +162,9 @@ function finishWarp() { cameraPosition = Vec3.subtract(MyAvatar.position, Vec3.multiplyQbyV(Camera.getOrientation(), { x: 0, y: -hipsToEyes, z: -hipsToEyes * WATCH_AVATAR_DISTANCE })); Camera.setPosition(cameraPosition); playSound(); + if (watchAvatar) { + restoreCountdownTimer = RESTORE_TIME; + } } } @@ -169,35 +182,11 @@ function update(deltaTime) { restoreCountDownTimer = 0.0; } } - var HEAD_TURN_TIME = 0.10; - var HEAD_TURN_DEGREES = 4.0; - var HEAD_TURN_START_ANGLE = 45.0; - var currentYaw = MyAvatar.getHeadFinalYaw(); - if (Math.abs(currentYaw) > HEAD_TURN_START_ANGLE) { - headTurningTimer += deltaTime; - if (headTurningTimer > HEAD_TURN_TIME) { - headTurningTimer = 0.0; - MyAvatar.orientation = Quat.multiply(Quat.fromPitchYawRollDegrees(0, (currentYaw > 0) ? HEAD_TURN_DEGREES: -HEAD_TURN_DEGREES, 0), - MyAvatar.orientation); - } - } else { - headTurningTimer = 0.0; - } } Controller.keyPressEvent.connect(function(event) { if (event.text == "SPACE" && !event.isAutoRepeat && !movingWithHead) { keyDownTime = 0.0; - movingWithHead = true; - hipsToEyes = MyAvatar.getEyePosition().y - MyAvatar.position.y; - headStartPosition = MyAvatar.getTrackedHeadPosition(); - headStartDeltaPitch = MyAvatar.getHeadDeltaPitch(); - headStartFinalPitch = MyAvatar.getHeadFinalPitch(); - headStartRoll = MyAvatar.getHeadFinalRoll(); - headStartYaw = MyAvatar.getHeadFinalYaw(); - deltaYaw = 0.0; - warpPosition = MyAvatar.position; - warpPosition.y += hipsToEyes; activateWarp(); } }); @@ -223,11 +212,40 @@ Controller.keyReleaseEvent.connect(function(event) { } timeSinceLastUp = 0.0; finishWarp(); - if (watchAvatar) { - restoreCountdownTimer = RESTORE_TIME; - } } }); +function reportButtonValue(button, newValue, oldValue) { + if (button == Joysticks.BUTTON_FACE_RIGHT) { + if (newValue) { + activateWarp(); + } else { + finishWarp(); + } + } +} + Script.update.connect(update); +function addJoystick(gamepad) { + gamepad.buttonStateChanged.connect(reportButtonValue); + + gamepads[gamepad.instanceId] = gamepad; + + print("Added gamepad: " + gamepad.name + " (" + gamepad.instanceId + ")"); +} + +function removeJoystick(gamepad) { + delete gamepads[gamepad.instanceId] + + print("Removed gamepad: " + gamepad.name + " (" + gamepad.instanceId + ")"); +} + +var allJoysticks = Joysticks.getAllJoysticks(); +for (var i = 0; i < allJoysticks.length; i++) { + addJoystick(allJoysticks[i]); +} + +Joysticks.joystickAdded.connect(addJoystick); +Joysticks.joystickRemoved.connect(removeJoystick); + From 896a34212b455ca8ab3ba9bb1593e93a76a0eae5 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 5 Dec 2014 15:27:24 -0800 Subject: [PATCH 6/7] Fix sections not properly updating in properties tool --- examples/html/entityProperties.html | 202 +++++++++++++++------------- 1 file changed, 106 insertions(+), 96 deletions(-) diff --git a/examples/html/entityProperties.html b/examples/html/entityProperties.html index 97e16fcf11..0308d7f5e7 100644 --- a/examples/html/entityProperties.html +++ b/examples/html/entityProperties.html @@ -104,12 +104,12 @@ var elCollisionsWillMove = document.getElementById("property-collisions-will-move"); var elLifetime = document.getElementById("property-lifetime"); - var elBoxSection = document.getElementById("box-section"); + var elBoxSections = document.querySelectorAll(".box-section"); var elBoxColorRed = document.getElementById("property-box-red"); var elBoxColorGreen = document.getElementById("property-box-green"); var elBoxColorBlue = document.getElementById("property-box-blue"); - var elLightSection = document.getElementById('light-section'); + var elLightSections = document.querySelectorAll(".light-section"); var elLightSpotLight = document.getElementById("property-light-spot-light"); var elLightDiffuseRed = document.getElementById("property-light-diffuse-red"); var elLightDiffuseGreen = document.getElementById("property-light-diffuse-green"); @@ -129,14 +129,14 @@ var elLightExponent = document.getElementById("property-light-exponent"); var elLightCutoff = document.getElementById("property-light-cutoff"); - var elModelSection = document.getElementById("model-section"); + var elModelSections = document.querySelectorAll(".model-section"); var elModelURL = document.getElementById("property-model-url"); var elModelAnimationURL = document.getElementById("property-model-animation-url"); var elModelAnimationPlaying = document.getElementById("property-model-animation-playing"); var elModelAnimationFPS = document.getElementById("property-model-animation-fps"); var elModelAnimationFrame = document.getElementById("property-model-animation-frame"); - var elTextSection = document.getElementById("text-section"); + var elTextSections = document.querySelectorAll(".text-section"); var elTextText = document.getElementById("property-text-text"); var elTextLineHeight = document.getElementById("property-text-line-height"); var elTextTextColorRed = document.getElementById("property-text-text-color-red"); @@ -200,9 +200,13 @@ elLifetime.value = properties.lifetime; if (properties.type != "Box") { - elBoxSection.style.display = 'none'; + for (var i = 0; i < elBoxSections.length; i++) { + elBoxSections[i].style.display = 'none'; + } } else { - elBoxSection.style.display = 'block'; + for (var i = 0; i < elBoxSections.length; i++) { + elBoxSections[i].style.display = 'table-row'; + } elBoxColorRed.value = properties.color.red; elBoxColorGreen.value = properties.color.green; @@ -210,9 +214,14 @@ } if (properties.type != "Model") { - elModelSection.style.display = 'none'; + for (var i = 0; i < elModelSections.length; i++) { + elModelSections[i].style.display = 'none'; + } } else { - elModelSection.style.display = 'block'; + for (var i = 0; i < elModelSections.length; i++) { + elModelSections[i].style.display = 'table-row'; + } + elModelURL.value = properties.modelURL; elModelAnimationURL.value = properties.animationURL; elModelAnimationPlaying.checked = properties.animationIsPlaying; @@ -220,9 +229,13 @@ } if (properties.type != "Text") { - elTextSection.style.display = 'none'; + for (var i = 0; i < elTextSections.length; i++) { + elTextSections[i].style.display = 'none'; + } } else { - elTextSection.style.display = 'block'; + for (var i = 0; i < elTextSections.length; i++) { + elTextSections[i].style.display = 'table-row'; + } elTextText.value = properties.text; elTextLineHeight.value = properties.lineHeight; @@ -235,9 +248,13 @@ } if (properties.type != "Light") { - elLightSection.style.display = 'none'; + for (var i = 0; i < elLightSections.length; i++) { + elLightSections[i].style.display = 'none'; + } } else { - elLightSection.style.display = 'block'; + for (var i = 0; i < elLightSections.length; i++) { + elLightSections[i].style.display = 'table-row'; + } elLightDiffuseRed.value = properties.diffuseColor.red; elLightDiffuseGreen.value = properties.diffuseColor.green; @@ -437,7 +454,7 @@ - + Position @@ -446,7 +463,7 @@
Y
Z
- + Registration @@ -455,55 +472,45 @@
Y
Z
- + - Width + Dimensions - +
X
+
Y
+
Z
- - - Height - - - - - - Depth - - - - + - Linear + Linear Velocity
X
Y
Z
- + Linear Damping + - - Angular + Angular Velocity
Pitch
Yaw
Roll
- + Angular Damping - + Gravity @@ -512,168 +519,171 @@
Y
Z
- + Mass - + Ignore For Collisions - + Collisions Will Move - + Lifetime + + - + Color -
Red
-
Green
-
Blue
+
R
+
G
+
B
- + - + Model URL - - + + Animation URL - - + + Animation Playing - - + + Animation FPS - - + + Animation Frame - + - + + Text - - + + Line Height - - + + Text Color -
Red
-
Green
-
Blue
+
R
+
G
+
B
- - + + Background Color -
Red
-
Green
-
Blue
+
R
+
G
+
B
- + - + Spot Light - - + + Diffuse -
Red
-
Green
-
Blue
+
R
+
G
+
B
- - + + Ambient -
Red
-
Green
-
Blue
+
R
+
G
+
B
- - + + Specular -
Red
-
Green
-
Blue
+
R
+
G
+
B
- - + + Constant Attenuation - - + + Linear Attenuation - - + + Quadratic Attenuation - - + + Exponent - - + + Cutoff (degrees) - + From a89411fd5eeb2f7e1a07e482b9f04441d7e9a910 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 5 Dec 2014 15:27:40 -0800 Subject: [PATCH 7/7] Add script URL to properties tool --- examples/html/entityProperties.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/html/entityProperties.html b/examples/html/entityProperties.html index 0308d7f5e7..17eb0ad88f 100644 --- a/examples/html/entityProperties.html +++ b/examples/html/entityProperties.html @@ -103,6 +103,7 @@ var elIgnoreForCollisions = document.getElementById("property-ignore-for-collisions"); var elCollisionsWillMove = document.getElementById("property-collisions-will-move"); var elLifetime = document.getElementById("property-lifetime"); + var elScriptURL = document.getElementById("property-script-url"); var elBoxSections = document.querySelectorAll(".box-section"); var elBoxColorRed = document.getElementById("property-box-red"); @@ -198,6 +199,7 @@ elIgnoreForCollisions.checked = properties.ignoreForCollisions; elCollisionsWillMove.checked = properties.collisionsWillMove; elLifetime.value = properties.lifetime; + elScriptURL.value = properties.script; if (properties.type != "Box") { for (var i = 0; i < elBoxSections.length; i++) { @@ -324,6 +326,7 @@ elIgnoreForCollisions.addEventListener('change', createEmitCheckedPropertyUpdateFunction('ignoreForCollisions')); elCollisionsWillMove.addEventListener('change', createEmitCheckedPropertyUpdateFunction('collisionsWillMove')); elLifetime.addEventListener('change', createEmitNumberPropertyUpdateFunction('lifetime')); + elScriptURL.addEventListener('change', createEmitTextPropertyUpdateFunction('script')); var boxColorChangeFunction = createEmitColorPropertyUpdateFunction( 'color', elBoxColorRed, elBoxColorGreen, elBoxColorBlue); @@ -550,6 +553,11 @@ + Script URL + + + +