From f569169662160fad5029a81854463c8cc395d372 Mon Sep 17 00:00:00 2001 From: samcake Date: Fri, 13 May 2016 11:01:15 -0700 Subject: [PATCH 01/89] Trying to support ambient occlusion map from blender --- libraries/fbx/src/FBXReader.cpp | 7 ++++++- libraries/fbx/src/FBXReader.h | 2 ++ libraries/fbx/src/FBXReader_Material.cpp | 16 ++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/libraries/fbx/src/FBXReader.cpp b/libraries/fbx/src/FBXReader.cpp index 2df388e1d4..5a57a3c6d8 100644 --- a/libraries/fbx/src/FBXReader.cpp +++ b/libraries/fbx/src/FBXReader.cpp @@ -924,6 +924,9 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS // material.emissiveColor = getVec3(property.properties, index); // material.emissiveFactor = 1.0; + } else if (property.properties.at(0) == "AmbientFactor") { + material.ambientFactor = property.properties.at(index).value(); + // Detected just for BLender AO vs lightmap } else if (property.properties.at(0) == "Shininess") { material.shininess = property.properties.at(index).value(); @@ -1126,8 +1129,10 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS emissiveTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1)); } else if (type.contains("tex_emissive_map")) { emissiveTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1)); - } else if (type.contains("ambient")) { + } else if (type.contains("ambientcolor")) { ambientTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1)); + } else if (type.contains("ambientfactor")) { + ambientFactorTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1)); } else if (type.contains("tex_ao_map")) { occlusionTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1)); diff --git a/libraries/fbx/src/FBXReader.h b/libraries/fbx/src/FBXReader.h index c1952fc550..9e960126b5 100644 --- a/libraries/fbx/src/FBXReader.h +++ b/libraries/fbx/src/FBXReader.h @@ -151,6 +151,7 @@ public: float metallic{ 0.0f }; float roughness{ 1.0f }; float emissiveIntensity{ 1.0f }; + float ambientFactor{ 1.0f }; QString materialID; QString name; @@ -436,6 +437,7 @@ public: QHash shininessTextures; QHash emissiveTextures; QHash ambientTextures; + QHash ambientFactorTextures; QHash occlusionTextures; QHash _fbxMaterials; diff --git a/libraries/fbx/src/FBXReader_Material.cpp b/libraries/fbx/src/FBXReader_Material.cpp index 11c6dad2f2..3503fe1054 100644 --- a/libraries/fbx/src/FBXReader_Material.cpp +++ b/libraries/fbx/src/FBXReader_Material.cpp @@ -175,6 +175,14 @@ void FBXReader::consolidateFBXMaterials() { FBXTexture occlusionTexture; QString occlusionTextureID = occlusionTextures.value(material.materialID); + if (occlusionTextureID.isNull()) { + // 2nd chance + // For blender we use the ambient factor texture ONLY if the ambientFactor value is set to 0 + if (material.ambientFactor == 0.0) { + occlusionTextureID = ambientFactorTextures.value(material.materialID); + } + } + if (!occlusionTextureID.isNull()) { occlusionTexture = getTexture(occlusionTextureID); detectDifferentUVs |= (occlusionTexture.texcoordSet != 0) || (!emissiveTexture.transform.isIdentity()); @@ -187,6 +195,14 @@ void FBXReader::consolidateFBXMaterials() { FBXTexture ambientTexture; QString ambientTextureID = ambientTextures.value(material.materialID); + if (ambientTextureID.isNull()) { + // 2nd chance + // For blender we use the ambient factor texture ONLY if the ambientFactor value is set to 1 + if (material.ambientFactor == 1.0) { + ambientTextureID = ambientFactorTextures.value(material.materialID); + } + } + if (_loadLightmaps && !ambientTextureID.isNull()) { ambientTexture = getTexture(ambientTextureID); detectDifferentUVs |= (ambientTexture.texcoordSet != 0) || (!ambientTexture.transform.isIdentity()); From 1c06c1a6ab9915b255812d994c1c88886d454a4f Mon Sep 17 00:00:00 2001 From: samcake Date: Fri, 13 May 2016 11:09:53 -0700 Subject: [PATCH 02/89] Cleaning up the pr from tthe transform.h file --- libraries/gpu/src/gpu/Transform.h | 36 ------------------------------- 1 file changed, 36 deletions(-) delete mode 100644 libraries/gpu/src/gpu/Transform.h diff --git a/libraries/gpu/src/gpu/Transform.h b/libraries/gpu/src/gpu/Transform.h deleted file mode 100644 index 82974964a8..0000000000 --- a/libraries/gpu/src/gpu/Transform.h +++ /dev/null @@ -1,36 +0,0 @@ -// -// Transform.h -// libraries/gpu/src/gpu -// -// Created by Sam Gateau on 06/12/2016. -// Copyright 2014 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 hifi_gpu_Transform_h -#define hifi_gpu_Transform_h - -#include - -#include - -#include "Resource.h" - -namespace gpu { - -class TransformBuffer { -public: - - TransformBuffer() {} - ~TransformBuffer() {} - -protected: - BufferPointer _buffer; -}; -typedef std::shared_ptr TransformBufferPointer; - -}; - - -#endif From c1fa096e78847f9aef8ef95bd730105f5188bb66 Mon Sep 17 00:00:00 2001 From: samcake Date: Mon, 16 May 2016 15:42:48 -0700 Subject: [PATCH 03/89] adding texcoord 1 on all the material/model and go fetch occlusion map with this uv instead of texcoor0. this allow for separate transforms just for occlusoin map --- libraries/fbx/src/FBXReader_Material.cpp | 8 ++++---- .../src/model-networking/ModelCache.cpp | 4 ++++ libraries/model/src/model/Material.cpp | 4 ++++ libraries/render-utils/src/MaterialTextures.slh | 16 +++++++++------- libraries/render-utils/src/model.slf | 4 +++- libraries/render-utils/src/model.slv | 2 ++ libraries/render-utils/src/model_lightmap.slf | 4 ++-- .../src/model_lightmap_normal_map.slf | 4 ++-- .../src/model_lightmap_normal_specular_map.slf | 4 ++-- .../src/model_lightmap_specular_map.slf | 4 ++-- libraries/render-utils/src/model_normal_map.slf | 4 +++- .../src/model_normal_specular_map.slf | 4 +++- .../render-utils/src/model_specular_map.slf | 4 +++- libraries/render-utils/src/model_translucent.slf | 6 ++++-- .../render-utils/src/model_translucent_unlit.slf | 2 +- libraries/render-utils/src/model_unlit.slf | 4 ++-- libraries/render-utils/src/skin_model.slv | 2 ++ .../render-utils/src/skin_model_normal_map.slv | 2 ++ 18 files changed, 54 insertions(+), 28 deletions(-) diff --git a/libraries/fbx/src/FBXReader_Material.cpp b/libraries/fbx/src/FBXReader_Material.cpp index e539f849c7..01878d6ccf 100644 --- a/libraries/fbx/src/FBXReader_Material.cpp +++ b/libraries/fbx/src/FBXReader_Material.cpp @@ -188,8 +188,8 @@ void FBXReader::consolidateFBXMaterials() { QString occlusionTextureID = occlusionTextures.value(material.materialID); if (occlusionTextureID.isNull()) { // 2nd chance - // For blender we use the ambient factor texture ONLY if the ambientFactor value is set to 0 - if (material.ambientFactor == 0.0) { + // For blender we use the ambient factor texture as AOMap ONLY if the ambientFactor value is > 0.0 + if (material.ambientFactor > 0.0f) { occlusionTextureID = ambientFactorTextures.value(material.materialID); } } @@ -208,8 +208,8 @@ void FBXReader::consolidateFBXMaterials() { QString ambientTextureID = ambientTextures.value(material.materialID); if (ambientTextureID.isNull()) { // 2nd chance - // For blender we use the ambient factor texture ONLY if the ambientFactor value is set to 1 - if (material.ambientFactor == 1.0) { + // For blender we use the ambient factor texture as Lightmap ONLY if the ambientFactor value is set to 0 + if (material.ambientFactor == 0.0f) { ambientTextureID = ambientFactorTextures.value(material.materialID); } } diff --git a/libraries/model-networking/src/model-networking/ModelCache.cpp b/libraries/model-networking/src/model-networking/ModelCache.cpp index 8cd6d9b65e..40388e6123 100644 --- a/libraries/model-networking/src/model-networking/ModelCache.cpp +++ b/libraries/model-networking/src/model-networking/ModelCache.cpp @@ -418,6 +418,8 @@ model::TextureMapPointer NetworkMaterial::fetchTextureMap(const QUrl& baseUrl, c auto map = std::make_shared(); map->setTextureSource(texture->_textureSource); + map->setTextureTransform(fbxTexture.transform); + return map; } @@ -427,6 +429,7 @@ model::TextureMapPointer NetworkMaterial::fetchTextureMap(const QUrl& url, Textu auto map = std::make_shared(); map->setTextureSource(texture->_textureSource); + return map; } @@ -475,6 +478,7 @@ NetworkMaterial::NetworkMaterial(const FBXMaterial& material, const QUrl& textur if (!material.occlusionTexture.filename.isEmpty()) { auto map = fetchTextureMap(textureBaseUrl, material.occlusionTexture, NetworkTexture::OCCLUSION_TEXTURE, MapChannel::OCCLUSION_MAP); + map->setTextureTransform(material.occlusionTexture.transform); setTextureMap(MapChannel::OCCLUSION_MAP, map); } diff --git a/libraries/model/src/model/Material.cpp b/libraries/model/src/model/Material.cpp index 53478be536..dbe3cabdeb 100755 --- a/libraries/model/src/model/Material.cpp +++ b/libraries/model/src/model/Material.cpp @@ -122,6 +122,10 @@ void Material::setTextureMap(MapChannel channel, const TextureMapPointer& textur _texMapArrayBuffer.edit()._texcoordTransforms[0] = (textureMap ? textureMap->getTextureTransform().getMatrix() : glm::mat4()); } + if (channel == MaterialKey::OCCLUSION_MAP) { + _texMapArrayBuffer.edit()._texcoordTransforms[1] = (textureMap ? textureMap->getTextureTransform().getMatrix() : glm::mat4()); + } + if (channel == MaterialKey::LIGHTMAP_MAP) { // update the texcoord1 with lightmap _texMapArrayBuffer.edit()._texcoordTransforms[1] = (textureMap ? textureMap->getTextureTransform().getMatrix() : glm::mat4()); diff --git a/libraries/render-utils/src/MaterialTextures.slh b/libraries/render-utils/src/MaterialTextures.slh index f9b1c76104..5cede16e13 100644 --- a/libraries/render-utils/src/MaterialTextures.slh +++ b/libraries/render-utils/src/MaterialTextures.slh @@ -90,7 +90,7 @@ float fetchOcclusionMap(vec2 uv) { <@endfunc@> -<@func fetchMaterialTextures(matKey, texcoord0, albedo, roughness, normal, metallic, emissive, occlusion)@> +<@func fetchMaterialTexturesCoord0(matKey, texcoord0, albedo, roughness, normal, metallic, emissive)@> <@if albedo@> vec4 <$albedo$> = (((<$matKey$> & (ALBEDO_MAP_BIT | OPACITY_MASK_MAP_BIT | OPACITY_TRANSLUCENT_MAP_BIT)) != 0) ? fetchAlbedoMap(<$texcoord0$>) : vec4(1.0)); <@endif@> @@ -106,12 +106,19 @@ float fetchOcclusionMap(vec2 uv) { <@if emissive@> vec3 <$emissive$> = (((<$matKey$> & EMISSIVE_MAP_BIT) != 0) ? fetchEmissiveMap(<$texcoord0$>) : vec3(0.0)); <@endif@> +<@endfunc@> + +<@func fetchMaterialTexturesCoord1(matKey, texcoord1, occlusion, lightmapVal)@> <@if occlusion@> - float <$occlusion$> = (((<$matKey$> & OCCLUSION_MAP_BIT) != 0) ? fetchOcclusionMap(<$texcoord0$>) : 1.0); + float <$occlusion$> = (((<$matKey$> & OCCLUSION_MAP_BIT) != 0) ? fetchOcclusionMap(<$texcoord1$>) : 1.0); +<@endif@> +<@if lightmapVal@> + vec3 <$lightmapVal$> = fetchLightmapMap(<$texcoord1$>); <@endif@> <@endfunc@> + <@func declareMaterialLightmap()@> <$declareMaterialTexMapArrayBuffer()$> @@ -123,11 +130,6 @@ vec3 fetchLightmapMap(vec2 uv) { } <@endfunc@> -<@func fetchMaterialLightmap(texcoord1, lightmapVal)@> - vec3 <$lightmapVal$> = fetchLightmapMap(<$texcoord1$>); -<@endfunc@> - - <@func tangentToViewSpace(fetchedNormal, interpolatedNormal, interpolatedTangent, normal)@> { vec3 normalizedNormal = normalize(<$interpolatedNormal$>.xyz); diff --git a/libraries/render-utils/src/model.slf b/libraries/render-utils/src/model.slf index f1dcc942c9..c1f5cb1f88 100755 --- a/libraries/render-utils/src/model.slf +++ b/libraries/render-utils/src/model.slf @@ -22,12 +22,14 @@ in vec4 _position; in vec3 _normal; in vec3 _color; in vec2 _texCoord0; +in vec2 _texCoord1; void main(void) { Material mat = getMaterial(); int matKey = getMaterialKey(mat); - <$fetchMaterialTextures(matKey, _texCoord0, albedoTex, roughnessTex, _SCRIBE_NULL, _SCRIBE_NULL, emissiveTex, occlusionTex)$> + <$fetchMaterialTexturesCoord0(matKey, _texCoord0, albedoTex, roughnessTex, _SCRIBE_NULL, _SCRIBE_NULL, emissiveTex)$> + <$fetchMaterialTexturesCoord1(matKey, _texCoord1, occlusionTex)$> float opacity = 1.0; <$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>; diff --git a/libraries/render-utils/src/model.slv b/libraries/render-utils/src/model.slv index f1989dcf76..4d36673123 100755 --- a/libraries/render-utils/src/model.slv +++ b/libraries/render-utils/src/model.slv @@ -22,6 +22,7 @@ out vec3 _color; out float _alpha; out vec2 _texCoord0; +out vec2 _texCoord1; out vec4 _position; out vec3 _normal; @@ -31,6 +32,7 @@ void main(void) { TexMapArray texMapArray = getTexMapArray(); <$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord0)$> + <$evalTexMapArrayTexcoord1(texMapArray, inTexCoord0, _texCoord1)$> // standard transform TransformCamera cam = getTransformCamera(); diff --git a/libraries/render-utils/src/model_lightmap.slf b/libraries/render-utils/src/model_lightmap.slf index 3afbbfd405..3a8cfde290 100755 --- a/libraries/render-utils/src/model_lightmap.slf +++ b/libraries/render-utils/src/model_lightmap.slf @@ -29,8 +29,8 @@ in vec3 _color; void main(void) { Material mat = getMaterial(); int matKey = getMaterialKey(mat); - <$fetchMaterialTextures(matKey, _texCoord0, albedo, roughness)$> - <$fetchMaterialLightmap(_texCoord1, lightmapVal)$> + <$fetchMaterialTexturesCoord0(matKey, _texCoord0, albedo, roughness)$> + <$fetchMaterialTexturesCoord1(matKey, _texCoord1, _SCRIBE_NULL, lightmapVal)$> packDeferredFragmentLightmap( diff --git a/libraries/render-utils/src/model_lightmap_normal_map.slf b/libraries/render-utils/src/model_lightmap_normal_map.slf index 9ccc6e5352..64c61e255d 100755 --- a/libraries/render-utils/src/model_lightmap_normal_map.slf +++ b/libraries/render-utils/src/model_lightmap_normal_map.slf @@ -30,8 +30,8 @@ in vec3 _color; void main(void) { Material mat = getMaterial(); int matKey = getMaterialKey(mat); - <$fetchMaterialTextures(matKey, _texCoord0, albedo, roughness, normalTexel)$> - <$fetchMaterialLightmap(_texCoord1, lightmapVal)$> + <$fetchMaterialTexturesCoord0(matKey, _texCoord0, albedo, roughness, normalTexel)$> + <$fetchMaterialTexturesCoord1(matKey, _texCoord1, _SCRIBE_NULL, lightmapVal)$> vec3 viewNormal; <$tangentToViewSpace(normalTexel, _normal, _tangent, viewNormal)$> diff --git a/libraries/render-utils/src/model_lightmap_normal_specular_map.slf b/libraries/render-utils/src/model_lightmap_normal_specular_map.slf index 71909a789f..34a116eac1 100755 --- a/libraries/render-utils/src/model_lightmap_normal_specular_map.slf +++ b/libraries/render-utils/src/model_lightmap_normal_specular_map.slf @@ -30,8 +30,8 @@ in vec3 _color; void main(void) { Material mat = getMaterial(); int matKey = getMaterialKey(mat); - <$fetchMaterialTextures(matKey, _texCoord0, albedo, roughness, normalTexel, metallicTex)$> - <$fetchMaterialLightmap(_texCoord1, lightmapVal)$> + <$fetchMaterialTexturesCoord0(matKey, _texCoord0, albedo, roughness, normalTexel, metallicTex)$> + <$fetchMaterialTexturesCoord1(matKey, _texCoord1, _SCRIBE_NULL, lightmapVal)$> vec3 viewNormal; <$tangentToViewSpace(normalTexel, _normal, _tangent, viewNormal)$> diff --git a/libraries/render-utils/src/model_lightmap_specular_map.slf b/libraries/render-utils/src/model_lightmap_specular_map.slf index 5eefefdc29..4dbc10a834 100755 --- a/libraries/render-utils/src/model_lightmap_specular_map.slf +++ b/libraries/render-utils/src/model_lightmap_specular_map.slf @@ -29,8 +29,8 @@ in vec3 _color; void main(void) { Material mat = getMaterial(); int matKey = getMaterialKey(mat); - <$fetchMaterialTextures(matKey, _texCoord0, albedo, roughness, _SCRIBE_NULL, metallicTex)$> - <$fetchMaterialLightmap(_texCoord1, lightmapVal)$> + <$fetchMaterialTexturesCoord0(matKey, _texCoord0, albedo, roughness, _SCRIBE_NULL, metallicTex)$> + <$fetchMaterialTexturesCoord1(matKey, _texCoord1, _SCRIBE_NULL, lightmapVal)$> packDeferredFragmentLightmap( normalize(_normal), diff --git a/libraries/render-utils/src/model_normal_map.slf b/libraries/render-utils/src/model_normal_map.slf index 519b41e17f..daaa1ed977 100755 --- a/libraries/render-utils/src/model_normal_map.slf +++ b/libraries/render-utils/src/model_normal_map.slf @@ -21,6 +21,7 @@ in vec4 _position; in vec2 _texCoord0; +in vec2 _texCoord1; in vec3 _normal; in vec3 _tangent; in vec3 _color; @@ -28,7 +29,8 @@ in vec3 _color; void main(void) { Material mat = getMaterial(); int matKey = getMaterialKey(mat); - <$fetchMaterialTextures(matKey, _texCoord0, albedoTex, roughnessTex, normalTex, _SCRIBE_NULL, emissiveTex, occlusionTex)$> + <$fetchMaterialTexturesCoord0(matKey, _texCoord0, albedoTex, roughnessTex, normalTex, _SCRIBE_NULL, emissiveTex)$> + <$fetchMaterialTexturesCoord1(matKey, _texCoord1, occlusionTex)$> float opacity = 1.0; <$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>; diff --git a/libraries/render-utils/src/model_normal_specular_map.slf b/libraries/render-utils/src/model_normal_specular_map.slf index 2529596818..dd2d3cc951 100755 --- a/libraries/render-utils/src/model_normal_specular_map.slf +++ b/libraries/render-utils/src/model_normal_specular_map.slf @@ -21,6 +21,7 @@ in vec4 _position; in vec2 _texCoord0; +in vec2 _texCoord1; in vec3 _normal; in vec3 _tangent; in vec3 _color; @@ -28,7 +29,8 @@ in vec3 _color; void main(void) { Material mat = getMaterial(); int matKey = getMaterialKey(mat); - <$fetchMaterialTextures(matKey, _texCoord0, albedoTex, roughnessTex, normalTex, metallicTex, emissiveTex, occlusionTex)$> + <$fetchMaterialTexturesCoord0(matKey, _texCoord0, albedoTex, roughnessTex, normalTex, metallicTex, emissiveTex)$> + <$fetchMaterialTexturesCoord1(matKey, _texCoord1, occlusionTex)$> float opacity = 1.0; <$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)&>; diff --git a/libraries/render-utils/src/model_specular_map.slf b/libraries/render-utils/src/model_specular_map.slf index 3cbb060ab5..f0fe20293c 100755 --- a/libraries/render-utils/src/model_specular_map.slf +++ b/libraries/render-utils/src/model_specular_map.slf @@ -21,6 +21,7 @@ in vec4 _position; in vec2 _texCoord0; +in vec2 _texCoord1; in vec3 _normal; in vec3 _color; @@ -28,7 +29,8 @@ in vec3 _color; void main(void) { Material mat = getMaterial(); int matKey = getMaterialKey(mat); - <$fetchMaterialTextures(matKey, _texCoord0, albedoTex, roughnessTex, _SCRIBE_NULL, metallicTex, emissiveTex, occlusionTex)$> + <$fetchMaterialTexturesCoord0(matKey, _texCoord0, albedoTex, roughnessTex, _SCRIBE_NULL, metallicTex, emissiveTex)$> + <$fetchMaterialTexturesCoord1(matKey, _texCoord1, occlusionTex)$> float opacity = 1.0; <$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>; diff --git a/libraries/render-utils/src/model_translucent.slf b/libraries/render-utils/src/model_translucent.slf index 27a22a9763..8f62a3a3e0 100755 --- a/libraries/render-utils/src/model_translucent.slf +++ b/libraries/render-utils/src/model_translucent.slf @@ -25,6 +25,7 @@ <$declareMaterialTextures(ALBEDO, ROUGHNESS, _SCRIBE_NULL, _SCRIBE_NULL, EMISSIVE, OCCLUSION)$> in vec2 _texCoord0; +in vec2 _texCoord1; in vec4 _position; in vec3 _normal; in vec3 _color; @@ -35,7 +36,8 @@ out vec4 _fragColor; void main(void) { Material mat = getMaterial(); int matKey = getMaterialKey(mat); - <$fetchMaterialTextures(matKey, _texCoord0, albedoTex, roughnessTex, _SCRIBE_NULL, _SCRIBE_NULL, emissiveTex, occlusionTex)$> + <$fetchMaterialTexturesCoord0(matKey, _texCoord0, albedoTex, roughnessTex, _SCRIBE_NULL, _SCRIBE_NULL, emissiveTex)$> + <$fetchMaterialTexturesCoord1(matKey, _texCoord1, occlusionTex)$> float opacity = getMaterialOpacity(mat) * _alpha; <$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>; @@ -61,7 +63,7 @@ void main(void) { _fragColor = vec4(evalGlobalLightingAlphaBlended( cam._viewInverse, 1.0, - 1.0, + occlusionTex, fragPosition, fragNormal, albedo, diff --git a/libraries/render-utils/src/model_translucent_unlit.slf b/libraries/render-utils/src/model_translucent_unlit.slf index b9d6c64d6f..e2676636bf 100644 --- a/libraries/render-utils/src/model_translucent_unlit.slf +++ b/libraries/render-utils/src/model_translucent_unlit.slf @@ -26,7 +26,7 @@ out vec4 _fragColor; void main(void) { Material mat = getMaterial(); int matKey = getMaterialKey(mat); - <$fetchMaterialTextures(matKey, _texCoord0, albedoTex, _SCRIBE_NULL, _SCRIBE_NULL, _SCRIBE_NULL, _SCRIBE_NULL, _SCRIBE_NULL)$> + <$fetchMaterialTexturesCoord0(matKey, _texCoord0, albedoTex)$> float opacity = getMaterialOpacity(mat) * _alpha; <$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>; diff --git a/libraries/render-utils/src/model_unlit.slf b/libraries/render-utils/src/model_unlit.slf index 50778153fb..3c2e4ae2e0 100644 --- a/libraries/render-utils/src/model_unlit.slf +++ b/libraries/render-utils/src/model_unlit.slf @@ -16,7 +16,7 @@ <@include model/Material.slh@> <@include MaterialTextures.slh@> -<$declareMaterialTextures(ALBEDO, _SCRIBE_NULL, _SCRIBE_NULL, _SCRIBE_NULL, _SCRIBE_NULL, _SCRIBE_NULL)$> +<$declareMaterialTextures(ALBEDO)$> in vec2 _texCoord0; in vec3 _normal; @@ -27,7 +27,7 @@ void main(void) { Material mat = getMaterial(); int matKey = getMaterialKey(mat); - <$fetchMaterialTextures(matKey, _texCoord0, albedoTex, _SCRIBE_NULL, _SCRIBE_NULL, _SCRIBE_NULL, _SCRIBE_NULL, _SCRIBE_NULL)$> + <$fetchMaterialTexturesCoord0(matKey, _texCoord0, albedoTex)$> float opacity = 1.0; <$evalMaterialOpacity(albedoTex.a, opacity, matKey, opacity)$>; diff --git a/libraries/render-utils/src/skin_model.slv b/libraries/render-utils/src/skin_model.slv index c8501b8ddf..268b203e35 100755 --- a/libraries/render-utils/src/skin_model.slv +++ b/libraries/render-utils/src/skin_model.slv @@ -24,6 +24,7 @@ out vec4 _position; out vec2 _texCoord0; +out vec2 _texCoord1; out vec3 _normal; out vec3 _color; out float _alpha; @@ -40,6 +41,7 @@ void main(void) { TexMapArray texMapArray = getTexMapArray(); <$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord0)$> + <$evalTexMapArrayTexcoord1(texMapArray, inTexCoord0, _texCoord1)$> // standard transform TransformCamera cam = getTransformCamera(); diff --git a/libraries/render-utils/src/skin_model_normal_map.slv b/libraries/render-utils/src/skin_model_normal_map.slv index db4b206405..05524385ef 100755 --- a/libraries/render-utils/src/skin_model_normal_map.slv +++ b/libraries/render-utils/src/skin_model_normal_map.slv @@ -24,6 +24,7 @@ out vec4 _position; out vec2 _texCoord0; +out vec2 _texCoord1; out vec3 _normal; out vec3 _tangent; out vec3 _color; @@ -42,6 +43,7 @@ void main(void) { TexMapArray texMapArray = getTexMapArray(); <$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord0)$> + <$evalTexMapArrayTexcoord1(texMapArray, inTexCoord0, _texCoord1)$> interpolatedNormal = vec4(normalize(interpolatedNormal.xyz), 0.0); interpolatedTangent = vec4(normalize(interpolatedTangent.xyz), 0.0); From a12e56f8802b0e52d9683a683499aaefb6be2b43 Mon Sep 17 00:00:00 2001 From: samcake Date: Mon, 16 May 2016 17:43:54 -0700 Subject: [PATCH 04/89] Fix forgotten vertex shader case --- libraries/render-utils/src/model_normal_map.slv | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/render-utils/src/model_normal_map.slv b/libraries/render-utils/src/model_normal_map.slv index ded37923c2..e70d93f909 100755 --- a/libraries/render-utils/src/model_normal_map.slv +++ b/libraries/render-utils/src/model_normal_map.slv @@ -34,6 +34,7 @@ void main(void) { TexMapArray texMapArray = getTexMapArray(); <$evalTexMapArrayTexcoord0(texMapArray, inTexCoord0, _texCoord0)$> + <$evalTexMapArrayTexcoord1(texMapArray, inTexCoord0, _texCoord1)$> // standard transform TransformCamera cam = getTransformCamera(); From d06c6e2a5967ef72a8333749623457d6820377f6 Mon Sep 17 00:00:00 2001 From: samcake Date: Mon, 16 May 2016 17:54:42 -0700 Subject: [PATCH 05/89] Fix forgotten vertex shader case --- libraries/render-utils/src/model_normal_map.slv | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/render-utils/src/model_normal_map.slv b/libraries/render-utils/src/model_normal_map.slv index e70d93f909..494e40ccff 100755 --- a/libraries/render-utils/src/model_normal_map.slv +++ b/libraries/render-utils/src/model_normal_map.slv @@ -22,6 +22,7 @@ out vec4 _position; out vec2 _texCoord0; +out vec2 _texCoord1; out vec3 _normal; out vec3 _tangent; out vec3 _color; From 17b617f1e181e44ce9b5cfe76b9136186e0bcc31 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Wed, 18 May 2016 10:23:45 -0700 Subject: [PATCH 06/89] umbrella --- .../Home/kineticObjects/bench.json | 36 ++ .../Home/kineticObjects/blueChair.json | 37 -- .../kineticObjects/dressingRoomBricabrac.json | 577 ++++++++++++++++++ .../Home/kineticObjects/umbrella.json | 38 ++ .../Home/kineticObjects/wrapper.js | 142 +++-- .../DomainContent/Home/reset.js | 25 +- 6 files changed, 763 insertions(+), 92 deletions(-) create mode 100644 unpublishedScripts/DomainContent/Home/kineticObjects/bench.json delete mode 100644 unpublishedScripts/DomainContent/Home/kineticObjects/blueChair.json create mode 100644 unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json create mode 100644 unpublishedScripts/DomainContent/Home/kineticObjects/umbrella.json diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/bench.json b/unpublishedScripts/DomainContent/Home/kineticObjects/bench.json new file mode 100644 index 0000000000..d7306155a6 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/bench.json @@ -0,0 +1,36 @@ +{ + "Entities": [{ + "collisionsWillMove": 1, + "compoundShapeURL": "atp:/kineticObjects/bench/Bench.obj", + "created": "2016-05-17T19:27:31Z", + "dimensions": { + "x": 2.3647537231445312, + "y": 0.51260757446289062, + "z": 0.49234861135482788 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{733c3f02-a98a-4876-91dc-320a26a07090}", + "modelURL": "atp:/kineticObjects/bench/Bench.fbx", + "queryAACube": { + "scale": 2.4692578315734863, + "x": -1.2346289157867432, + "y": -1.2346289157867432, + "z": -1.2346289157867432 + }, + "rotation": { + "w": 0.88613712787628174, + "x": -0.0015716552734375, + "y": -0.46337074041366577, + "z": -1.52587890625e-05 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }], + "Version": 57 +} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/blueChair.json b/unpublishedScripts/DomainContent/Home/kineticObjects/blueChair.json deleted file mode 100644 index 2556cd6223..0000000000 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/blueChair.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "Entities": [{ - "collisionsWillMove": 1, - "compoundShapeURL": "atp:/kineticObjects/blueChair/Comfy_Chair_Blue_hull.obj", - "created": "2016-03-29T17:37:52Z", - "dimensions": { - "x": 1.1764, - "y": 1.4557, - "z": 1.2657 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "id": "{51a44c3a-ec4a-4c79-8034-aeb5c45660b5}", - "modelURL": "atp:/kineticObjects/blueChair/Comfy_Chair_Blue.fbx", - "name": "home_model_comfyChair", - "queryAACube": { - "scale": 1.9147497415542603, - "x": -0.95737487077713013, - "y": -0.95737487077713013, - "z": -0.95737487077713013 - }, - "rotation": { - "w": 0.46746015548706055, - "x": -0.0017547607421875, - "y": 0.88400089740753174, - "z": 0.0024261474609375 - }, - "shapeType": "compound", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }], - "Version": 57 -} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json b/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json new file mode 100644 index 0000000000..8b19e16901 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json @@ -0,0 +1,577 @@ +{ + "Entities": [{ + "collisionsWillMove": 1, + "compoundShapeURL": "https://hifi-content.s3.amazonaws.com/DomainContent/Home/skully/573a170808bd0_vhacd_skully.obj", + "created": "2016-05-16T19:34:28Z", + "dimensions": { + "x": 0.19080814719200134, + "y": 0.20009028911590576, + "z": 0.21198928356170654 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -6, + "z": 0 + }, + "id": "{cef37b0a-bb3d-4549-a645-f3a934f82148}", + "modelURL": "https://hifi-content.s3.amazonaws.com/DomainContent/Home/skully/skully.fbx", + "position": { + "x": 0.254150390625, + "y": 0.4500732421875, + "z": 0.26517486572265625 + }, + "queryAACube": { + "scale": 0.34840109944343567, + "x": 0.079949840903282166, + "y": 0.27587270736694336, + "z": 0.090974316000938416 + }, + "rotation": { + "w": 0.11515986919403076, + "x": -0.087693572044372559, + "y": 0.88818192481994629, + "z": -0.43608760833740234 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionsWillMove": 1, + "compoundShapeURL": "atp:/dressingRoom/trump.obj", + "created": "2016-05-18T00:02:46Z", + "dimensions": { + "x": 0.25387090444564819, + "y": 0.28642392158508301, + "z": 0.31468403339385986 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{6483a752-5ba0-4a02-bee5-3290781dfef8}", + "modelURL": "atp:/dressingRoom/trump.fbx", + "position": { + "x": 0.3887939453125, + "y": 0.879974365234375, + "z": 0.2674407958984375 + }, + "queryAACube": { + "scale": 0.49549484252929688, + "x": 0.14104652404785156, + "y": 0.63222694396972656, + "z": 0.019693374633789062 + }, + "rotation": { + "w": 0.58565652370452881, + "x": -0.039444565773010254, + "y": 0.73434042930603027, + "z": -0.34084075689315796 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionsWillMove": 1, + "compoundShapeURL": "atp:/dressingRoom/dreads.obj", + "created": "2016-05-18T00:02:46Z", + "dimensions": { + "x": 0.30918264389038086, + "y": 0.31221473217010498, + "z": 0.29840445518493652 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{2f2fb50b-35f0-4818-9cfa-e29f7aeb7a1f}", + "modelURL": "atp:/dressingRoom/dreads.fbx", + "position": { + "x": 0.5389404296875, + "y": 0.52008056640625, + "z": 0.09856414794921875 + }, + "queryAACube": { + "scale": 0.53114700317382812, + "x": 0.27336692810058594, + "y": 0.25450706481933594, + "z": -0.16700935363769531 + }, + "rotation": { + "w": 0.85949492454528809, + "x": 0.051773905754089355, + "y": -0.41289389133453369, + "z": 0.29680323600769043 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collidesWith": "static,dynamic,kinematic,otherAvatar,", + "collisionMask": 23, + "collisionsWillMove": 1, + "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/tophat/tophat.obj", + "created": "2016-05-16T16:59:22Z", + "dimensions": { + "x": 0.38495281338691711, + "y": 0.26857495307922363, + "z": 0.39648750424385071 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{8cff801b-cb50-47d2-a1e8-4f7ee245d2ee}", + "modelURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/tophat/tophat.fbx", + "position": { + "x": 0, + "y": 0.541900634765625, + "z": 0.4959869384765625 + }, + "queryAACube": { + "scale": 0.61442941427230835, + "x": -0.30721470713615417, + "y": 0.23468592762947083, + "z": 0.18877223134040833 + }, + "rotation": { + "w": 0.92727553844451904, + "x": -0.18382543325424194, + "y": 0.32610058784484863, + "z": 0.0003204345703125 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collidesWith": "static,dynamic,kinematic,otherAvatar,", + "collisionMask": 23, + "collisionsWillMove": 1, + "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/m2.obj", + "created": "2016-05-16T17:12:28Z", + "dimensions": { + "x": 0.094467177987098694, + "y": 0.079604864120483398, + "z": 0.029766213148832321 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{0805851a-4ef1-4075-b4b3-5692ca7d6352}", + "modelURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/m2.fbx", + "position": { + "x": 0.0111083984375, + "y": 0.00689697265625, + "z": 0.45806884765625 + }, + "queryAACube": { + "scale": 0.12707087397575378, + "x": -0.052427038550376892, + "y": -0.056638464331626892, + "z": 0.39453339576721191 + }, + "rotation": { + "w": 0.84777605533599854, + "x": 0.43642330169677734, + "y": 0.26695656776428223, + "z": -0.13978791236877441 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionsWillMove": 1, + "compoundShapeURL": "atp:/dressingRoom/rectangleFrames.obj", + "created": "2016-05-18T15:50:52Z", + "dimensions": { + "x": 0.18497957289218903, + "y": 0.048084259033203125, + "z": 0.14581345021724701 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{692df470-2a76-4d5b-971b-257291ff67f7}", + "modelURL": "atp:/dressingRoom/rectangleFrames.fbx", + "name": "rectangleFrames.fbx", + "position": { + "x": 0.3701171875, + "y": 0.062652587890625, + "z": 0.35735321044921875 + }, + "queryAACube": { + "scale": 0.24039779603481293, + "x": 0.24991828203201294, + "y": -0.057546310126781464, + "z": 0.23715430498123169 + }, + "rotation": { + "w": -0.084428191184997559, + "x": -0.10658425092697144, + "y": 0.9651484489440918, + "z": -0.2235599160194397 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collidesWith": "static,dynamic,kinematic,otherAvatar,", + "collisionMask": 23, + "collisionsWillMove": 1, + "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/b3.obj", + "created": "2016-05-16T17:10:17Z", + "dimensions": { + "x": 0.19054701924324036, + "y": 0.16880631446838379, + "z": 0.11410932987928391 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{32926ddc-7c3b-49ca-97da-56e69af211af}", + "modelURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/b3.fbx", + "position": { + "x": 0.75, + "y": 0.0643310546875, + "z": 0 + }, + "queryAACube": { + "scale": 0.27897074818611145, + "x": 0.61051464080810547, + "y": -0.075154319405555725, + "z": -0.13948537409305573 + }, + "rotation": { + "w": -0.26207369565963745, + "x": 0.055374979972839355, + "y": 0.93298232555389404, + "z": 0.24034488201141357 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collidesWith": "static,dynamic,kinematic,otherAvatar,", + "collisionMask": 23, + "collisionsWillMove": 1, + "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/b1.obj", + "created": "2016-05-16T17:05:55Z", + "dimensions": { + "x": 0.18918535113334656, + "y": 0.15465652942657471, + "z": 0.11267256736755371 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{c412654f-9feb-489d-91f9-6f4eb369afe7}", + "modelURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/b1.fbx", + "position": { + "x": 0.55712890625, + "y": 0.0443115234375, + "z": 0.0774078369140625 + }, + "queryAACube": { + "scale": 0.2690814733505249, + "x": 0.42258816957473755, + "y": -0.090229213237762451, + "z": -0.057132899761199951 + }, + "rotation": { + "w": -0.26680397987365723, + "x": 0.16276800632476807, + "y": 0.81954681873321533, + "z": 0.4802471399307251 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collidesWith": "static,dynamic,kinematic,otherAvatar,", + "collisionMask": 23, + "collisionsWillMove": 1, + "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/m3.obj", + "created": "2016-05-16T17:12:28Z", + "dimensions": { + "x": 0.15590831637382507, + "y": 0.057838320732116699, + "z": 0.033922493457794189 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{c2df6722-e970-4c36-bf42-b117e2bc13c4}", + "modelURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/m3.fbx", + "position": { + "x": 0.1549072265625, + "y": 0.006439208984375, + "z": 0.34037017822265625 + }, + "queryAACube": { + "scale": 0.16971567273139954, + "x": 0.070049390196800232, + "y": -0.078418627381324768, + "z": 0.25551235675811768 + }, + "rotation": { + "w": -0.2230105996131897, + "x": 0.19484245777130127, + "y": 0.73751425743103027, + "z": 0.60689711570739746 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionsWillMove": 1, + "compoundShapeURL": "atp:/dressingRoom/Elvis.obj", + "created": "2016-05-17T23:58:24Z", + "dimensions": { + "x": 0.22462925314903259, + "y": 0.32056856155395508, + "z": 0.32186508178710938 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{5fe0d835-e52b-432b-8ffe-2e7467613974}", + "modelURL": "atp:/dressingRoom/Elvis.fbx", + "position": { + "x": 0.6776123046875, + "y": 0.89739990234375, + "z": 0.036468505859375 + }, + "queryAACube": { + "scale": 0.50677376985549927, + "x": 0.42422541975975037, + "y": 0.64401304721832275, + "z": -0.21691837906837463 + }, + "rotation": { + "w": 0.76330208778381348, + "x": 0.26140224933624268, + "y": -0.43398183584213257, + "z": 0.40090024471282959 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionsWillMove": 1, + "compoundShapeURL": "atp:/dressingRoom/roundFrames.obj", + "created": "2016-05-18T15:55:14Z", + "dimensions": { + "x": 0.18497957289218903, + "y": 0.061892151832580566, + "z": 0.14581345021724701 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{2706fd7c-9f99-4e11-aebe-4c7274d29d69}", + "modelURL": "atp:/dressingRoom/roundFrames.fbx", + "name": "roundFrames.fbx", + "position": { + "x": 0.1690673828125, + "y": 0.08319091796875, + "z": 0.50496673583984375 + }, + "queryAACube": { + "scale": 0.24353571236133575, + "x": 0.047299526631832123, + "y": -0.038576938211917877, + "z": 0.38319888710975647 + }, + "rotation": { + "w": -0.27809566259384155, + "x": -0.059800088405609131, + "y": 0.93838405609130859, + "z": -0.19615471363067627 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collidesWith": "static,dynamic,kinematic,otherAvatar,", + "collisionMask": 23, + "collisionsWillMove": 1, + "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/m1.obj", + "created": "2016-05-16T17:10:17Z", + "dimensions": { + "x": 0.10473950952291489, + "y": 0.044521570205688477, + "z": 0.032888296991586685 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{448c53c2-bf1e-44f5-b28f-06da33a4145d}", + "modelURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/m1.fbx", + "position": { + "x": 0.29052734375, + "y": 0, + "z": 0.254638671875 + }, + "queryAACube": { + "scale": 0.11846592277288437, + "x": 0.23129437863826752, + "y": -0.059232961386442184, + "z": 0.19540570676326752 + }, + "rotation": { + "w": -0.24409854412078857, + "x": -0.17210650444030762, + "y": 0.76794075965881348, + "z": -0.56667429208755493 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collidesWith": "static,dynamic,kinematic,otherAvatar,", + "collisionMask": 23, + "collisionsWillMove": 1, + "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/b2.obj", + "created": "2016-05-16T17:05:55Z", + "dimensions": { + "x": 0.12604480981826782, + "y": 0.090894937515258789, + "z": 0.069697588682174683 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{33d3ba77-d2c9-4a5f-ba1c-f6f731d05221}", + "modelURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/b2.fbx", + "position": { + "x": 0.4130859375, + "y": 0.030181884765625, + "z": 0.182342529296875 + }, + "queryAACube": { + "scale": 0.1703142374753952, + "x": 0.3279288113117218, + "y": -0.054975233972072601, + "z": 0.097185410559177399 + }, + "rotation": { + "w": -0.2856946587562561, + "x": 0.17711150646209717, + "y": 0.86263823509216309, + "z": 0.37792015075683594 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collidesWith": "static,dynamic,kinematic,otherAvatar,", + "collisionMask": 23, + "collisionsWillMove": 1, + "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/snapback/snapbackFinal.OBJ", + "created": "2016-05-16T17:01:33Z", + "dimensions": { + "x": 0.19942393898963928, + "y": 0.12862896919250488, + "z": 0.30034130811691284 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{26e895b7-4a83-45fe-a3e9-5b6ba5f5717e}", + "modelURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/snapback/snapback.fbx", + "position": { + "x": 0.7891845703125, + "y": 0.492218017578125, + "z": 0.0359649658203125 + }, + "queryAACube": { + "scale": 0.38277959823608398, + "x": 0.59779477119445801, + "y": 0.30082821846008301, + "z": -0.15542483329772949 + }, + "rotation": { + "w": -0.31783014535903931, + "x": -0.04985123872756958, + "y": 0.92556643486022949, + "z": -0.19945067167282104 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionsWillMove": 1, + "compoundShapeURL": "atp:/dressingRoom/afro.obj", + "created": "2016-05-17T23:58:24Z", + "dimensions": { + "x": 0.35398837924003601, + "y": 0.33958616852760315, + "z": 0.35055956244468689 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{d163c628-8247-4d13-a465-c1692825b4fe}", + "modelURL": "atp:/dressingRoom/afro.fbx", + "position": { + "x": 0.1300048828125, + "y": 0.9853515625, + "z": 0.4675140380859375 + }, + "queryAACube": { + "scale": 0.60292500257492065, + "x": -0.17145761847496033, + "y": 0.68388903141021729, + "z": 0.16605153679847717 + }, + "rotation": { + "w": 0.73046457767486572, + "x": 0.14757001399993896, + "y": 0.58101773262023926, + "z": -0.32719922065734863 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }], + "Version": 57 +} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/umbrella.json b/unpublishedScripts/DomainContent/Home/kineticObjects/umbrella.json new file mode 100644 index 0000000000..9d0386a339 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/umbrella.json @@ -0,0 +1,38 @@ +{ + "Entities": [{ + "collidesWith": "static,dynamic,kinematic,otherAvatar,", + "collisionMask": 23, + "collisionsWillMove": 1, + "compoundShapeURL": "atp:/kineticObjects/umbrellaopen_ch.obj", + "created": "2016-05-16T22:48:54Z", + "dimensions": { + "x": 1.2649545669555664, + "y": 1.0218980312347412, + "z": 1.2649545669555664 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{59f5cc21-c6e8-4deb-a1e2-0364e82fe062}", + "modelURL": "atp:/kineticObjects/umbrella_open.fbx", + "queryAACube": { + "scale": 2.0602173805236816, + "x": -1.0301086902618408, + "y": -1.0301086902618408, + "z": -1.0301086902618408 + }, + "rotation": { + "w": 0.66066992282867432, + "x": -0.2207522988319397, + "y": 0.64501416683197021, + "z": -0.31422901153564453 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }], + "Version": 57 +} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js b/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js index 5b0e75dc94..5ddea20560 100644 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js @@ -1,24 +1,23 @@ -print('HOME KINETIC INCLUDING WRAPPER') - -var BOOKS_URL = "atp:/kineticObjects/books.json" -var UPPER_BOOKSHELF_URL = "atp:/kineticObjects/upperBookShelf.json" -var LOWER_BOOKSHELF_URL = "atp:/kineticObjects/lowerBookShelf.json" +print('HOME KINETIC INCLUDING WRAPPER'); +var BOOKS_URL = "atp:/kineticObjects/books.json"; +var UPPER_BOOKSHELF_URL = "atp:/kineticObjects/upperBookShelf.json"; +var LOWER_BOOKSHELF_URL = "atp:/kineticObjects/lowerBookShelf.json"; var CHAIR_URL = 'atp:/kineticObjects/deskChair.json'; -var BLUE_CHAIR_URL = 'atp:/kineticObjects/blueChair.json'; - var FRUIT_BOWL_URL = "atp:/kineticObjects/fruit.json" - -var LIVING_ROOM_LAMP_URL = "atp:/kineticObjects/deskLamp.json" +var LIVING_ROOM_LAMP_URL = "atp:/kineticObjects/deskLamp.json"; var TRASHCAN_URL = "atp:/kineticObjects/trashcan.json" var BLOCKS_URL = "atp:/kineticObjects/blocks.json"; -var PLAYA_POSTER_URL = "atp:/kineticObjects/postersPlaya.json" -var CELL_POSTER_URL = "atp:/kineticObjects/postersCell.json" -var STUFF_ON_SHELVES_URL = "atp:/kineticObjects/stuff_on_shelves.json" -var JUNK_URL = "atp:/kineticObjects/junk.json" +var PLAYA_POSTER_URL = "atp:/kineticObjects/postersPlaya.json"; +var CELL_POSTER_URL = "atp:/kineticObjects/postersCell.json"; +var STUFF_ON_SHELVES_URL = "atp:/kineticObjects/stuff_on_shelves.json"; +var JUNK_URL = "atp:/kineticObjects/junk.json"; +var BRICABRAC_URL = "atp:/kineticObjects/dressingRoomBricabrac.json"; +var BENCH_URL = "atp:/kineticObjects/bench.json"; +var UMBRELLA_URL = "atp:/kineticObjects/umbrella.json"; FruitBowl = function(spawnLocation, spawnRotation) { - print('CREATE FRUIT BOWL') + print('CREATE FRUIT BOWL'); var created = []; function create() { @@ -42,7 +41,7 @@ FruitBowl = function(spawnLocation, spawnRotation) { } LivingRoomLamp = function(spawnLocation, spawnRotation) { - print('CREATE LIVING ROOM LAMP') + print('CREATE LIVING ROOM LAMP'); var created = []; function create() { @@ -65,7 +64,7 @@ LivingRoomLamp = function(spawnLocation, spawnRotation) { } UpperBookShelf = function(spawnLocation, spawnRotation) { - print('CREATE UPPER SHELF') + print('CREATE UPPER SHELF'); var created = []; function create() { @@ -89,7 +88,7 @@ UpperBookShelf = function(spawnLocation, spawnRotation) { LowerBookShelf = function(spawnLocation, spawnRotation) { - print('CREATE LOWER SHELF') + print('CREATE LOWER SHELF'); var created = []; function create() { @@ -112,7 +111,7 @@ LowerBookShelf = function(spawnLocation, spawnRotation) { } Chair = function(spawnLocation, spawnRotation) { - print('CREATE CHAIR') + print('CREATE CHAIR'); var created = []; function create() { @@ -134,32 +133,8 @@ Chair = function(spawnLocation, spawnRotation) { this.cleanup = cleanup; } -BlueChair = function(spawnLocation, spawnRotation) { - print('CREATE BLUE CHAIR') - var created = []; - - function create() { - var success = Clipboard.importEntities(BLUE_CHAIR_URL); - - if (success === true) { - created = Clipboard.pasteEntities(spawnLocation) - print('created ' + created); - } - }; - - function cleanup() { - created.forEach(function(obj) { - Entities.deleteEntity(obj); - }) - }; - - create(); - - this.cleanup = cleanup; -} - Trashcan = function(spawnLocation, spawnRotation) { - print('CREATE TRASHCAN') + print('CREATE TRASHCAN'); var created = []; function create() { @@ -183,7 +158,7 @@ Trashcan = function(spawnLocation, spawnRotation) { } Books = function(spawnLocation, spawnRotation) { - print('CREATE BOOKS') + print('CREATE BOOKS'); var created = []; function create() { @@ -206,7 +181,7 @@ Books = function(spawnLocation, spawnRotation) { } Blocks = function(spawnLocation, spawnRotation) { - print('EBL CREATE BLOCKS') + print('EBL CREATE BLOCKS'); var created = []; function create() { @@ -230,7 +205,7 @@ Blocks = function(spawnLocation, spawnRotation) { } PosterCell = function(spawnLocation, spawnRotation) { - print('CREATE CELL POSTER') + print('CREATE CELL POSTER'); var created = []; function create() { @@ -253,7 +228,7 @@ PosterCell = function(spawnLocation, spawnRotation) { } PosterPlaya = function(spawnLocation, spawnRotation) { - print('CREATE PLAYA POSTER') + print('CREATE PLAYA POSTER'); var created = []; function create() { @@ -276,7 +251,7 @@ PosterPlaya = function(spawnLocation, spawnRotation) { } StuffOnShelves = function(spawnLocation, spawnRotation) { - print('CREATE STUFF ON SHELVES') + print('CREATE STUFF ON SHELVES'); var created = []; function create() { @@ -299,7 +274,7 @@ StuffOnShelves = function(spawnLocation, spawnRotation) { } HomeJunk = function(spawnLocation, spawnRotation) { - print('HOME CREATE JUNK') + print('HOME CREATE JUNK'); var created = []; function create() { @@ -318,5 +293,74 @@ HomeJunk = function(spawnLocation, spawnRotation) { create(); + this.cleanup = cleanup; +} + +Bricabrac = function(spawnLocation, spawnRotation) { + print('HOME CREATE BRICABRAC'); + var created = []; + + function create() { + var success = Clipboard.importEntities(BRICABRAC_URL); + if (success === true) { + created = Clipboard.pasteEntities(spawnLocation) + print('created ' + created); + } + }; + + function cleanup() { + created.forEach(function(obj) { + Entities.deleteEntity(obj); + }) + }; + + create(); + + this.cleanup = cleanup; +} + +Bench = function(spawnLocation, spawnRotation) { + print('HOME CREATE BENCH'); + var created = []; + + function create() { + var success = Clipboard.importEntities(BENCH_URL); + if (success === true) { + created = Clipboard.pasteEntities(spawnLocation) + print('created ' + created); + } + }; + + function cleanup() { + created.forEach(function(obj) { + Entities.deleteEntity(obj); + }) + }; + + create(); + + this.cleanup = cleanup; +} + +Umbrella = function(spawnLocation, spawnRotation) { + print('HOME CREATE Umbrella'); + var created = []; + + function create() { + var success = Clipboard.importEntities(UMBRELLA_URL); + if (success === true) { + created = Clipboard.pasteEntities(spawnLocation) + print('created ' + created); + } + }; + + function cleanup() { + created.forEach(function(obj) { + Entities.deleteEntity(obj); + }) + }; + + create(); + this.cleanup = cleanup; } \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index f6e5a01c7c..31a4433b91 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -380,12 +380,6 @@ z: -79.8097 }); - var blueChair = new BlueChair({ - x: 1100.4821, - y: 459.9147, - z: -75.9071 - }); - var stuffOnShelves = new StuffOnShelves({ x: 1105.9432, @@ -422,6 +416,25 @@ y: 461, z: -73.3 }); + + var dressingRoomBricabrac = new Bricabrac({ + x: 1107.6450, + y: 460.4309, + z: -72.6496 + }); + + var bench = new Bench({ + x: 1100.1210, + y: 459.4552, + z: -75.4537 + }); + + var umbrella = new Umbrella({ + x: 1097.5510, + y: 459.5230, + z: -84.3897 + }); + print('HOME after creating kinetic entities'); }, From d6d94b7d17c2ddb6375d410f4bb9ce048dd7ae17 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Wed, 18 May 2016 14:12:45 -0700 Subject: [PATCH 07/89] switch branches --- .../DomainContent/Home/kineticObjects/bench.json | 1 + .../Home/kineticObjects/dressingRoomBricabrac.json | 8 ++++---- .../DomainContent/Home/kineticObjects/umbrella.json | 5 +++-- unpublishedScripts/DomainContent/Home/reset.js | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/bench.json b/unpublishedScripts/DomainContent/Home/kineticObjects/bench.json index d7306155a6..6ad65af88d 100644 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/bench.json +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/bench.json @@ -1,5 +1,6 @@ { "Entities": [{ + "name": "home_model_bench", "collisionsWillMove": 1, "compoundShapeURL": "atp:/kineticObjects/bench/Bench.obj", "created": "2016-05-17T19:27:31Z", diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json b/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json index 8b19e16901..215f2b3506 100644 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json @@ -1,7 +1,7 @@ { "Entities": [{ "collisionsWillMove": 1, - "compoundShapeURL": "https://hifi-content.s3.amazonaws.com/DomainContent/Home/skully/573a170808bd0_vhacd_skully.obj", + "compoundShapeURL": "atp:/kineticObjects/skully/skullyhull.obj", "created": "2016-05-16T19:34:28Z", "dimensions": { "x": 0.19080814719200134, @@ -15,7 +15,7 @@ "z": 0 }, "id": "{cef37b0a-bb3d-4549-a645-f3a934f82148}", - "modelURL": "https://hifi-content.s3.amazonaws.com/DomainContent/Home/skully/skully.fbx", + "modelURL": "atp:/kineticObjects/skully/skully.fbx", "position": { "x": 0.254150390625, "y": 0.4500732421875, @@ -500,7 +500,7 @@ "collidesWith": "static,dynamic,kinematic,otherAvatar,", "collisionMask": 23, "collisionsWillMove": 1, - "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/snapback/snapbackFinal.OBJ", + "compoundShapeURL": "atp:/kineticObjects/snapback/snapback.obj", "created": "2016-05-16T17:01:33Z", "dimensions": { "x": 0.19942393898963928, @@ -514,7 +514,7 @@ "z": 0 }, "id": "{26e895b7-4a83-45fe-a3e9-5b6ba5f5717e}", - "modelURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/snapback/snapback.fbx", + "modelURL": "atp:/kineticObjects/snapback/snapback.fbx", "position": { "x": 0.7891845703125, "y": 0.492218017578125, diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/umbrella.json b/unpublishedScripts/DomainContent/Home/kineticObjects/umbrella.json index 9d0386a339..6ab8f11ddc 100644 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/umbrella.json +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/umbrella.json @@ -1,9 +1,10 @@ { "Entities": [{ + "name": "home_model_umbrella", "collidesWith": "static,dynamic,kinematic,otherAvatar,", "collisionMask": 23, "collisionsWillMove": 1, - "compoundShapeURL": "atp:/kineticObjects/umbrellaopen_ch.obj", + "compoundShapeURL": "atp:/kineticObjects/umbrella/umbrellaopen_ch.obj", "created": "2016-05-16T22:48:54Z", "dimensions": { "x": 1.2649545669555664, @@ -17,7 +18,7 @@ "z": 0 }, "id": "{59f5cc21-c6e8-4deb-a1e2-0364e82fe062}", - "modelURL": "atp:/kineticObjects/umbrella_open.fbx", + "modelURL": "atp:/kineticObjects/umbrella/umbrella_open.fbx", "queryAACube": { "scale": 2.0602173805236816, "x": -1.0301086902618408, diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index 31a4433b91..2c56ee2141 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -418,9 +418,9 @@ }); var dressingRoomBricabrac = new Bricabrac({ - x: 1107.6450, + x: 1105.8, y: 460.4309, - z: -72.6496 + z: -72.6 }); var bench = new Bench({ From d50681243c1c14f09b03ce1a7b650c525a7eeae3 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Wed, 18 May 2016 14:49:30 -0700 Subject: [PATCH 08/89] bricabrac, bench, no blue chair, umbrella --- .../kineticObjects/dressingRoomBricabrac.json | 43 +++++++++++++------ .../DomainContent/Home/reset.js | 4 +- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json b/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json index 215f2b3506..aa4c944427 100644 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json @@ -1,5 +1,6 @@ { "Entities": [{ + "name": "home_model_dressing_room_bricabrac", "collisionsWillMove": 1, "compoundShapeURL": "atp:/kineticObjects/skully/skullyhull.obj", "created": "2016-05-16T19:34:28Z", @@ -37,6 +38,7 @@ "type": "Model", "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { + "name": "home_model_dressing_room_bricabrac", "collisionsWillMove": 1, "compoundShapeURL": "atp:/dressingRoom/trump.obj", "created": "2016-05-18T00:02:46Z", @@ -74,6 +76,7 @@ "type": "Model", "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { + "name": "home_model_dressing_room_bricabrac", "collisionsWillMove": 1, "compoundShapeURL": "atp:/dressingRoom/dreads.obj", "created": "2016-05-18T00:02:46Z", @@ -111,10 +114,11 @@ "type": "Model", "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { + "name": "home_model_dressing_room_bricabrac", "collidesWith": "static,dynamic,kinematic,otherAvatar,", "collisionMask": 23, "collisionsWillMove": 1, - "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/tophat/tophat.obj", + "compoundShapeURL": "atp:/kineticObjects/tophat/tophat.obj", "created": "2016-05-16T16:59:22Z", "dimensions": { "x": 0.38495281338691711, @@ -128,7 +132,7 @@ "z": 0 }, "id": "{8cff801b-cb50-47d2-a1e8-4f7ee245d2ee}", - "modelURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/tophat/tophat.fbx", + "modelURL": "atp:/kineticObjects/tophat/tophat.fbx", "position": { "x": 0, "y": 0.541900634765625, @@ -150,10 +154,11 @@ "type": "Model", "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { + "name": "home_model_dressing_room_bricabrac", "collidesWith": "static,dynamic,kinematic,otherAvatar,", "collisionMask": 23, "collisionsWillMove": 1, - "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/m2.obj", + "compoundShapeURL": "atp:/kineticObjects/hair/m2.obj", "created": "2016-05-16T17:12:28Z", "dimensions": { "x": 0.094467177987098694, @@ -167,7 +172,7 @@ "z": 0 }, "id": "{0805851a-4ef1-4075-b4b3-5692ca7d6352}", - "modelURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/m2.fbx", + "modelURL": "atp:/kineticObjects/hair/m3.fbx", "position": { "x": 0.0111083984375, "y": 0.00689697265625, @@ -189,6 +194,7 @@ "type": "Model", "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { + "name": "home_model_dressing_room_bricabrac", "collisionsWillMove": 1, "compoundShapeURL": "atp:/dressingRoom/rectangleFrames.obj", "created": "2016-05-18T15:50:52Z", @@ -227,10 +233,11 @@ "type": "Model", "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { + "name": "home_model_dressing_room_bricabrac", "collidesWith": "static,dynamic,kinematic,otherAvatar,", "collisionMask": 23, "collisionsWillMove": 1, - "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/b3.obj", + "compoundShapeURL": "atp:/kineticObjects/hair/b3.obj", "created": "2016-05-16T17:10:17Z", "dimensions": { "x": 0.19054701924324036, @@ -244,7 +251,7 @@ "z": 0 }, "id": "{32926ddc-7c3b-49ca-97da-56e69af211af}", - "modelURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/b3.fbx", + "modelURL": "atp:/kineticObjects/hair/b3.fbx", "position": { "x": 0.75, "y": 0.0643310546875, @@ -266,10 +273,11 @@ "type": "Model", "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { + "name": "home_model_dressing_room_bricabrac", "collidesWith": "static,dynamic,kinematic,otherAvatar,", "collisionMask": 23, "collisionsWillMove": 1, - "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/b1.obj", + "compoundShapeURL": "atp:/kineticObjects/hair/b1.obj", "created": "2016-05-16T17:05:55Z", "dimensions": { "x": 0.18918535113334656, @@ -283,7 +291,7 @@ "z": 0 }, "id": "{c412654f-9feb-489d-91f9-6f4eb369afe7}", - "modelURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/b1.fbx", + "modelURL": "atp:/kineticObjects/hair/b1.fbx", "position": { "x": 0.55712890625, "y": 0.0443115234375, @@ -305,10 +313,11 @@ "type": "Model", "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { + "name": "home_model_dressing_room_bricabrac", "collidesWith": "static,dynamic,kinematic,otherAvatar,", "collisionMask": 23, "collisionsWillMove": 1, - "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/m3.obj", + "compoundShapeURL": "atp:/kineticObjects/hair/m3.obj", "created": "2016-05-16T17:12:28Z", "dimensions": { "x": 0.15590831637382507, @@ -322,7 +331,7 @@ "z": 0 }, "id": "{c2df6722-e970-4c36-bf42-b117e2bc13c4}", - "modelURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/m3.fbx", + "modelURL": "atp:/kineticObjects/hair/m3.fbx", "position": { "x": 0.1549072265625, "y": 0.006439208984375, @@ -344,6 +353,7 @@ "type": "Model", "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { + "name": "home_model_dressing_room_bricabrac", "collisionsWillMove": 1, "compoundShapeURL": "atp:/dressingRoom/Elvis.obj", "created": "2016-05-17T23:58:24Z", @@ -381,6 +391,7 @@ "type": "Model", "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { + "name": "home_model_dressing_room_bricabrac", "collisionsWillMove": 1, "compoundShapeURL": "atp:/dressingRoom/roundFrames.obj", "created": "2016-05-18T15:55:14Z", @@ -419,10 +430,11 @@ "type": "Model", "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { + "name": "home_model_dressing_room_bricabrac", "collidesWith": "static,dynamic,kinematic,otherAvatar,", "collisionMask": 23, "collisionsWillMove": 1, - "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/m1.obj", + "compoundShapeURL": "atp:/kineticObjects/hair/m1.obj", "created": "2016-05-16T17:10:17Z", "dimensions": { "x": 0.10473950952291489, @@ -436,7 +448,7 @@ "z": 0 }, "id": "{448c53c2-bf1e-44f5-b28f-06da33a4145d}", - "modelURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/m1.fbx", + "modelURL": "atp:/kineticObjects/hair/m1.fbx", "position": { "x": 0.29052734375, "y": 0, @@ -458,10 +470,11 @@ "type": "Model", "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { + "name": "home_model_dressing_room_bricabrac", "collidesWith": "static,dynamic,kinematic,otherAvatar,", "collisionMask": 23, "collisionsWillMove": 1, - "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/b2.obj", + "compoundShapeURL": "atp:/kineticObjects/hair/b2.obj", "created": "2016-05-16T17:05:55Z", "dimensions": { "x": 0.12604480981826782, @@ -475,7 +488,7 @@ "z": 0 }, "id": "{33d3ba77-d2c9-4a5f-ba1c-f6f731d05221}", - "modelURL": "http://hifi-content.s3.amazonaws.com/DomainContent/Home/JJAssets/Stache%26Beard_Home/b2.fbx", + "modelURL": "atp:/kineticObjects/hair/b3.fbx", "position": { "x": 0.4130859375, "y": 0.030181884765625, @@ -497,6 +510,7 @@ "type": "Model", "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { + "name": "home_model_dressing_room_bricabrac", "collidesWith": "static,dynamic,kinematic,otherAvatar,", "collisionMask": 23, "collisionsWillMove": 1, @@ -536,6 +550,7 @@ "type": "Model", "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { + "name": "home_model_dressing_room_bricabrac", "collisionsWillMove": 1, "compoundShapeURL": "atp:/dressingRoom/afro.obj", "created": "2016-05-17T23:58:24Z", diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index 2c56ee2141..bd8e4383e0 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -418,8 +418,8 @@ }); var dressingRoomBricabrac = new Bricabrac({ - x: 1105.8, - y: 460.4309, + x: 1106.8, + y: 460.3909, z: -72.6 }); From bc29bcf0d2ce6fc706d952b58f5c41c13669f0fc Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Thu, 19 May 2016 11:18:30 -0700 Subject: [PATCH 09/89] light switch swap --- .../Home/switches/livingRoomDiscLights.js | 26 +++++--------- .../Home/switches/livingRoomFan.js | 35 +++++++------------ 2 files changed, 22 insertions(+), 39 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/switches/livingRoomDiscLights.js b/unpublishedScripts/DomainContent/Home/switches/livingRoomDiscLights.js index eef64fd3f8..6fb2ea538a 100644 --- a/unpublishedScripts/DomainContent/Home/switches/livingRoomDiscLights.js +++ b/unpublishedScripts/DomainContent/Home/switches/livingRoomDiscLights.js @@ -10,7 +10,8 @@ // (function() { - + var ON_MODEL_URL = "atp:/switches/lightswitch_on.fbx"; + var OFF_MODEL_URL = "atp:/switches/lightswitch_off.fbx"; var SEARCH_RADIUS = 100; var _this; @@ -142,6 +143,9 @@ setEntityCustomData('home-switch', _this.entityID, { state: 'on' }); + Entities.editEntity(this.entityID, { + modelURL: ON_MODEL_URL + }); } else { glowLights.forEach(function(glowLight) { @@ -156,9 +160,12 @@ setEntityCustomData('home-switch', this.entityID, { state: 'off' }); + + Entities.editEntity(this.entityID, { + modelURL: OFF_MODEL_URL + }); } - this.flipSwitch(); Audio.playSound(this.switchSound, { volume: 0.5, position: this.position @@ -166,21 +173,6 @@ }, - flipSwitch: function() { - var rotation = Entities.getEntityProperties(this.entityID, "rotation").rotation; - var axis = { - x: 0, - y: 1, - z: 0 - }; - var dQ = Quat.angleAxis(180, axis); - rotation = Quat.multiply(rotation, dQ); - - Entities.editEntity(this.entityID, { - rotation: rotation - }); - }, - preload: function(entityID) { this.entityID = entityID; setEntityCustomData('grabbableKey', this.entityID, { diff --git a/unpublishedScripts/DomainContent/Home/switches/livingRoomFan.js b/unpublishedScripts/DomainContent/Home/switches/livingRoomFan.js index 6005503cf3..c1f0c0f112 100644 --- a/unpublishedScripts/DomainContent/Home/switches/livingRoomFan.js +++ b/unpublishedScripts/DomainContent/Home/switches/livingRoomFan.js @@ -11,7 +11,7 @@ (function() { - var FAN_SOUND_ENTITY_NAME ="home_sfx_ceiling_fan" + var FAN_SOUND_ENTITY_NAME = "home_sfx_ceiling_fan" var SEARCH_RADIUS = 100; var _this; var utilitiesScript = Script.resolvePath('../utils.js'); @@ -74,16 +74,16 @@ if (!_this.fanSoundEntity) { return; } - print('HOME FAN OFF 2') + print('HOME FAN OFF 2') var soundUserData = getEntityCustomData("soundKey", _this.fanSoundEntity); if (!soundUserData) { print("NO SOUND USER DATA! RETURNING."); return; } - print('HOME FAN OFF 3') + print('HOME FAN OFF 3') soundUserData.volume = 0.0; setEntityCustomData("soundKey", _this.fanSoundEntity, soundUserData); - print('HOME FAN OFF 4') + print('HOME FAN OFF 4') }, findFan: function() { @@ -105,7 +105,7 @@ var fan = null; print('HOME LOOKING FOR A FAN') - print('HOME TOTAL ENTITIES:: ' +entities.length) + print('HOME TOTAL ENTITIES:: ' + entities.length) entities.forEach(function(entity) { var props = Entities.getEntityProperties(entity); if (props.name === FAN_SOUND_ENTITY_NAME) { @@ -132,7 +132,9 @@ setEntityCustomData('home-switch', this.entityID, { state: 'on' }); - + Entities.editEntity(this.entityID, { + modelURL: ON_MODEL_URL + }) } else { this.fanRotationOff(); this.fanSoundOff(); @@ -140,9 +142,13 @@ setEntityCustomData('home-switch', this.entityID, { state: 'off' }); + + Entities.editEntity(this.entityID, { + modelURL: OFF_MODEL_URL + }) } - this.flipSwitch(); + Audio.playSound(this.switchSound, { volume: 0.5, position: this.position @@ -150,21 +156,6 @@ }, - flipSwitch: function() { - var rotation = Entities.getEntityProperties(this.entityID, "rotation").rotation; - var axis = { - x: 0, - y: 1, - z: 0 - }; - var dQ = Quat.angleAxis(180, axis); - rotation = Quat.multiply(rotation, dQ); - - Entities.editEntity(this.entityID, { - rotation: rotation - }); - }, - preload: function(entityID) { this.entityID = entityID; setEntityCustomData('grabbableKey', this.entityID, { From a00ce2599ce9a1bc35a427f27d1af2387dcbca6a Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Thu, 19 May 2016 17:54:10 -0700 Subject: [PATCH 10/89] cleanup --- .../DomainContent/Home/switches/livingRoomFan.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/switches/livingRoomFan.js b/unpublishedScripts/DomainContent/Home/switches/livingRoomFan.js index c1f0c0f112..fa8d0968a0 100644 --- a/unpublishedScripts/DomainContent/Home/switches/livingRoomFan.js +++ b/unpublishedScripts/DomainContent/Home/switches/livingRoomFan.js @@ -9,7 +9,9 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -(function() { +(function() { + var ON_MODEL_URL="atp:/switches/fanswitch_on.fbx"; + var OFF_MODEL_URL="atp:/switches/fanswitch_off.fbx"; var FAN_SOUND_ENTITY_NAME = "home_sfx_ceiling_fan" var SEARCH_RADIUS = 100; @@ -129,12 +131,15 @@ if (this._switch.state === 'off') { this.fanRotationOn(); this.fanSoundOn(); + setEntityCustomData('home-switch', this.entityID, { state: 'on' }); + Entities.editEntity(this.entityID, { modelURL: ON_MODEL_URL - }) + }); + } else { this.fanRotationOff(); this.fanSoundOff(); From f2f911ef29017f4b75c9606361da0fda2e5700e9 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 20 May 2016 16:15:15 -0700 Subject: [PATCH 11/89] remove blocks --- .../Home/kineticObjects/blocks.json | 778 ------------------ .../DomainContent/Home/reset.js | 6 - 2 files changed, 784 deletions(-) delete mode 100644 unpublishedScripts/DomainContent/Home/kineticObjects/blocks.json diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/blocks.json b/unpublishedScripts/DomainContent/Home/kineticObjects/blocks.json deleted file mode 100644 index 08331169de..0000000000 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/blocks.json +++ /dev/null @@ -1,778 +0,0 @@ -{ - "Entities": [{ - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{5371218c-e05b-49da-ac70-81f1f76c55ea}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_block", - "position": { - "x": 0.69732666015625, - "y": 0.1600341796875, - "z": 0.28265380859375 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.6540253758430481, - "y": 0.11673291027545929, - "z": 0.23935253918170929 - }, - "rotation": { - "w": 0.996917724609375, - "x": -0.0001678466796875, - "y": 0.078294038772583008, - "z": -0.0003204345703125 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{ccc1198a-a501-48b8-959a-68297258aea7}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_block", - "position": { - "x": 0.47344970703125, - "y": 0.06005859375, - "z": 0.30706787109375 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.4301484227180481, - "y": 0.01675732433795929, - "z": 0.2637665867805481 - }, - "rotation": { - "w": 0.70644688606262207, - "x": 0.70638585090637207, - "y": -0.030960559844970703, - "z": 0.031174182891845703 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{3aaf5dd5-16d8-4852-880d-8256de68de19}", - "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", - "name": "home_model_block", - "position": { - "x": 0.2613525390625, - "y": 0.01007080078125, - "z": 0.359466552734375 - }, - "queryAACube": { - "scale": 0.27386128902435303, - "x": 0.12442189455032349, - "y": -0.12685984373092651, - "z": 0.22253590822219849 - }, - "rotation": { - "w": -4.57763671875e-05, - "x": 0.35637450218200684, - "y": -4.57763671875e-05, - "z": 0.93432521820068359 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.029999999329447746, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{0474a29f-c45b-4d42-ae95-0c0bd1e6c501}", - "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", - "name": "home_model_block", - "position": { - "x": 0.30487060546875, - "y": 0.01007080078125, - "z": 0.188262939453125 - }, - "queryAACube": { - "scale": 0.25670996308326721, - "x": 0.17651562392711639, - "y": -0.11828418076038361, - "z": 0.059907957911491394 - }, - "rotation": { - "w": 0.99496448040008545, - "x": 1.52587890625e-05, - "y": 0.10020601749420166, - "z": 0.0002288818359375 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{53e06851-8346-45ac-bdb5-0a74c99b5bd5}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_block", - "position": { - "x": 0.40277099609375, - "y": 0.035064697265625, - "z": 0.254364013671875 - }, - "queryAACube": { - "scale": 0.28722813725471497, - "x": 0.25915694236755371, - "y": -0.10854937136173248, - "z": 0.11074994504451752 - }, - "rotation": { - "w": 0.70650792121887207, - "x": -0.031143665313720703, - "y": -0.031143665313720703, - "z": 0.70632481575012207 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.029999999329447746, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{38bcb70d-e384-4b60-878a-e34d4830f045}", - "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", - "name": "home_model_block", - "position": { - "x": 0.54962158203125, - "y": 0.010040283203125, - "z": 0.294647216796875 - }, - "queryAACube": { - "scale": 0.25670996308326721, - "x": 0.42126661539077759, - "y": -0.11831469833850861, - "z": 0.16629223525524139 - }, - "rotation": { - "w": 0.999969482421875, - "x": -7.62939453125e-05, - "y": -0.0037384629249572754, - "z": 0.0001068115234375 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{fa8f8bbc-5bd0-4121-985d-75ce2f68eba1}", - "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", - "name": "home_model_block", - "position": { - "x": 0.52001953125, - "y": 0.01007080078125, - "z": 0 - }, - "queryAACube": { - "scale": 0.27386128902435303, - "x": 0.38308888673782349, - "y": -0.12685984373092651, - "z": -0.13693064451217651 - }, - "rotation": { - "w": 0.9861142635345459, - "x": -7.62939453125e-05, - "y": -0.16603344678878784, - "z": -7.62939453125e-05 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.029999999329447746, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{d4b8582b-b707-453c-89c6-65e358da5cd7}", - "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", - "name": "home_model_block", - "position": { - "x": 0.66876220703125, - "y": 0, - "z": 0.012939453125 - }, - "queryAACube": { - "scale": 0.25670996308326721, - "x": 0.54040724039077759, - "y": -0.12835498154163361, - "z": -0.11541552841663361 - }, - "rotation": { - "w": 0.70589756965637207, - "x": 0.036270737648010254, - "y": -0.036331713199615479, - "z": -0.70647746324539185 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{3b5b53fb-7ee5-44eb-9b81-8de8a525c433}", - "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", - "name": "home_model_block", - "position": { - "x": 0.83819580078125, - "y": 0.135040283203125, - "z": 0.261627197265625 - }, - "queryAACube": { - "scale": 0.27386128902435303, - "x": 0.70126515626907349, - "y": -0.0018903613090515137, - "z": 0.12469655275344849 - }, - "rotation": { - "w": 0.69332420825958252, - "x": 0.13832306861877441, - "y": -0.13841456174850464, - "z": -0.69353783130645752 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{0d1f27e9-7e74-4263-9428-8c8f7aac94a6}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_block", - "position": { - "x": 0.61773681640625, - "y": 0.0350341796875, - "z": 0.265533447265625 - }, - "queryAACube": { - "scale": 0.28722813725471497, - "x": 0.47412276268005371, - "y": -0.10857988893985748, - "z": 0.12191937863826752 - }, - "rotation": { - "w": 0.9998779296875, - "x": -4.57763671875e-05, - "y": -0.014206171035766602, - "z": 1.52587890625e-05 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{79ea518f-aac3-45ff-b22d-6d295b3c9e87}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_block", - "position": { - "x": 0.7188720703125, - "y": 0.08502197265625, - "z": 0.26397705078125 - }, - "queryAACube": { - "scale": 0.28722813725471497, - "x": 0.57525801658630371, - "y": -0.058592095971107483, - "z": 0.12036298215389252 - }, - "rotation": { - "w": 0.99993896484375, - "x": -4.57763671875e-05, - "y": -0.0099946856498718262, - "z": -0.0001068115234375 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{ff470ff9-c889-4893-a25f-80895bff0e9a}", - "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", - "name": "home_model_block", - "position": { - "x": 0.74981689453125, - "y": 0.010040283203125, - "z": 0.258575439453125 - }, - "queryAACube": { - "scale": 0.25980761647224426, - "x": 0.61991310119628906, - "y": -0.11986352503299713, - "z": 0.12867163121700287 - }, - "rotation": { - "w": 0.99993896484375, - "x": -4.57763671875e-05, - "y": -0.010666072368621826, - "z": -0.0003814697265625 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{b5319f85-603d-436b-8bbe-fc9f798ca738}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_block", - "position": { - "x": 0.8824462890625, - "y": 0.0350341796875, - "z": 0.281097412109375 - }, - "queryAACube": { - "scale": 0.28722813725471497, - "x": 0.73883223533630371, - "y": -0.10857988893985748, - "z": 0.13748334348201752 - }, - "rotation": { - "w": 0.999847412109375, - "x": -4.57763671875e-05, - "y": -0.016922235488891602, - "z": 1.52587890625e-05 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{944a4616-8dac-4d6a-a92b-49fa98514416}", - "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", - "name": "home_model_block", - "position": { - "x": 0.963623046875, - "y": 0.010009765625, - "z": 0.25885009765625 - }, - "queryAACube": { - "scale": 0.25980761647224426, - "x": 0.83371925354003906, - "y": -0.11989404261112213, - "z": 0.12894628942012787 - }, - "rotation": { - "w": 0.999847412109375, - "x": -4.57763671875e-05, - "y": -0.017379999160766602, - "z": 1.52587890625e-05 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{ea6a1038-7047-4a1e-bdbd-076d6e41508c}", - "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", - "name": "home_model_block", - "position": { - "x": 0.49188232421875, - "y": 0.010040283203125, - "z": 0.27752685546875 - }, - "queryAACube": { - "scale": 0.25980761647224426, - "x": 0.36197853088378906, - "y": -0.11986352503299713, - "z": 0.14762304723262787 - }, - "rotation": { - "w": 0.99798583984375, - "x": -4.57763671875e-05, - "y": -0.063248634338378906, - "z": 4.57763671875e-05 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{ff65f5dd-2d53-4127-86da-05156a42946d}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_block", - "position": { - "x": 0, - "y": 0.010101318359375, - "z": 0.353302001953125 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": -0.04330126941204071, - "y": -0.03319995105266571, - "z": 0.3100007176399231 - }, - "rotation": { - "w": 0.55049967765808105, - "x": 0.44353401660919189, - "y": -0.44359505176544189, - "z": -0.55083543062210083 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{3a9acd14-f754-4c70-b294-9f622c000785}", - "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", - "name": "home_model_block", - "position": { - "x": 0.88006591796875, - "y": 0.010040283203125, - "z": 0.05718994140625 - }, - "queryAACube": { - "scale": 0.27386128902435303, - "x": 0.74313527345657349, - "y": -0.12689036130905151, - "z": -0.079740703105926514 - }, - "rotation": { - "w": 0.86965739727020264, - "x": -4.57763671875e-05, - "y": -0.4936751127243042, - "z": -4.57763671875e-05 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-03-23T21:29:36Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -10, - "z": 0 - }, - "velocity": { - "x": 0, - "y": -0.1, - "z": 0 - }, - "id": "{bb014301-247b-44d0-8b09-b830fea4439e}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_block", - "position": { - "x": 0.80487060546875, - "y": 0.010040283203125, - "z": 0.19500732421875 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.7615693211555481, - "y": -0.03326098620891571, - "z": 0.15170605480670929 - }, - "rotation": { - "w": 0.70440220832824707, - "x": 0.060776710510253906, - "y": -0.060868263244628906, - "z": -0.70455479621887207 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }], - "Version": 57 -} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index bd8e4383e0..b68486864a 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -344,12 +344,6 @@ createKineticEntities: function() { - var blocks = new Blocks({ - x: 1097.1383, - y: 460.3790, - z: -66.4895 - }); - var fruitBowl = new FruitBowl({ x: 1105.3185, y: 460.3221, From a48d26a59df2d88f467424d1d17420617aec7edb Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 20 May 2016 16:18:40 -0700 Subject: [PATCH 12/89] individual switches --- .../Home/switches/livingRoomLightDown.js | 197 ++++++++++++++++++ .../Home/switches/livingRoomLightUp.js | 195 +++++++++++++++++ 2 files changed, 392 insertions(+) create mode 100644 unpublishedScripts/DomainContent/Home/switches/livingRoomLightDown.js create mode 100644 unpublishedScripts/DomainContent/Home/switches/livingRoomLightUp.js diff --git a/unpublishedScripts/DomainContent/Home/switches/livingRoomLightDown.js b/unpublishedScripts/DomainContent/Home/switches/livingRoomLightDown.js new file mode 100644 index 0000000000..86c9a70716 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/switches/livingRoomLightDown.js @@ -0,0 +1,197 @@ +// +// +// Created by The Content Team 4/10/216 +// Copyright 2016 High Fidelity, Inc. +// +// this finds lights and toggles thier visibility, and flips the emissive texture of some light models +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +(function() { + + var SEARCH_RADIUS = 100; + + var _this; + var utilitiesScript = Script.resolvePath('../utils.js'); + Script.include(utilitiesScript); + Switch = function() { + _this = this; + this.switchSound = SoundCache.getSound("atp:/switches/lamp_switch_2.wav"); + }; + + Switch.prototype = { + prefix: 'hifi-home-living-room-disc-', + clickReleaseOnEntity: function(entityID, mouseEvent) { + if (!mouseEvent.isLeftButton) { + return; + } + this.toggleLights(); + }, + + startNearTrigger: function() { + this.toggleLights(); + }, + + modelEmitOn: function(glowDisc) { + var data = { + "Metal-brushed-light.jpg": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/Metal-brushed-light.jpg", + "Tex.CeilingLight.Emit": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-On-Diffuse.jpg", + "TexCeilingLight.Diffuse": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-Base.jpg" + } + + Entities.editEntity(glowDisc, { + textures: JSON.stringify(data) + }) + }, + + modelEmitOff: function(glowDisc) { + var data = { + "Metal-brushed-light.jpg": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/Metal-brushed-light.jpg", + "Tex.CeilingLight.Emit": "", + "TexCeilingLight.Diffuse": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-Base.jpg" + } + + Entities.editEntity(glowDisc, { + textures: JSON.stringify(data) + + }) + }, + + masterLightOn: function(masterLight) { + Entities.editEntity(masterLight, { + visible: true + }); + }, + + masterLightOff: function(masterLight) { + Entities.editEntity(masterLight, { + visible: false + }); + }, + + glowLightOn: function(glowLight) { + Entities.editEntity(glowLight, { + visible: true + }); + }, + + glowLightOff: function(glowLight) { + Entities.editEntity(glowLight, { + visible: false + }); + }, + + findGlowLights: function() { + var found = []; + var results = Entities.findEntities(this.position, SEARCH_RADIUS); + results.forEach(function(result) { + var properties = Entities.getEntityProperties(result); + if (properties.name === _this.prefix + "light-glow") { + found.push(result); + } + }); + return found; + }, + + findMasterLights: function() { + var found = []; + var results = Entities.findEntities(this.position, SEARCH_RADIUS); + results.forEach(function(result) { + var properties = Entities.getEntityProperties(result); + if (properties.name === _this.prefix + "light-master") { + found.push(result); + } + }); + return found; + }, + + findEmitModels: function() { + var found = []; + var results = Entities.findEntities(this.position, SEARCH_RADIUS); + results.forEach(function(result) { + var properties = Entities.getEntityProperties(result); + if (properties.name === _this.prefix + "light-model") { + found.push(result); + } + }); + return found; + }, + + findSwitch: function() { + var found = []; + var results = Entities.findEntities(this.position, SEARCH_RADIUS); + results.forEach(function(result) { + var properties = Entities.getEntityProperties(result); + if (properties.name === "hifi-home-living-room-light-switch-up") { + found.push(result); + } + }); + return found; + }, + + toggleLights: function() { + + var glowLights = this.findGlowLights(); + var masterLights = this.findMasterLights(); + var emitModels = this.findEmitModels(); + + glowLights.forEach(function(glowLight) { + // _this.glowLightOff(glowLight); + }); + + masterLights.forEach(function(masterLight) { + _this.masterLightOff(masterLight); + }); + + emitModels.forEach(function(emitModel) { + _this.modelEmitOff(emitModel); + }); + + + Audio.playSound(this.switchSound, { + volume: 0.5, + position: this.position + }); + + Entities.editEntity(this.entityID, { + position: { + x: 1103.9894, + y: 460.6867, + z: -75.5650 + } + }); + + + var otherSwitch = this.findSwitch(); + + print('other switch:: ' + otherSwitch) + + + var success = Entities.editEntity(otherSwitch.toString(), { + position: { + x: 1103.5823, + y: 460.6867, + z: -75.6313 + } + }) + print('edit success ' + success) + }, + + preload: function(entityID) { + this.entityID = entityID; + setEntityCustomData('grabbableKey', this.entityID, { + wantsTrigger: true + }); + + var properties = Entities.getEntityProperties(this.entityID); + + //The light switch is static, so just cache its position once + this.position = Entities.getEntityProperties(this.entityID, "position").position; + } + }; + + // entity scripts always need to return a newly constructed object of our type + return new Switch(); +}); \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/switches/livingRoomLightUp.js b/unpublishedScripts/DomainContent/Home/switches/livingRoomLightUp.js new file mode 100644 index 0000000000..1be08a6fec --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/switches/livingRoomLightUp.js @@ -0,0 +1,195 @@ +// +// +// Created by The Content Team 4/10/216 +// Copyright 2016 High Fidelity, Inc. +// +// this finds lights and toggles thier visibility, and flips the emissive texture of some light models +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +(function() { + + var SEARCH_RADIUS = 100; + + var _this; + var utilitiesScript = Script.resolvePath('../utils.js'); + Script.include(utilitiesScript); + Switch = function() { + _this = this; + this.switchSound = SoundCache.getSound("atp:/switches/lamp_switch_2.wav"); + }; + + Switch.prototype = { + prefix: 'hifi-home-living-room-disc-', + clickReleaseOnEntity: function(entityID, mouseEvent) { + if (!mouseEvent.isLeftButton) { + return; + } + this.toggleLights(); + }, + + startNearTrigger: function() { + this.toggleLights(); + }, + + modelEmitOn: function(glowDisc) { + var data = { + "Metal-brushed-light.jpg": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/Metal-brushed-light.jpg", + "Tex.CeilingLight.Emit": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-On-Diffuse.jpg", + "TexCeilingLight.Diffuse": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-Base.jpg" + } + + Entities.editEntity(glowDisc, { + textures: JSON.stringify(data) + }) + }, + + modelEmitOff: function(glowDisc) { + var data = { + "Metal-brushed-light.jpg": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/Metal-brushed-light.jpg", + "Tex.CeilingLight.Emit": "", + "TexCeilingLight.Diffuse": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-Base.jpg" + } + + Entities.editEntity(glowDisc, { + textures: JSON.stringify(data) + + }) + }, + + masterLightOn: function(masterLight) { + Entities.editEntity(masterLight, { + visible: true + }); + }, + + masterLightOff: function(masterLight) { + Entities.editEntity(masterLight, { + visible: false + }); + }, + + glowLightOn: function(glowLight) { + Entities.editEntity(glowLight, { + visible: true + }); + }, + + glowLightOff: function(glowLight) { + Entities.editEntity(glowLight, { + visible: false + }); + }, + + findGlowLights: function() { + var found = []; + var results = Entities.findEntities(this.position, SEARCH_RADIUS); + results.forEach(function(result) { + var properties = Entities.getEntityProperties(result); + if (properties.name === _this.prefix + "light-glow") { + found.push(result); + } + }); + return found; + }, + + findMasterLights: function() { + var found = []; + var results = Entities.findEntities(this.position, SEARCH_RADIUS); + results.forEach(function(result) { + var properties = Entities.getEntityProperties(result); + if (properties.name === _this.prefix + "light-master") { + found.push(result); + } + }); + return found; + }, + + findEmitModels: function() { + var found = []; + var results = Entities.findEntities(this.position, SEARCH_RADIUS); + results.forEach(function(result) { + var properties = Entities.getEntityProperties(result); + if (properties.name === _this.prefix + "light-model") { + found.push(result); + } + }); + return found; + }, + + findSwitch: function() { + var found = []; + var results = Entities.findEntities(this.position, SEARCH_RADIUS); + results.forEach(function(result) { + var properties = Entities.getEntityProperties(result); + if (properties.name === "hifi-home-living-room-light-switch-down") { + found.push(result); + } + }); + return found; + }, + + toggleLights: function() { + + var glowLights = this.findGlowLights(); + var masterLights = this.findMasterLights(); + var emitModels = this.findEmitModels(); + + glowLights.forEach(function(glowLight) { + // _this.glowLightOff(glowLight); + }); + + masterLights.forEach(function(masterLight) { + _this.masterLightOff(masterLight); + }); + + emitModels.forEach(function(emitModel) { + _this.modelEmitOff(emitModel); + }); + + + Audio.playSound(this.switchSound, { + volume: 0.5, + position: this.position + }); + + Entities.editEntity(this.entityID, { + position: { + x: 1103.9894, + y: 460.6867, + z: -75.5650 + } + }); + + var otherSwitch = this.findSwitch(); + + print('other switch:: ' + otherSwitch) + + var success = Entities.editEntity(otherSwitch.toString(), { + position: { + x: 1103.5823, + y: 460.6867, + z: -75.6313 + } + }) + print('edit success ' + success) + }, + + preload: function(entityID) { + this.entityID = entityID; + setEntityCustomData('grabbableKey', this.entityID, { + wantsTrigger: true + }); + + var properties = Entities.getEntityProperties(this.entityID); + + //The light switch is static, so just cache its position once + this.position = Entities.getEntityProperties(this.entityID, "position").position; + } + }; + + // entity scripts always need to return a newly constructed object of our type + return new Switch(); +}); \ No newline at end of file From fdb0fa45597aeb9547cb39c865432510e10156d6 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 20 May 2016 16:21:52 -0700 Subject: [PATCH 13/89] add blocky start --- .../Home/blocky/arrangement1.json | 103 ++++++ .../Home/blocky/arrangement1A.json | 104 ++++++ .../Home/blocky/arrangement2.json | 179 ++++++++++ .../Home/blocky/arrangement2A.json | 174 ++++++++++ .../Home/blocky/arrangement3.json | 311 ++++++++++++++++++ .../Home/blocky/arrangement3A.json | 229 +++++++++++++ .../Home/blocky/arrangement4.json | 232 +++++++++++++ .../Home/blocky/arrangement4A.json | 203 ++++++++++++ .../Home/blocky/arrangement5.json | 254 ++++++++++++++ .../Home/blocky/arrangement5B.json | 203 ++++++++++++ .../Home/blocky/arrangement5a.json | 197 +++++++++++ .../Home/blocky/arrangement6.json | 238 ++++++++++++++ .../Home/blocky/arrangement6B.json | 236 +++++++++++++ .../DomainContent/Home/blocky/blocky.js | 227 +++++++++++++ .../Home/blocky/singleSpawner.js | 27 ++ .../DomainContent/Home/blocky/wrapper.js | 61 ++++ 16 files changed, 2978 insertions(+) create mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement1.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement1A.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement2.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement2A.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement3.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement3A.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement4.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement4A.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement5.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement5B.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement5a.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement6.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement6B.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/blocky.js create mode 100644 unpublishedScripts/DomainContent/Home/blocky/singleSpawner.js create mode 100644 unpublishedScripts/DomainContent/Home/blocky/wrapper.js diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement1.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement1.json new file mode 100644 index 0000000000..754db172b6 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/arrangement1.json @@ -0,0 +1,103 @@ +{ + "Entities": [{ + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:46:06Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "dynamic": 0, + "id": "{e4fd5fc4-10b9-4d84-b6ba-b732cc7de7b7}", + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0147705078125, + "y": 0.5, + "z": 0 + }, + "queryAACube": { + "scale": 0.28722813725471497, + "x": -0.12884356081485748, + "y": 0.35638594627380371, + "z": -0.14361406862735748 + }, + "rotation": { + "w": -0.31651788949966431, + "x": -0.31587702035903931, + "y": -0.63225758075714111, + "z": 0.63265430927276611 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:46:06Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "dynamic": 0, + "id": "{1e310b85-7823-414b-8448-4435e056c07a}", + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0, + "y": 0, + "z": 0.0084075927734375 + }, + "queryAACube": { + "scale": 0.28722813725471497, + "x": -0.14361406862735748, + "y": -0.14361406862735748, + "z": -0.13520647585391998 + }, + "rotation": { + "w": 0.34120702743530273, + "x": -0.34154266119003296, + "y": 0.61931788921356201, + "z": 0.61916530132293701 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:28:38Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "dynamic": 0, + "id": "{1f07cd0e-f9d1-46f3-b71a-ad7127d1a0b0}", + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0155029296875, + "y": 0.25, + "z": 0.0084686279296875 + }, + "queryAACube": { + "scale": 0.28722813725471497, + "x": -0.12811113893985748, + "y": 0.10638593137264252, + "z": -0.13514544069766998 + }, + "rotation": { + "w": 0.62478065490722656, + "x": -0.62526893615722656, + "y": -0.33089190721511841, + "z": -0.33040362596511841 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }], + "Version": 57 +} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement1A.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement1A.json new file mode 100644 index 0000000000..2d224c7d0a --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/arrangement1A.json @@ -0,0 +1,104 @@ +{ + "Entities": [ + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:28:38Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "id": "{061cfb78-aece-414a-a56b-a83df3d3c188}", + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "parentID": "{adc9842c-db50-4bbf-8d90-8c12e5ad59ac}", + "position": { + "x": -0.0069605633616447449, + "y": -0.0044899135828018188, + "z": 0.24996849894523621 + }, + "queryAACube": { + "scale": 0.86168444156646729, + "x": 1098.883544921875, + "y": 460.20965576171875, + "z": -69.462593078613281 + }, + "rotation": { + "w": -6.8545341491699219e-05, + "x": -0.022976815700531006, + "y": 0.9996645450592041, + "z": 0.00011834502220153809 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:46:06Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "id": "{526b3076-78eb-438d-8566-ae0d0599029c}", + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "parentID": "{adc9842c-db50-4bbf-8d90-8c12e5ad59ac}", + "position": { + "x": 0.0026676803827285767, + "y": -0.016830384731292725, + "z": 0.4999808669090271 + }, + "queryAACube": { + "scale": 0.86168444156646729, + "x": 1098.8680419921875, + "y": 459.95965576171875, + "z": -69.462570190429688 + }, + "rotation": { + "w": 3.6507844924926758e-05, + "x": 0.99916994571685791, + "y": 0.040203869342803955, + "z": -0.0002717822790145874 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "angularDamping": 0, + "angularVelocity": { + "x": 0, + "y": 0.52359879016876221, + "z": 0 + }, + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:46:06Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "id": "{adc9842c-db50-4bbf-8d90-8c12e5ad59ac}", + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "queryAACube": { + "scale": 0.28722813725471497, + "x": -0.14361406862735748, + "y": -0.14361406862735748, + "z": -0.14361406862735748 + }, + "rotation": { + "w": -0.69973748922348022, + "x": -0.69991332292556763, + "y": 0.10158070176839828, + "z": -0.10084760189056396 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + } + ], + "Version": 57 +} diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement2.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement2.json new file mode 100644 index 0000000000..2a47e2c5d4 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/arrangement2.json @@ -0,0 +1,179 @@ +{ + "Entities": [{ + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:46:06Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "dynamic": 0, + "id": "{e4fd5fc4-10b9-4d84-b6ba-b732cc7de7b7}", + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0531005859375, + "y": 0.17498779296875, + "z": 0.10013580322265625 + }, + "queryAACube": { + "scale": 0.28722813725471497, + "x": -0.090513482689857483, + "y": 0.031373724341392517, + "z": -0.043478265404701233 + }, + "rotation": { + "w": 0.70144569873809814, + "x": 0.089502327144145966, + "y": 0.089585684239864349, + "z": 0.70138269662857056 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:28:38Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "dynamic": 0, + "id": "{82c627f6-d296-4ee9-9206-56aa06846013}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0238037109375, + "y": 0.5, + "z": 0 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": -0.01949755847454071, + "y": 0.4566987156867981, + "z": -0.04330126941204071 + }, + "rotation": { + "w": 0.00020232143288012594, + "x": 0.89600801467895508, + "y": 0.00046253428445197642, + "z": 0.44403755664825439 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", + "velocity": { + "x": -0.007318682037293911, + "y": -0.0010040029883384705, + "z": -9.1018431703560054e-05 + } + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:33:00Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.05000000074505806, + "z": 0.25 + }, + "dynamic": 0, + "id": "{c07b3366-9fb2-4192-a2aa-963bbfa46de1}", + "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0, + "y": 0, + "z": 0.11705780029296875 + }, + "queryAACube": { + "scale": 0.27386128902435303, + "x": -0.13693064451217651, + "y": -0.13693064451217651, + "z": -0.019872844219207764 + }, + "rotation": { + "w": 0.52331775426864624, + "x": -0.52310466766357422, + "y": -0.47588011622428894, + "z": -0.47543454170227051 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:46:06Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "dynamic": 0, + "id": "{1fa9f95d-b040-4d52-8c50-6ceaaf794bba}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.024658203125, + "y": 0.3499755859375, + "z": 0.00504302978515625 + }, + "queryAACube": { + "scale": 0.25670996308326721, + "x": -0.10369677841663361, + "y": 0.22162060439586639, + "z": -0.12331195175647736 + }, + "rotation": { + "w": 0.69705569744110107, + "x": 0.69662469625473022, + "y": 0.11998884379863739, + "z": -0.12012538313865662 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", + "velocity": { + "x": -0.0049706185236573219, + "y": 0.0010576546192169189, + "z": 0.00093202776042744517 + } + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:28:29Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.05000000074505806, + "z": 0.25 + }, + "dynamic": 0, + "id": "{02fb5b0d-17cb-44b2-ad41-9dbe24bcd606}", + "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", + "name": "home_model_block", + "position": { + "x": 0.1104736328125, + "y": 0, + "z": 0.097320556640625 + }, + "queryAACube": { + "scale": 0.27386128902435303, + "x": -0.026457011699676514, + "y": -0.13693064451217651, + "z": -0.039610087871551514 + }, + "rotation": { + "w": 0.58954423666000366, + "x": 0.58955228328704834, + "y": -0.39041024446487427, + "z": 0.39044272899627686 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }], + "Version": 57 +} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement2A.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement2A.json new file mode 100644 index 0000000000..42ae9059ac --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/arrangement2A.json @@ -0,0 +1,174 @@ +{ + "Entities": [ + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:28:29Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{c170eefd-bd60-4d6b-a475-9c084f1c2de0}", + "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", + "name": "home_model_block", + "parentID": "{505fe8c9-4678-43ac-9eaf-c8327c08b02a}", + "position": { + "x": 0.13519594073295593, + "y": 0.49943554401397705, + "z": 0.017574317753314972 + }, + "queryAACube": { + "scale": 0.82158386707305908, + "x": 1099.1766357421875, + "y": 460.05300903320312, + "z": -69.957748413085938 + }, + "rotation": { + "w": 0.7015533447265625, + "x": -0.70165455341339111, + "y": 0.08770480751991272, + "z": 0.088382631540298462 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:33:00Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{336bdac8-0229-460d-a9be-38efbc8b7e1f}", + "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", + "name": "home_model_blocky_block", + "parentID": "{505fe8c9-4678-43ac-9eaf-c8327c08b02a}", + "position": { + "x": 0.083991743624210358, + "y": 0.49937903881072998, + "z": -0.082286134362220764 + }, + "queryAACube": { + "scale": 0.82158386707305908, + "x": 1099.06591796875, + "y": 460.05300903320312, + "z": -69.939018249511719 + }, + "rotation": { + "w": -0.6799309253692627, + "x": -0.68009138107299805, + "y": -0.19405338168144226, + "z": 0.19368152320384979 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:46:06Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "id": "{3ba19cc0-2572-4f42-9c21-1d9da982855c}", + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "parentID": "{505fe8c9-4678-43ac-9eaf-c8327c08b02a}", + "position": { + "x": 0.10286395996809006, + "y": 0.32441270351409912, + "z": -0.029775351285934448 + }, + "queryAACube": { + "scale": 0.86168444156646729, + "x": 1099.0992431640625, + "y": 460.20794677734375, + "z": -69.975509643554688 + }, + "rotation": { + "w": 0.39181840419769287, + "x": -0.58902782201766968, + "y": 0.58839577436447144, + "z": -0.39155444502830505 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:46:06Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{7b4e39a0-2e4b-49da-a9c0-18bca0adb568}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "parentID": "{505fe8c9-4678-43ac-9eaf-c8327c08b02a}", + "position": { + "x": 0.0086878137663006783, + "y": 0.14853793382644653, + "z": 0.00078312074765563011 + }, + "queryAACube": { + "scale": 0.77012991905212402, + "x": 1099.113037109375, + "y": 460.42950439453125, + "z": -70.023597717285156 + }, + "rotation": { + "w": 0.57103759050369263, + "x": -0.57109135389328003, + "y": -0.41725897789001465, + "z": -0.41673195362091064 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", + "velocity": { + "x": -0.0010035448940470815, + "y": 0.00021353544434532523, + "z": 0.00018817203817889094 + } + }, + { + "angularDamping": 0, + "angularVelocity": { + "x": 0, + "y": 0.2617993950843811, + "z": 0 + }, + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:28:38Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{505fe8c9-4678-43ac-9eaf-c8327c08b02a}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "queryAACube": { + "scale": 0.086602538824081421, + "x": -0.04330126941204071, + "y": -0.04330126941204071, + "z": -0.04330126941204071 + }, + "rotation": { + "w": 0.00035001290962100029, + "x": 0.68673843145370483, + "y": 0.0003638292255345732, + "z": 0.72690451145172119 + }, + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":false},\"hifiHomeKey\":{\"reset\":true}}" + } + ], + "Version": 57 +} diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement3.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement3.json new file mode 100644 index 0000000000..990656eacd --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/arrangement3.json @@ -0,0 +1,311 @@ +{ + "Entities": [{ + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:28:29Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "dynamic": 0, + "id": "{099ee4ce-8cef-4885-b1a5-46c4efc9ec6d}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_block", + "position": { + "x": 0.0489501953125, + "y": 0.074981689453125, + "z": 0.1115264892578125 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.0056489259004592896, + "y": 0.03168042004108429, + "z": 0.06822521984577179 + }, + "rotation": { + "w": 0.28857278823852539, + "x": 0.28886386752128601, + "y": -0.64528524875640869, + "z": 0.64567047357559204 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}", + "velocity": { + "x": -7.4302828579675406e-05, + "y": 0.0010566487908363342, + "z": -0.00053769041551277041 + } + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:30:40Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "dynamic": 0, + "id": "{83e6f44b-7444-4377-a89e-439a034e6cd3}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.18896484375, + "y": 0.075103759765625, + "z": 0.31917572021484375 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.14566357433795929, + "y": 0.03180249035358429, + "z": 0.27587443590164185 + }, + "rotation": { + "w": 0.00027349172160029411, + "x": 0.89839118719100952, + "y": 0.0002214395790360868, + "z": -0.43919605016708374 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", + "velocity": { + "x": 0.00010077288607135415, + "y": 0.0014465302228927612, + "z": 2.9299229936441407e-05 + } + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:35:02Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "dynamic": 0, + "id": "{44f920b7-a2ba-4e65-a30a-27bc127f4570}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.121337890625, + "y": 0.075042724609375, + "z": 0.225860595703125 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.07803662121295929, + "y": 0.03174145519733429, + "z": 0.18255932629108429 + }, + "rotation": { + "w": 0.55899232625961304, + "x": -0.43351781368255615, + "y": 0.4330800473690033, + "z": -0.55859774351119995 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:33:00Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "dynamic": 0, + "id": "{f1b7be87-97d7-4c28-ba77-c431c3a248a4}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.2723388671875, + "y": 0.07513427734375, + "z": 0.44538116455078125 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.22903759777545929, + "y": 0.03183300793170929, + "z": 0.40207988023757935 + }, + "rotation": { + "w": 0.098181776702404022, + "x": 0.70029288530349731, + "y": 0.70022231340408325, + "z": 0.098178565502166748 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:28:38Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "dynamic": 0, + "id": "{82c627f6-d296-4ee9-9206-56aa06846013}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.327392578125, + "y": 0.07513427734375, + "z": 0.52436065673828125 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.2840912938117981, + "y": 0.03183300793170929, + "z": 0.48105937242507935 + }, + "rotation": { + "w": 0.68337905406951904, + "x": -0.18168261647224426, + "y": 0.18157178163528442, + "z": -0.68338578939437866 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:33:00Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "dynamic": 0, + "id": "{ae9bb770-d8a5-4a8f-9f07-512347c41fe7}", + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0238037109375, + "y": 0, + "z": 0.05812835693359375 + }, + "queryAACube": { + "scale": 0.28722813725471497, + "x": -0.11981035768985748, + "y": -0.14361406862735748, + "z": -0.085485711693763733 + }, + "rotation": { + "w": 7.7116979809943587e-05, + "x": 0.9558948278427124, + "y": 9.8852447990793735e-05, + "z": -0.29370918869972229 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:37:13Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "dynamic": 0, + "id": "{5dbfa65e-77f6-4646-864c-6ef99387bf21}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0, + "y": 0.074981689453125, + "z": 0 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": -0.04330126941204071, + "y": 0.03168042004108429, + "z": -0.04330126941204071 + }, + "rotation": { + "w": 0.70565086603164673, + "x": -0.70586901903152466, + "y": 0.043502748012542725, + "z": 0.043741695582866669 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:35:02Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "dynamic": 0, + "id": "{be46be67-9288-4eef-97be-1bc501bda8f0}", + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.1683349609375, + "y": 6.103515625e-05, + "z": 0.2762603759765625 + }, + "queryAACube": { + "scale": 0.28722813725471497, + "x": 0.024720892310142517, + "y": -0.14355303347110748, + "z": 0.13264630734920502 + }, + "rotation": { + "w": 0.22011587023735046, + "x": 0.67208588123321533, + "y": -0.67190313339233398, + "z": -0.21999000012874603 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:32:51Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "dynamic": 0, + "id": "{eef1688c-5eba-4a57-8ece-39339fee5ffe}", + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.3221435546875, + "y": 0.000152587890625, + "z": 0.478668212890625 + }, + "queryAACube": { + "scale": 0.28722813725471497, + "x": 0.17852948606014252, + "y": -0.14346148073673248, + "z": 0.33505415916442871 + }, + "rotation": { + "w": -0.00010969530558213592, + "x": 0.29818582534790039, + "y": 7.1413240220863372e-05, + "z": 0.95450782775878906 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }], + "Version": 57 +} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement3A.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement3A.json new file mode 100644 index 0000000000..4446c0f23a --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/arrangement3A.json @@ -0,0 +1,229 @@ +{ + "Entities": [ + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:28:29Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{68b93994-05ce-49e8-acfc-113439b0016c}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_block", + "position": { + "x": 0.1077880859375, + "y": 0.075286865234375, + "z": 0.0563507080078125 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.06448681652545929, + "y": 0.03198559582233429, + "z": 0.01304943859577179 + }, + "rotation": { + "w": -0.48592910170555115, + "x": -0.48633205890655518, + "y": 0.51336151361465454, + "z": -0.51362788677215576 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:30:40Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{a55936ed-a7bb-4367-a08d-2c35610908ca}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.3470458984375, + "y": 0.075897216796875, + "z": 0.1311492919921875 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.3037446141242981, + "y": 0.03259594738483429, + "z": 0.08784802258014679 + }, + "rotation": { + "w": -0.00018426775932312012, + "x": -0.70232832431793213, + "y": -0.00030004978179931641, + "z": 0.71185272932052612 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:35:02Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{1f6d3b72-8e31-47d7-8306-61722554b8e5}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.23583984375, + "y": 0.075042724609375, + "z": 0.1005401611328125 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.19253857433795929, + "y": 0.03174145519733429, + "z": 0.05723889172077179 + }, + "rotation": { + "w": -0.38409394025802612, + "x": 0.59400159120559692, + "y": -0.5937197208404541, + "z": 0.38357573747634888 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:28:38Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{4f17bcac-91f2-4a0d-ae1d-00c6628ef578}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.583251953125, + "y": 0.07513427734375, + "z": 0.204864501953125 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.5399506688117981, + "y": 0.03183300793170929, + "z": 0.16156323254108429 + }, + "rotation": { + "w": -0.58473116159439087, + "x": 0.39768025279045105, + "y": -0.39757427573204041, + "z": 0.58470022678375244 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:33:00Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{5dfd5f47-3040-4d58-be0d-ce96a2962913}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.490966796875, + "y": 0.07513427734375, + "z": 0.1775970458984375 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.4476655125617981, + "y": 0.03183300793170929, + "z": 0.13429577648639679 + }, + "rotation": { + "w": 0.13917262852191925, + "x": -0.69330555200576782, + "y": -0.69324028491973877, + "z": 0.13919799029827118 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:33:00Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "id": "{a7497e99-914a-4a51-9d96-70198f7bbb0e}", + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.054931640625, + "y": 0, + "z": 0.03050994873046875 + }, + "queryAACube": { + "scale": 0.28722813725471497, + "x": -0.088682428002357483, + "y": -0.14361406862735748, + "z": -0.11310411989688873 + }, + "rotation": { + "w": -3.9517879486083984e-05, + "x": -0.80475461483001709, + "y": -0.00011920928955078125, + "z": 0.59360742568969727 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:37:13Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{3167fe1f-5d3e-49a5-aee4-b4a657eb93ff}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0, + "y": 0.074981689453125, + "z": 0 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": -0.04330126941204071, + "y": 0.03168042004108429, + "z": -0.04330126941204071 + }, + "rotation": { + "w": -0.65145671367645264, + "x": 0.65158241987228394, + "y": -0.2746637761592865, + "z": -0.274961918592453 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + } + ], + "Version": 57 +} diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement4.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement4.json new file mode 100644 index 0000000000..6bb6c4067a --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/arrangement4.json @@ -0,0 +1,232 @@ +{ + "Entities": [{ + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:30:40Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "dynamic": 0, + "id": "{973dc65a-0200-4c27-b311-a16632abd336}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.060791015625, + "y": 0.439910888671875, + "z": 0.02478790283203125 + }, + "queryAACube": { + "scale": 0.25670996308326721, + "x": -0.067563965916633606, + "y": 0.31155592203140259, + "z": -0.10356707870960236 + }, + "rotation": { + "w": -0.36391082406044006, + "x": -0.60559296607971191, + "y": 0.60754096508026123, + "z": 0.3629324734210968 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", + "velocity": { + "x": -0.00066184467868879437, + "y": 0.00055500119924545288, + "z": -0.0027390613686293364 + } + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:33:00Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "dynamic": 0, + "id": "{ae9bb770-d8a5-4a8f-9f07-512347c41fe7}", + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0587158203125, + "y": 0, + "z": 0.06317138671875 + }, + "queryAACube": { + "scale": 0.28722813725471497, + "x": -0.084898248314857483, + "y": -0.14361406862735748, + "z": -0.080442681908607483 + }, + "rotation": { + "w": 0.62027901411056519, + "x": 0.62011599540710449, + "y": 0.33941084146499634, + "z": -0.33986839652061462 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", + "velocity": { + "x": 0.0011035117786377668, + "y": 0.00049801170825958252, + "z": -1.9822968170046806e-05 + } + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:28:29Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.25 + }, + "dynamic": 0, + "id": "{fc5d6d27-52b0-4334-b60b-84c27f466f76}", + "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", + "name": "home_model_block", + "position": { + "x": 0, + "y": 0.2999267578125, + "z": 0 + }, + "queryAACube": { + "scale": 0.25980761647224426, + "x": -0.12990380823612213, + "y": 0.17002294957637787, + "z": -0.12990380823612213 + }, + "rotation": { + "w": -0.18395118415355682, + "x": -0.18451963365077972, + "y": -0.6821141242980957, + "z": 0.68325310945510864 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}", + "velocity": { + "x": 3.076787106692791e-05, + "y": 0.00042589753866195679, + "z": -0.0022651664912700653 + } + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:33:00Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.05000000074505806, + "z": 0.25 + }, + "dynamic": 0, + "id": "{fa73da33-a242-4384-9795-317caae92c29}", + "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0673828125, + "y": 0.149932861328125, + "z": 0.0480499267578125 + }, + "queryAACube": { + "scale": 0.27386128902435303, + "x": -0.069547832012176514, + "y": 0.013002216815948486, + "z": -0.088880717754364014 + }, + "rotation": { + "w": 0.88347971439361572, + "x": -0.00053799827583134174, + "y": 0.46846789121627808, + "z": -0.0010445250663906336 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", + "velocity": { + "x": 0.0007340551819652319, + "y": -0.00011105835437774658, + "z": -0.0010081863729283214 + } + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:33:00Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.25 + }, + "dynamic": 0, + "id": "{d83f649b-1dfd-4fe3-8f25-b472665ec28a}", + "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.112548828125, + "y": 0.29986572265625, + "z": 0.043243408203125 + }, + "queryAACube": { + "scale": 0.25980761647224426, + "x": -0.017354980111122131, + "y": 0.16996191442012787, + "z": -0.086660400032997131 + }, + "rotation": { + "w": 0.67243033647537231, + "x": 0.67039400339126587, + "y": -0.22182278335094452, + "z": 0.22181977331638336 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", + "velocity": { + "x": 0.0043582655489444733, + "y": 0.0005900263786315918, + "z": -0.0029577072709798813 + } + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:33:00Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "dynamic": 0, + "id": "{f1b7be87-97d7-4c28-ba77-c431c3a248a4}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0489501953125, + "y": 0.4798583984375, + "z": 0.02193450927734375 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.0056489259004592896, + "y": 0.4365571141242981, + "z": -0.02136676013469696 + }, + "rotation": { + "w": 0.049316942691802979, + "x": -0.046750579029321671, + "y": 0.70699954032897949, + "z": 0.7039417028427124 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", + "velocity": { + "x": -0.0029058775398880243, + "y": 0.00084279477596282959, + "z": -0.0020738139282912016 + } + }], + "Version": 57 +} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement4A.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement4A.json new file mode 100644 index 0000000000..df74a6aa64 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/arrangement4A.json @@ -0,0 +1,203 @@ +{ + "Entities": [ + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:33:00Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{0aba0660-0991-47ab-b4d7-9c606f553e68}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "parentID": "{9aead5f1-edb1-4e75-a5f4-a121410f2dee}", + "position": { + "x": 0.031455338001251221, + "y": -0.032536625862121582, + "z": -0.48027312755584717 + }, + "queryAACube": { + "scale": 0.25980761647224426, + "x": 1100.8177490234375, + "y": 461.0120849609375, + "z": -70.972358703613281 + }, + "rotation": { + "w": 0.0023152828216552734, + "x": -0.53879290819168091, + "y": 0.84243488311767578, + "z": -0.0008878018707036972 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:33:00Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{421d62c3-e5e5-4e51-9b14-46ce25a5cb11}", + "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", + "name": "home_model_blocky_block", + "parentID": "{9aead5f1-edb1-4e75-a5f4-a121410f2dee}", + "position": { + "x": 0.017628543078899384, + "y": -0.0010632872581481934, + "z": -0.14994476735591888 + }, + "queryAACube": { + "scale": 0.82158386707305908, + "x": 1100.5284423828125, + "y": 460.40087890625, + "z": -71.226631164550781 + }, + "rotation": { + "w": 0.70702850818634033, + "x": -0.70705664157867432, + "y": -0.010112389922142029, + "z": 0.0089319320395588875 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:28:29Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{95792255-7fa6-4936-bb51-ce2f945dd5b9}", + "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", + "name": "home_model_block", + "parentID": "{9aead5f1-edb1-4e75-a5f4-a121410f2dee}", + "position": { + "x": 0.023592084646224976, + "y": -0.084929108619689941, + "z": -0.29993364214897156 + }, + "queryAACube": { + "scale": 0.77942287921905518, + "x": 1100.482421875, + "y": 460.57196044921875, + "z": -71.256011962890625 + }, + "rotation": { + "w": -0.69225782155990601, + "x": -0.00045704841613769531, + "y": 0.00031775236129760742, + "z": 0.72165042161941528 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:33:00Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{4c3ba7ac-2122-4402-a05d-f70a32bfd9d8}", + "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", + "name": "home_model_blocky_block", + "parentID": "{9aead5f1-edb1-4e75-a5f4-a121410f2dee}", + "position": { + "x": 0.05141855776309967, + "y": 0.034773021936416626, + "z": -0.29993501305580139 + }, + "queryAACube": { + "scale": 0.77942287921905518, + "x": 1100.59814453125, + "y": 460.57192993164062, + "z": -71.214653015136719 + }, + "rotation": { + "w": 0.68213790655136108, + "x": -0.0010509714484214783, + "y": -0.00042241811752319336, + "z": 0.73122292757034302 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:30:40Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{f04a15fe-4482-44f0-8b63-46ff8aa7538c}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "parentID": "{9aead5f1-edb1-4e75-a5f4-a121410f2dee}", + "position": { + "x": 0.036200806498527527, + "y": -0.020915478467941284, + "z": -0.43993330001831055 + }, + "queryAACube": { + "scale": 0.77012991905212402, + "x": 1100.5477294921875, + "y": 460.71658325195312, + "z": -71.227401733398438 + }, + "rotation": { + "w": -0.51840746402740479, + "x": -0.47963690757751465, + "y": 0.51959860324859619, + "z": -0.48085314035415649 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "angularDamping": 0, + "angularVelocity": { + "x": 0, + "y": -0.2617993950843811, + "z": 0 + }, + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:33:00Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "id": "{9aead5f1-edb1-4e75-a5f4-a121410f2dee}", + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "queryAACube": { + "scale": 0.28722813725471497, + "x": -0.14361406862735748, + "y": -0.14361406862735748, + "z": -0.14361406862735748 + }, + "rotation": { + "w": 0.2521953284740448, + "x": 0.2517753541469574, + "y": 0.66056090593338013, + "z": -0.66080713272094727 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + } + ], + "Version": 57 +} diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement5.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement5.json new file mode 100644 index 0000000000..d04f78b106 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/arrangement5.json @@ -0,0 +1,254 @@ +{ + "Entities": [ + { + "angularVelocity": { + "x": -0.0058977864682674408, + "y": 0.012016458436846733, + "z": -0.019001182168722153 + }, + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:37:13Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "dynamic": 0, + "id": "{5dbfa65e-77f6-4646-864c-6ef99387bf21}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.118896484375, + "y": 0.261627197265625, + "z": 0.5547332763671875 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.07559521496295929, + "y": 0.21832592785358429, + "z": 0.5114319920539856 + }, + "rotation": { + "w": 0.25579428672790527, + "x": 0.659473717212677, + "y": 0.65893793106079102, + "z": 0.25586038827896118 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", + "velocity": { + "x": 0.0021444200538098812, + "y": 0.0011220350861549377, + "z": 0.0011650724336504936 + } + }, + { + "angularVelocity": { + "x": 0.0021077222190797329, + "y": 0.0096995644271373749, + "z": -0.00475650979205966 + }, + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:28:29Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.25 + }, + "dynamic": 0, + "id": "{18d0fe48-f5af-4baa-bc76-fd02b2cf507b}", + "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", + "name": "home_model_block", + "position": { + "x": 0.1376953125, + "y": 0.11163330078125, + "z": 0.54648590087890625 + }, + "queryAACube": { + "scale": 0.25980761647224426, + "x": 0.0077915042638778687, + "y": -0.018270507454872131, + "z": 0.41658210754394531 + }, + "rotation": { + "w": -0.16635751724243164, + "x": -0.16560617089271545, + "y": 0.68745934963226318, + "z": -0.68724048137664795 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:46:06Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "dynamic": 0, + "id": "{f61afc15-4813-4306-8db2-6fb9dc3baf33}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.2005615234375, + "y": 0.111602783203125, + "z": 0.3127593994140625 + }, + "queryAACube": { + "scale": 0.25670996308326721, + "x": 0.072206541895866394, + "y": -0.016752198338508606, + "z": 0.18440441787242889 + }, + "rotation": { + "w": 0.5063401460647583, + "x": 0.5066148042678833, + "y": 0.4936140775680542, + "z": -0.4932173490524292 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "angularVelocity": { + "x": 0.0085022579878568649, + "y": 8.5791980382055044e-05, + "z": -0.0055606141686439514 + }, + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:59:13Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "dynamic": 0, + "id": "{050ba484-bd34-4819-a860-776f8d865a76}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0, + "y": 0.261627197265625, + "z": 0.6636199951171875 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": -0.04330126941204071, + "y": 0.21832592785358429, + "z": 0.6203187108039856 + }, + "rotation": { + "w": -0.11174160987138748, + "x": 0.6981397271156311, + "y": 0.69834953546524048, + "z": -0.11145715415477753 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", + "velocity": { + "x": 0.00021521201415453106, + "y": 0.0007597804069519043, + "z": 0.0016687994357198477 + } + }, + { + "angularVelocity": { + "x": 0.10312929749488831, + "y": 0.02031000517308712, + "z": 0.17793627083301544 + }, + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:37:13Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "dynamic":0, + "id": "{0a801214-14b7-4059-828a-61f18250a315}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.1876220703125, + "y": 0, + "z": 0 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.14432080090045929, + "y": -0.04330126941204071, + "z": -0.04330126941204071 + }, + "rotation": { + "w": 0.38613453507423401, + "x": 0.27518847584724426, + "y": 0.11528003960847855, + "z": 0.87285858392715454 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", + "velocity": { + "x": -0.0028362239245325327, + "y": 0.0032131313346326351, + "z": 0.0032204082235693932 + } + }, + { + "angularVelocity": { + "x": 0.0060502123087644577, + "y": -0.0002331961877644062, + "z": -0.0040579927153885365 + }, + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:32:51Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.25 + }, + "dynamic": 0, + "id": "{c0abdb26-3e55-422f-811a-306239ec4894}", + "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0091552734375, + "y": 0.11163330078125, + "z": 0.663543701171875 + }, + "queryAACube": { + "scale": 0.25980761647224426, + "x": -0.12074853479862213, + "y": -0.018270507454872131, + "z": 0.53363990783691406 + }, + "rotation": { + "w": 0.38818395137786865, + "x": -0.38840728998184204, + "y": 0.5908893346786499, + "z": 0.59101837873458862 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", + "velocity": { + "x": 0.00010580161324469373, + "y": 0.00069457292556762695, + "z": 0.00075469817966222763 + } + } + ], + "Version": 57 +} diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement5B.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement5B.json new file mode 100644 index 0000000000..634f1e6858 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/arrangement5B.json @@ -0,0 +1,203 @@ +{ + "Entities": [ + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:37:13Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{e9a7eb61-bdfe-484d-963a-fdae21bc12e7}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "parentID": "{f9f90ed5-6a9e-45c1-99e2-db2ba28f12c2}", + "position": { + "x": -0.16834764182567596, + "y": 0.17657718062400818, + "z": -0.14808396995067596 + }, + "queryAACube": { + "scale": 0.25980761647224426, + "x": 1102.9293212890625, + "y": 460.51165771484375, + "z": -70.490364074707031 + }, + "rotation": { + "w": -0.72276210784912109, + "x": -0.67909777164459229, + "y": 0.11672055721282959, + "z": 0.054192394018173218 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:59:13Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{242a2da8-26e9-439f-a6bd-a5174d68b791}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "parentID": "{f9f90ed5-6a9e-45c1-99e2-db2ba28f12c2}", + "position": { + "x": 0.17733007669448853, + "y": -0.041430100798606873, + "z": -0.14965415000915527 + }, + "queryAACube": { + "scale": 0.25980761647224426, + "x": 1102.8548583984375, + "y": 460.51361083984375, + "z": -70.082504272460938 + }, + "rotation": { + "w": 0.45803076028823853, + "x": -0.54004138708114624, + "y": 0.45782959461212158, + "z": 0.53765928745269775 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:46:06Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{8d10e070-80b5-41a1-a98d-2fb60a73f98c}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "parentID": "{f9f90ed5-6a9e-45c1-99e2-db2ba28f12c2}", + "position": { + "x": -0.16358290612697601, + "y": 0.17843163013458252, + "z": 7.3954463005065918e-05 + }, + "queryAACube": { + "scale": 0.77012991905212402, + "x": 1102.6942138671875, + "y": 460.10836791992188, + "z": -70.743125915527344 + }, + "rotation": { + "w": 0.50793719291687012, + "x": -0.0007769167423248291, + "y": -0.0016511008143424988, + "z": 0.86144548654556274 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:32:51Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{96880a75-218a-485b-91d3-be9741f320ed}", + "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", + "name": "home_model_blocky_block", + "parentID": "{f9f90ed5-6a9e-45c1-99e2-db2ba28f12c2}", + "position": { + "x": 0.16807788610458374, + "y": -0.044651858508586884, + "z": 0.00034449249505996704 + }, + "queryAACube": { + "scale": 0.77942287921905518, + "x": 1102.57421875, + "y": 460.10379028320312, + "z": -70.363555908203125 + }, + "rotation": { + "w": -0.00017070770263671875, + "x": -0.68149137496948242, + "y": -0.73185545206069946, + "z": -0.0021193623542785645 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:37:13Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{0fdd72df-a5f5-4f9c-b3ec-b79bc606b356}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "parentID": "{f9f90ed5-6a9e-45c1-99e2-db2ba28f12c2}", + "position": { + "x": 0.02161325141787529, + "y": 0.0003502964973449707, + "z": -0.14994175732135773 + }, + "queryAACube": { + "scale": 0.25980761647224426, + "x": 1102.9146728515625, + "y": 460.51358032226562, + "z": -70.236610412597656 + }, + "rotation": { + "w": 0.12661613523960114, + "x": -0.68729931116104126, + "y": 0.1313164234161377, + "z": 0.70317196846008301 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "angularDamping": 0, + "angularVelocity": { + "x": 0, + "y": -0.2617993950843811, + "z": 0 + }, + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:28:29Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{f9f90ed5-6a9e-45c1-99e2-db2ba28f12c2}", + "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", + "name": "home_model_block", + "queryAACube": { + "scale": 0.25980761647224426, + "x": -0.12990380823612213, + "y": -0.12990380823612213, + "z": -0.12990380823612213 + }, + "rotation": { + "w": 0.21236260235309601, + "x": 0.20996685326099396, + "y": -0.67540425062179565, + "z": 0.67427384853363037 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + } + ], + "Version": 57 +} diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement5a.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement5a.json new file mode 100644 index 0000000000..3d12988bbc --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/arrangement5a.json @@ -0,0 +1,197 @@ +{ + "Entities": [ + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:37:13Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{e5dcde81-ec21-49cd-bfc1-47a04678d620}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.118896484375, + "y": 0.1500244140625, + "z": 0.24393463134765625 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.07559521496295929, + "y": 0.10672314465045929, + "z": 0.20063336193561554 + }, + "rotation": { + "w": 0.25630581378936768, + "x": 0.66857409477233887, + "y": 0.65368127822875977, + "z": 0.24492251873016357 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:32:51Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{ecbc77d5-b578-453c-b502-f4b7331c9088}", + "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0091552734375, + "y": 3.0517578125e-05, + "z": 0.35125732421875 + }, + "queryAACube": { + "scale": 0.25980761647224426, + "x": -0.12074853479862213, + "y": -0.12987329065799713, + "z": 0.22135351598262787 + }, + "rotation": { + "w": 0.38817429542541504, + "x": -0.38844889402389526, + "y": 0.59087514877319336, + "z": 0.59099721908569336 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:37:13Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{35d2e036-2cfa-4e62-8cb7-81beda65963d}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.2061767578125, + "y": 0.148101806640625, + "z": 0 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.16287548840045929, + "y": 0.10480053722858429, + "z": -0.04330126941204071 + }, + "rotation": { + "w": -0.034055888652801514, + "x": 0.35255527496337891, + "y": -0.041519246995449066, + "z": 0.93420767784118652 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:59:13Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{e7edf689-89c9-4daf-b5e0-38c330f34c6e}", + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0, + "y": 0.1500244140625, + "z": 0.3527984619140625 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": -0.04330126941204071, + "y": 0.10672314465045929, + "z": 0.3094971776008606 + }, + "rotation": { + "w": -0.11314564943313599, + "x": 0.69872581958770752, + "y": 0.69771873950958252, + "z": -0.11012434959411621 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:46:06Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{764c37c5-892f-41b4-8a34-8e13561726f7}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.2005615234375, + "y": 0, + "z": 0.00042724609375 + }, + "queryAACube": { + "scale": 0.25670996308326721, + "x": 0.072206541895866394, + "y": -0.12835498154163361, + "z": -0.12792773544788361 + }, + "rotation": { + "w": 0.5063401460647583, + "x": 0.5066148042678833, + "y": 0.4936140775680542, + "z": -0.4932783842086792 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:28:29Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{8b4d7620-0303-447c-815c-ed5a90ba33b3}", + "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", + "name": "home_model_block", + "position": { + "x": 0.1376953125, + "y": 3.0517578125e-05, + "z": 0.23415374755859375 + }, + "queryAACube": { + "scale": 0.25980761647224426, + "x": 0.0077915042638778687, + "y": -0.12987329065799713, + "z": 0.10424993932247162 + }, + "rotation": { + "w": -0.16896313428878784, + "x": -0.16664379835128784, + "y": 0.68758678436279297, + "z": -0.68624401092529297 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + } + ], + "Version": 57 +} diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement6.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement6.json new file mode 100644 index 0000000000..17c88e8308 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/arrangement6.json @@ -0,0 +1,238 @@ +{ + "Entities": [{ + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:32:51Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{845bc4f0-f59b-4826-9910-e92ab0a82eca}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.118896484375, + "y": 6.103515625e-05, + "z": 0.16530609130859375 + }, + "queryAACube": { + "scale": 0.25670996308326721, + "x": -0.009458497166633606, + "y": -0.12829394638538361, + "z": 0.036951109766960144 + }, + "rotation": { + "w": 0.37096202373504639, + "x": -0.37190812826156616, + "y": 0.60173952579498291, + "z": 0.60161745548248291 + }, + "dynamic": 0, + + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T21:28:38Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{1af7f363-a1e4-4f2b-94af-fc8c592769e8}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.34423828125, + "y": 0.000152587890625, + "z": 0.4805755615234375 + }, + "queryAACube": { + "scale": 0.25670996308326721, + "x": 0.21588329970836639, + "y": -0.12820239365100861, + "z": 0.35222059488296509 + }, + "rotation": { + "w": 0.66173803806304932, + "x": 0.66201269626617432, + "y": -0.24910354614257812, + "z": 0.24846267700195312 + }, + "dynamic": 0, + + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:30:40Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{f05ff17b-a9ef-4b67-9f1e-a0cdbac1d73a}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.1954345703125, + "y": 9.1552734375e-05, + "z": 0.2958984375 + }, + "queryAACube": { + "scale": 0.25670996308326721, + "x": 0.067079588770866394, + "y": -0.12826342880725861, + "z": 0.16754345595836639 + }, + "rotation": { + "w": 0.61269545555114746, + "x": 0.61297011375427246, + "y": -0.35289537906646729, + "z": 0.35259020328521729 + }, + "dynamic": 0, + + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:37:13Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "dynamic": 0, + + "id": "{d501c4f4-5ace-4337-a694-bf08230fd3ff}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.238037109375, + "y": 9.1552734375e-05, + "z": 0.35927581787109375 + }, + "queryAACube": { + "scale": 0.25670996308326721, + "x": 0.10968212783336639, + "y": -0.12826342880725861, + "z": 0.23092083632946014 + }, + "rotation": { + "w": 0.61916530132293701, + "x": -0.61983668804168701, + "y": -0.34154266119003296, + "z": -0.34023040533065796 + }, + "dynamic": 0, + + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:32:51Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{b18bd985-1db5-40cf-b53b-d8765fac9112}", + "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", + "name": "home_model_blocky_block", + "queryAACube": { + "scale": 0.27386128902435303, + "x": -0.13693064451217651, + "y": -0.13693064451217651, + "z": -0.13693064451217651 + }, + "rotation": { + "w": 0.67776000499725342, + "x": 0.67730224132537842, + "y": 0.20234990119934082, + "z": -0.20231938362121582 + }, + "dynamic": 0, + + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:30:40Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{0284ad28-9e2b-45f5-91b0-e00da9238b41}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0765380859375, + "y": 3.0517578125e-05, + "z": 0.09934234619140625 + }, + "queryAACube": { + "scale": 0.25670996308326721, + "x": -0.051816895604133606, + "y": -0.12832446396350861, + "z": -0.029012635350227356 + }, + "rotation": { + "w": 0.65304040908813477, + "x": -0.65294879674911499, + "y": -0.271351158618927, + "z": -0.271198570728302 + }, + "dynamic": 0, + + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionsWillMove": 1, + "created": "2016-05-09T19:28:29Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "dynamic": 0, + "id": "{7090697d-bf3c-4edc-9090-0ef7e313151b}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_block", + "position": { + "x": 0.4200439453125, + "y": 0.00018310546875, + "z": 0.53116607666015625 + }, + "queryAACube": { + "scale": 0.25670996308326721, + "x": 0.29168897867202759, + "y": -0.12817187607288361, + "z": 0.40281111001968384 + }, + "rotation": { + "w": 0.66921496391296387, + "x": 0.66921496391296387, + "y": -0.22810709476470947, + "z": 0.22853434085845947 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }], + "Version": 57 +} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement6B.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement6B.json new file mode 100644 index 0000000000..edced193a8 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/arrangement6B.json @@ -0,0 +1,236 @@ +{ + "Entities": [ + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:37:13Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{5692ed0d-52ae-4bd9-8ef6-13a3d28dbcec}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "parentID": "{8c29606d-b071-4793-a5d5-26453bb12bf4}", + "position": { + "x": 0.076191246509552002, + "y": -0.0050119552761316299, + "z": -4.275888204574585e-05 + }, + "queryAACube": { + "scale": 0.77012991905212402, + "x": 1104.9146728515625, + "y": 460.09011840820312, + "z": -69.708526611328125 + }, + "rotation": { + "w": -3.1195580959320068e-05, + "x": -0.99968332052230835, + "y": 0.019217833876609802, + "z": 0.0013828873634338379 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:28:29Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{41fdce7a-5c15-4335-a7d4-e6e42c419edb}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_block", + "parentID": "{8c29606d-b071-4793-a5d5-26453bb12bf4}", + "position": { + "x": 0.31622248888015747, + "y": -0.076068185269832611, + "z": -0.00023670494556427002 + }, + "queryAACube": { + "scale": 0.77012991905212402, + "x": 1104.552734375, + "y": 460.09014892578125, + "z": -69.711776733398438 + }, + "rotation": { + "w": 0.9812014102935791, + "x": 2.8990209102630615e-05, + "y": 0.00053216516971588135, + "z": -0.19223560392856598 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:30:40Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{376ea748-6b7b-4ac4-9194-b0f118ac39dd}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "parentID": "{8c29606d-b071-4793-a5d5-26453bb12bf4}", + "position": { + "x": -0.22965218126773834, + "y": 0.0041047781705856323, + "z": 0.00015974044799804688 + }, + "queryAACube": { + "scale": 0.77012991905212402, + "x": 1105.10009765625, + "y": 460.09011840820312, + "z": -69.742721557617188 + }, + "rotation": { + "w": -7.3388218879699707e-06, + "x": -0.99162417650222778, + "y": 0.1281534731388092, + "z": 0.00039628148078918457 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T21:28:38Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{d1359425-9129-4827-b881-e4802703a0ca}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "parentID": "{8c29606d-b071-4793-a5d5-26453bb12bf4}", + "position": { + "x": 0.23440317809581757, + "y": -0.035929545760154724, + "z": -0.00016139447689056396 + }, + "queryAACube": { + "scale": 0.77012991905212402, + "x": 1104.6361083984375, + "y": 460.09011840820312, + "z": -69.792564392089844 + }, + "rotation": { + "w": 0.986641526222229, + "x": -0.00016996264457702637, + "y": -0.00021627545356750488, + "z": -0.16198150813579559 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:32:51Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{11b3c61c-abe3-48ac-9033-3f88d3efee00}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "parentID": "{8c29606d-b071-4793-a5d5-26453bb12bf4}", + "position": { + "x": -0.15134727954864502, + "y": 0.00060278922319412231, + "z": 0.00011575222015380859 + }, + "queryAACube": { + "scale": 0.77012991905212402, + "x": 1104.79541015625, + "y": 460.090087890625, + "z": -69.902366638183594 + }, + "rotation": { + "w": -0.00098252296447753906, + "x": -0.030791401863098145, + "y": 0.99939167499542236, + "z": 0.0002511441707611084 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:32:51Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{15c3aeae-1166-4cff-aa53-d732f20a1203}", + "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", + "name": "home_model_blocky_block", + "parentID": "{8c29606d-b071-4793-a5d5-26453bb12bf4}", + "position": { + "x": -0.35397925972938538, + "y": 0.020401254296302795, + "z": 0.00025978684425354004 + }, + "queryAACube": { + "scale": 0.82158386707305908, + "x": 1105.195068359375, + "y": 460.06436157226562, + "z": -69.863059997558594 + }, + "rotation": { + "w": 0.68755638599395752, + "x": -0.00055142492055892944, + "y": 0.00033529102802276611, + "z": -0.72594141960144043 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "angularDamping": 0, + "angularVelocity": { + "x": 0, + "y": -0.2617993950843811, + "z": 0 + }, + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "created": "2016-05-09T19:30:40Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{8c29606d-b071-4793-a5d5-26453bb12bf4}", + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "queryAACube": { + "scale": 0.25670996308326721, + "x": -0.12835498154163361, + "y": -0.12835498154163361, + "z": -0.12835498154163361 + }, + "rotation": { + "w": 0.097722500562667847, + "x": 0.097280360758304596, + "y": 0.70029336214065552, + "z": -0.70041131973266602 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + } + ], + "Version": 57 +} diff --git a/unpublishedScripts/DomainContent/Home/blocky/blocky.js b/unpublishedScripts/DomainContent/Home/blocky/blocky.js new file mode 100644 index 0000000000..c9dc0a0678 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/blocky.js @@ -0,0 +1,227 @@ +// this script creates a pile of playable blocks and displays a target arrangement when you trigger it + +var BLOCK_RED = { + url: 'atp:/kineticObjects/blocks/planky_red.fbx', + dimensions: { + "x": 0.10000000149011612, + "y": 0.05000000074505806, + "z": 0.25 + } +}; +var BLOCK_BLUE = { + url: 'atp:/kineticObjects/blocks/planky_blue.fbx', + dimensions: { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.25 + }, +}; +var BLOCK_YELLOW = { + url: 'atp:/kineticObjects/blocks/planky_yellow.fbx', + dimensions: { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + } +}; +var BLOCK_GREEN = { + url: 'atp:/kineticObjects/blocks/planky_green.fbx', + dimensions: { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, +}; +var BLOCK_NATURAL = { + url: "atp:/kineticObjects/blocks/planky_natural.fbx", + dimensions: { + "x": 0.05, + "y": 0.05, + "z": 0.05 + } +}; + +var blocks = [ + BLOCK_RED, BLOCK_BLUE, BLOCK_YELLOW, BLOCK_GREEN, BLOCK_SMALL_CUBE +]; + +var arrangements = [{ + name: 'tall', + blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_GREEN, ], + target: Script.resolvePath("arrangement1.json") +}, { + name: 'ostrich', + blocks: [BLOCK_RED, BLOCK_RED, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_NATURAL], + target: Script.resolvePath("arrangement2.json") +}, { + name: 'froglog', + blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_GREEN, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL], + target: Script.resolvePath("arrangement3.json") +}, { + name: 'allOneLeg', + blocks: [BLOCK_RED, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_BLUE, BLOCK_BLUE, BLOCK_NATURAL], + target: Script.resolvePath("arrangement4.json") +}, { + name: 'threeppl', + blocks: [BLOCK_BLUE BLOCK_YELLOW, BLOCK_BLUE, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL], + target: Script.resolvePath("arrangement5.json") +}, { + name: 'dominoes', + blocks: [BLOCK_RED, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW], + target: Script.resolvePath("arrangement6.json") +}] + +var PLAYABLE_BLOCKS_POSITION = { + x: 1097.6, + y: 460.5, + z: -66.22 +}; + +var TARGET_BLOCKS_POSITION = { + x: 1096.82, + y: 460.5, + z: -67.689 +}; + +(function() { + //#debug + print('BLOCK ENTITY SCRIPT') + var _this; + + function Blocky() { + _this = this; + } + + Blocky.prototype = { + debug: true, + playableBlocks: [], + targetBlocks: [], + preload: function(entityID) { + print('BLOCKY preload') + this.entityID = entityID; + }, + createTargetBlocks: function(arrangement) { + var created = []; + print('BLOCKY create target blocks') + + var created = []; + var success = Clipboard.importEntities(arrangement.target); + if (success === true) { + created = Clipboard.pasteEntities(TARGET_BLOCKS_POSITION) + print('created ' + created); + } + + this.targetBlocks = created; + print('BLOCKY TARGET BLOCKS:: ' + this.targetBlocks); + }, + createPlayableBlocks: function(arrangement) { + print('BLOCKY creating playable blocks'); + arrangement.blocks.forEach(function(block) { + var blockProps = { + name: "home_model_blocky_block", + type: 'Model', + collisionSoundURL: "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + dynamic: true, + gravity: { + x: 0, + y: -9.8, + z: 0 + }, + userData: JSON.stringify({ + grabbableKey: { + grabbable: true + }, + hifiHomeKey: { + reset: true + } + }), + dimensions: block.dimensions, + modelURL: block.url, + shapeType: 'box', + velocity: { + x: 0, + y: -0.01, + z: 0, + }, + position: PLAYABLE_BLOCKS_POSITION + } + this.playableBlocks.push(Entities.addEntity(blockProps)); + + }) + }, + startNearTrigger: function() { + print('BLOCKY got a near trigger'); + this.advanceRound(); + }, + advanceRound: function() { + print('BLOCKY advance round'); + this.cleanup(); + var arrangement = arrangements[Math.floor(Math.random() * arrangements.length)]; + this.createTargetBlocks(arrangement); + + if (this.debug === true) { + this.debugCreatePlayableBlocks(); + } else { + this.createPlayableBlocks(arrangement); + + } + }, + cleanup: function() { + print('BLOCKY cleanup'); + this.targetBlocks.forEach(function(block) { + Entities.deleteEntity(block); + }); + this.playableBlocks.forEach(function(block) { + Entities.deleteEntity(block); + }); + this.targetBlocks = []; + this.playableBlocks = []; + }, + debugCreatePlayableBlocks: function() { + print('BLOCKY debug create'); + var howMany = 10; + var i; + for (i = 0; i < howMany; i++) { + var block = blocks[Math.floor(Math.random() * blocks.length)]; + var blockProps = { + name: "home_model_blocky_block", + type: 'Model', + collisionSoundURL: "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + dynamic: true, + gravity: { + x: 0, + y: -9.8, + z: 0 + }, + userData: JSON.stringify({ + grabbableKey: { + grabbable: true + }, + hifiHomeKey: { + reset: true + } + }), + dimensions: block.dimensions, + modelURL: block.url, + shapeType: 'box', + velocity: { + x: 0, + y: -0.01, + z: 0, + }, + position: PLAYABLE_BLOCKS_POSITION + } + this.playableBlocks.push(Entities.addEntity(blockProps)); + } + }, + unload: function() { + this.cleanup(); + }, + clickReleaseOnEntity: function() { + print('BLOCKY click') + this.startNearTrigger(); + } + } + + return new Blocky(); +}) \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/blocky/singleSpawner.js b/unpublishedScripts/DomainContent/Home/blocky/singleSpawner.js new file mode 100644 index 0000000000..823d9ea67a --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/singleSpawner.js @@ -0,0 +1,27 @@ +// +// +// Created by The Content Team 4/10/216 +// Copyright 2016 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 +// + +var blockyPath = Script.resolvePath('wrapper.js?'+Math.random()); +Script.include(blockyPath); +var center = Vec3.sum(Vec3.sum(MyAvatar.position, { + x: 0, + y: 0.5, + z: 0 +}), Vec3.multiply(1, Quat.getFront(Camera.getOrientation()))); +var blocky = new BlockyGame(center, { + x: 0, + y: 0, + z: 0 +}); + +Script.scriptEnding.connect(function() { + blocky.cleanup() +}) \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/blocky/wrapper.js b/unpublishedScripts/DomainContent/Home/blocky/wrapper.js new file mode 100644 index 0000000000..140c0753db --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/wrapper.js @@ -0,0 +1,61 @@ +// createPingPongGun.js +// +// Script Type: Entity Spawner +// Created by James B. Pollack on 9/30/2015 +// Copyright 2015 High Fidelity, Inc. +// +// This script creates a gun that shoots ping pong balls when you pull the trigger on a hand controller. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + + +var RESETTER_POSITION = { + x: 1098.27, + y: 460.43, + z: -66.15 +}; + +BlockyGame = function(spawnPosition, spawnRotation) { + + var scriptURL = Script.resolvePath("blocky.js?" + Math.random()); + print('SCIRPT?!?' + scriptURL) + + var blockyProps = { + type: 'Box', + name:'home_box_blocky_resetter', + color: { + red: 0, + green: 0, + blue: 255 + }, + dimensions: { + x: 0.25, + y: 0.25, + z: 0.25 + }, + script: scriptURL, + userData: JSON.stringify({ + "grabbableKey": { + "wantsTrigger": true + }, + 'hifiHomeKey': { + 'reset': true + } + }), + dynamic: false, + position: spawnPosition + }; + + var blocky = Entities.addEntity(blockyProps); + + function cleanup() { + print('BLOCKY CLEANUP!') + Entities.deleteEntity(blocky); + } + + this.cleanup = cleanup; + + print('HOME CREATED BLOCKY GAME BLOCK 1') + +} \ No newline at end of file From 7f89ded241bd3692007c1289a1f4c8f3074c5399 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 20 May 2016 16:55:12 -0700 Subject: [PATCH 14/89] add blocky --- unpublishedScripts/DomainContent/Home/blocky/blocky.js | 2 +- .../DomainContent/Home/blocky/singleSpawner.js | 2 +- unpublishedScripts/DomainContent/Home/reset.js | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/blocky/blocky.js b/unpublishedScripts/DomainContent/Home/blocky/blocky.js index c9dc0a0678..cc185b96bf 100644 --- a/unpublishedScripts/DomainContent/Home/blocky/blocky.js +++ b/unpublishedScripts/DomainContent/Home/blocky/blocky.js @@ -93,7 +93,7 @@ var TARGET_BLOCKS_POSITION = { } Blocky.prototype = { - debug: true, + debug: false, playableBlocks: [], targetBlocks: [], preload: function(entityID) { diff --git a/unpublishedScripts/DomainContent/Home/blocky/singleSpawner.js b/unpublishedScripts/DomainContent/Home/blocky/singleSpawner.js index 823d9ea67a..4bc5ddd3a9 100644 --- a/unpublishedScripts/DomainContent/Home/blocky/singleSpawner.js +++ b/unpublishedScripts/DomainContent/Home/blocky/singleSpawner.js @@ -9,7 +9,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var blockyPath = Script.resolvePath('wrapper.js?'+Math.random()); +var blockyPath = Script.resolvePath('wrapper.js'); Script.include(blockyPath); var center = Vec3.sum(Vec3.sum(MyAvatar.position, { x: 0, diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index b68486864a..84320d11ff 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -338,6 +338,12 @@ z: -0.0013 }); + var blocky = new BlockyGame({ + x: 1098.27, + y: 460.43, + z: -66.15 + }) + print('HOME after creating scripted entities') }, @@ -428,7 +434,7 @@ y: 459.5230, z: -84.3897 }); - + print('HOME after creating kinetic entities'); }, From 6bc745ee017517bc625e22685026fb7f2cef3f63 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 20 May 2016 17:05:38 -0700 Subject: [PATCH 15/89] end of day --- unpublishedScripts/DomainContent/Home/blocky/singleSpawner.js | 2 +- unpublishedScripts/DomainContent/Home/blocky/wrapper.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/blocky/singleSpawner.js b/unpublishedScripts/DomainContent/Home/blocky/singleSpawner.js index 4bc5ddd3a9..fc6650ac6a 100644 --- a/unpublishedScripts/DomainContent/Home/blocky/singleSpawner.js +++ b/unpublishedScripts/DomainContent/Home/blocky/singleSpawner.js @@ -9,7 +9,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var blockyPath = Script.resolvePath('wrapper.js'); +var blockyPath = 'atp:/blocky/wrapper.js'; Script.include(blockyPath); var center = Vec3.sum(Vec3.sum(MyAvatar.position, { x: 0, diff --git a/unpublishedScripts/DomainContent/Home/blocky/wrapper.js b/unpublishedScripts/DomainContent/Home/blocky/wrapper.js index 140c0753db..2b56b716ec 100644 --- a/unpublishedScripts/DomainContent/Home/blocky/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/blocky/wrapper.js @@ -18,8 +18,7 @@ var RESETTER_POSITION = { BlockyGame = function(spawnPosition, spawnRotation) { - var scriptURL = Script.resolvePath("blocky.js?" + Math.random()); - print('SCIRPT?!?' + scriptURL) + var scriptURL ="atp:/blocky/blocky.js"; var blockyProps = { type: 'Box', From 5211b6ad77084527724e37ab19247ee495bb2aed Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Sat, 21 May 2016 11:43:12 -0700 Subject: [PATCH 16/89] add blocky --- .../DomainContent/Home/blocky/blocky.js | 29 +++++++++++-------- .../DomainContent/Home/reset.js | 6 +++- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/blocky/blocky.js b/unpublishedScripts/DomainContent/Home/blocky/blocky.js index cc185b96bf..0c4b252a21 100644 --- a/unpublishedScripts/DomainContent/Home/blocky/blocky.js +++ b/unpublishedScripts/DomainContent/Home/blocky/blocky.js @@ -42,33 +42,33 @@ var BLOCK_NATURAL = { }; var blocks = [ - BLOCK_RED, BLOCK_BLUE, BLOCK_YELLOW, BLOCK_GREEN, BLOCK_SMALL_CUBE + BLOCK_RED, BLOCK_BLUE, BLOCK_YELLOW, BLOCK_GREEN, BLOCK_NATURAL ]; var arrangements = [{ name: 'tall', - blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_GREEN, ], - target: Script.resolvePath("arrangement1.json") + blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_GREEN], + target: "atp:/blocky/arrangement1A.json" }, { name: 'ostrich', blocks: [BLOCK_RED, BLOCK_RED, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_NATURAL], - target: Script.resolvePath("arrangement2.json") + target: "atp:/blocky/arrangement2A.json" }, { name: 'froglog', blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_GREEN, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL], - target: Script.resolvePath("arrangement3.json") + target: "atp:/blocky/arrangement3A.json" }, { name: 'allOneLeg', blocks: [BLOCK_RED, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_BLUE, BLOCK_BLUE, BLOCK_NATURAL], - target: Script.resolvePath("arrangement4.json") + target: "atp:/blocky/arrangement4A.json" }, { name: 'threeppl', - blocks: [BLOCK_BLUE BLOCK_YELLOW, BLOCK_BLUE, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL], - target: Script.resolvePath("arrangement5.json") + blocks: [BLOCK_BLUE, BLOCK_YELLOW, BLOCK_BLUE, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL], + target: "atp:/blocky/arrangement5B.json" }, { name: 'dominoes', blocks: [BLOCK_RED, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW], - target: Script.resolvePath("arrangement6.json") + target: "atp:/blocky/arrangement6B.json" }] var PLAYABLE_BLOCKS_POSITION = { @@ -115,8 +115,9 @@ var TARGET_BLOCKS_POSITION = { print('BLOCKY TARGET BLOCKS:: ' + this.targetBlocks); }, createPlayableBlocks: function(arrangement) { - print('BLOCKY creating playable blocks'); + print('BLOCKY creating playable blocks' + arrangement.blocks.length); arrangement.blocks.forEach(function(block) { + print('BLOCKY in a block loop') var blockProps = { name: "home_model_blocky_block", type: 'Model', @@ -145,9 +146,13 @@ var TARGET_BLOCKS_POSITION = { }, position: PLAYABLE_BLOCKS_POSITION } - this.playableBlocks.push(Entities.addEntity(blockProps)); - + var newBlock = Entities.addEntity(blockProps); + print('BLOCKY made a playable block' + newBlock) + _this.playableBlocks.push(newBlock); + print('BLOCKY pushing it into playable blocks'); }) + + print('BLOCKY after going through playable arrangement') }, startNearTrigger: function() { print('BLOCKY got a near trigger'); diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index 84320d11ff..bdc97fcbc6 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -43,6 +43,8 @@ var transformerPath = Script.resolvePath("atp:/dressingRoom/wrapper.js"); + var blockyPath = Script.resolvePath("atp:/blocky/wrapper.js"); + Script.include(utilsPath); Script.include(kineticPath); @@ -53,6 +55,7 @@ Script.include(cuckooClockPath); Script.include(pingPongGunPath); Script.include(transformerPath); + Script.include(blockyPath); var TRANSFORMER_URL_ROBOT = 'atp:/dressingRoom/simple_robot.fbx'; @@ -327,6 +330,7 @@ y: 179.0293, z: 89.9698 }); + print('home before cuckooClock') var cuckooClock = new MyCuckooClock({ x: 1105.5237, @@ -337,7 +341,7 @@ y: -57.0089, z: -0.0013 }); - + print('home after cuckooClock') var blocky = new BlockyGame({ x: 1098.27, y: 460.43, From 266dfcd8e941cc68e134274c7e5cb65b047d021f Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Mon, 23 May 2016 11:45:55 -0700 Subject: [PATCH 17/89] new lightswitches and cleanup old code, also more blocky stuff --- .../DomainContent/Home/blocky/blocky.js | 19 ++ .../Home/switches/livingRoomFan.js | 28 ++- .../Home/switches/livingRoomLightDown.js | 197 ------------------ .../Home/switches/livingRoomLightUp.js | 195 ----------------- ...gRoomDiscLights.js => livingRoomLights.js} | 24 ++- 5 files changed, 57 insertions(+), 406 deletions(-) delete mode 100644 unpublishedScripts/DomainContent/Home/switches/livingRoomLightDown.js delete mode 100644 unpublishedScripts/DomainContent/Home/switches/livingRoomLightUp.js rename unpublishedScripts/DomainContent/Home/switches/{livingRoomDiscLights.js => livingRoomLights.js} (91%) diff --git a/unpublishedScripts/DomainContent/Home/blocky/blocky.js b/unpublishedScripts/DomainContent/Home/blocky/blocky.js index 0c4b252a21..948ccd5e04 100644 --- a/unpublishedScripts/DomainContent/Home/blocky/blocky.js +++ b/unpublishedScripts/DomainContent/Home/blocky/blocky.js @@ -171,8 +171,27 @@ var TARGET_BLOCKS_POSITION = { } }, + findBlocks: function() { + var found = []; + var results = Entities.findEntities(this.position, 10); + results.forEach(function(result) { + var properties = Entities.getEntityProperties(result); + print('got result props') + if (properties.name.indexOf('blocky_block') > -1) { + found.push(result); + } + }); + return found; + }, + cleanup: function() { print('BLOCKY cleanup'); + var blocks = this.findBlocks(); + print('BLOCKY cleanup2') + blocks.forEach(function(block) { + Entities.deleteEntity(block); + }) + print('BLOCKY after find and delete') this.targetBlocks.forEach(function(block) { Entities.deleteEntity(block); }); diff --git a/unpublishedScripts/DomainContent/Home/switches/livingRoomFan.js b/unpublishedScripts/DomainContent/Home/switches/livingRoomFan.js index fa8d0968a0..09d0fb97c8 100644 --- a/unpublishedScripts/DomainContent/Home/switches/livingRoomFan.js +++ b/unpublishedScripts/DomainContent/Home/switches/livingRoomFan.js @@ -9,9 +9,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -(function() { - var ON_MODEL_URL="atp:/switches/fanswitch_on.fbx"; - var OFF_MODEL_URL="atp:/switches/fanswitch_off.fbx"; +(function() { var FAN_SOUND_ENTITY_NAME = "home_sfx_ceiling_fan" var SEARCH_RADIUS = 100; @@ -131,14 +129,21 @@ if (this._switch.state === 'off') { this.fanRotationOn(); this.fanSoundOn(); - + setEntityCustomData('home-switch', this.entityID, { state: 'on' }); Entities.editEntity(this.entityID, { - modelURL: ON_MODEL_URL - }); + "animation": { + "currentFrame": 1, + "firstFrame": 1, + "hold": 1, + "lastFrame": 2, + "url": "atp:/switches/fanswitch.fbx" + }, + }) + } else { this.fanRotationOff(); @@ -147,10 +152,17 @@ setEntityCustomData('home-switch', this.entityID, { state: 'off' }); - Entities.editEntity(this.entityID, { - modelURL: OFF_MODEL_URL + "animation": { + "currentFrame": 3, + "firstFrame": 3, + "hold": 1, + "lastFrame": 4, + "url": "atp:/switches/fanswitch.fbx" + }, }) + + } diff --git a/unpublishedScripts/DomainContent/Home/switches/livingRoomLightDown.js b/unpublishedScripts/DomainContent/Home/switches/livingRoomLightDown.js deleted file mode 100644 index 86c9a70716..0000000000 --- a/unpublishedScripts/DomainContent/Home/switches/livingRoomLightDown.js +++ /dev/null @@ -1,197 +0,0 @@ -// -// -// Created by The Content Team 4/10/216 -// Copyright 2016 High Fidelity, Inc. -// -// this finds lights and toggles thier visibility, and flips the emissive texture of some light models -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -(function() { - - var SEARCH_RADIUS = 100; - - var _this; - var utilitiesScript = Script.resolvePath('../utils.js'); - Script.include(utilitiesScript); - Switch = function() { - _this = this; - this.switchSound = SoundCache.getSound("atp:/switches/lamp_switch_2.wav"); - }; - - Switch.prototype = { - prefix: 'hifi-home-living-room-disc-', - clickReleaseOnEntity: function(entityID, mouseEvent) { - if (!mouseEvent.isLeftButton) { - return; - } - this.toggleLights(); - }, - - startNearTrigger: function() { - this.toggleLights(); - }, - - modelEmitOn: function(glowDisc) { - var data = { - "Metal-brushed-light.jpg": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/Metal-brushed-light.jpg", - "Tex.CeilingLight.Emit": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-On-Diffuse.jpg", - "TexCeilingLight.Diffuse": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-Base.jpg" - } - - Entities.editEntity(glowDisc, { - textures: JSON.stringify(data) - }) - }, - - modelEmitOff: function(glowDisc) { - var data = { - "Metal-brushed-light.jpg": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/Metal-brushed-light.jpg", - "Tex.CeilingLight.Emit": "", - "TexCeilingLight.Diffuse": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-Base.jpg" - } - - Entities.editEntity(glowDisc, { - textures: JSON.stringify(data) - - }) - }, - - masterLightOn: function(masterLight) { - Entities.editEntity(masterLight, { - visible: true - }); - }, - - masterLightOff: function(masterLight) { - Entities.editEntity(masterLight, { - visible: false - }); - }, - - glowLightOn: function(glowLight) { - Entities.editEntity(glowLight, { - visible: true - }); - }, - - glowLightOff: function(glowLight) { - Entities.editEntity(glowLight, { - visible: false - }); - }, - - findGlowLights: function() { - var found = []; - var results = Entities.findEntities(this.position, SEARCH_RADIUS); - results.forEach(function(result) { - var properties = Entities.getEntityProperties(result); - if (properties.name === _this.prefix + "light-glow") { - found.push(result); - } - }); - return found; - }, - - findMasterLights: function() { - var found = []; - var results = Entities.findEntities(this.position, SEARCH_RADIUS); - results.forEach(function(result) { - var properties = Entities.getEntityProperties(result); - if (properties.name === _this.prefix + "light-master") { - found.push(result); - } - }); - return found; - }, - - findEmitModels: function() { - var found = []; - var results = Entities.findEntities(this.position, SEARCH_RADIUS); - results.forEach(function(result) { - var properties = Entities.getEntityProperties(result); - if (properties.name === _this.prefix + "light-model") { - found.push(result); - } - }); - return found; - }, - - findSwitch: function() { - var found = []; - var results = Entities.findEntities(this.position, SEARCH_RADIUS); - results.forEach(function(result) { - var properties = Entities.getEntityProperties(result); - if (properties.name === "hifi-home-living-room-light-switch-up") { - found.push(result); - } - }); - return found; - }, - - toggleLights: function() { - - var glowLights = this.findGlowLights(); - var masterLights = this.findMasterLights(); - var emitModels = this.findEmitModels(); - - glowLights.forEach(function(glowLight) { - // _this.glowLightOff(glowLight); - }); - - masterLights.forEach(function(masterLight) { - _this.masterLightOff(masterLight); - }); - - emitModels.forEach(function(emitModel) { - _this.modelEmitOff(emitModel); - }); - - - Audio.playSound(this.switchSound, { - volume: 0.5, - position: this.position - }); - - Entities.editEntity(this.entityID, { - position: { - x: 1103.9894, - y: 460.6867, - z: -75.5650 - } - }); - - - var otherSwitch = this.findSwitch(); - - print('other switch:: ' + otherSwitch) - - - var success = Entities.editEntity(otherSwitch.toString(), { - position: { - x: 1103.5823, - y: 460.6867, - z: -75.6313 - } - }) - print('edit success ' + success) - }, - - preload: function(entityID) { - this.entityID = entityID; - setEntityCustomData('grabbableKey', this.entityID, { - wantsTrigger: true - }); - - var properties = Entities.getEntityProperties(this.entityID); - - //The light switch is static, so just cache its position once - this.position = Entities.getEntityProperties(this.entityID, "position").position; - } - }; - - // entity scripts always need to return a newly constructed object of our type - return new Switch(); -}); \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/switches/livingRoomLightUp.js b/unpublishedScripts/DomainContent/Home/switches/livingRoomLightUp.js deleted file mode 100644 index 1be08a6fec..0000000000 --- a/unpublishedScripts/DomainContent/Home/switches/livingRoomLightUp.js +++ /dev/null @@ -1,195 +0,0 @@ -// -// -// Created by The Content Team 4/10/216 -// Copyright 2016 High Fidelity, Inc. -// -// this finds lights and toggles thier visibility, and flips the emissive texture of some light models -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -(function() { - - var SEARCH_RADIUS = 100; - - var _this; - var utilitiesScript = Script.resolvePath('../utils.js'); - Script.include(utilitiesScript); - Switch = function() { - _this = this; - this.switchSound = SoundCache.getSound("atp:/switches/lamp_switch_2.wav"); - }; - - Switch.prototype = { - prefix: 'hifi-home-living-room-disc-', - clickReleaseOnEntity: function(entityID, mouseEvent) { - if (!mouseEvent.isLeftButton) { - return; - } - this.toggleLights(); - }, - - startNearTrigger: function() { - this.toggleLights(); - }, - - modelEmitOn: function(glowDisc) { - var data = { - "Metal-brushed-light.jpg": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/Metal-brushed-light.jpg", - "Tex.CeilingLight.Emit": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-On-Diffuse.jpg", - "TexCeilingLight.Diffuse": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-Base.jpg" - } - - Entities.editEntity(glowDisc, { - textures: JSON.stringify(data) - }) - }, - - modelEmitOff: function(glowDisc) { - var data = { - "Metal-brushed-light.jpg": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/Metal-brushed-light.jpg", - "Tex.CeilingLight.Emit": "", - "TexCeilingLight.Diffuse": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-Base.jpg" - } - - Entities.editEntity(glowDisc, { - textures: JSON.stringify(data) - - }) - }, - - masterLightOn: function(masterLight) { - Entities.editEntity(masterLight, { - visible: true - }); - }, - - masterLightOff: function(masterLight) { - Entities.editEntity(masterLight, { - visible: false - }); - }, - - glowLightOn: function(glowLight) { - Entities.editEntity(glowLight, { - visible: true - }); - }, - - glowLightOff: function(glowLight) { - Entities.editEntity(glowLight, { - visible: false - }); - }, - - findGlowLights: function() { - var found = []; - var results = Entities.findEntities(this.position, SEARCH_RADIUS); - results.forEach(function(result) { - var properties = Entities.getEntityProperties(result); - if (properties.name === _this.prefix + "light-glow") { - found.push(result); - } - }); - return found; - }, - - findMasterLights: function() { - var found = []; - var results = Entities.findEntities(this.position, SEARCH_RADIUS); - results.forEach(function(result) { - var properties = Entities.getEntityProperties(result); - if (properties.name === _this.prefix + "light-master") { - found.push(result); - } - }); - return found; - }, - - findEmitModels: function() { - var found = []; - var results = Entities.findEntities(this.position, SEARCH_RADIUS); - results.forEach(function(result) { - var properties = Entities.getEntityProperties(result); - if (properties.name === _this.prefix + "light-model") { - found.push(result); - } - }); - return found; - }, - - findSwitch: function() { - var found = []; - var results = Entities.findEntities(this.position, SEARCH_RADIUS); - results.forEach(function(result) { - var properties = Entities.getEntityProperties(result); - if (properties.name === "hifi-home-living-room-light-switch-down") { - found.push(result); - } - }); - return found; - }, - - toggleLights: function() { - - var glowLights = this.findGlowLights(); - var masterLights = this.findMasterLights(); - var emitModels = this.findEmitModels(); - - glowLights.forEach(function(glowLight) { - // _this.glowLightOff(glowLight); - }); - - masterLights.forEach(function(masterLight) { - _this.masterLightOff(masterLight); - }); - - emitModels.forEach(function(emitModel) { - _this.modelEmitOff(emitModel); - }); - - - Audio.playSound(this.switchSound, { - volume: 0.5, - position: this.position - }); - - Entities.editEntity(this.entityID, { - position: { - x: 1103.9894, - y: 460.6867, - z: -75.5650 - } - }); - - var otherSwitch = this.findSwitch(); - - print('other switch:: ' + otherSwitch) - - var success = Entities.editEntity(otherSwitch.toString(), { - position: { - x: 1103.5823, - y: 460.6867, - z: -75.6313 - } - }) - print('edit success ' + success) - }, - - preload: function(entityID) { - this.entityID = entityID; - setEntityCustomData('grabbableKey', this.entityID, { - wantsTrigger: true - }); - - var properties = Entities.getEntityProperties(this.entityID); - - //The light switch is static, so just cache its position once - this.position = Entities.getEntityProperties(this.entityID, "position").position; - } - }; - - // entity scripts always need to return a newly constructed object of our type - return new Switch(); -}); \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/switches/livingRoomDiscLights.js b/unpublishedScripts/DomainContent/Home/switches/livingRoomLights.js similarity index 91% rename from unpublishedScripts/DomainContent/Home/switches/livingRoomDiscLights.js rename to unpublishedScripts/DomainContent/Home/switches/livingRoomLights.js index 6fb2ea538a..2c6208481f 100644 --- a/unpublishedScripts/DomainContent/Home/switches/livingRoomDiscLights.js +++ b/unpublishedScripts/DomainContent/Home/switches/livingRoomLights.js @@ -10,8 +10,7 @@ // (function() { - var ON_MODEL_URL = "atp:/switches/lightswitch_on.fbx"; - var OFF_MODEL_URL = "atp:/switches/lightswitch_off.fbx"; + var SEARCH_RADIUS = 100; var _this; @@ -40,7 +39,7 @@ "Metal-brushed-light.jpg": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/Metal-brushed-light.jpg", "Tex.CeilingLight.Emit": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-On-Diffuse.jpg", "TexCeilingLight.Diffuse": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-Base.jpg" - } + }; Entities.editEntity(glowDisc, { textures: JSON.stringify(data) @@ -52,7 +51,7 @@ "Metal-brushed-light.jpg": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/Metal-brushed-light.jpg", "Tex.CeilingLight.Emit": "", "TexCeilingLight.Diffuse": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-Base.jpg" - } + }; Entities.editEntity(glowDisc, { textures: JSON.stringify(data) @@ -143,8 +142,15 @@ setEntityCustomData('home-switch', _this.entityID, { state: 'on' }); + Entities.editEntity(this.entityID, { - modelURL: ON_MODEL_URL + "animation": { + "currentFrame": 1, + "firstFrame": 1, + "hold": 1, + "lastFrame": 2, + "url": "atp:/switches/lightswitch.fbx" + }, }); } else { @@ -162,7 +168,13 @@ }); Entities.editEntity(this.entityID, { - modelURL: OFF_MODEL_URL + "animation": { + "currentFrame": 3, + "firstFrame": 3, + "hold": 1, + "lastFrame": 4, + "url": "atp:/switches/lightswitch.fbx" + }, }); } From 7cf56401f5ccd1a80792b0393943bdacd87d6624 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Mon, 23 May 2016 15:05:44 -0700 Subject: [PATCH 18/89] teleport sparkles, dressing room switch --- ...oomDiscLights.js => dressingRoomLights.js} | 34 ++++++---- .../Home/teleport/downsparkle.json | 65 +++++++++++++++++++ .../Home/teleport/downsparkler.json | 63 ++++++++++++++++++ .../Home/teleport/upsparkle.json | 63 ++++++++++++++++++ .../Home/teleport/upsparkler.json | 44 +++++++++++++ 5 files changed, 255 insertions(+), 14 deletions(-) rename unpublishedScripts/DomainContent/Home/switches/{dressingRoomDiscLights.js => dressingRoomLights.js} (89%) create mode 100644 unpublishedScripts/DomainContent/Home/teleport/downsparkle.json create mode 100644 unpublishedScripts/DomainContent/Home/teleport/downsparkler.json create mode 100644 unpublishedScripts/DomainContent/Home/teleport/upsparkle.json create mode 100644 unpublishedScripts/DomainContent/Home/teleport/upsparkler.json diff --git a/unpublishedScripts/DomainContent/Home/switches/dressingRoomDiscLights.js b/unpublishedScripts/DomainContent/Home/switches/dressingRoomLights.js similarity index 89% rename from unpublishedScripts/DomainContent/Home/switches/dressingRoomDiscLights.js rename to unpublishedScripts/DomainContent/Home/switches/dressingRoomLights.js index 6e2c4908b9..a44fa8f2f3 100644 --- a/unpublishedScripts/DomainContent/Home/switches/dressingRoomDiscLights.js +++ b/unpublishedScripts/DomainContent/Home/switches/dressingRoomLights.js @@ -147,6 +147,16 @@ setEntityCustomData('home-switch', _this.entityID, { state: 'on' }); + + Entities.editEntity(this.entityID, { + "animation": { + "currentFrame": 1, + "firstFrame": 1, + "hold": 1, + "lastFrame": 2, + "url": "atp:/switches/lightswitch.fbx" + }, + }); } else { glowLights.forEach(function(glowLight) { @@ -161,9 +171,18 @@ setEntityCustomData('home-switch', this.entityID, { state: 'off' }); + + Entities.editEntity(this.entityID, { + "animation": { + "currentFrame": 3, + "firstFrame": 3, + "hold": 1, + "lastFrame": 4, + "url": "atp:/switches/lightswitch.fbx" + }, + }); } - this.flipSwitch(); Audio.playSound(this.switchSound, { volume: 0.5, position: this.position @@ -171,20 +190,7 @@ }, - flipSwitch: function() { - var rotation = Entities.getEntityProperties(this.entityID, "rotation").rotation; - var axis = { - x: 0, - y: 1, - z: 0 - }; - var dQ = Quat.angleAxis(180, axis); - rotation = Quat.multiply(rotation, dQ); - Entities.editEntity(this.entityID, { - rotation: rotation - }); - }, preload: function(entityID) { this.entityID = entityID; diff --git a/unpublishedScripts/DomainContent/Home/teleport/downsparkle.json b/unpublishedScripts/DomainContent/Home/teleport/downsparkle.json new file mode 100644 index 0000000000..8682a4ed4c --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/teleport/downsparkle.json @@ -0,0 +1,65 @@ +down sparkle + +{ + "color": { + "red": "#", + "green": "c", + "blue": "f" + }, + "isEmitting": 1, + "maxParticles": 1000, + "lifespan": 2, + "emitRate": 10, + "emitSpeed": 0.1, + "speedSpread": 0.6, + "emitOrientation": { + "x": 0.8, + "y": 0, + "z": 0, + "w": 0.7071068286895752 + }, + "emitDimensions": { + "x": 0, + "y": 0, + "z": 0 + }, + "polarStart": 0, + "polarFinish": 0, + "azimuthStart": -3.1415927410125732, + "azimuthFinish": 3.1415927410125732, + "emitAcceleration": { + "x": 0, + "y": -1, + "z": 0 + }, + "accelerationSpread": { + "x": 0, + "y": 1, + "z": 0 + }, + "particleRadius": 0.02500000037252903, + "radiusSpread": 0, + "radiusStart": 0.079, + "radiusFinish": 0.053, + "colorSpread": { + "red": "#", + "green": "e", + "blue": "8" + }, + "colorStart": { + "red": 255, + "green": 255, + "blue": 255 + }, + "colorFinish": { + "red": "#", + "green": "d", + "blue": "4" + }, + "alpha": 1, + "alphaSpread": 0, + "alphaStart": 1, + "alphaFinish": 0, + "emitterShouldTrail": 1, + "textures": "atp:/teleport/sparkle1.png" +} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/teleport/downsparkler.json b/unpublishedScripts/DomainContent/Home/teleport/downsparkler.json new file mode 100644 index 0000000000..09ec79910a --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/teleport/downsparkler.json @@ -0,0 +1,63 @@ +{ + "Entities": [ + { + "accelerationSpread": { + "x": 0, + "y": 1, + "z": 0 + }, + "color": { + "blue": 207, + "green": 207, + "red": 207 + }, + "colorFinish": { + "blue": 207, + "green": 207, + "red": 207 + }, + "colorSpread": { + "blue": 125, + "green": 125, + "red": 232 + }, + "colorStart": { + "blue": 207, + "green": 207, + "red": 207 + }, + "created": "2016-05-23T20:41:38Z", + "dimensions": { + "x": 2.6566545963287354, + "y": 2.6566545963287354, + "z": 2.6566545963287354 + }, + "emitAcceleration": { + "x": 0, + "y": -1, + "z": 0 + }, + "emitOrientation": { + "w": 0.66226339340209961, + "x": 0.74927115440368652, + "y": -1.5258940038620494e-05, + "z": -1.5258940038620494e-05 + }, + "emitRate": 10, + "emitSpeed": 0.10000000149011612, + "id": "{e700e0a1-026a-4ebd-8609-6068b32df14e}", + "lifespan": 2, + "name": "home_particle_teleport_sparkle_down", + "queryAACube": { + "scale": 4.6014609336853027, + "x": -2.3007304668426514, + "y": -2.3007304668426514, + "z": -2.3007304668426514 + }, + "speedSpread": 0.60000002384185791, + "textures": "atp:/teleport/sparkle1.png", + "type": "ParticleEffect" + } + ], + "Version": 57 +} diff --git a/unpublishedScripts/DomainContent/Home/teleport/upsparkle.json b/unpublishedScripts/DomainContent/Home/teleport/upsparkle.json new file mode 100644 index 0000000000..508366d293 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/teleport/upsparkle.json @@ -0,0 +1,63 @@ +{ + "color": { + "red": 255, + "green": 255, + "blue": 255 + }, + "isEmitting": 1, + "maxParticles": 210, + "lifespan": 3.6, + "emitRate": 11, + "emitSpeed": 0.5, + "speedSpread": 0.8, + "emitOrientation": { + "x": -1, + "y": -0.0000152587890625, + "z": -0.0000152587890625, + "w": 1 + }, + "emitDimensions": { + "x": 0, + "y": 0, + "z": 0 + }, + "polarStart": 0, + "polarFinish": 0, + "azimuthStart": -3.1415927410125732, + "azimuthFinish": 3.1415927410125732, + "emitAcceleration": { + "x": 0, + "y": 0.2, + "z": 0 + }, + "accelerationSpread": { + "x": 0, + "y": 0.30000000000000004, + "z": 0 + }, + "particleRadius": 0.02500000037252903, + "radiusSpread": 0, + "radiusStart": 0.013, + "radiusFinish": 0.014, + "colorSpread": { + "red": 0, + "green": 0, + "blue": 0 + }, + "colorStart": { + "red": 255, + "green": 255, + "blue": 255 + }, + "colorFinish": { + "red": 255, + "green": 255, + "blue": 255 + }, + "alpha": 1, + "alphaSpread": 0, + "alphaStart": 1, + "alphaFinish": 0, + "emitterShouldTrail": 0, + "textures": "atp:/teleport/sparkle2.png" +} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/teleport/upsparkler.json b/unpublishedScripts/DomainContent/Home/teleport/upsparkler.json new file mode 100644 index 0000000000..a573b3deae --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/teleport/upsparkler.json @@ -0,0 +1,44 @@ +{ + "Entities": [ + { + "accelerationSpread": { + "x": 0, + "y": 0.30000001192092896, + "z": 0 + }, + "created": "2016-05-23T20:56:55Z", + "dimensions": { + "x": 15.000479698181152, + "y": 15.000479698181152, + "z": 15.000479698181152 + }, + "emitAcceleration": { + "x": 0, + "y": 0.20000000298023224, + "z": 0 + }, + "emitOrientation": { + "w": 0.7070763111114502, + "x": -0.70713728666305542, + "y": -1.5258539860951714e-05, + "z": -1.5258539860951714e-05 + }, + "emitRate": 11, + "emitSpeed": 0.5, + "id": "{57104b1c-01a9-4f2b-b7bf-9eb406e8d78b}", + "lifespan": 3.5999999046325684, + "maxParticles": 210, + "name": "home_teleport_sparkler_up", + "queryAACube": { + "scale": 25.981592178344727, + "x": -12.990796089172363, + "y": -12.990796089172363, + "z": -12.990796089172363 + }, + "speedSpread": 0.80000001192092896, + "textures": "atp:/teleport/sparkle2.png", + "type": "ParticleEffect" + } + ], + "Version": 57 +} From fafea941969c5e767d93827859d362c24ed28665 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Mon, 23 May 2016 16:48:21 -0700 Subject: [PATCH 19/89] new blocky, delete old files --- .../Home/blocky/arrangement1.json | 103 ------ .../Home/blocky/arrangement1A.json | 104 ------ .../Home/blocky/arrangement2.json | 179 ---------- .../Home/blocky/arrangement2A.json | 174 ---------- .../Home/blocky/arrangement3.json | 311 ------------------ .../Home/blocky/arrangement3A.json | 229 ------------- .../Home/blocky/arrangement4.json | 232 ------------- .../Home/blocky/arrangement4A.json | 203 ------------ .../Home/blocky/arrangement5.json | 254 -------------- .../Home/blocky/arrangement5B.json | 203 ------------ .../Home/blocky/arrangement5a.json | 197 ----------- .../Home/blocky/arrangement6.json | 238 -------------- .../DomainContent/Home/blocky/blocky.js | 36 +- .../DomainContent/Home/blocky/newblocks1.json | 136 ++++++++ .../DomainContent/Home/blocky/newblocks2.json | 107 ++++++ .../DomainContent/Home/blocky/newblocks3.json | 277 ++++++++++++++++ .../DomainContent/Home/blocky/newblocks4.json | 277 ++++++++++++++++ .../DomainContent/Home/blocky/newblocks5.json | 175 ++++++++++ 18 files changed, 991 insertions(+), 2444 deletions(-) delete mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement1.json delete mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement1A.json delete mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement2.json delete mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement2A.json delete mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement3.json delete mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement3A.json delete mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement4.json delete mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement4A.json delete mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement5.json delete mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement5B.json delete mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement5a.json delete mode 100644 unpublishedScripts/DomainContent/Home/blocky/arrangement6.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/newblocks1.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/newblocks2.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/newblocks3.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/newblocks4.json create mode 100644 unpublishedScripts/DomainContent/Home/blocky/newblocks5.json diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement1.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement1.json deleted file mode 100644 index 754db172b6..0000000000 --- a/unpublishedScripts/DomainContent/Home/blocky/arrangement1.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "Entities": [{ - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:46:06Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "dynamic": 0, - "id": "{e4fd5fc4-10b9-4d84-b6ba-b732cc7de7b7}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.0147705078125, - "y": 0.5, - "z": 0 - }, - "queryAACube": { - "scale": 0.28722813725471497, - "x": -0.12884356081485748, - "y": 0.35638594627380371, - "z": -0.14361406862735748 - }, - "rotation": { - "w": -0.31651788949966431, - "x": -0.31587702035903931, - "y": -0.63225758075714111, - "z": 0.63265430927276611 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:46:06Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "dynamic": 0, - "id": "{1e310b85-7823-414b-8448-4435e056c07a}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0, - "y": 0, - "z": 0.0084075927734375 - }, - "queryAACube": { - "scale": 0.28722813725471497, - "x": -0.14361406862735748, - "y": -0.14361406862735748, - "z": -0.13520647585391998 - }, - "rotation": { - "w": 0.34120702743530273, - "x": -0.34154266119003296, - "y": 0.61931788921356201, - "z": 0.61916530132293701 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:28:38Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "dynamic": 0, - "id": "{1f07cd0e-f9d1-46f3-b71a-ad7127d1a0b0}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.0155029296875, - "y": 0.25, - "z": 0.0084686279296875 - }, - "queryAACube": { - "scale": 0.28722813725471497, - "x": -0.12811113893985748, - "y": 0.10638593137264252, - "z": -0.13514544069766998 - }, - "rotation": { - "w": 0.62478065490722656, - "x": -0.62526893615722656, - "y": -0.33089190721511841, - "z": -0.33040362596511841 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }], - "Version": 57 -} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement1A.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement1A.json deleted file mode 100644 index 2d224c7d0a..0000000000 --- a/unpublishedScripts/DomainContent/Home/blocky/arrangement1A.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "Entities": [ - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:28:38Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "id": "{061cfb78-aece-414a-a56b-a83df3d3c188}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_blocky_block", - "parentID": "{adc9842c-db50-4bbf-8d90-8c12e5ad59ac}", - "position": { - "x": -0.0069605633616447449, - "y": -0.0044899135828018188, - "z": 0.24996849894523621 - }, - "queryAACube": { - "scale": 0.86168444156646729, - "x": 1098.883544921875, - "y": 460.20965576171875, - "z": -69.462593078613281 - }, - "rotation": { - "w": -6.8545341491699219e-05, - "x": -0.022976815700531006, - "y": 0.9996645450592041, - "z": 0.00011834502220153809 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:46:06Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "id": "{526b3076-78eb-438d-8566-ae0d0599029c}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_blocky_block", - "parentID": "{adc9842c-db50-4bbf-8d90-8c12e5ad59ac}", - "position": { - "x": 0.0026676803827285767, - "y": -0.016830384731292725, - "z": 0.4999808669090271 - }, - "queryAACube": { - "scale": 0.86168444156646729, - "x": 1098.8680419921875, - "y": 459.95965576171875, - "z": -69.462570190429688 - }, - "rotation": { - "w": 3.6507844924926758e-05, - "x": 0.99916994571685791, - "y": 0.040203869342803955, - "z": -0.0002717822790145874 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "angularDamping": 0, - "angularVelocity": { - "x": 0, - "y": 0.52359879016876221, - "z": 0 - }, - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:46:06Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "id": "{adc9842c-db50-4bbf-8d90-8c12e5ad59ac}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_blocky_block", - "queryAACube": { - "scale": 0.28722813725471497, - "x": -0.14361406862735748, - "y": -0.14361406862735748, - "z": -0.14361406862735748 - }, - "rotation": { - "w": -0.69973748922348022, - "x": -0.69991332292556763, - "y": 0.10158070176839828, - "z": -0.10084760189056396 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - } - ], - "Version": 57 -} diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement2.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement2.json deleted file mode 100644 index 2a47e2c5d4..0000000000 --- a/unpublishedScripts/DomainContent/Home/blocky/arrangement2.json +++ /dev/null @@ -1,179 +0,0 @@ -{ - "Entities": [{ - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:46:06Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "dynamic": 0, - "id": "{e4fd5fc4-10b9-4d84-b6ba-b732cc7de7b7}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.0531005859375, - "y": 0.17498779296875, - "z": 0.10013580322265625 - }, - "queryAACube": { - "scale": 0.28722813725471497, - "x": -0.090513482689857483, - "y": 0.031373724341392517, - "z": -0.043478265404701233 - }, - "rotation": { - "w": 0.70144569873809814, - "x": 0.089502327144145966, - "y": 0.089585684239864349, - "z": 0.70138269662857056 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:28:38Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "dynamic": 0, - "id": "{82c627f6-d296-4ee9-9206-56aa06846013}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.0238037109375, - "y": 0.5, - "z": 0 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": -0.01949755847454071, - "y": 0.4566987156867981, - "z": -0.04330126941204071 - }, - "rotation": { - "w": 0.00020232143288012594, - "x": 0.89600801467895508, - "y": 0.00046253428445197642, - "z": 0.44403755664825439 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", - "velocity": { - "x": -0.007318682037293911, - "y": -0.0010040029883384705, - "z": -9.1018431703560054e-05 - } - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:33:00Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 0, - "id": "{c07b3366-9fb2-4192-a2aa-963bbfa46de1}", - "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0, - "y": 0, - "z": 0.11705780029296875 - }, - "queryAACube": { - "scale": 0.27386128902435303, - "x": -0.13693064451217651, - "y": -0.13693064451217651, - "z": -0.019872844219207764 - }, - "rotation": { - "w": 0.52331775426864624, - "x": -0.52310466766357422, - "y": -0.47588011622428894, - "z": -0.47543454170227051 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:46:06Z", - "dimensions": { - "x": 0.029999999329447746, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 0, - "id": "{1fa9f95d-b040-4d52-8c50-6ceaaf794bba}", - "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.024658203125, - "y": 0.3499755859375, - "z": 0.00504302978515625 - }, - "queryAACube": { - "scale": 0.25670996308326721, - "x": -0.10369677841663361, - "y": 0.22162060439586639, - "z": -0.12331195175647736 - }, - "rotation": { - "w": 0.69705569744110107, - "x": 0.69662469625473022, - "y": 0.11998884379863739, - "z": -0.12012538313865662 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", - "velocity": { - "x": -0.0049706185236573219, - "y": 0.0010576546192169189, - "z": 0.00093202776042744517 - } - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:28:29Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 0, - "id": "{02fb5b0d-17cb-44b2-ad41-9dbe24bcd606}", - "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", - "name": "home_model_block", - "position": { - "x": 0.1104736328125, - "y": 0, - "z": 0.097320556640625 - }, - "queryAACube": { - "scale": 0.27386128902435303, - "x": -0.026457011699676514, - "y": -0.13693064451217651, - "z": -0.039610087871551514 - }, - "rotation": { - "w": 0.58954423666000366, - "x": 0.58955228328704834, - "y": -0.39041024446487427, - "z": 0.39044272899627686 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }], - "Version": 57 -} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement2A.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement2A.json deleted file mode 100644 index 42ae9059ac..0000000000 --- a/unpublishedScripts/DomainContent/Home/blocky/arrangement2A.json +++ /dev/null @@ -1,174 +0,0 @@ -{ - "Entities": [ - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T19:28:29Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{c170eefd-bd60-4d6b-a475-9c084f1c2de0}", - "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", - "name": "home_model_block", - "parentID": "{505fe8c9-4678-43ac-9eaf-c8327c08b02a}", - "position": { - "x": 0.13519594073295593, - "y": 0.49943554401397705, - "z": 0.017574317753314972 - }, - "queryAACube": { - "scale": 0.82158386707305908, - "x": 1099.1766357421875, - "y": 460.05300903320312, - "z": -69.957748413085938 - }, - "rotation": { - "w": 0.7015533447265625, - "x": -0.70165455341339111, - "y": 0.08770480751991272, - "z": 0.088382631540298462 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:33:00Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{336bdac8-0229-460d-a9be-38efbc8b7e1f}", - "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", - "name": "home_model_blocky_block", - "parentID": "{505fe8c9-4678-43ac-9eaf-c8327c08b02a}", - "position": { - "x": 0.083991743624210358, - "y": 0.49937903881072998, - "z": -0.082286134362220764 - }, - "queryAACube": { - "scale": 0.82158386707305908, - "x": 1099.06591796875, - "y": 460.05300903320312, - "z": -69.939018249511719 - }, - "rotation": { - "w": -0.6799309253692627, - "x": -0.68009138107299805, - "y": -0.19405338168144226, - "z": 0.19368152320384979 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:46:06Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "id": "{3ba19cc0-2572-4f42-9c21-1d9da982855c}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_blocky_block", - "parentID": "{505fe8c9-4678-43ac-9eaf-c8327c08b02a}", - "position": { - "x": 0.10286395996809006, - "y": 0.32441270351409912, - "z": -0.029775351285934448 - }, - "queryAACube": { - "scale": 0.86168444156646729, - "x": 1099.0992431640625, - "y": 460.20794677734375, - "z": -69.975509643554688 - }, - "rotation": { - "w": 0.39181840419769287, - "x": -0.58902782201766968, - "y": 0.58839577436447144, - "z": -0.39155444502830505 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:46:06Z", - "dimensions": { - "x": 0.029999999329447746, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{7b4e39a0-2e4b-49da-a9c0-18bca0adb568}", - "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", - "name": "home_model_blocky_block", - "parentID": "{505fe8c9-4678-43ac-9eaf-c8327c08b02a}", - "position": { - "x": 0.0086878137663006783, - "y": 0.14853793382644653, - "z": 0.00078312074765563011 - }, - "queryAACube": { - "scale": 0.77012991905212402, - "x": 1099.113037109375, - "y": 460.42950439453125, - "z": -70.023597717285156 - }, - "rotation": { - "w": 0.57103759050369263, - "x": -0.57109135389328003, - "y": -0.41725897789001465, - "z": -0.41673195362091064 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", - "velocity": { - "x": -0.0010035448940470815, - "y": 0.00021353544434532523, - "z": 0.00018817203817889094 - } - }, - { - "angularDamping": 0, - "angularVelocity": { - "x": 0, - "y": 0.2617993950843811, - "z": 0 - }, - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:28:38Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "id": "{505fe8c9-4678-43ac-9eaf-c8327c08b02a}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "queryAACube": { - "scale": 0.086602538824081421, - "x": -0.04330126941204071, - "y": -0.04330126941204071, - "z": -0.04330126941204071 - }, - "rotation": { - "w": 0.00035001290962100029, - "x": 0.68673843145370483, - "y": 0.0003638292255345732, - "z": 0.72690451145172119 - }, - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":false},\"hifiHomeKey\":{\"reset\":true}}" - } - ], - "Version": 57 -} diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement3.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement3.json deleted file mode 100644 index 990656eacd..0000000000 --- a/unpublishedScripts/DomainContent/Home/blocky/arrangement3.json +++ /dev/null @@ -1,311 +0,0 @@ -{ - "Entities": [{ - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:28:29Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "dynamic": 0, - "id": "{099ee4ce-8cef-4885-b1a5-46c4efc9ec6d}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_block", - "position": { - "x": 0.0489501953125, - "y": 0.074981689453125, - "z": 0.1115264892578125 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.0056489259004592896, - "y": 0.03168042004108429, - "z": 0.06822521984577179 - }, - "rotation": { - "w": 0.28857278823852539, - "x": 0.28886386752128601, - "y": -0.64528524875640869, - "z": 0.64567047357559204 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}", - "velocity": { - "x": -7.4302828579675406e-05, - "y": 0.0010566487908363342, - "z": -0.00053769041551277041 - } - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:30:40Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "dynamic": 0, - "id": "{83e6f44b-7444-4377-a89e-439a034e6cd3}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.18896484375, - "y": 0.075103759765625, - "z": 0.31917572021484375 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.14566357433795929, - "y": 0.03180249035358429, - "z": 0.27587443590164185 - }, - "rotation": { - "w": 0.00027349172160029411, - "x": 0.89839118719100952, - "y": 0.0002214395790360868, - "z": -0.43919605016708374 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", - "velocity": { - "x": 0.00010077288607135415, - "y": 0.0014465302228927612, - "z": 2.9299229936441407e-05 - } - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:35:02Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "dynamic": 0, - "id": "{44f920b7-a2ba-4e65-a30a-27bc127f4570}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.121337890625, - "y": 0.075042724609375, - "z": 0.225860595703125 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.07803662121295929, - "y": 0.03174145519733429, - "z": 0.18255932629108429 - }, - "rotation": { - "w": 0.55899232625961304, - "x": -0.43351781368255615, - "y": 0.4330800473690033, - "z": -0.55859774351119995 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:33:00Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "dynamic": 0, - "id": "{f1b7be87-97d7-4c28-ba77-c431c3a248a4}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.2723388671875, - "y": 0.07513427734375, - "z": 0.44538116455078125 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.22903759777545929, - "y": 0.03183300793170929, - "z": 0.40207988023757935 - }, - "rotation": { - "w": 0.098181776702404022, - "x": 0.70029288530349731, - "y": 0.70022231340408325, - "z": 0.098178565502166748 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:28:38Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "dynamic": 0, - "id": "{82c627f6-d296-4ee9-9206-56aa06846013}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.327392578125, - "y": 0.07513427734375, - "z": 0.52436065673828125 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.2840912938117981, - "y": 0.03183300793170929, - "z": 0.48105937242507935 - }, - "rotation": { - "w": 0.68337905406951904, - "x": -0.18168261647224426, - "y": 0.18157178163528442, - "z": -0.68338578939437866 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:33:00Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "dynamic": 0, - "id": "{ae9bb770-d8a5-4a8f-9f07-512347c41fe7}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.0238037109375, - "y": 0, - "z": 0.05812835693359375 - }, - "queryAACube": { - "scale": 0.28722813725471497, - "x": -0.11981035768985748, - "y": -0.14361406862735748, - "z": -0.085485711693763733 - }, - "rotation": { - "w": 7.7116979809943587e-05, - "x": 0.9558948278427124, - "y": 9.8852447990793735e-05, - "z": -0.29370918869972229 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:37:13Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "dynamic": 0, - "id": "{5dbfa65e-77f6-4646-864c-6ef99387bf21}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0, - "y": 0.074981689453125, - "z": 0 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": -0.04330126941204071, - "y": 0.03168042004108429, - "z": -0.04330126941204071 - }, - "rotation": { - "w": 0.70565086603164673, - "x": -0.70586901903152466, - "y": 0.043502748012542725, - "z": 0.043741695582866669 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:35:02Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "dynamic": 0, - "id": "{be46be67-9288-4eef-97be-1bc501bda8f0}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.1683349609375, - "y": 6.103515625e-05, - "z": 0.2762603759765625 - }, - "queryAACube": { - "scale": 0.28722813725471497, - "x": 0.024720892310142517, - "y": -0.14355303347110748, - "z": 0.13264630734920502 - }, - "rotation": { - "w": 0.22011587023735046, - "x": 0.67208588123321533, - "y": -0.67190313339233398, - "z": -0.21999000012874603 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:32:51Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "dynamic": 0, - "id": "{eef1688c-5eba-4a57-8ece-39339fee5ffe}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.3221435546875, - "y": 0.000152587890625, - "z": 0.478668212890625 - }, - "queryAACube": { - "scale": 0.28722813725471497, - "x": 0.17852948606014252, - "y": -0.14346148073673248, - "z": 0.33505415916442871 - }, - "rotation": { - "w": -0.00010969530558213592, - "x": 0.29818582534790039, - "y": 7.1413240220863372e-05, - "z": 0.95450782775878906 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }], - "Version": 57 -} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement3A.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement3A.json deleted file mode 100644 index 4446c0f23a..0000000000 --- a/unpublishedScripts/DomainContent/Home/blocky/arrangement3A.json +++ /dev/null @@ -1,229 +0,0 @@ -{ - "Entities": [ - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T19:28:29Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "id": "{68b93994-05ce-49e8-acfc-113439b0016c}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_block", - "position": { - "x": 0.1077880859375, - "y": 0.075286865234375, - "z": 0.0563507080078125 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.06448681652545929, - "y": 0.03198559582233429, - "z": 0.01304943859577179 - }, - "rotation": { - "w": -0.48592910170555115, - "x": -0.48633205890655518, - "y": 0.51336151361465454, - "z": -0.51362788677215576 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T19:30:40Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "id": "{a55936ed-a7bb-4367-a08d-2c35610908ca}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.3470458984375, - "y": 0.075897216796875, - "z": 0.1311492919921875 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.3037446141242981, - "y": 0.03259594738483429, - "z": 0.08784802258014679 - }, - "rotation": { - "w": -0.00018426775932312012, - "x": -0.70232832431793213, - "y": -0.00030004978179931641, - "z": 0.71185272932052612 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T19:35:02Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "id": "{1f6d3b72-8e31-47d7-8306-61722554b8e5}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.23583984375, - "y": 0.075042724609375, - "z": 0.1005401611328125 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.19253857433795929, - "y": 0.03174145519733429, - "z": 0.05723889172077179 - }, - "rotation": { - "w": -0.38409394025802612, - "x": 0.59400159120559692, - "y": -0.5937197208404541, - "z": 0.38357573747634888 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:28:38Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "id": "{4f17bcac-91f2-4a0d-ae1d-00c6628ef578}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.583251953125, - "y": 0.07513427734375, - "z": 0.204864501953125 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.5399506688117981, - "y": 0.03183300793170929, - "z": 0.16156323254108429 - }, - "rotation": { - "w": -0.58473116159439087, - "x": 0.39768025279045105, - "y": -0.39757427573204041, - "z": 0.58470022678375244 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:33:00Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "id": "{5dfd5f47-3040-4d58-be0d-ce96a2962913}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.490966796875, - "y": 0.07513427734375, - "z": 0.1775970458984375 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.4476655125617981, - "y": 0.03183300793170929, - "z": 0.13429577648639679 - }, - "rotation": { - "w": 0.13917262852191925, - "x": -0.69330555200576782, - "y": -0.69324028491973877, - "z": 0.13919799029827118 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:33:00Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "id": "{a7497e99-914a-4a51-9d96-70198f7bbb0e}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.054931640625, - "y": 0, - "z": 0.03050994873046875 - }, - "queryAACube": { - "scale": 0.28722813725471497, - "x": -0.088682428002357483, - "y": -0.14361406862735748, - "z": -0.11310411989688873 - }, - "rotation": { - "w": -3.9517879486083984e-05, - "x": -0.80475461483001709, - "y": -0.00011920928955078125, - "z": 0.59360742568969727 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T19:37:13Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "id": "{3167fe1f-5d3e-49a5-aee4-b4a657eb93ff}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0, - "y": 0.074981689453125, - "z": 0 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": -0.04330126941204071, - "y": 0.03168042004108429, - "z": -0.04330126941204071 - }, - "rotation": { - "w": -0.65145671367645264, - "x": 0.65158241987228394, - "y": -0.2746637761592865, - "z": -0.274961918592453 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - } - ], - "Version": 57 -} diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement4.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement4.json deleted file mode 100644 index 6bb6c4067a..0000000000 --- a/unpublishedScripts/DomainContent/Home/blocky/arrangement4.json +++ /dev/null @@ -1,232 +0,0 @@ -{ - "Entities": [{ - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:30:40Z", - "dimensions": { - "x": 0.029999999329447746, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 0, - "id": "{973dc65a-0200-4c27-b311-a16632abd336}", - "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.060791015625, - "y": 0.439910888671875, - "z": 0.02478790283203125 - }, - "queryAACube": { - "scale": 0.25670996308326721, - "x": -0.067563965916633606, - "y": 0.31155592203140259, - "z": -0.10356707870960236 - }, - "rotation": { - "w": -0.36391082406044006, - "x": -0.60559296607971191, - "y": 0.60754096508026123, - "z": 0.3629324734210968 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", - "velocity": { - "x": -0.00066184467868879437, - "y": 0.00055500119924545288, - "z": -0.0027390613686293364 - } - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:33:00Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "dynamic": 0, - "id": "{ae9bb770-d8a5-4a8f-9f07-512347c41fe7}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.0587158203125, - "y": 0, - "z": 0.06317138671875 - }, - "queryAACube": { - "scale": 0.28722813725471497, - "x": -0.084898248314857483, - "y": -0.14361406862735748, - "z": -0.080442681908607483 - }, - "rotation": { - "w": 0.62027901411056519, - "x": 0.62011599540710449, - "y": 0.33941084146499634, - "z": -0.33986839652061462 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", - "velocity": { - "x": 0.0011035117786377668, - "y": 0.00049801170825958252, - "z": -1.9822968170046806e-05 - } - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:28:29Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 0, - "id": "{fc5d6d27-52b0-4334-b60b-84c27f466f76}", - "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", - "name": "home_model_block", - "position": { - "x": 0, - "y": 0.2999267578125, - "z": 0 - }, - "queryAACube": { - "scale": 0.25980761647224426, - "x": -0.12990380823612213, - "y": 0.17002294957637787, - "z": -0.12990380823612213 - }, - "rotation": { - "w": -0.18395118415355682, - "x": -0.18451963365077972, - "y": -0.6821141242980957, - "z": 0.68325310945510864 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}", - "velocity": { - "x": 3.076787106692791e-05, - "y": 0.00042589753866195679, - "z": -0.0022651664912700653 - } - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:33:00Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 0, - "id": "{fa73da33-a242-4384-9795-317caae92c29}", - "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.0673828125, - "y": 0.149932861328125, - "z": 0.0480499267578125 - }, - "queryAACube": { - "scale": 0.27386128902435303, - "x": -0.069547832012176514, - "y": 0.013002216815948486, - "z": -0.088880717754364014 - }, - "rotation": { - "w": 0.88347971439361572, - "x": -0.00053799827583134174, - "y": 0.46846789121627808, - "z": -0.0010445250663906336 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", - "velocity": { - "x": 0.0007340551819652319, - "y": -0.00011105835437774658, - "z": -0.0010081863729283214 - } - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:33:00Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 0, - "id": "{d83f649b-1dfd-4fe3-8f25-b472665ec28a}", - "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.112548828125, - "y": 0.29986572265625, - "z": 0.043243408203125 - }, - "queryAACube": { - "scale": 0.25980761647224426, - "x": -0.017354980111122131, - "y": 0.16996191442012787, - "z": -0.086660400032997131 - }, - "rotation": { - "w": 0.67243033647537231, - "x": 0.67039400339126587, - "y": -0.22182278335094452, - "z": 0.22181977331638336 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", - "velocity": { - "x": 0.0043582655489444733, - "y": 0.0005900263786315918, - "z": -0.0029577072709798813 - } - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:33:00Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "dynamic": 0, - "id": "{f1b7be87-97d7-4c28-ba77-c431c3a248a4}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.0489501953125, - "y": 0.4798583984375, - "z": 0.02193450927734375 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.0056489259004592896, - "y": 0.4365571141242981, - "z": -0.02136676013469696 - }, - "rotation": { - "w": 0.049316942691802979, - "x": -0.046750579029321671, - "y": 0.70699954032897949, - "z": 0.7039417028427124 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", - "velocity": { - "x": -0.0029058775398880243, - "y": 0.00084279477596282959, - "z": -0.0020738139282912016 - } - }], - "Version": 57 -} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement4A.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement4A.json deleted file mode 100644 index df74a6aa64..0000000000 --- a/unpublishedScripts/DomainContent/Home/blocky/arrangement4A.json +++ /dev/null @@ -1,203 +0,0 @@ -{ - "Entities": [ - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:33:00Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "id": "{0aba0660-0991-47ab-b4d7-9c606f553e68}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "parentID": "{9aead5f1-edb1-4e75-a5f4-a121410f2dee}", - "position": { - "x": 0.031455338001251221, - "y": -0.032536625862121582, - "z": -0.48027312755584717 - }, - "queryAACube": { - "scale": 0.25980761647224426, - "x": 1100.8177490234375, - "y": 461.0120849609375, - "z": -70.972358703613281 - }, - "rotation": { - "w": 0.0023152828216552734, - "x": -0.53879290819168091, - "y": 0.84243488311767578, - "z": -0.0008878018707036972 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:33:00Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{421d62c3-e5e5-4e51-9b14-46ce25a5cb11}", - "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", - "name": "home_model_blocky_block", - "parentID": "{9aead5f1-edb1-4e75-a5f4-a121410f2dee}", - "position": { - "x": 0.017628543078899384, - "y": -0.0010632872581481934, - "z": -0.14994476735591888 - }, - "queryAACube": { - "scale": 0.82158386707305908, - "x": 1100.5284423828125, - "y": 460.40087890625, - "z": -71.226631164550781 - }, - "rotation": { - "w": 0.70702850818634033, - "x": -0.70705664157867432, - "y": -0.010112389922142029, - "z": 0.0089319320395588875 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T19:28:29Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{95792255-7fa6-4936-bb51-ce2f945dd5b9}", - "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", - "name": "home_model_block", - "parentID": "{9aead5f1-edb1-4e75-a5f4-a121410f2dee}", - "position": { - "x": 0.023592084646224976, - "y": -0.084929108619689941, - "z": -0.29993364214897156 - }, - "queryAACube": { - "scale": 0.77942287921905518, - "x": 1100.482421875, - "y": 460.57196044921875, - "z": -71.256011962890625 - }, - "rotation": { - "w": -0.69225782155990601, - "x": -0.00045704841613769531, - "y": 0.00031775236129760742, - "z": 0.72165042161941528 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:33:00Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{4c3ba7ac-2122-4402-a05d-f70a32bfd9d8}", - "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", - "name": "home_model_blocky_block", - "parentID": "{9aead5f1-edb1-4e75-a5f4-a121410f2dee}", - "position": { - "x": 0.05141855776309967, - "y": 0.034773021936416626, - "z": -0.29993501305580139 - }, - "queryAACube": { - "scale": 0.77942287921905518, - "x": 1100.59814453125, - "y": 460.57192993164062, - "z": -71.214653015136719 - }, - "rotation": { - "w": 0.68213790655136108, - "x": -0.0010509714484214783, - "y": -0.00042241811752319336, - "z": 0.73122292757034302 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T19:30:40Z", - "dimensions": { - "x": 0.029999999329447746, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{f04a15fe-4482-44f0-8b63-46ff8aa7538c}", - "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", - "name": "home_model_blocky_block", - "parentID": "{9aead5f1-edb1-4e75-a5f4-a121410f2dee}", - "position": { - "x": 0.036200806498527527, - "y": -0.020915478467941284, - "z": -0.43993330001831055 - }, - "queryAACube": { - "scale": 0.77012991905212402, - "x": 1100.5477294921875, - "y": 460.71658325195312, - "z": -71.227401733398438 - }, - "rotation": { - "w": -0.51840746402740479, - "x": -0.47963690757751465, - "y": 0.51959860324859619, - "z": -0.48085314035415649 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "angularDamping": 0, - "angularVelocity": { - "x": 0, - "y": -0.2617993950843811, - "z": 0 - }, - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:33:00Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.10000000149011612, - "z": 0.25 - }, - "id": "{9aead5f1-edb1-4e75-a5f4-a121410f2dee}", - "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", - "name": "home_model_blocky_block", - "queryAACube": { - "scale": 0.28722813725471497, - "x": -0.14361406862735748, - "y": -0.14361406862735748, - "z": -0.14361406862735748 - }, - "rotation": { - "w": 0.2521953284740448, - "x": 0.2517753541469574, - "y": 0.66056090593338013, - "z": -0.66080713272094727 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - } - ], - "Version": 57 -} diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement5.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement5.json deleted file mode 100644 index d04f78b106..0000000000 --- a/unpublishedScripts/DomainContent/Home/blocky/arrangement5.json +++ /dev/null @@ -1,254 +0,0 @@ -{ - "Entities": [ - { - "angularVelocity": { - "x": -0.0058977864682674408, - "y": 0.012016458436846733, - "z": -0.019001182168722153 - }, - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:37:13Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "dynamic": 0, - "id": "{5dbfa65e-77f6-4646-864c-6ef99387bf21}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.118896484375, - "y": 0.261627197265625, - "z": 0.5547332763671875 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.07559521496295929, - "y": 0.21832592785358429, - "z": 0.5114319920539856 - }, - "rotation": { - "w": 0.25579428672790527, - "x": 0.659473717212677, - "y": 0.65893793106079102, - "z": 0.25586038827896118 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", - "velocity": { - "x": 0.0021444200538098812, - "y": 0.0011220350861549377, - "z": 0.0011650724336504936 - } - }, - { - "angularVelocity": { - "x": 0.0021077222190797329, - "y": 0.0096995644271373749, - "z": -0.00475650979205966 - }, - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:28:29Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 0, - "id": "{18d0fe48-f5af-4baa-bc76-fd02b2cf507b}", - "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", - "name": "home_model_block", - "position": { - "x": 0.1376953125, - "y": 0.11163330078125, - "z": 0.54648590087890625 - }, - "queryAACube": { - "scale": 0.25980761647224426, - "x": 0.0077915042638778687, - "y": -0.018270507454872131, - "z": 0.41658210754394531 - }, - "rotation": { - "w": -0.16635751724243164, - "x": -0.16560617089271545, - "y": 0.68745934963226318, - "z": -0.68724048137664795 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:46:06Z", - "dimensions": { - "x": 0.029999999329447746, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 0, - "id": "{f61afc15-4813-4306-8db2-6fb9dc3baf33}", - "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.2005615234375, - "y": 0.111602783203125, - "z": 0.3127593994140625 - }, - "queryAACube": { - "scale": 0.25670996308326721, - "x": 0.072206541895866394, - "y": -0.016752198338508606, - "z": 0.18440441787242889 - }, - "rotation": { - "w": 0.5063401460647583, - "x": 0.5066148042678833, - "y": 0.4936140775680542, - "z": -0.4932173490524292 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "angularVelocity": { - "x": 0.0085022579878568649, - "y": 8.5791980382055044e-05, - "z": -0.0055606141686439514 - }, - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:59:13Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "dynamic": 0, - "id": "{050ba484-bd34-4819-a860-776f8d865a76}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0, - "y": 0.261627197265625, - "z": 0.6636199951171875 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": -0.04330126941204071, - "y": 0.21832592785358429, - "z": 0.6203187108039856 - }, - "rotation": { - "w": -0.11174160987138748, - "x": 0.6981397271156311, - "y": 0.69834953546524048, - "z": -0.11145715415477753 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", - "velocity": { - "x": 0.00021521201415453106, - "y": 0.0007597804069519043, - "z": 0.0016687994357198477 - } - }, - { - "angularVelocity": { - "x": 0.10312929749488831, - "y": 0.02031000517308712, - "z": 0.17793627083301544 - }, - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:37:13Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "dynamic":0, - "id": "{0a801214-14b7-4059-828a-61f18250a315}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.1876220703125, - "y": 0, - "z": 0 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.14432080090045929, - "y": -0.04330126941204071, - "z": -0.04330126941204071 - }, - "rotation": { - "w": 0.38613453507423401, - "x": 0.27518847584724426, - "y": 0.11528003960847855, - "z": 0.87285858392715454 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", - "velocity": { - "x": -0.0028362239245325327, - "y": 0.0032131313346326351, - "z": 0.0032204082235693932 - } - }, - { - "angularVelocity": { - "x": 0.0060502123087644577, - "y": -0.0002331961877644062, - "z": -0.0040579927153885365 - }, - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:32:51Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 0, - "id": "{c0abdb26-3e55-422f-811a-306239ec4894}", - "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.0091552734375, - "y": 0.11163330078125, - "z": 0.663543701171875 - }, - "queryAACube": { - "scale": 0.25980761647224426, - "x": -0.12074853479862213, - "y": -0.018270507454872131, - "z": 0.53363990783691406 - }, - "rotation": { - "w": 0.38818395137786865, - "x": -0.38840728998184204, - "y": 0.5908893346786499, - "z": 0.59101837873458862 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}", - "velocity": { - "x": 0.00010580161324469373, - "y": 0.00069457292556762695, - "z": 0.00075469817966222763 - } - } - ], - "Version": 57 -} diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement5B.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement5B.json deleted file mode 100644 index 634f1e6858..0000000000 --- a/unpublishedScripts/DomainContent/Home/blocky/arrangement5B.json +++ /dev/null @@ -1,203 +0,0 @@ -{ - "Entities": [ - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T19:37:13Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "id": "{e9a7eb61-bdfe-484d-963a-fdae21bc12e7}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "parentID": "{f9f90ed5-6a9e-45c1-99e2-db2ba28f12c2}", - "position": { - "x": -0.16834764182567596, - "y": 0.17657718062400818, - "z": -0.14808396995067596 - }, - "queryAACube": { - "scale": 0.25980761647224426, - "x": 1102.9293212890625, - "y": 460.51165771484375, - "z": -70.490364074707031 - }, - "rotation": { - "w": -0.72276210784912109, - "x": -0.67909777164459229, - "y": 0.11672055721282959, - "z": 0.054192394018173218 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:59:13Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "id": "{242a2da8-26e9-439f-a6bd-a5174d68b791}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "parentID": "{f9f90ed5-6a9e-45c1-99e2-db2ba28f12c2}", - "position": { - "x": 0.17733007669448853, - "y": -0.041430100798606873, - "z": -0.14965415000915527 - }, - "queryAACube": { - "scale": 0.25980761647224426, - "x": 1102.8548583984375, - "y": 460.51361083984375, - "z": -70.082504272460938 - }, - "rotation": { - "w": 0.45803076028823853, - "x": -0.54004138708114624, - "y": 0.45782959461212158, - "z": 0.53765928745269775 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:46:06Z", - "dimensions": { - "x": 0.029999999329447746, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{8d10e070-80b5-41a1-a98d-2fb60a73f98c}", - "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", - "name": "home_model_blocky_block", - "parentID": "{f9f90ed5-6a9e-45c1-99e2-db2ba28f12c2}", - "position": { - "x": -0.16358290612697601, - "y": 0.17843163013458252, - "z": 7.3954463005065918e-05 - }, - "queryAACube": { - "scale": 0.77012991905212402, - "x": 1102.6942138671875, - "y": 460.10836791992188, - "z": -70.743125915527344 - }, - "rotation": { - "w": 0.50793719291687012, - "x": -0.0007769167423248291, - "y": -0.0016511008143424988, - "z": 0.86144548654556274 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T19:32:51Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{96880a75-218a-485b-91d3-be9741f320ed}", - "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", - "name": "home_model_blocky_block", - "parentID": "{f9f90ed5-6a9e-45c1-99e2-db2ba28f12c2}", - "position": { - "x": 0.16807788610458374, - "y": -0.044651858508586884, - "z": 0.00034449249505996704 - }, - "queryAACube": { - "scale": 0.77942287921905518, - "x": 1102.57421875, - "y": 460.10379028320312, - "z": -70.363555908203125 - }, - "rotation": { - "w": -0.00017070770263671875, - "x": -0.68149137496948242, - "y": -0.73185545206069946, - "z": -0.0021193623542785645 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T19:37:13Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "id": "{0fdd72df-a5f5-4f9c-b3ec-b79bc606b356}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "parentID": "{f9f90ed5-6a9e-45c1-99e2-db2ba28f12c2}", - "position": { - "x": 0.02161325141787529, - "y": 0.0003502964973449707, - "z": -0.14994175732135773 - }, - "queryAACube": { - "scale": 0.25980761647224426, - "x": 1102.9146728515625, - "y": 460.51358032226562, - "z": -70.236610412597656 - }, - "rotation": { - "w": 0.12661613523960114, - "x": -0.68729931116104126, - "y": 0.1313164234161377, - "z": 0.70317196846008301 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "angularDamping": 0, - "angularVelocity": { - "x": 0, - "y": -0.2617993950843811, - "z": 0 - }, - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T19:28:29Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{f9f90ed5-6a9e-45c1-99e2-db2ba28f12c2}", - "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", - "name": "home_model_block", - "queryAACube": { - "scale": 0.25980761647224426, - "x": -0.12990380823612213, - "y": -0.12990380823612213, - "z": -0.12990380823612213 - }, - "rotation": { - "w": 0.21236260235309601, - "x": 0.20996685326099396, - "y": -0.67540425062179565, - "z": 0.67427384853363037 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - } - ], - "Version": 57 -} diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement5a.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement5a.json deleted file mode 100644 index 3d12988bbc..0000000000 --- a/unpublishedScripts/DomainContent/Home/blocky/arrangement5a.json +++ /dev/null @@ -1,197 +0,0 @@ -{ - "Entities": [ - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T19:37:13Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "id": "{e5dcde81-ec21-49cd-bfc1-47a04678d620}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.118896484375, - "y": 0.1500244140625, - "z": 0.24393463134765625 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.07559521496295929, - "y": 0.10672314465045929, - "z": 0.20063336193561554 - }, - "rotation": { - "w": 0.25630581378936768, - "x": 0.66857409477233887, - "y": 0.65368127822875977, - "z": 0.24492251873016357 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T19:32:51Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{ecbc77d5-b578-453c-b502-f4b7331c9088}", - "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.0091552734375, - "y": 3.0517578125e-05, - "z": 0.35125732421875 - }, - "queryAACube": { - "scale": 0.25980761647224426, - "x": -0.12074853479862213, - "y": -0.12987329065799713, - "z": 0.22135351598262787 - }, - "rotation": { - "w": 0.38817429542541504, - "x": -0.38844889402389526, - "y": 0.59087514877319336, - "z": 0.59099721908569336 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T19:37:13Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "id": "{35d2e036-2cfa-4e62-8cb7-81beda65963d}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.2061767578125, - "y": 0.148101806640625, - "z": 0 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": 0.16287548840045929, - "y": 0.10480053722858429, - "z": -0.04330126941204071 - }, - "rotation": { - "w": -0.034055888652801514, - "x": 0.35255527496337891, - "y": -0.041519246995449066, - "z": 0.93420767784118652 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:59:13Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.05000000074505806 - }, - "id": "{e7edf689-89c9-4daf-b5e0-38c330f34c6e}", - "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0, - "y": 0.1500244140625, - "z": 0.3527984619140625 - }, - "queryAACube": { - "scale": 0.086602538824081421, - "x": -0.04330126941204071, - "y": 0.10672314465045929, - "z": 0.3094971776008606 - }, - "rotation": { - "w": -0.11314564943313599, - "x": 0.69872581958770752, - "y": 0.69771873950958252, - "z": -0.11012434959411621 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T21:46:06Z", - "dimensions": { - "x": 0.029999999329447746, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{764c37c5-892f-41b4-8a34-8e13561726f7}", - "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.2005615234375, - "y": 0, - "z": 0.00042724609375 - }, - "queryAACube": { - "scale": 0.25670996308326721, - "x": 0.072206541895866394, - "y": -0.12835498154163361, - "z": -0.12792773544788361 - }, - "rotation": { - "w": 0.5063401460647583, - "x": 0.5066148042678833, - "y": 0.4936140775680542, - "z": -0.4932783842086792 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, - { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "created": "2016-05-09T19:28:29Z", - "dimensions": { - "x": 0.05000000074505806, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{8b4d7620-0303-447c-815c-ed5a90ba33b3}", - "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", - "name": "home_model_block", - "position": { - "x": 0.1376953125, - "y": 3.0517578125e-05, - "z": 0.23415374755859375 - }, - "queryAACube": { - "scale": 0.25980761647224426, - "x": 0.0077915042638778687, - "y": -0.12987329065799713, - "z": 0.10424993932247162 - }, - "rotation": { - "w": -0.16896313428878784, - "x": -0.16664379835128784, - "y": 0.68758678436279297, - "z": -0.68624401092529297 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - } - ], - "Version": 57 -} diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement6.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement6.json deleted file mode 100644 index 17c88e8308..0000000000 --- a/unpublishedScripts/DomainContent/Home/blocky/arrangement6.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "Entities": [{ - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:32:51Z", - "dimensions": { - "x": 0.029999999329447746, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{845bc4f0-f59b-4826-9910-e92ab0a82eca}", - "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.118896484375, - "y": 6.103515625e-05, - "z": 0.16530609130859375 - }, - "queryAACube": { - "scale": 0.25670996308326721, - "x": -0.009458497166633606, - "y": -0.12829394638538361, - "z": 0.036951109766960144 - }, - "rotation": { - "w": 0.37096202373504639, - "x": -0.37190812826156616, - "y": 0.60173952579498291, - "z": 0.60161745548248291 - }, - "dynamic": 0, - - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T21:28:38Z", - "dimensions": { - "x": 0.029999999329447746, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{1af7f363-a1e4-4f2b-94af-fc8c592769e8}", - "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.34423828125, - "y": 0.000152587890625, - "z": 0.4805755615234375 - }, - "queryAACube": { - "scale": 0.25670996308326721, - "x": 0.21588329970836639, - "y": -0.12820239365100861, - "z": 0.35222059488296509 - }, - "rotation": { - "w": 0.66173803806304932, - "x": 0.66201269626617432, - "y": -0.24910354614257812, - "z": 0.24846267700195312 - }, - "dynamic": 0, - - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:30:40Z", - "dimensions": { - "x": 0.029999999329447746, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{f05ff17b-a9ef-4b67-9f1e-a0cdbac1d73a}", - "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.1954345703125, - "y": 9.1552734375e-05, - "z": 0.2958984375 - }, - "queryAACube": { - "scale": 0.25670996308326721, - "x": 0.067079588770866394, - "y": -0.12826342880725861, - "z": 0.16754345595836639 - }, - "rotation": { - "w": 0.61269545555114746, - "x": 0.61297011375427246, - "y": -0.35289537906646729, - "z": 0.35259020328521729 - }, - "dynamic": 0, - - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:37:13Z", - "dimensions": { - "x": 0.029999999329447746, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 0, - - "id": "{d501c4f4-5ace-4337-a694-bf08230fd3ff}", - "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.238037109375, - "y": 9.1552734375e-05, - "z": 0.35927581787109375 - }, - "queryAACube": { - "scale": 0.25670996308326721, - "x": 0.10968212783336639, - "y": -0.12826342880725861, - "z": 0.23092083632946014 - }, - "rotation": { - "w": 0.61916530132293701, - "x": -0.61983668804168701, - "y": -0.34154266119003296, - "z": -0.34023040533065796 - }, - "dynamic": 0, - - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:32:51Z", - "dimensions": { - "x": 0.10000000149011612, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{b18bd985-1db5-40cf-b53b-d8765fac9112}", - "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", - "name": "home_model_blocky_block", - "queryAACube": { - "scale": 0.27386128902435303, - "x": -0.13693064451217651, - "y": -0.13693064451217651, - "z": -0.13693064451217651 - }, - "rotation": { - "w": 0.67776000499725342, - "x": 0.67730224132537842, - "y": 0.20234990119934082, - "z": -0.20231938362121582 - }, - "dynamic": 0, - - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:30:40Z", - "dimensions": { - "x": 0.029999999329447746, - "y": 0.05000000074505806, - "z": 0.25 - }, - "id": "{0284ad28-9e2b-45f5-91b0-e00da9238b41}", - "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", - "name": "home_model_blocky_block", - "position": { - "x": 0.0765380859375, - "y": 3.0517578125e-05, - "z": 0.09934234619140625 - }, - "queryAACube": { - "scale": 0.25670996308326721, - "x": -0.051816895604133606, - "y": -0.12832446396350861, - "z": -0.029012635350227356 - }, - "rotation": { - "w": 0.65304040908813477, - "x": -0.65294879674911499, - "y": -0.271351158618927, - "z": -0.271198570728302 - }, - "dynamic": 0, - - "shapeType": "box", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" - }, { - "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - "collisionsWillMove": 1, - "created": "2016-05-09T19:28:29Z", - "dimensions": { - "x": 0.029999999329447746, - "y": 0.05000000074505806, - "z": 0.25 - }, - "dynamic": 0, - "id": "{7090697d-bf3c-4edc-9090-0ef7e313151b}", - "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", - "name": "home_model_block", - "position": { - "x": 0.4200439453125, - "y": 0.00018310546875, - "z": 0.53116607666015625 - }, - "queryAACube": { - "scale": 0.25670996308326721, - "x": 0.29168897867202759, - "y": -0.12817187607288361, - "z": 0.40281111001968384 - }, - "rotation": { - "w": 0.66921496391296387, - "x": 0.66921496391296387, - "y": -0.22810709476470947, - "z": 0.22853434085845947 - }, - "shapeType": "box", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }], - "Version": 57 -} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/blocky/blocky.js b/unpublishedScripts/DomainContent/Home/blocky/blocky.js index 948ccd5e04..92a11696da 100644 --- a/unpublishedScripts/DomainContent/Home/blocky/blocky.js +++ b/unpublishedScripts/DomainContent/Home/blocky/blocky.js @@ -48,23 +48,23 @@ var blocks = [ var arrangements = [{ name: 'tall', blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_GREEN], - target: "atp:/blocky/arrangement1A.json" + target: "atp:/blocky/newblocks1.json" }, { name: 'ostrich', blocks: [BLOCK_RED, BLOCK_RED, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_NATURAL], - target: "atp:/blocky/arrangement2A.json" + target: "atp:/blocky/newblocks5.json" }, { name: 'froglog', blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_GREEN, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL], - target: "atp:/blocky/arrangement3A.json" + target: "atp:/blocky/newblocks2.json" }, { name: 'allOneLeg', blocks: [BLOCK_RED, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_BLUE, BLOCK_BLUE, BLOCK_NATURAL], - target: "atp:/blocky/arrangement4A.json" + target: "atp:/blocky/newblocks3.json" }, { name: 'threeppl', blocks: [BLOCK_BLUE, BLOCK_YELLOW, BLOCK_BLUE, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL], - target: "atp:/blocky/arrangement5B.json" + target: "atp:/blocky/newblocks4.json" }, { name: 'dominoes', blocks: [BLOCK_RED, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW], @@ -82,9 +82,9 @@ var TARGET_BLOCKS_POSITION = { y: 460.5, z: -67.689 }; - +//#debug (function() { - //#debug + print('BLOCK ENTITY SCRIPT') var _this; @@ -93,7 +93,7 @@ var TARGET_BLOCKS_POSITION = { } Blocky.prototype = { - debug: false, + debug: true, playableBlocks: [], targetBlocks: [], preload: function(entityID) { @@ -122,7 +122,8 @@ var TARGET_BLOCKS_POSITION = { name: "home_model_blocky_block", type: 'Model', collisionSoundURL: "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - dynamic: true, + dynamic: false, + collisionless: true, gravity: { x: 0, y: -9.8, @@ -173,7 +174,7 @@ var TARGET_BLOCKS_POSITION = { }, findBlocks: function() { var found = []; - var results = Entities.findEntities(this.position, 10); + var results = Entities.findEntities(MyAvatar.position, 10); results.forEach(function(result) { var properties = Entities.getEntityProperties(result); print('got result props') @@ -187,7 +188,7 @@ var TARGET_BLOCKS_POSITION = { cleanup: function() { print('BLOCKY cleanup'); var blocks = this.findBlocks(); - print('BLOCKY cleanup2') + print('BLOCKY cleanup2' + blocks.length) blocks.forEach(function(block) { Entities.deleteEntity(block); }) @@ -211,12 +212,13 @@ var TARGET_BLOCKS_POSITION = { name: "home_model_blocky_block", type: 'Model', collisionSoundURL: "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - dynamic: true, - gravity: { - x: 0, - y: -9.8, - z: 0 - }, + dynamic: false, + collisionless: true, + // gravity: { + // x: 0, + // y: -9.8, + // z: 0 + // }, userData: JSON.stringify({ grabbableKey: { grabbable: true diff --git a/unpublishedScripts/DomainContent/Home/blocky/newblocks1.json b/unpublishedScripts/DomainContent/Home/blocky/newblocks1.json new file mode 100644 index 0000000000..2409c7c34c --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/newblocks1.json @@ -0,0 +1,136 @@ +{ + "Entities": [ + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:35:13Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{aad3b1c3-6478-46dd-a985-800d0e38c8e7}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.069580078125, + "y": 0.153778076171875, + "z": 0.04181671142578125 + }, + "queryAACube": { + "scale": 0.25670996308326721, + "x": -0.058774903416633606, + "y": 0.025423094630241394, + "z": -0.086538270115852356 + }, + "rotation": { + "w": 0.95882409811019897, + "x": -1.896415778901428e-05, + "y": 0.28400072455406189, + "z": -1.0296697837475222e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:30:51Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{f5714678-d436-4353-b0c8-2d73599dda3a}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0181884765625, + "y": 0.153778076171875, + "z": 0.0773468017578125 + }, + "queryAACube": { + "scale": 0.25670996308326721, + "x": -0.11016650497913361, + "y": 0.025423094630241394, + "z": -0.051008179783821106 + }, + "rotation": { + "w": 0.95882409811019897, + "x": -1.896415778901428e-05, + "y": 0.28400072455406189, + "z": -1.0296697837475222e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:30:51Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "id": "{0cf93a58-18d2-4c69-9c1b-33d6d1e647b8}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.078857421875, + "y": 0.002899169921875, + "z": 0.11455535888671875 + }, + "queryAACube": { + "scale": 0.28722813725471497, + "x": -0.064756646752357483, + "y": -0.14071489870548248, + "z": -0.029058709740638733 + }, + "rotation": { + "w": 0.33741602301597595, + "x": -0.33740735054016113, + "y": 0.62139773368835449, + "z": 0.62142699956893921 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:33:02Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "id": "{7f8791fb-e236-4280-b9d4-4ee6d1663e2a}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "queryAACube": { + "scale": 0.28722813725471497, + "x": -0.14361406862735748, + "y": -0.14361406862735748, + "z": -0.14361406862735748 + }, + "rotation": { + "w": 0.68138498067855835, + "x": -0.68140000104904175, + "y": 0.18894240260124207, + "z": 0.1889689564704895 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + } + ], + "Version": 57 +} diff --git a/unpublishedScripts/DomainContent/Home/blocky/newblocks2.json b/unpublishedScripts/DomainContent/Home/blocky/newblocks2.json new file mode 100644 index 0000000000..8487e709d4 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/newblocks2.json @@ -0,0 +1,107 @@ +{ + "Entities": [ + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:37:24Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{2454f490-787c-491b-9b7e-c0e098af86e8}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0, + "y": 0.504150390625, + "z": 0 + }, + "queryAACube": { + "scale": 0.27386128902435303, + "x": -0.13693064451217651, + "y": 0.36721974611282349, + "z": -0.13693064451217651 + }, + "rotation": { + "w": 0.70711755752563477, + "x": 0.70709598064422607, + "y": 0, + "z": -2.1579186068265699e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:37:24Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{5bf66e29-a3b6-4171-8470-6e0462d51dd3}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0, + "y": 0, + "z": 0.00112152099609375 + }, + "queryAACube": { + "scale": 0.27386128902435303, + "x": -0.13693064451217651, + "y": -0.13693064451217651, + "z": -0.13580912351608276 + }, + "rotation": { + "w": 0.70711755752563477, + "x": 0.70709598064422607, + "y": 0, + "z": -2.1579186068265699e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:39:35Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{2cf52537-9f88-41eb-86d6-14a5ff218fb6}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0, + "y": 0.253204345703125, + "z": 0 + }, + "queryAACube": { + "scale": 0.27386128902435303, + "x": -0.13693064451217651, + "y": 0.11627370119094849, + "z": -0.13693064451217651 + }, + "rotation": { + "w": 0.70711755752563477, + "x": 0.70709598064422607, + "y": 0, + "z": -2.1579186068265699e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + } + ], + "Version": 57 +} diff --git a/unpublishedScripts/DomainContent/Home/blocky/newblocks3.json b/unpublishedScripts/DomainContent/Home/blocky/newblocks3.json new file mode 100644 index 0000000000..846800a2eb --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/newblocks3.json @@ -0,0 +1,277 @@ +{ + "Entities": [ + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:41:47Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{806e18fc-1ffd-4d7a-a405-52f1ad6cc164}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.1412353515625, + "y": 0.150634765625, + "z": 0.19216156005859375 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.09793408215045929, + "y": 0.10733349621295929, + "z": 0.14886029064655304 + }, + "rotation": { + "w": 0.96592974662780762, + "x": -1.8688122509047389e-05, + "y": 0.25880429148674011, + "z": -1.0789593034132849e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:41:47Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{3c99f577-fc38-4f5b-8b7b-2dc36b742ff9}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.078369140625, + "y": 0.150634765625, + "z": 0.10829925537109375 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.03506787121295929, + "y": 0.10733349621295929, + "z": 0.06499798595905304 + }, + "rotation": { + "w": 0.96592974662780762, + "x": -1.8688122509047389e-05, + "y": 0.25880429148674011, + "z": -1.0789593034132849e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:41:47Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{3aa37e21-48ff-4d41-be0b-d47a67e004cc}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.2056884765625, + "y": 0.150634765625, + "z": 0.2870941162109375 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.16238720715045929, + "y": 0.10733349621295929, + "z": 0.24379284679889679 + }, + "rotation": { + "w": 0.96592974662780762, + "x": -1.8688122509047389e-05, + "y": 0.25880429148674011, + "z": -1.0789593034132849e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:39:35Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{a34966c4-0f1c-4103-8857-f998559318e7}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0, + "y": 0.150634765625, + "z": 0 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": -0.04330126941204071, + "y": 0.10733349621295929, + "z": -0.04330126941204071 + }, + "rotation": { + "w": 0.96592974662780762, + "x": -1.8688122509047389e-05, + "y": 0.25880429148674011, + "z": -1.0789593034132849e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:41:47Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{96336167-827c-48ec-b641-ee462fb2abdc}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.2088623046875, + "y": 0, + "z": 0.28765869140625 + }, + "queryAACube": { + "scale": 0.25980761647224426, + "x": 0.078958496451377869, + "y": -0.12990380823612213, + "z": 0.15775488317012787 + }, + "rotation": { + "w": 0.68138498067855835, + "x": -0.68140000104904175, + "y": 0.18894240260124207, + "z": 0.1889689564704895 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:39:35Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{17b1be58-b3d6-4b27-856e-f74b8ba34309}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.001953125, + "y": 0, + "z": 0.00205230712890625 + }, + "queryAACube": { + "scale": 0.25980761647224426, + "x": -0.12795068323612213, + "y": -0.12990380823612213, + "z": -0.12785150110721588 + }, + "rotation": { + "w": 0.68138498067855835, + "x": -0.68140000104904175, + "y": 0.18894240260124207, + "z": 0.1889689564704895 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:41:47Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{161eefc7-ba39-4301-913f-edb4f7d9236e}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0777587890625, + "y": 0, + "z": 0.10608673095703125 + }, + "queryAACube": { + "scale": 0.25980761647224426, + "x": -0.052145019173622131, + "y": -0.12990380823612213, + "z": -0.023817077279090881 + }, + "rotation": { + "w": 0.68138498067855835, + "x": -0.68140000104904175, + "y": 0.18894240260124207, + "z": 0.1889689564704895 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:41:47Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{ea1eebe2-fef3-4587-9f87-f7812359ec8b}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.152099609375, + "y": 0, + "z": 0.1891937255859375 + }, + "queryAACube": { + "scale": 0.25980761647224426, + "x": 0.022195801138877869, + "y": -0.12990380823612213, + "z": 0.059289917349815369 + }, + "rotation": { + "w": 0.68138498067855835, + "x": -0.68140000104904175, + "y": 0.18894240260124207, + "z": 0.1889689564704895 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + } + ], + "Version": 57 +} diff --git a/unpublishedScripts/DomainContent/Home/blocky/newblocks4.json b/unpublishedScripts/DomainContent/Home/blocky/newblocks4.json new file mode 100644 index 0000000000..5d5a7a8d9d --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/newblocks4.json @@ -0,0 +1,277 @@ +{ + "Entities": [ + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:52:42Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{df9f2e81-c7c3-45b3-9459-0dc1647e3ac8}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.1153564453125, + "y": 0.3056640625, + "z": 0.19878387451171875 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.07205517590045929, + "y": 0.2623627781867981, + "z": 0.15548260509967804 + }, + "rotation": { + "w": 0.87880980968475342, + "x": -6.1288210417842492e-06, + "y": -0.4771721363067627, + "z": -2.0690549717983231e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:48:20Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{00f70709-d22b-4e50-98b6-c49783a1ca2d}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0565185546875, + "y": 0.3056640625, + "z": 0.0875244140625 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.01321728527545929, + "y": 0.2623627781867981, + "z": 0.04422314465045929 + }, + "rotation": { + "w": 0.87880980968475342, + "x": -6.1288210417842492e-06, + "y": -0.4771721363067627, + "z": -2.0690549717983231e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:48:20Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{925922c7-c8da-4862-8695-9e823cde5f43}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.165771484375, + "y": 0.1016845703125, + "z": 0.3075103759765625 + }, + "queryAACube": { + "scale": 0.27386128902435303, + "x": 0.028840839862823486, + "y": -0.035246074199676514, + "z": 0.17057973146438599 + }, + "rotation": { + "w": 0.76051729917526245, + "x": 0.5797961950302124, + "y": 0.20168730616569519, + "z": -0.21159422397613525 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:48:20Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{9754d1bd-30f0-473c-87fa-159902f3ae54}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0, + "y": 0.1016845703125, + "z": 0 + }, + "queryAACube": { + "scale": 0.27386128902435303, + "x": -0.13693064451217651, + "y": -0.035246074199676514, + "z": -0.13693064451217651 + }, + "rotation": { + "w": -0.24484673142433167, + "x": -0.2088056355714798, + "y": 0.70473498106002808, + "z": -0.63229680061340332 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:48:20Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "id": "{d2cd5cb1-cc1c-48b5-a190-b25279ca46aa}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0667724609375, + "y": 0.18121337890625, + "z": 0.155120849609375 + }, + "queryAACube": { + "scale": 0.28722813725471497, + "x": -0.076841607689857483, + "y": 0.037599310278892517, + "z": 0.011506780982017517 + }, + "rotation": { + "w": 0.9612659215927124, + "x": -1.8873581211664714e-05, + "y": 0.27562269568443298, + "z": -1.0461797501193359e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:48:20Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{168a3f35-29f3-4a5c-92e5-868ce8476052}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.08154296875, + "y": 0.256256103515625, + "z": 0.1437225341796875 + }, + "queryAACube": { + "scale": 0.25670996308326721, + "x": -0.046812012791633606, + "y": 0.12790112197399139, + "z": 0.015367552638053894 + }, + "rotation": { + "w": 0.96592974662780762, + "x": -1.8688122509047389e-05, + "y": 0.25880429148674011, + "z": -1.0789593034132849e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:48:20Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "id": "{8df113eb-303f-461a-914b-1ff86083af28}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0667724609375, + "y": 0.093353271484375, + "z": 0.155120849609375 + }, + "queryAACube": { + "scale": 0.28722813725471497, + "x": -0.076841607689857483, + "y": -0.050260797142982483, + "z": 0.011506780982017517 + }, + "rotation": { + "w": 0.9612659215927124, + "x": -1.8873581211664714e-05, + "y": 0.27562269568443298, + "z": -1.0461797501193359e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T22:48:20Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "id": "{6126fb1e-5702-4ea5-9840-fc93534a284c}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0667724609375, + "y": 0, + "z": 0.155120849609375 + }, + "queryAACube": { + "scale": 0.28722813725471497, + "x": -0.076841607689857483, + "y": -0.14361406862735748, + "z": 0.011506780982017517 + }, + "rotation": { + "w": 0.9612659215927124, + "x": -1.8873581211664714e-05, + "y": 0.27562269568443298, + "z": -1.0461797501193359e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + } + ], + "Version": 57 +} diff --git a/unpublishedScripts/DomainContent/Home/blocky/newblocks5.json b/unpublishedScripts/DomainContent/Home/blocky/newblocks5.json new file mode 100644 index 0000000000..88ccb23c44 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/blocky/newblocks5.json @@ -0,0 +1,175 @@ +{ + "Entities": [ + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T23:42:57Z", + "dimensions": { + "x": 0.029999999329447746, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{f89e9217-6048-4ad8-a9fa-80404931864c}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0689697265625, + "y": 0.336700439453125, + "z": 0.02086639404296875 + }, + "queryAACube": { + "scale": 0.25670996308326721, + "x": -0.059385254979133606, + "y": 0.20834545791149139, + "z": -0.10748858749866486 + }, + "rotation": { + "w": 0.66232722997665405, + "x": 0.66232722997665405, + "y": 0.24763399362564087, + "z": -0.24763399362564087 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T23:42:57Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.10000000149011612, + "z": 0.25 + }, + "id": "{e065e9c3-b722-4ad3-bbd4-3f12efb530f5}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_green.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0335693359375, + "y": 0.179962158203125, + "z": 0.0505828857421875 + }, + "queryAACube": { + "scale": 0.28722813725471497, + "x": -0.11004473268985748, + "y": 0.036348089575767517, + "z": -0.093031182885169983 + }, + "rotation": { + "w": 0.88294041156768799, + "x": -6.3091447373153642e-06, + "y": -0.46948501467704773, + "z": -2.0636278350139037e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T23:42:57Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{f1367c6c-744a-4ee2-9a6f-ffe89fe67e7e}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0, + "y": 0, + "z": 0.03073883056640625 + }, + "queryAACube": { + "scale": 0.27386128902435303, + "x": -0.13693064451217651, + "y": -0.13693064451217651, + "z": -0.10619181394577026 + }, + "rotation": { + "w": 0.67456501722335815, + "x": 0.67456501722335815, + "y": 0.21204251050949097, + "z": -0.21204251050949097 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T23:42:57Z", + "dimensions": { + "x": 0.10000000149011612, + "y": 0.05000000074505806, + "z": 0.25 + }, + "id": "{73c2bd96-e77d-4ba2-908b-1ee8ca7c814c}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_red.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.02685546875, + "y": 0, + "z": 0.0877532958984375 + }, + "queryAACube": { + "scale": 0.27386128902435303, + "x": -0.11007517576217651, + "y": -0.13693064451217651, + "z": -0.049177348613739014 + }, + "rotation": { + "w": 0.67456501722335815, + "x": 0.67456501722335815, + "y": 0.21204251050949097, + "z": -0.21204251050949097 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + "collisionless": 1, + "created": "2016-05-23T23:42:57Z", + "dimensions": { + "x": 0.05000000074505806, + "y": 0.05000000074505806, + "z": 0.05000000074505806 + }, + "id": "{28fd21e4-2138-4ca1-875b-1d35cbefa6b8}", + "ignoreForCollisions": 1, + "modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx", + "name": "home_model_blocky_block", + "position": { + "x": 0.0506591796875, + "y": 0.485748291015625, + "z": 0 + }, + "queryAACube": { + "scale": 0.086602538824081421, + "x": 0.0073579102754592896, + "y": 0.4424470067024231, + "z": -0.04330126941204071 + }, + "rotation": { + "w": 1, + "x": -1.52587890625e-05, + "y": -1.52587890625e-05, + "z": -1.52587890625e-05 + }, + "shapeType": "box", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":true},\"hifiHomeKey\":{\"reset\":true}}" + } + ], + "Version": 57 +} From c7ae3396ebae20e1216afee4bdbcd90d975f9bfe Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Mon, 23 May 2016 17:29:16 -0700 Subject: [PATCH 20/89] end of day --- .../DomainContent/Home/blocky/blocky.js | 391 +++++++++--------- 1 file changed, 198 insertions(+), 193 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/blocky/blocky.js b/unpublishedScripts/DomainContent/Home/blocky/blocky.js index 92a11696da..56567cc971 100644 --- a/unpublishedScripts/DomainContent/Home/blocky/blocky.js +++ b/unpublishedScripts/DomainContent/Home/blocky/blocky.js @@ -46,208 +46,213 @@ var blocks = [ ]; var arrangements = [{ - name: 'tall', - blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_GREEN], - target: "atp:/blocky/newblocks1.json" -}, { - name: 'ostrich', - blocks: [BLOCK_RED, BLOCK_RED, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_NATURAL], - target: "atp:/blocky/newblocks5.json" -}, { - name: 'froglog', - blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_GREEN, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL], - target: "atp:/blocky/newblocks2.json" -}, { - name: 'allOneLeg', - blocks: [BLOCK_RED, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_BLUE, BLOCK_BLUE, BLOCK_NATURAL], - target: "atp:/blocky/newblocks3.json" -}, { - name: 'threeppl', - blocks: [BLOCK_BLUE, BLOCK_YELLOW, BLOCK_BLUE, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL], - target: "atp:/blocky/newblocks4.json" -}, { - name: 'dominoes', - blocks: [BLOCK_RED, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW], - target: "atp:/blocky/arrangement6B.json" -}] + name: 'greenhenge', + blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_YELLOW], + target: "atp:/blocky/newblocks1.json" + }, + { + name: 'tallstuff', + blocks: [BLOCK_RED, BLOCK_RED, BLOCK_RED], + target: "atp:/blocky/newblocks2.json" + }, + { + name: 'ostrich', + blocks: [BLOCK_RED, BLOCK_RED, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_NATURAL], + target: "atp:/blocky/newblocks5.json" + }, + { + name: 'fourppl', + blocks: [BLOCK_BLUE, BLOCK_BLUE, BLOCK_BLUE, BLOCK_BLUE, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL], + target: "atp:/blocky/newblocks3.json" + }, + { + name: 'frogguy', + blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_RED, BLOCK_RED, BLOCK_NATURAL, BLOCK_NATURAL], + target: "atp:/blocky/newblocks4.json" + }, + { + name: 'dominoes', + blocks: [BLOCK_RED, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW], + target: "atp:/blocky/arrangement6B.json" + }] -var PLAYABLE_BLOCKS_POSITION = { - x: 1097.6, - y: 460.5, - z: -66.22 -}; + var PLAYABLE_BLOCKS_POSITION = { + x: 1097.6, + y: 460.5, + z: -66.22 + }; -var TARGET_BLOCKS_POSITION = { - x: 1096.82, - y: 460.5, - z: -67.689 -}; -//#debug -(function() { + var TARGET_BLOCKS_POSITION = { + x: 1096.82, + y: 460.5, + z: -67.689 + }; + //#debug + (function() { - print('BLOCK ENTITY SCRIPT') - var _this; + print('BLOCK ENTITY SCRIPT') + var _this; - function Blocky() { - _this = this; - } - - Blocky.prototype = { - debug: true, - playableBlocks: [], - targetBlocks: [], - preload: function(entityID) { - print('BLOCKY preload') - this.entityID = entityID; - }, - createTargetBlocks: function(arrangement) { - var created = []; - print('BLOCKY create target blocks') - - var created = []; - var success = Clipboard.importEntities(arrangement.target); - if (success === true) { - created = Clipboard.pasteEntities(TARGET_BLOCKS_POSITION) - print('created ' + created); + function Blocky() { + _this = this; } - this.targetBlocks = created; - print('BLOCKY TARGET BLOCKS:: ' + this.targetBlocks); - }, - createPlayableBlocks: function(arrangement) { - print('BLOCKY creating playable blocks' + arrangement.blocks.length); - arrangement.blocks.forEach(function(block) { - print('BLOCKY in a block loop') - var blockProps = { - name: "home_model_blocky_block", - type: 'Model', - collisionSoundURL: "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - dynamic: false, - collisionless: true, - gravity: { - x: 0, - y: -9.8, - z: 0 - }, - userData: JSON.stringify({ - grabbableKey: { - grabbable: true - }, - hifiHomeKey: { - reset: true + Blocky.prototype = { + debug: false, + playableBlocks: [], + targetBlocks: [], + preload: function(entityID) { + print('BLOCKY preload') + this.entityID = entityID; + }, + createTargetBlocks: function(arrangement) { + var created = []; + print('BLOCKY create target blocks') + + var created = []; + var success = Clipboard.importEntities(arrangement.target); + if (success === true) { + created = Clipboard.pasteEntities(TARGET_BLOCKS_POSITION) + print('created ' + created); + } + + this.targetBlocks = created; + print('BLOCKY TARGET BLOCKS:: ' + this.targetBlocks); + }, + createPlayableBlocks: function(arrangement) { + print('BLOCKY creating playable blocks' + arrangement.blocks.length); + arrangement.blocks.forEach(function(block) { + print('BLOCKY in a block loop') + var blockProps = { + name: "home_model_blocky_block", + type: 'Model', + collisionSoundURL: "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + dynamic: true, + collisionless: false, + gravity: { + x: 0, + y: -9.8, + z: 0 + }, + userData: JSON.stringify({ + grabbableKey: { + grabbable: true + }, + hifiHomeKey: { + reset: true + } + }), + dimensions: block.dimensions, + modelURL: block.url, + shapeType: 'box', + velocity: { + x: 0, + y: -0.01, + z: 0, + }, + position: PLAYABLE_BLOCKS_POSITION } - }), - dimensions: block.dimensions, - modelURL: block.url, - shapeType: 'box', - velocity: { - x: 0, - y: -0.01, - z: 0, - }, - position: PLAYABLE_BLOCKS_POSITION - } - var newBlock = Entities.addEntity(blockProps); - print('BLOCKY made a playable block' + newBlock) - _this.playableBlocks.push(newBlock); - print('BLOCKY pushing it into playable blocks'); - }) + var newBlock = Entities.addEntity(blockProps); + print('BLOCKY made a playable block' + newBlock) + _this.playableBlocks.push(newBlock); + print('BLOCKY pushing it into playable blocks'); + }) - print('BLOCKY after going through playable arrangement') - }, - startNearTrigger: function() { - print('BLOCKY got a near trigger'); - this.advanceRound(); - }, - advanceRound: function() { - print('BLOCKY advance round'); - this.cleanup(); - var arrangement = arrangements[Math.floor(Math.random() * arrangements.length)]; - this.createTargetBlocks(arrangement); + print('BLOCKY after going through playable arrangement') + }, + startNearTrigger: function() { + print('BLOCKY got a near trigger'); + this.advanceRound(); + }, + advanceRound: function() { + print('BLOCKY advance round'); + this.cleanup(); + var arrangement = arrangements[Math.floor(Math.random() * arrangements.length)]; + this.createTargetBlocks(arrangement); - if (this.debug === true) { - this.debugCreatePlayableBlocks(); - } else { - this.createPlayableBlocks(arrangement); + if (this.debug === true) { + this.debugCreatePlayableBlocks(); + } else { + this.createPlayableBlocks(arrangement); - } - }, - findBlocks: function() { - var found = []; - var results = Entities.findEntities(MyAvatar.position, 10); - results.forEach(function(result) { - var properties = Entities.getEntityProperties(result); - print('got result props') - if (properties.name.indexOf('blocky_block') > -1) { - found.push(result); - } - }); - return found; - }, - - cleanup: function() { - print('BLOCKY cleanup'); - var blocks = this.findBlocks(); - print('BLOCKY cleanup2' + blocks.length) - blocks.forEach(function(block) { - Entities.deleteEntity(block); - }) - print('BLOCKY after find and delete') - this.targetBlocks.forEach(function(block) { - Entities.deleteEntity(block); - }); - this.playableBlocks.forEach(function(block) { - Entities.deleteEntity(block); - }); - this.targetBlocks = []; - this.playableBlocks = []; - }, - debugCreatePlayableBlocks: function() { - print('BLOCKY debug create'); - var howMany = 10; - var i; - for (i = 0; i < howMany; i++) { - var block = blocks[Math.floor(Math.random() * blocks.length)]; - var blockProps = { - name: "home_model_blocky_block", - type: 'Model', - collisionSoundURL: "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - dynamic: false, - collisionless: true, - // gravity: { - // x: 0, - // y: -9.8, - // z: 0 - // }, - userData: JSON.stringify({ - grabbableKey: { - grabbable: true - }, - hifiHomeKey: { - reset: true + } + }, + findBlocks: function() { + var found = []; + var results = Entities.findEntities(MyAvatar.position, 10); + results.forEach(function(result) { + var properties = Entities.getEntityProperties(result); + print('got result props') + if (properties.name.indexOf('blocky_block') > -1) { + found.push(result); } - }), - dimensions: block.dimensions, - modelURL: block.url, - shapeType: 'box', - velocity: { - x: 0, - y: -0.01, - z: 0, - }, - position: PLAYABLE_BLOCKS_POSITION - } - this.playableBlocks.push(Entities.addEntity(blockProps)); - } - }, - unload: function() { - this.cleanup(); - }, - clickReleaseOnEntity: function() { - print('BLOCKY click') - this.startNearTrigger(); - } - } + }); + return found; + }, - return new Blocky(); -}) \ No newline at end of file + cleanup: function() { + print('BLOCKY cleanup'); + var blocks = this.findBlocks(); + print('BLOCKY cleanup2' + blocks.length) + blocks.forEach(function(block) { + Entities.deleteEntity(block); + }) + print('BLOCKY after find and delete') + this.targetBlocks.forEach(function(block) { + Entities.deleteEntity(block); + }); + this.playableBlocks.forEach(function(block) { + Entities.deleteEntity(block); + }); + this.targetBlocks = []; + this.playableBlocks = []; + }, + debugCreatePlayableBlocks: function() { + print('BLOCKY debug create'); + var howMany = 10; + var i; + for (i = 0; i < howMany; i++) { + var block = blocks[Math.floor(Math.random() * blocks.length)]; + var blockProps = { + name: "home_model_blocky_block", + type: 'Model', + collisionSoundURL: "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + dynamic: false, + collisionless: true, + // gravity: { + // x: 0, + // y: -9.8, + // z: 0 + // }, + userData: JSON.stringify({ + grabbableKey: { + grabbable: true + }, + hifiHomeKey: { + reset: true + } + }), + dimensions: block.dimensions, + modelURL: block.url, + shapeType: 'box', + velocity: { + x: 0, + y: -0.01, + z: 0, + }, + position: PLAYABLE_BLOCKS_POSITION + } + this.playableBlocks.push(Entities.addEntity(blockProps)); + } + }, + unload: function() { + this.cleanup(); + }, + clickReleaseOnEntity: function() { + print('BLOCKY click') + this.startNearTrigger(); + } + } + + return new Blocky(); + }) \ No newline at end of file From f1e826b3050bc22e28be39f1e1f18a4bfcd49c38 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Tue, 24 May 2016 15:28:11 -0700 Subject: [PATCH 21/89] make blocky swipable --- .../Home/blocky/arrangement6B.json | 5 - .../DomainContent/Home/blocky/blocky.js | 426 ++++++++++-------- .../DomainContent/Home/blocky/wrapper.js | 11 +- .../DomainContent/Home/reset.js | 9 +- 4 files changed, 236 insertions(+), 215 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/blocky/arrangement6B.json b/unpublishedScripts/DomainContent/Home/blocky/arrangement6B.json index edced193a8..2a0510e259 100644 --- a/unpublishedScripts/DomainContent/Home/blocky/arrangement6B.json +++ b/unpublishedScripts/DomainContent/Home/blocky/arrangement6B.json @@ -200,11 +200,6 @@ }, { "angularDamping": 0, - "angularVelocity": { - "x": 0, - "y": -0.2617993950843811, - "z": 0 - }, "collisionSoundURL": "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", "created": "2016-05-09T19:30:40Z", "dimensions": { diff --git a/unpublishedScripts/DomainContent/Home/blocky/blocky.js b/unpublishedScripts/DomainContent/Home/blocky/blocky.js index 56567cc971..c7e35d15e7 100644 --- a/unpublishedScripts/DomainContent/Home/blocky/blocky.js +++ b/unpublishedScripts/DomainContent/Home/blocky/blocky.js @@ -46,213 +46,239 @@ var blocks = [ ]; var arrangements = [{ - name: 'greenhenge', - blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_YELLOW], - target: "atp:/blocky/newblocks1.json" - }, - { - name: 'tallstuff', - blocks: [BLOCK_RED, BLOCK_RED, BLOCK_RED], - target: "atp:/blocky/newblocks2.json" - }, - { - name: 'ostrich', - blocks: [BLOCK_RED, BLOCK_RED, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_NATURAL], - target: "atp:/blocky/newblocks5.json" - }, - { - name: 'fourppl', - blocks: [BLOCK_BLUE, BLOCK_BLUE, BLOCK_BLUE, BLOCK_BLUE, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL], - target: "atp:/blocky/newblocks3.json" - }, - { - name: 'frogguy', - blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_RED, BLOCK_RED, BLOCK_NATURAL, BLOCK_NATURAL], - target: "atp:/blocky/newblocks4.json" - }, - { - name: 'dominoes', - blocks: [BLOCK_RED, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW], - target: "atp:/blocky/arrangement6B.json" - }] + name: 'greenhenge', + blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_YELLOW], + target: "atp:/blocky/newblocks1.json" +}, { + name: 'tallstuff', + blocks: [BLOCK_RED, BLOCK_RED, BLOCK_RED], + target: "atp:/blocky/newblocks2.json" +}, { + name: 'ostrich', + blocks: [BLOCK_RED, BLOCK_RED, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_NATURAL], + target: "atp:/blocky/newblocks5.json" +}, { + name: 'fourppl', + blocks: [BLOCK_BLUE, BLOCK_BLUE, BLOCK_BLUE, BLOCK_BLUE, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL, BLOCK_NATURAL], + target: "atp:/blocky/newblocks3.json" +}, { + name: 'frogguy', + blocks: [BLOCK_GREEN, BLOCK_GREEN, BLOCK_GREEN, BLOCK_YELLOW, BLOCK_RED, BLOCK_RED, BLOCK_NATURAL, BLOCK_NATURAL], + target: "atp:/blocky/newblocks4.json" +}, { + name: 'dominoes', + blocks: [BLOCK_RED, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW, BLOCK_YELLOW], + target: "atp:/blocky/arrangement6B.json" +}] - var PLAYABLE_BLOCKS_POSITION = { - x: 1097.6, - y: 460.5, - z: -66.22 - }; +var PLAYABLE_BLOCKS_POSITION = { + x: 1097.6, + y: 460.5, + z: -66.22 +}; - var TARGET_BLOCKS_POSITION = { - x: 1096.82, - y: 460.5, - z: -67.689 - }; - //#debug - (function() { +var TARGET_BLOCKS_POSITION = { + x: 1096.82, + y: 460.5, + z: -67.689 +}; +//#debug +(function() { - print('BLOCK ENTITY SCRIPT') - var _this; + print('BLOCK ENTITY SCRIPT') + var _this; - function Blocky() { - _this = this; + function Blocky() { + _this = this; + } + + Blocky.prototype = { + busy: false, + debug: false, + playableBlocks: [], + targetBlocks: [], + preload: function(entityID) { + print('BLOCKY preload') + this.entityID = entityID; + Script.update.connect(_this.update); + }, + + createTargetBlocks: function(arrangement) { + var created = []; + print('BLOCKY create target blocks') + + var created = []; + var success = Clipboard.importEntities(arrangement.target); + if (success === true) { + created = Clipboard.pasteEntities(TARGET_BLOCKS_POSITION) + print('created ' + created); } - Blocky.prototype = { - debug: false, - playableBlocks: [], - targetBlocks: [], - preload: function(entityID) { - print('BLOCKY preload') - this.entityID = entityID; - }, - createTargetBlocks: function(arrangement) { - var created = []; - print('BLOCKY create target blocks') + this.targetBlocks = created; + print('BLOCKY TARGET BLOCKS:: ' + this.targetBlocks); + }, - var created = []; - var success = Clipboard.importEntities(arrangement.target); - if (success === true) { - created = Clipboard.pasteEntities(TARGET_BLOCKS_POSITION) - print('created ' + created); - } - - this.targetBlocks = created; - print('BLOCKY TARGET BLOCKS:: ' + this.targetBlocks); - }, - createPlayableBlocks: function(arrangement) { - print('BLOCKY creating playable blocks' + arrangement.blocks.length); - arrangement.blocks.forEach(function(block) { - print('BLOCKY in a block loop') - var blockProps = { - name: "home_model_blocky_block", - type: 'Model', - collisionSoundURL: "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - dynamic: true, - collisionless: false, - gravity: { - x: 0, - y: -9.8, - z: 0 - }, - userData: JSON.stringify({ - grabbableKey: { - grabbable: true - }, - hifiHomeKey: { - reset: true - } - }), - dimensions: block.dimensions, - modelURL: block.url, - shapeType: 'box', - velocity: { - x: 0, - y: -0.01, - z: 0, - }, - position: PLAYABLE_BLOCKS_POSITION + createPlayableBlocks: function(arrangement) { + print('BLOCKY creating playable blocks' + arrangement.blocks.length); + arrangement.blocks.forEach(function(block) { + print('BLOCKY in a block loop') + var blockProps = { + name: "home_model_blocky_block", + type: 'Model', + collisionSoundURL: "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + dynamic: true, + collisionless: false, + gravity: { + x: 0, + y: -9.8, + z: 0 + }, + userData: JSON.stringify({ + grabbableKey: { + grabbable: true + }, + hifiHomeKey: { + reset: true } - var newBlock = Entities.addEntity(blockProps); - print('BLOCKY made a playable block' + newBlock) - _this.playableBlocks.push(newBlock); - print('BLOCKY pushing it into playable blocks'); - }) - - print('BLOCKY after going through playable arrangement') - }, - startNearTrigger: function() { - print('BLOCKY got a near trigger'); - this.advanceRound(); - }, - advanceRound: function() { - print('BLOCKY advance round'); - this.cleanup(); - var arrangement = arrangements[Math.floor(Math.random() * arrangements.length)]; - this.createTargetBlocks(arrangement); - - if (this.debug === true) { - this.debugCreatePlayableBlocks(); - } else { - this.createPlayableBlocks(arrangement); - - } - }, - findBlocks: function() { - var found = []; - var results = Entities.findEntities(MyAvatar.position, 10); - results.forEach(function(result) { - var properties = Entities.getEntityProperties(result); - print('got result props') - if (properties.name.indexOf('blocky_block') > -1) { - found.push(result); - } - }); - return found; - }, - - cleanup: function() { - print('BLOCKY cleanup'); - var blocks = this.findBlocks(); - print('BLOCKY cleanup2' + blocks.length) - blocks.forEach(function(block) { - Entities.deleteEntity(block); - }) - print('BLOCKY after find and delete') - this.targetBlocks.forEach(function(block) { - Entities.deleteEntity(block); - }); - this.playableBlocks.forEach(function(block) { - Entities.deleteEntity(block); - }); - this.targetBlocks = []; - this.playableBlocks = []; - }, - debugCreatePlayableBlocks: function() { - print('BLOCKY debug create'); - var howMany = 10; - var i; - for (i = 0; i < howMany; i++) { - var block = blocks[Math.floor(Math.random() * blocks.length)]; - var blockProps = { - name: "home_model_blocky_block", - type: 'Model', - collisionSoundURL: "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", - dynamic: false, - collisionless: true, - // gravity: { - // x: 0, - // y: -9.8, - // z: 0 - // }, - userData: JSON.stringify({ - grabbableKey: { - grabbable: true - }, - hifiHomeKey: { - reset: true - } - }), - dimensions: block.dimensions, - modelURL: block.url, - shapeType: 'box', - velocity: { - x: 0, - y: -0.01, - z: 0, - }, - position: PLAYABLE_BLOCKS_POSITION - } - this.playableBlocks.push(Entities.addEntity(blockProps)); - } - }, - unload: function() { - this.cleanup(); - }, - clickReleaseOnEntity: function() { - print('BLOCKY click') - this.startNearTrigger(); + }), + dimensions: block.dimensions, + modelURL: block.url, + shapeType: 'box', + velocity: { + x: 0, + y: -0.01, + z: 0, + }, + position: PLAYABLE_BLOCKS_POSITION } - } + var newBlock = Entities.addEntity(blockProps); + print('BLOCKY made a playable block' + newBlock) + _this.playableBlocks.push(newBlock); + print('BLOCKY pushing it into playable blocks'); + }) - return new Blocky(); - }) \ No newline at end of file + print('BLOCKY after going through playable arrangement') + }, + + startNearTrigger: function() { + print('BLOCKY got a near trigger'); + this.advanceRound(); + }, + + advanceRound: function() { + print('BLOCKY advance round'); + this.busy = true; + this.cleanup(); + var arrangement = arrangements[Math.floor(Math.random() * arrangements.length)]; + this.createTargetBlocks(arrangement); + + if (this.debug === true) { + this.debugCreatePlayableBlocks(); + } else { + this.createPlayableBlocks(arrangement); + + } + this.busy = false; + }, + + findBlocks: function() { + var found = []; + var results = Entities.findEntities(MyAvatar.position, 10); + results.forEach(function(result) { + var properties = Entities.getEntityProperties(result); + print('got result props') + if (properties.name.indexOf('blocky_block') > -1) { + found.push(result); + } + }); + return found; + }, + + cleanup: function() { + print('BLOCKY cleanup'); + var blocks = this.findBlocks(); + print('BLOCKY cleanup2' + blocks.length) + blocks.forEach(function(block) { + Entities.deleteEntity(block); + }) + print('BLOCKY after find and delete') + this.targetBlocks.forEach(function(block) { + Entities.deleteEntity(block); + }); + this.playableBlocks.forEach(function(block) { + Entities.deleteEntity(block); + }); + this.targetBlocks = []; + this.playableBlocks = []; + }, + + debugCreatePlayableBlocks: function() { + print('BLOCKY debug create'); + var howMany = 10; + var i; + for (i = 0; i < howMany; i++) { + var block = blocks[Math.floor(Math.random() * blocks.length)]; + var blockProps = { + name: "home_model_blocky_block", + type: 'Model', + collisionSoundURL: "atp:/kineticObjects/blocks/ToyWoodBlock.L.wav", + dynamic: false, + collisionless: true, + userData: JSON.stringify({ + grabbableKey: { + grabbable: true + }, + hifiHomeKey: { + reset: true + } + }), + dimensions: block.dimensions, + modelURL: block.url, + shapeType: 'box', + velocity: { + x: 0, + y: -0.01, + z: 0, + }, + position: PLAYABLE_BLOCKS_POSITION + } + this.playableBlocks.push(Entities.addEntity(blockProps)); + } + }, + + unload: function() { + this.cleanup(); + Script.update.disconnect(_this.update); + }, + + clickReleaseOnEntity: function() { + print('BLOCKY click') + this.startNearTrigger(); + }, + + update: function() { + if (this.busy === true) { + return; + } + var BEAM_TRIGGER_THRESHOLD = 0.075; + + var BEAM_POSITION = { + x: 1098.5159, + y: 460.0490, + z: -66.3012 + }; + + var leftHandPosition = MyAvatar.getLeftPalmPosition(); + var rightHandPosition = MyAvatar.getRightPalmPosition(); + + var rightDistance = Vec3.distance(leftHandPosition, BEAM_POSITION) + var leftDistance = Vec3.distance(rightHandPosition, BEAM_POSITION) + + if (rightDistance < BEAM_TRIGGER_THRESHOLD || leftDistance < BEAM_TRIGGER_THRESHOLD) { + _this.startNearTrigger(); + } + } + } + + return new Blocky(); +}) \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/blocky/wrapper.js b/unpublishedScripts/DomainContent/Home/blocky/wrapper.js index 2b56b716ec..dfddbaff5d 100644 --- a/unpublishedScripts/DomainContent/Home/blocky/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/blocky/wrapper.js @@ -11,18 +11,18 @@ var RESETTER_POSITION = { - x: 1098.27, - y: 460.43, - z: -66.15 + x: 1098.5159, + y: 460.0490, + z: -66.3012 }; BlockyGame = function(spawnPosition, spawnRotation) { - var scriptURL ="atp:/blocky/blocky.js"; + var scriptURL = "atp:/blocky/blocky.js"; var blockyProps = { type: 'Box', - name:'home_box_blocky_resetter', + name: 'home_box_blocky_resetter', color: { red: 0, green: 0, @@ -33,6 +33,7 @@ BlockyGame = function(spawnPosition, spawnRotation) { y: 0.25, z: 0.25 }, + rotation:Quat.fromPitchYawRollDegrees(-0.0029,32.9983,-0.0021), script: scriptURL, userData: JSON.stringify({ "grabbableKey": { diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index bdc97fcbc6..a15c0c4d87 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -330,7 +330,6 @@ y: 179.0293, z: 89.9698 }); - print('home before cuckooClock') var cuckooClock = new MyCuckooClock({ x: 1105.5237, @@ -341,11 +340,11 @@ y: -57.0089, z: -0.0013 }); - print('home after cuckooClock') + var blocky = new BlockyGame({ - x: 1098.27, - y: 460.43, - z: -66.15 + x: 1098.5159, + y: 460.0490, + z: -66.3012 }) print('HOME after creating scripted entities') From b171b5e9eb75e1c0c85b69e90ef083bad84d26ce Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Wed, 1 Jun 2016 13:40:46 -0700 Subject: [PATCH 22/89] update blocky --- .../DomainContent/Home/blocky/blocky.js | 12 +++++----- .../DomainContent/Home/blocky/wrapper.js | 22 +++++-------------- .../DomainContent/Home/reset.js | 6 ++--- 3 files changed, 16 insertions(+), 24 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/blocky/blocky.js b/unpublishedScripts/DomainContent/Home/blocky/blocky.js index c7e35d15e7..8eae31a439 100644 --- a/unpublishedScripts/DomainContent/Home/blocky/blocky.js +++ b/unpublishedScripts/DomainContent/Home/blocky/blocky.js @@ -178,7 +178,9 @@ var TARGET_BLOCKS_POSITION = { this.createPlayableBlocks(arrangement); } - this.busy = false; + Script.setTimeout(function() { + _this.busy = false; + }, 1000) }, findBlocks: function() { @@ -257,15 +259,15 @@ var TARGET_BLOCKS_POSITION = { }, update: function() { - if (this.busy === true) { + if (_this.busy === true) { return; } var BEAM_TRIGGER_THRESHOLD = 0.075; var BEAM_POSITION = { - x: 1098.5159, - y: 460.0490, - z: -66.3012 + x: 1098.4424, + y: 460.3090, + z: -66.2190 }; var leftHandPosition = MyAvatar.getLeftPalmPosition(); diff --git a/unpublishedScripts/DomainContent/Home/blocky/wrapper.js b/unpublishedScripts/DomainContent/Home/blocky/wrapper.js index dfddbaff5d..5ae7d4592e 100644 --- a/unpublishedScripts/DomainContent/Home/blocky/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/blocky/wrapper.js @@ -10,30 +10,20 @@ // -var RESETTER_POSITION = { - x: 1098.5159, - y: 460.0490, - z: -66.3012 -}; - BlockyGame = function(spawnPosition, spawnRotation) { var scriptURL = "atp:/blocky/blocky.js"; var blockyProps = { - type: 'Box', + type: 'Model', + modelURL:'atp:/blocky/swiper.fbx', name: 'home_box_blocky_resetter', - color: { - red: 0, - green: 0, - blue: 255 - }, dimensions: { - x: 0.25, - y: 0.25, - z: 0.25 + x: 0.2543, + y: 0.3269, + z: 0.4154 }, - rotation:Quat.fromPitchYawRollDegrees(-0.0029,32.9983,-0.0021), + rotation:Quat.fromPitchYawRollDegrees(-9.5165,-147.3687,16.6577), script: scriptURL, userData: JSON.stringify({ "grabbableKey": { diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index a15c0c4d87..ffa26fb8b3 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -342,9 +342,9 @@ }); var blocky = new BlockyGame({ - x: 1098.5159, - y: 460.0490, - z: -66.3012 + x: 1098.4424, + y: 460.3090, + z: -66.2190 }) print('HOME after creating scripted entities') From 7bd29c13b0fd28ec27252adf8caa15995ef73185 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Thu, 2 Jun 2016 09:09:25 -0700 Subject: [PATCH 23/89] corrected oculus touch rotation and converted hand pose to avatar coordinate system --- .../oculus/src/OculusControllerManager.cpp | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/plugins/oculus/src/OculusControllerManager.cpp b/plugins/oculus/src/OculusControllerManager.cpp index 09ab6ec159..822b751ec4 100644 --- a/plugins/oculus/src/OculusControllerManager.cpp +++ b/plugins/oculus/src/OculusControllerManager.cpp @@ -220,12 +220,51 @@ void OculusControllerManager::TouchDevice::focusOutEvent() { void OculusControllerManager::TouchDevice::handlePose(float deltaTime, const controller::InputCalibrationData& inputCalibrationData, ovrHandType hand, const ovrPoseStatef& handPose) { + // When the sensor-to-world rotation is identity the coordinate axes look like this: + // + // user + // forward + // -z + // | + // y| user + // y o----x right + // o-----x user + // | up + // | + // z + // + // Rift + + // From ABOVE the hand canonical axes looks like this: + // + // | | | | y | | | | + // | | | | | | | | | + // | | | | | + // |left | / x---- + \ |right| + // | _/ z \_ | + // | | | | + // | | | | + // + + // So when the user is in Rift space facing the -zAxis with hands outstretched and palms down + // the rotation to align the Touch axes with those of the hands is: + // + // touchToHand = halfTurnAboutY * quaterTurnAboutX auto poseId = hand == ovrHand_Left ? controller::LEFT_HAND : controller::RIGHT_HAND; auto& pose = _poseStateMap[poseId]; + + static const glm::quat yFlip = glm::angleAxis(PI, Vectors::UNIT_Y); + static const glm::quat quarterX = glm::angleAxis(PI_OVER_TWO, Vectors::UNIT_X); + static const glm::quat touchToHand = yFlip * quarterX; + pose.translation = toGlm(handPose.ThePose.Position); - pose.rotation = toGlm(handPose.ThePose.Orientation); + pose.rotation = toGlm(handPose.ThePose.Orientation)*touchToHand; pose.angularVelocity = toGlm(handPose.AngularVelocity); pose.velocity = toGlm(handPose.LinearVelocity); + + // transform into avatar frame + glm::mat4 controllerToAvatar = glm::inverse(inputCalibrationData.avatarMat) * inputCalibrationData.sensorToWorldMat; + pose = pose.transform(controllerToAvatar); } controller::Input::NamedVector OculusControllerManager::TouchDevice::getAvailableInputs() const { From 0035774eb27099076a06c9fed670ed82a8946b3a Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Wed, 25 May 2016 14:57:34 -0700 Subject: [PATCH 24/89] Fix for models exported from Daz3D. The way post rotations were being applied was incorrect. I guess we've never tried a model that used the Maya Rotate Axis property before... --- libraries/fbx/src/FBXReader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/fbx/src/FBXReader.cpp b/libraries/fbx/src/FBXReader.cpp index 12cd0b0a91..e6f2741098 100644 --- a/libraries/fbx/src/FBXReader.cpp +++ b/libraries/fbx/src/FBXReader.cpp @@ -759,7 +759,7 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS model.preTransform = glm::translate(rotationOffset) * glm::translate(rotationPivot); model.preRotation = glm::quat(glm::radians(preRotation)); model.rotation = glm::quat(glm::radians(rotation)); - model.postRotation = glm::quat(glm::radians(postRotation)); + model.postRotation = glm::inverse(glm::quat(glm::radians(postRotation))); model.postTransform = glm::translate(-rotationPivot) * glm::translate(scaleOffset) * glm::translate(scalePivot) * glm::scale(scale) * glm::translate(-scalePivot); // NOTE: angles from the FBX file are in degrees From 99846677421f44e2a5fe1caea508cc1c431e9ddf Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Thu, 2 Jun 2016 10:09:41 -0700 Subject: [PATCH 25/89] touch properly sets pose.valid and further corrected hand rotation --- .../oculus/src/OculusControllerManager.cpp | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/plugins/oculus/src/OculusControllerManager.cpp b/plugins/oculus/src/OculusControllerManager.cpp index 822b751ec4..f19282a8f2 100644 --- a/plugins/oculus/src/OculusControllerManager.cpp +++ b/plugins/oculus/src/OculusControllerManager.cpp @@ -183,6 +183,8 @@ void OculusControllerManager::TouchDevice::update(float deltaTime, const control ++numTrackedControllers; if (REQUIRED_HAND_STATUS == (tracking.HandStatusFlags[hand] & REQUIRED_HAND_STATUS)) { handlePose(deltaTime, inputCalibrationData, hand, tracking.HandPoses[hand]); + } else { + _poseStateMap[hand == ovrHand_Left ? controller::LEFT_HAND : controller::RIGHT_HAND].valid = false; } }); using namespace controller; @@ -250,6 +252,25 @@ void OculusControllerManager::TouchDevice::handlePose(float deltaTime, // the rotation to align the Touch axes with those of the hands is: // // touchToHand = halfTurnAboutY * quaterTurnAboutX + + // Due to how the Touch controllers fit into the palm there is an offset that is different for each hand. + // You can think of this offset as the inverse of the measured rotation when the hands are posed, such that + // the combination (measurement * offset) is identity at this orientation. + // + // Qoffset = glm::inverse(deltaRotation when hand is posed fingers forward, palm down) + // + // An approximate offset for the Touch can be obtained by inspection: + // + // Qoffset = glm::inverse(glm::angleAxis(sign * PI/2.0f, zAxis) + // + // So the full equation is: + // + // Q = combinedMeasurement * touchToHand + // + // Q = (deltaQ * QOffset) * (yFlip * quarterTurnAboutX) + // + // Q = (deltaQ * inverse(deltaQForAlignedHand)) * (yFlip * quarterTurnAboutX) + auto poseId = hand == ovrHand_Left ? controller::LEFT_HAND : controller::RIGHT_HAND; auto& pose = _poseStateMap[poseId]; @@ -257,10 +278,15 @@ void OculusControllerManager::TouchDevice::handlePose(float deltaTime, static const glm::quat quarterX = glm::angleAxis(PI_OVER_TWO, Vectors::UNIT_X); static const glm::quat touchToHand = yFlip * quarterX; + static const float sign = (hand == ovrHand_Left ? 1.0f : -1.0f); + static const glm::quat signedQuarterZ = glm::angleAxis(sign * PI_OVER_TWO, Vectors::UNIT_Z); + static const glm::quat signedRotationOffset = glm::inverse(signedQuarterZ) * touchToHand; + pose.translation = toGlm(handPose.ThePose.Position); - pose.rotation = toGlm(handPose.ThePose.Orientation)*touchToHand; + pose.rotation = toGlm(handPose.ThePose.Orientation)*signedRotationOffset; pose.angularVelocity = toGlm(handPose.AngularVelocity); pose.velocity = toGlm(handPose.LinearVelocity); + pose.valid = true; // transform into avatar frame glm::mat4 controllerToAvatar = glm::inverse(inputCalibrationData.avatarMat) * inputCalibrationData.sensorToWorldMat; From c9ea85e659302e8df170aa9beb460087a0275278 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Thu, 2 Jun 2016 10:50:22 -0700 Subject: [PATCH 26/89] fixed left hand rotation --- plugins/oculus/src/OculusControllerManager.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/oculus/src/OculusControllerManager.cpp b/plugins/oculus/src/OculusControllerManager.cpp index f19282a8f2..2fd48bb611 100644 --- a/plugins/oculus/src/OculusControllerManager.cpp +++ b/plugins/oculus/src/OculusControllerManager.cpp @@ -278,12 +278,16 @@ void OculusControllerManager::TouchDevice::handlePose(float deltaTime, static const glm::quat quarterX = glm::angleAxis(PI_OVER_TWO, Vectors::UNIT_X); static const glm::quat touchToHand = yFlip * quarterX; - static const float sign = (hand == ovrHand_Left ? 1.0f : -1.0f); - static const glm::quat signedQuarterZ = glm::angleAxis(sign * PI_OVER_TWO, Vectors::UNIT_Z); - static const glm::quat signedRotationOffset = glm::inverse(signedQuarterZ) * touchToHand; + static const glm::quat leftQuarterZ = glm::angleAxis(-PI_OVER_TWO, Vectors::UNIT_Z); + static const glm::quat rightQuarterZ = glm::angleAxis(PI_OVER_TWO, Vectors::UNIT_Z); + + static const glm::quat leftRotationOffset = glm::inverse(leftQuarterZ) * touchToHand; + static const glm::quat rightRotationOffset = glm::inverse(rightQuarterZ) * touchToHand; + + auto rotationOffset = (hand == ovrHand_Left ? leftRotationOffset : rightRotationOffset); pose.translation = toGlm(handPose.ThePose.Position); - pose.rotation = toGlm(handPose.ThePose.Orientation)*signedRotationOffset; + pose.rotation = toGlm(handPose.ThePose.Orientation)*rotationOffset; pose.angularVelocity = toGlm(handPose.AngularVelocity); pose.velocity = toGlm(handPose.LinearVelocity); pose.valid = true; From 6ca02dcad24d4a1a1fa195120c6e24c47509252c Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Thu, 2 Jun 2016 12:11:13 -0700 Subject: [PATCH 27/89] expose Controller.triggerHapticPulse to javascript (currently does nothing) --- .../controllers/src/controllers/InputDevice.h | 5 +- .../src/controllers/ScriptingInterface.cpp | 104 +++++++++--------- .../src/controllers/ScriptingInterface.h | 6 +- .../src/controllers/UserInputMapper.cpp | 8 ++ .../src/controllers/UserInputMapper.h | 1 + 5 files changed, 71 insertions(+), 53 deletions(-) diff --git a/libraries/controllers/src/controllers/InputDevice.h b/libraries/controllers/src/controllers/InputDevice.h index afb1f7d1f7..3c8e728f4d 100644 --- a/libraries/controllers/src/controllers/InputDevice.h +++ b/libraries/controllers/src/controllers/InputDevice.h @@ -51,10 +51,13 @@ public: float getValue(const Input& input) const; float getValue(ChannelType channelType, uint16_t channel) const; - Pose getPoseValue(uint16_t channel) const; + Pose getPoseValue(uint16_t channel) const; const QString& getName() const { return _name; } + // By default, Input Devices do not support haptics + virtual bool triggerHapticPulse(float strength, float duration, bool leftHand) { return false; } + // Update call MUST be called once per simulation loop // It takes care of updating the action states and deltas virtual void update(float deltaTime, const InputCalibrationData& inputCalibrationData) {}; diff --git a/libraries/controllers/src/controllers/ScriptingInterface.cpp b/libraries/controllers/src/controllers/ScriptingInterface.cpp index c2e64ca19e..a7d9270ddf 100644 --- a/libraries/controllers/src/controllers/ScriptingInterface.cpp +++ b/libraries/controllers/src/controllers/ScriptingInterface.cpp @@ -76,69 +76,73 @@ controller::ScriptingInterface::ScriptingInterface() { namespace controller { - QObject* ScriptingInterface::newMapping(const QString& mappingName) { - auto userInputMapper = DependencyManager::get(); - return new MappingBuilderProxy(*userInputMapper, userInputMapper->newMapping(mappingName)); - } + QObject* ScriptingInterface::newMapping(const QString& mappingName) { + auto userInputMapper = DependencyManager::get(); + return new MappingBuilderProxy(*userInputMapper, userInputMapper->newMapping(mappingName)); + } - void ScriptingInterface::enableMapping(const QString& mappingName, bool enable) { - auto userInputMapper = DependencyManager::get(); - userInputMapper->enableMapping(mappingName, enable); - } + void ScriptingInterface::enableMapping(const QString& mappingName, bool enable) { + auto userInputMapper = DependencyManager::get(); + userInputMapper->enableMapping(mappingName, enable); + } - float ScriptingInterface::getValue(const int& source) const { - auto userInputMapper = DependencyManager::get(); - return userInputMapper->getValue(Input((uint32_t)source)); - } + float ScriptingInterface::getValue(const int& source) const { + auto userInputMapper = DependencyManager::get(); + return userInputMapper->getValue(Input((uint32_t)source)); + } - float ScriptingInterface::getButtonValue(StandardButtonChannel source, uint16_t device) const { - return getValue(Input(device, source, ChannelType::BUTTON).getID()); - } + float ScriptingInterface::getButtonValue(StandardButtonChannel source, uint16_t device) const { + return getValue(Input(device, source, ChannelType::BUTTON).getID()); + } - float ScriptingInterface::getAxisValue(StandardAxisChannel source, uint16_t device) const { - return getValue(Input(device, source, ChannelType::AXIS).getID()); - } + float ScriptingInterface::getAxisValue(StandardAxisChannel source, uint16_t device) const { + return getValue(Input(device, source, ChannelType::AXIS).getID()); + } - Pose ScriptingInterface::getPoseValue(const int& source) const { - auto userInputMapper = DependencyManager::get(); - return userInputMapper->getPose(Input((uint32_t)source)); - } - - Pose ScriptingInterface::getPoseValue(StandardPoseChannel source, uint16_t device) const { - return getPoseValue(Input(device, source, ChannelType::POSE).getID()); - } + Pose ScriptingInterface::getPoseValue(const int& source) const { + auto userInputMapper = DependencyManager::get(); + return userInputMapper->getPose(Input((uint32_t)source)); + } - QVector ScriptingInterface::getAllActions() { - return DependencyManager::get()->getAllActions(); - } + Pose ScriptingInterface::getPoseValue(StandardPoseChannel source, uint16_t device) const { + return getPoseValue(Input(device, source, ChannelType::POSE).getID()); + } - QString ScriptingInterface::getDeviceName(unsigned int device) { - return DependencyManager::get()->getDeviceName((unsigned short)device); - } + QVector ScriptingInterface::getAllActions() { + return DependencyManager::get()->getAllActions(); + } - QVector ScriptingInterface::getAvailableInputs(unsigned int device) { - return DependencyManager::get()->getAvailableInputs((unsigned short)device); - } + QString ScriptingInterface::getDeviceName(unsigned int device) { + return DependencyManager::get()->getDeviceName((unsigned short)device); + } - int ScriptingInterface::findDevice(QString name) { - return DependencyManager::get()->findDevice(name); - } + QVector ScriptingInterface::getAvailableInputs(unsigned int device) { + return DependencyManager::get()->getAvailableInputs((unsigned short)device); + } - QVector ScriptingInterface::getDeviceNames() { - return DependencyManager::get()->getDeviceNames(); - } + int ScriptingInterface::findDevice(QString name) { + return DependencyManager::get()->findDevice(name); + } - float ScriptingInterface::getActionValue(int action) { - return DependencyManager::get()->getActionState(Action(action)); - } + QVector ScriptingInterface::getDeviceNames() { + return DependencyManager::get()->getDeviceNames(); + } - int ScriptingInterface::findAction(QString actionName) { - return DependencyManager::get()->findAction(actionName); - } + float ScriptingInterface::getActionValue(int action) { + return DependencyManager::get()->getActionState(Action(action)); + } - QVector ScriptingInterface::getActionNames() const { - return DependencyManager::get()->getActionNames(); - } + int ScriptingInterface::findAction(QString actionName) { + return DependencyManager::get()->findAction(actionName); + } + + QVector ScriptingInterface::getActionNames() const { + return DependencyManager::get()->getActionNames(); + } + + bool ScriptingInterface::triggerHapticPulse(unsigned int device, float strength, float duration, bool leftHand) const { + return DependencyManager::get()->triggerHapticPulse(device, strength, duration, leftHand); + } void ScriptingInterface::updateMaps() { QVariantMap newHardware; diff --git a/libraries/controllers/src/controllers/ScriptingInterface.h b/libraries/controllers/src/controllers/ScriptingInterface.h index f30212a09e..7f7120a907 100644 --- a/libraries/controllers/src/controllers/ScriptingInterface.h +++ b/libraries/controllers/src/controllers/ScriptingInterface.h @@ -77,12 +77,14 @@ namespace controller { Q_INVOKABLE QVector getDeviceNames(); Q_INVOKABLE int findAction(QString actionName); Q_INVOKABLE QVector getActionNames() const; - + Q_INVOKABLE float getValue(const int& source) const; Q_INVOKABLE float getButtonValue(StandardButtonChannel source, uint16_t device = 0) const; Q_INVOKABLE float getAxisValue(StandardAxisChannel source, uint16_t device = 0) const; Q_INVOKABLE Pose getPoseValue(const int& source) const; - Q_INVOKABLE Pose getPoseValue(StandardPoseChannel source, uint16_t device = 0) const; + Q_INVOKABLE Pose getPoseValue(StandardPoseChannel source, uint16_t device = 0) const; + + Q_INVOKABLE bool triggerHapticPulse(unsigned int device, float strength, float duration, bool leftHand = true) const; Q_INVOKABLE QObject* newMapping(const QString& mappingName = QUuid::createUuid().toString()); Q_INVOKABLE void enableMapping(const QString& mappingName, bool enable = true); diff --git a/libraries/controllers/src/controllers/UserInputMapper.cpp b/libraries/controllers/src/controllers/UserInputMapper.cpp index c1ee3ce36c..2c9138e120 100755 --- a/libraries/controllers/src/controllers/UserInputMapper.cpp +++ b/libraries/controllers/src/controllers/UserInputMapper.cpp @@ -336,6 +336,14 @@ QVector UserInputMapper::getActionNames() const { return result; } +bool UserInputMapper::triggerHapticPulse(uint16 deviceID, float strength, float duration, bool leftHand) { + Locker locker(_lock); + if (_registeredDevices.find(deviceID) != _registeredDevices.end()) { + return _registeredDevices[deviceID]->triggerHapticPulse(strength, duration, leftHand); + } + return false; +} + int actionMetaTypeId = qRegisterMetaType(); int inputMetaTypeId = qRegisterMetaType(); int inputPairMetaTypeId = qRegisterMetaType(); diff --git a/libraries/controllers/src/controllers/UserInputMapper.h b/libraries/controllers/src/controllers/UserInputMapper.h index 9c79415b6e..ac60247e8e 100644 --- a/libraries/controllers/src/controllers/UserInputMapper.h +++ b/libraries/controllers/src/controllers/UserInputMapper.h @@ -89,6 +89,7 @@ namespace controller { void setActionState(Action action, float value) { _actionStates[toInt(action)] = value; } void deltaActionState(Action action, float delta) { _actionStates[toInt(action)] += delta; } void setActionState(Action action, const Pose& value) { _poseStates[toInt(action)] = value; } + bool triggerHapticPulse(uint16 deviceID, float strength, float duration, bool leftHand); static Input makeStandardInput(controller::StandardButtonChannel button); static Input makeStandardInput(controller::StandardAxisChannel axis); From 642438a2596c8ea6d4d7f3fb7b55c11deb7d4545 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Thu, 2 Jun 2016 12:18:56 -0700 Subject: [PATCH 28/89] fix tabs --- .../controllers/src/controllers/InputDevice.h | 6 +- .../src/controllers/ScriptingInterface.cpp | 106 +++++++++--------- .../src/controllers/ScriptingInterface.h | 6 +- .../src/controllers/UserInputMapper.cpp | 10 +- .../src/controllers/UserInputMapper.h | 2 +- 5 files changed, 65 insertions(+), 65 deletions(-) diff --git a/libraries/controllers/src/controllers/InputDevice.h b/libraries/controllers/src/controllers/InputDevice.h index 3c8e728f4d..cc158497e0 100644 --- a/libraries/controllers/src/controllers/InputDevice.h +++ b/libraries/controllers/src/controllers/InputDevice.h @@ -51,12 +51,12 @@ public: float getValue(const Input& input) const; float getValue(ChannelType channelType, uint16_t channel) const; - Pose getPoseValue(uint16_t channel) const; + Pose getPoseValue(uint16_t channel) const; const QString& getName() const { return _name; } - // By default, Input Devices do not support haptics - virtual bool triggerHapticPulse(float strength, float duration, bool leftHand) { return false; } + // By default, Input Devices do not support haptics + virtual bool triggerHapticPulse(float strength, float duration, bool leftHand) { return false; } // Update call MUST be called once per simulation loop // It takes care of updating the action states and deltas diff --git a/libraries/controllers/src/controllers/ScriptingInterface.cpp b/libraries/controllers/src/controllers/ScriptingInterface.cpp index a7d9270ddf..97b7a9ddd9 100644 --- a/libraries/controllers/src/controllers/ScriptingInterface.cpp +++ b/libraries/controllers/src/controllers/ScriptingInterface.cpp @@ -76,73 +76,73 @@ controller::ScriptingInterface::ScriptingInterface() { namespace controller { - QObject* ScriptingInterface::newMapping(const QString& mappingName) { - auto userInputMapper = DependencyManager::get(); - return new MappingBuilderProxy(*userInputMapper, userInputMapper->newMapping(mappingName)); - } + QObject* ScriptingInterface::newMapping(const QString& mappingName) { + auto userInputMapper = DependencyManager::get(); + return new MappingBuilderProxy(*userInputMapper, userInputMapper->newMapping(mappingName)); + } - void ScriptingInterface::enableMapping(const QString& mappingName, bool enable) { - auto userInputMapper = DependencyManager::get(); - userInputMapper->enableMapping(mappingName, enable); - } + void ScriptingInterface::enableMapping(const QString& mappingName, bool enable) { + auto userInputMapper = DependencyManager::get(); + userInputMapper->enableMapping(mappingName, enable); + } - float ScriptingInterface::getValue(const int& source) const { - auto userInputMapper = DependencyManager::get(); - return userInputMapper->getValue(Input((uint32_t)source)); - } + float ScriptingInterface::getValue(const int& source) const { + auto userInputMapper = DependencyManager::get(); + return userInputMapper->getValue(Input((uint32_t)source)); + } - float ScriptingInterface::getButtonValue(StandardButtonChannel source, uint16_t device) const { - return getValue(Input(device, source, ChannelType::BUTTON).getID()); - } + float ScriptingInterface::getButtonValue(StandardButtonChannel source, uint16_t device) const { + return getValue(Input(device, source, ChannelType::BUTTON).getID()); + } - float ScriptingInterface::getAxisValue(StandardAxisChannel source, uint16_t device) const { - return getValue(Input(device, source, ChannelType::AXIS).getID()); - } + float ScriptingInterface::getAxisValue(StandardAxisChannel source, uint16_t device) const { + return getValue(Input(device, source, ChannelType::AXIS).getID()); + } - Pose ScriptingInterface::getPoseValue(const int& source) const { - auto userInputMapper = DependencyManager::get(); - return userInputMapper->getPose(Input((uint32_t)source)); - } + Pose ScriptingInterface::getPoseValue(const int& source) const { + auto userInputMapper = DependencyManager::get(); + return userInputMapper->getPose(Input((uint32_t)source)); + } + + Pose ScriptingInterface::getPoseValue(StandardPoseChannel source, uint16_t device) const { + return getPoseValue(Input(device, source, ChannelType::POSE).getID()); + } - Pose ScriptingInterface::getPoseValue(StandardPoseChannel source, uint16_t device) const { - return getPoseValue(Input(device, source, ChannelType::POSE).getID()); - } + QVector ScriptingInterface::getAllActions() { + return DependencyManager::get()->getAllActions(); + } - QVector ScriptingInterface::getAllActions() { - return DependencyManager::get()->getAllActions(); - } + QString ScriptingInterface::getDeviceName(unsigned int device) { + return DependencyManager::get()->getDeviceName((unsigned short)device); + } - QString ScriptingInterface::getDeviceName(unsigned int device) { - return DependencyManager::get()->getDeviceName((unsigned short)device); - } + QVector ScriptingInterface::getAvailableInputs(unsigned int device) { + return DependencyManager::get()->getAvailableInputs((unsigned short)device); + } - QVector ScriptingInterface::getAvailableInputs(unsigned int device) { - return DependencyManager::get()->getAvailableInputs((unsigned short)device); - } + int ScriptingInterface::findDevice(QString name) { + return DependencyManager::get()->findDevice(name); + } - int ScriptingInterface::findDevice(QString name) { - return DependencyManager::get()->findDevice(name); - } + QVector ScriptingInterface::getDeviceNames() { + return DependencyManager::get()->getDeviceNames(); + } - QVector ScriptingInterface::getDeviceNames() { - return DependencyManager::get()->getDeviceNames(); - } + float ScriptingInterface::getActionValue(int action) { + return DependencyManager::get()->getActionState(Action(action)); + } - float ScriptingInterface::getActionValue(int action) { - return DependencyManager::get()->getActionState(Action(action)); - } + int ScriptingInterface::findAction(QString actionName) { + return DependencyManager::get()->findAction(actionName); + } - int ScriptingInterface::findAction(QString actionName) { - return DependencyManager::get()->findAction(actionName); - } + QVector ScriptingInterface::getActionNames() const { + return DependencyManager::get()->getActionNames(); + } - QVector ScriptingInterface::getActionNames() const { - return DependencyManager::get()->getActionNames(); - } - - bool ScriptingInterface::triggerHapticPulse(unsigned int device, float strength, float duration, bool leftHand) const { - return DependencyManager::get()->triggerHapticPulse(device, strength, duration, leftHand); - } + bool ScriptingInterface::triggerHapticPulse(unsigned int device, float strength, float duration, bool leftHand) const { + return DependencyManager::get()->triggerHapticPulse(device, strength, duration, leftHand); + } void ScriptingInterface::updateMaps() { QVariantMap newHardware; diff --git a/libraries/controllers/src/controllers/ScriptingInterface.h b/libraries/controllers/src/controllers/ScriptingInterface.h index 7f7120a907..cce159a9a7 100644 --- a/libraries/controllers/src/controllers/ScriptingInterface.h +++ b/libraries/controllers/src/controllers/ScriptingInterface.h @@ -77,14 +77,14 @@ namespace controller { Q_INVOKABLE QVector getDeviceNames(); Q_INVOKABLE int findAction(QString actionName); Q_INVOKABLE QVector getActionNames() const; - + Q_INVOKABLE float getValue(const int& source) const; Q_INVOKABLE float getButtonValue(StandardButtonChannel source, uint16_t device = 0) const; Q_INVOKABLE float getAxisValue(StandardAxisChannel source, uint16_t device = 0) const; Q_INVOKABLE Pose getPoseValue(const int& source) const; - Q_INVOKABLE Pose getPoseValue(StandardPoseChannel source, uint16_t device = 0) const; + Q_INVOKABLE Pose getPoseValue(StandardPoseChannel source, uint16_t device = 0) const; - Q_INVOKABLE bool triggerHapticPulse(unsigned int device, float strength, float duration, bool leftHand = true) const; + Q_INVOKABLE bool triggerHapticPulse(unsigned int device, float strength, float duration, bool leftHand = true) const; Q_INVOKABLE QObject* newMapping(const QString& mappingName = QUuid::createUuid().toString()); Q_INVOKABLE void enableMapping(const QString& mappingName, bool enable = true); diff --git a/libraries/controllers/src/controllers/UserInputMapper.cpp b/libraries/controllers/src/controllers/UserInputMapper.cpp index 2c9138e120..c7c62ad7d9 100755 --- a/libraries/controllers/src/controllers/UserInputMapper.cpp +++ b/libraries/controllers/src/controllers/UserInputMapper.cpp @@ -337,11 +337,11 @@ QVector UserInputMapper::getActionNames() const { } bool UserInputMapper::triggerHapticPulse(uint16 deviceID, float strength, float duration, bool leftHand) { - Locker locker(_lock); - if (_registeredDevices.find(deviceID) != _registeredDevices.end()) { - return _registeredDevices[deviceID]->triggerHapticPulse(strength, duration, leftHand); - } - return false; + Locker locker(_lock); + if (_registeredDevices.find(deviceID) != _registeredDevices.end()) { + return _registeredDevices[deviceID]->triggerHapticPulse(strength, duration, leftHand); + } + return false; } int actionMetaTypeId = qRegisterMetaType(); diff --git a/libraries/controllers/src/controllers/UserInputMapper.h b/libraries/controllers/src/controllers/UserInputMapper.h index ac60247e8e..b23657fff7 100644 --- a/libraries/controllers/src/controllers/UserInputMapper.h +++ b/libraries/controllers/src/controllers/UserInputMapper.h @@ -89,7 +89,7 @@ namespace controller { void setActionState(Action action, float value) { _actionStates[toInt(action)] = value; } void deltaActionState(Action action, float delta) { _actionStates[toInt(action)] += delta; } void setActionState(Action action, const Pose& value) { _poseStates[toInt(action)] = value; } - bool triggerHapticPulse(uint16 deviceID, float strength, float duration, bool leftHand); + bool triggerHapticPulse(uint16 deviceID, float strength, float duration, bool leftHand); static Input makeStandardInput(controller::StandardButtonChannel button); static Input makeStandardInput(controller::StandardAxisChannel axis); From 69971a3439163e912a5c677edcf6796ec234687f Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Thu, 2 Jun 2016 12:20:05 -0700 Subject: [PATCH 29/89] fix one more tab --- libraries/controllers/src/controllers/ScriptingInterface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/controllers/src/controllers/ScriptingInterface.h b/libraries/controllers/src/controllers/ScriptingInterface.h index cce159a9a7..015ec25454 100644 --- a/libraries/controllers/src/controllers/ScriptingInterface.h +++ b/libraries/controllers/src/controllers/ScriptingInterface.h @@ -77,7 +77,7 @@ namespace controller { Q_INVOKABLE QVector getDeviceNames(); Q_INVOKABLE int findAction(QString actionName); Q_INVOKABLE QVector getActionNames() const; - + Q_INVOKABLE float getValue(const int& source) const; Q_INVOKABLE float getButtonValue(StandardButtonChannel source, uint16_t device = 0) const; Q_INVOKABLE float getAxisValue(StandardAxisChannel source, uint16_t device = 0) const; From bf920c2b80e1041dafec8ca8c7bd19c0bd630ebd Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Wed, 25 May 2016 12:16:39 -0700 Subject: [PATCH 30/89] Compact Domain heartbeat JSON --- domain-server/src/DomainServer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 052a7c0fec..231e9ba014 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1121,7 +1121,7 @@ void DomainServer::sendHeartbeatToMetaverse(const QString& networkAddress) { domainObject[DOMAIN_HEARTBEAT_KEY] = heartbeatObject; - QString domainUpdateJSON = QString("{\"domain\": %1 }").arg(QString(QJsonDocument(domainObject).toJson())); + QString domainUpdateJSON = QString("{\"domain\":%1}").arg(QString(QJsonDocument(domainObject).toJson(QJsonDocument::Compact))); DependencyManager::get()->sendRequest(DOMAIN_UPDATE.arg(uuidStringWithoutCurlyBraces(domainID)), AccountManagerAuth::Required, From 87e27d9570b9419802ddbed6f664d42baf912db8 Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Wed, 25 May 2016 12:16:02 -0700 Subject: [PATCH 31/89] Factor out metadata generation from heartbeat --- domain-server/src/DomainServer.cpp | 79 ++++++++++++++++-------------- 1 file changed, 43 insertions(+), 36 deletions(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 231e9ba014..ae3c26a34d 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1067,62 +1067,69 @@ void DomainServer::performIPAddressUpdate(const HifiSockAddr& newPublicSockAddr) sendHeartbeatToMetaverse(newPublicSockAddr.getAddress().toString()); } - -void DomainServer::sendHeartbeatToMetaverse(const QString& networkAddress) { - const QString DOMAIN_UPDATE = "/api/v1/domains/%1"; - - auto nodeList = DependencyManager::get(); - const QUuid& domainID = nodeList->getSessionUUID(); - - // setup the domain object to send to the data server - const QString PUBLIC_NETWORK_ADDRESS_KEY = "network_address"; - const QString AUTOMATIC_NETWORKING_KEY = "automatic_networking"; - - QJsonObject domainObject; - if (!networkAddress.isEmpty()) { - domainObject[PUBLIC_NETWORK_ADDRESS_KEY] = networkAddress; - } - - domainObject[AUTOMATIC_NETWORKING_KEY] = _automaticNetworkingSetting; - - // add a flag to indicate if this domain uses restricted access - for now that will exclude it from listings - const QString RESTRICTED_ACCESS_FLAG = "restricted"; - - domainObject[RESTRICTED_ACCESS_FLAG] = - _settingsManager.valueOrDefaultValueForKeyPath(RESTRICTED_ACCESS_SETTINGS_KEYPATH).toBool(); - - // figure out the breakdown of currently connected interface clients - int numConnectedUnassigned = 0; - QJsonObject userHostnames; - +QVariantMap getMetadata() { static const QString DEFAULT_HOSTNAME = "*"; + auto nodeList = DependencyManager::get(); + int numConnectedUnassigned = 0; + QVariantMap userHostnames; + + // figure out the breakdown of currently connected interface clients nodeList->eachNode([&numConnectedUnassigned, &userHostnames](const SharedNodePointer& node) { - if (node->getLinkedData()) { - auto nodeData = static_cast(node->getLinkedData()); + auto linkedData = node->getLinkedData(); + if (linkedData) { + auto nodeData = static_cast(linkedData); if (!nodeData->wasAssigned()) { ++numConnectedUnassigned; // increment the count for this hostname (or the default if we don't have one) - auto hostname = nodeData->getPlaceName().isEmpty() ? DEFAULT_HOSTNAME : nodeData->getPlaceName(); + auto placeName = nodeData->getPlaceName(); + auto hostname = placeName.isEmpty() ? DEFAULT_HOSTNAME : placeName; userHostnames[hostname] = userHostnames[hostname].toInt() + 1; } } }); - static const QString DOMAIN_HEARTBEAT_KEY = "heartbeat"; + QVariantMap metadata; + static const QString HEARTBEAT_NUM_USERS_KEY = "num_users"; + metadata[HEARTBEAT_NUM_USERS_KEY] = numConnectedUnassigned; + static const QString HEARTBEAT_USER_HOSTNAMES_KEY = "user_hostnames"; + metadata[HEARTBEAT_USER_HOSTNAMES_KEY] = userHostnames; - QJsonObject heartbeatObject; - heartbeatObject[HEARTBEAT_NUM_USERS_KEY] = numConnectedUnassigned; - heartbeatObject[HEARTBEAT_USER_HOSTNAMES_KEY] = userHostnames; + return metadata; +} - domainObject[DOMAIN_HEARTBEAT_KEY] = heartbeatObject; +void DomainServer::sendHeartbeatToMetaverse(const QString& networkAddress) { + auto nodeList = DependencyManager::get(); + const QUuid& domainID = nodeList->getSessionUUID(); + + // Setup the domain object to send to the data server + QJsonObject domainObject; + + if (!networkAddress.isEmpty()) { + static const QString PUBLIC_NETWORK_ADDRESS_KEY = "network_address"; + domainObject[PUBLIC_NETWORK_ADDRESS_KEY] = networkAddress; + } + + static const QString AUTOMATIC_NETWORKING_KEY = "automatic_networking"; + domainObject[AUTOMATIC_NETWORKING_KEY] = _automaticNetworkingSetting; + + // Add a flag to indicate if this domain uses restricted access - + // for now that will exclude it from listings + static const QString RESTRICTED_ACCESS_FLAG = "restricted"; + domainObject[RESTRICTED_ACCESS_FLAG] = + _settingsManager.valueOrDefaultValueForKeyPath(RESTRICTED_ACCESS_SETTINGS_KEYPATH).toBool(); + + // Add the metadata to the heartbeat + static const QString DOMAIN_HEARTBEAT_KEY = "heartbeat"; + domainObject[DOMAIN_HEARTBEAT_KEY] = QJsonObject::fromVariantMap(getMetadata()); QString domainUpdateJSON = QString("{\"domain\":%1}").arg(QString(QJsonDocument(domainObject).toJson(QJsonDocument::Compact))); + static const QString DOMAIN_UPDATE = "/api/v1/domains/%1"; DependencyManager::get()->sendRequest(DOMAIN_UPDATE.arg(uuidStringWithoutCurlyBraces(domainID)), AccountManagerAuth::Required, QNetworkAccessManager::PutOperation, From 18696144f1c29e383d0bd2056395c6f8573fa19a Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Wed, 25 May 2016 12:23:47 -0700 Subject: [PATCH 32/89] Move metadata generation to DomainMetadata --- domain-server/src/DomainMetadata.cpp | 51 ++++++++++++++++++++++++++++ domain-server/src/DomainMetadata.h | 21 ++++++++++++ domain-server/src/DomainServer.cpp | 35 ------------------- domain-server/src/DomainServer.h | 1 + 4 files changed, 73 insertions(+), 35 deletions(-) create mode 100644 domain-server/src/DomainMetadata.cpp create mode 100644 domain-server/src/DomainMetadata.h diff --git a/domain-server/src/DomainMetadata.cpp b/domain-server/src/DomainMetadata.cpp new file mode 100644 index 0000000000..f584198b51 --- /dev/null +++ b/domain-server/src/DomainMetadata.cpp @@ -0,0 +1,51 @@ +// +// DomainMetadata.cpp +// domain-server/src +// +// Created by Zach Pomerantz on 5/25/2016. +// Copyright 2016 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 + +#include "DomainMetadata.h" + +#include +#include + +#include "DomainServerNodeData.h" + +QVariantMap getMetadata() { + static const QString DEFAULT_HOSTNAME = "*"; + + auto nodeList = DependencyManager::get(); + int numConnectedUnassigned = 0; + QVariantMap userHostnames; + + // figure out the breakdown of currently connected interface clients + nodeList->eachNode([&numConnectedUnassigned, &userHostnames](const SharedNodePointer& node) { + auto linkedData = node->getLinkedData(); + if (linkedData) { + auto nodeData = static_cast(linkedData); + + if (!nodeData->wasAssigned()) { + ++numConnectedUnassigned; + + // increment the count for this hostname (or the default if we don't have one) + auto placeName = nodeData->getPlaceName(); + auto hostname = placeName.isEmpty() ? DEFAULT_HOSTNAME : placeName; + userHostnames[hostname] = userHostnames[hostname].toInt() + 1; + } + } + }); + + QVariantMap metadata; + + static const QString HEARTBEAT_NUM_USERS_KEY = "num_users"; + metadata[HEARTBEAT_NUM_USERS_KEY] = numConnectedUnassigned; + + static const QString HEARTBEAT_USER_HOSTNAMES_KEY = "user_hostnames"; + metadata[HEARTBEAT_USER_HOSTNAMES_KEY] = userHostnames; + + return metadata; +} diff --git a/domain-server/src/DomainMetadata.h b/domain-server/src/DomainMetadata.h new file mode 100644 index 0000000000..3cd160ce85 --- /dev/null +++ b/domain-server/src/DomainMetadata.h @@ -0,0 +1,21 @@ +// +// DomainMetadata.h +// domain-server/src +// +// Created by Zach Pomerantz on 5/25/2016. +// Copyright 2016 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 hifi_DomainMetadata_h +#define hifi_DomainMetadata_h + +#include + +QVariantMap getMetadata(); + +// TODO: Encapsulate +class DomainMetadata { }; + +#endif // hifi_DomainMetadata_h diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index ae3c26a34d..f05dfd2c6d 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1067,41 +1067,6 @@ void DomainServer::performIPAddressUpdate(const HifiSockAddr& newPublicSockAddr) sendHeartbeatToMetaverse(newPublicSockAddr.getAddress().toString()); } -QVariantMap getMetadata() { - static const QString DEFAULT_HOSTNAME = "*"; - - auto nodeList = DependencyManager::get(); - int numConnectedUnassigned = 0; - QVariantMap userHostnames; - - // figure out the breakdown of currently connected interface clients - nodeList->eachNode([&numConnectedUnassigned, &userHostnames](const SharedNodePointer& node) { - auto linkedData = node->getLinkedData(); - if (linkedData) { - auto nodeData = static_cast(linkedData); - - if (!nodeData->wasAssigned()) { - ++numConnectedUnassigned; - - // increment the count for this hostname (or the default if we don't have one) - auto placeName = nodeData->getPlaceName(); - auto hostname = placeName.isEmpty() ? DEFAULT_HOSTNAME : placeName; - userHostnames[hostname] = userHostnames[hostname].toInt() + 1; - } - } - }); - - QVariantMap metadata; - - static const QString HEARTBEAT_NUM_USERS_KEY = "num_users"; - metadata[HEARTBEAT_NUM_USERS_KEY] = numConnectedUnassigned; - - static const QString HEARTBEAT_USER_HOSTNAMES_KEY = "user_hostnames"; - metadata[HEARTBEAT_USER_HOSTNAMES_KEY] = userHostnames; - - return metadata; -} - void DomainServer::sendHeartbeatToMetaverse(const QString& networkAddress) { auto nodeList = DependencyManager::get(); const QUuid& domainID = nodeList->getSessionUUID(); diff --git a/domain-server/src/DomainServer.h b/domain-server/src/DomainServer.h index c39e405380..0f93c50468 100644 --- a/domain-server/src/DomainServer.h +++ b/domain-server/src/DomainServer.h @@ -26,6 +26,7 @@ #include #include "DomainGatekeeper.h" +#include "DomainMetadata.h" #include "DomainServerSettingsManager.h" #include "DomainServerWebSessionData.h" #include "WalletTransaction.h" From b13e7a1a8f48cb61e7862591f5927a04cbf5abe5 Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Wed, 25 May 2016 12:35:52 -0700 Subject: [PATCH 33/89] Encapsulate metadata in DomainMetadata --- domain-server/src/DomainMetadata.cpp | 12 ++++++------ domain-server/src/DomainMetadata.h | 15 ++++++++++++--- domain-server/src/DomainServer.cpp | 2 +- domain-server/src/DomainServer.h | 2 ++ 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/domain-server/src/DomainMetadata.cpp b/domain-server/src/DomainMetadata.cpp index f584198b51..224fe1939b 100644 --- a/domain-server/src/DomainMetadata.cpp +++ b/domain-server/src/DomainMetadata.cpp @@ -15,7 +15,7 @@ #include "DomainServerNodeData.h" -QVariantMap getMetadata() { +void DomainMetadata::generate() { static const QString DEFAULT_HOSTNAME = "*"; auto nodeList = DependencyManager::get(); @@ -39,13 +39,13 @@ QVariantMap getMetadata() { } }); - QVariantMap metadata; - static const QString HEARTBEAT_NUM_USERS_KEY = "num_users"; - metadata[HEARTBEAT_NUM_USERS_KEY] = numConnectedUnassigned; + _metadata[HEARTBEAT_NUM_USERS_KEY] = numConnectedUnassigned; static const QString HEARTBEAT_USER_HOSTNAMES_KEY = "user_hostnames"; - metadata[HEARTBEAT_USER_HOSTNAMES_KEY] = userHostnames; + _metadata[HEARTBEAT_USER_HOSTNAMES_KEY] = userHostnames; - return metadata; +#if DEV_BUILD + qDebug() << "Regenerated domain metadata - users:" << _metadata; +#endif } diff --git a/domain-server/src/DomainMetadata.h b/domain-server/src/DomainMetadata.h index 3cd160ce85..5096f1bb3e 100644 --- a/domain-server/src/DomainMetadata.h +++ b/domain-server/src/DomainMetadata.h @@ -12,10 +12,19 @@ #define hifi_DomainMetadata_h #include +#include -QVariantMap getMetadata(); +class DomainMetadata { +public: + QVariantMap toVariantMap() { generate(); return _metadata; } + QJsonObject toJSON() { generate(); return QJsonObject::fromVariantMap(_metadata); } -// TODO: Encapsulate -class DomainMetadata { }; +protected slots: + // TODO: Connect appropriate signals to obviate JIT generation + void generate(); + +protected: + QVariantMap _metadata; +}; #endif // hifi_DomainMetadata_h diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index f05dfd2c6d..9b1fbb1d84 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1090,7 +1090,7 @@ void DomainServer::sendHeartbeatToMetaverse(const QString& networkAddress) { // Add the metadata to the heartbeat static const QString DOMAIN_HEARTBEAT_KEY = "heartbeat"; - domainObject[DOMAIN_HEARTBEAT_KEY] = QJsonObject::fromVariantMap(getMetadata()); + domainObject[DOMAIN_HEARTBEAT_KEY] = _metadata.toJSON(); QString domainUpdateJSON = QString("{\"domain\":%1}").arg(QString(QJsonDocument(domainObject).toJson(QJsonDocument::Compact))); diff --git a/domain-server/src/DomainServer.h b/domain-server/src/DomainServer.h index 0f93c50468..0a1df41f50 100644 --- a/domain-server/src/DomainServer.h +++ b/domain-server/src/DomainServer.h @@ -168,6 +168,8 @@ private: DomainServerSettingsManager _settingsManager; + DomainMetadata _metadata; + HifiSockAddr _iceServerSocket; std::unique_ptr _iceServerHeartbeatPacket; From 079f6af2cc3c07d881c23d01c2da32f2eb6866b0 Mon Sep 17 00:00:00 2001 From: samcake Date: Thu, 2 Jun 2016 16:14:46 -0700 Subject: [PATCH 34/89] Fixing the gamma correction for the debug view of occlusion --- libraries/render-utils/src/DebugDeferredBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/render-utils/src/DebugDeferredBuffer.cpp b/libraries/render-utils/src/DebugDeferredBuffer.cpp index 6dfec30b16..dc46b5d897 100644 --- a/libraries/render-utils/src/DebugDeferredBuffer.cpp +++ b/libraries/render-utils/src/DebugDeferredBuffer.cpp @@ -83,7 +83,7 @@ static const std::string DEFAULT_NORMAL_SHADER { static const std::string DEFAULT_OCCLUSION_SHADER{ "vec4 getFragmentColor() {" " DeferredFragment frag = unpackDeferredFragmentNoPosition(uv);" - " return vec4(vec3(frag.obscurance), 1.0);" + " return vec4(vec3(pow(frag.obscurance, 1.0 / 2.2)), 1.0);" " }" }; From 681da201fc7dfcec6f9649be1b11972ccab97657 Mon Sep 17 00:00:00 2001 From: samcake Date: Thu, 2 Jun 2016 16:25:14 -0700 Subject: [PATCH 35/89] COrrect the name of the Unlit dbug view --- scripts/developer/utilities/render/framebuffer.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/developer/utilities/render/framebuffer.qml b/scripts/developer/utilities/render/framebuffer.qml index 0d8d85cc32..1612f59276 100644 --- a/scripts/developer/utilities/render/framebuffer.qml +++ b/scripts/developer/utilities/render/framebuffer.qml @@ -33,7 +33,7 @@ Column { "Roughness", "Metallic", "Emissive", - "Shaded/Lightmapped/Unlit", + "Unlit", "Occlusion", "Lightmap", "Lighting", From 8b76af531bf326a0e707ce4760f4600218611784 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Thu, 2 Jun 2016 16:52:17 -0700 Subject: [PATCH 36/89] made touch hand orientation more comfortable, fixed all the touch key mappings, exposed capacitive touch keys for use later --- .../resources/controllers/oculus_touch.json | 36 ++++++-- .../oculus/src/OculusControllerManager.cpp | 86 +++++++++++++++---- 2 files changed, 98 insertions(+), 24 deletions(-) diff --git a/interface/resources/controllers/oculus_touch.json b/interface/resources/controllers/oculus_touch.json index cc8c2f8bdc..8cb512a526 100644 --- a/interface/resources/controllers/oculus_touch.json +++ b/interface/resources/controllers/oculus_touch.json @@ -1,22 +1,42 @@ { "name": "Oculus Touch to Standard", "channels": [ - { "from": "OculusTouch.LY", "filters": "invert", "to": "Standard.LY" }, - { "from": "OculusTouch.LX", "to": "Standard.LX" }, + { "from": "OculusTouch.A", "to": "Standard.A" }, + { "from": "OculusTouch.B", "to": "Standard.B" }, + { "from": "OculusTouch.X", "to": "Standard.X" }, + { "from": "OculusTouch.Y", "to": "Standard.Y" }, + + { "from": "OculusTouch.LY", "filters": "invert", "to": "Standard.LY" }, + { "from": "OculusTouch.LX", "to": "Standard.LX" }, { "from": "OculusTouch.LT", "to": "Standard.LT" }, + { "from": "OculusTouch.LS", "to": "Standard.LS" }, + { "from": "OculusTouch.LG", "to": "Standard.LG" }, + { "from": "OculusTouch.LeftGrip", "to": "Standard.LB" }, + { "from": "OculusTouch.LeftHand", "to": "Standard.LeftHand" }, - { "from": "OculusTouch.RY", "filters": "invert", "to": "Standard.RY" }, - { "from": "OculusTouch.RX", "to": "Standard.RX" }, - + { "from": "OculusTouch.RY", "filters": "invert", "to": "Standard.RY" }, + { "from": "OculusTouch.RX", "to": "Standard.RX" }, { "from": "OculusTouch.RT", "to": "Standard.RT" }, - { "from": "OculusTouch.RB", "to": "Standard.RB" }, { "from": "OculusTouch.RS", "to": "Standard.RS" }, + { "from": "OculusTouch.RG", "to": "Standard.RG" }, + { "from": "OculusTouch.RightGrip", "to": "Standard.RB" }, + { "from": "OculusTouch.RightHand", "to": "Standard.RightHand" }, { "from": "OculusTouch.LeftApplicationMenu", "to": "Standard.Back" }, { "from": "OculusTouch.RightApplicationMenu", "to": "Standard.Start" }, - { "from": "OculusTouch.LeftHand", "to": "Standard.LeftHand" }, - { "from": "OculusTouch.RightHand", "to": "Standard.RightHand" } + { "from": "OculusTouch.LeftPrimaryThumbTouch", "to": "Standard.LeftPrimaryThumbTouch" }, + { "from": "OculusTouch.LeftSecondaryThumbTouch", "to": "Standard.LeftSecondaryThumbTouch" }, + { "from": "OculusTouch.RightPrimaryThumbTouch", "to": "Standard.RightPrimaryThumbTouch" }, + { "from": "OculusTouch.RightSecondaryThumbTouch", "to": "Standard.RightSecondaryThumbTouch" }, + { "from": "OculusTouch.LeftPrimaryIndexTouch", "to": "Standard.LeftPrimaryIndexTouch" }, + { "from": "OculusTouch.RightPrimaryIndexTouch", "to": "Standard.RightPrimaryIndexTouch" }, + { "from": "OculusTouch.LSTouch", "to": "Standard.LSTouch" }, + { "from": "OculusTouch.RSTouch", "to": "Standard.RSTouch" }, + { "from": "OculusTouch.LeftThumbUp", "to": "Standard.LeftThumbUp" }, + { "from": "OculusTouch.RightThumbUp", "to": "Standard.RightThumbUp" }, + { "from": "OculusTouch.LeftIndexPoint", "to": "Standard.LeftIndexPoint" }, + { "from": "OculusTouch.RightIndexPoint", "to": "Standard.RightIndexPoint" } ] } diff --git a/plugins/oculus/src/OculusControllerManager.cpp b/plugins/oculus/src/OculusControllerManager.cpp index 2fd48bb611..e84fdcbfc7 100644 --- a/plugins/oculus/src/OculusControllerManager.cpp +++ b/plugins/oculus/src/OculusControllerManager.cpp @@ -120,14 +120,14 @@ static const std::vector> BUTTON_MAP { ovrButton_B, B }, { ovrButton_LThumb, LS }, { ovrButton_RThumb, RS }, - { ovrButton_LShoulder, LB }, - { ovrButton_RShoulder, RB }, + //{ ovrButton_LShoulder, LB }, + //{ ovrButton_RShoulder, RB }, } }; static const std::vector> TOUCH_MAP { { - { ovrTouch_X, LEFT_SECONDARY_THUMB_TOUCH }, + { ovrTouch_X, LEFT_PRIMARY_THUMB_TOUCH }, { ovrTouch_Y, LEFT_SECONDARY_THUMB_TOUCH }, - { ovrTouch_A, RIGHT_SECONDARY_THUMB_TOUCH }, + { ovrTouch_A, RIGHT_PRIMARY_THUMB_TOUCH }, { ovrTouch_B, RIGHT_SECONDARY_THUMB_TOUCH }, { ovrTouch_LIndexTrigger, LEFT_PRIMARY_INDEX_TOUCH }, { ovrTouch_RIndexTrigger, RIGHT_PRIMARY_INDEX_TOUCH }, @@ -173,6 +173,11 @@ void OculusControllerManager::RemoteDevice::focusOutEvent() { } void OculusControllerManager::TouchDevice::update(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) { + // Check past values of button map for hysteresis before clearing map + const float HYSTERESIS_OFFSET = -0.1f; + float LEFT_HYSTERESIS_OFFSET = _buttonPressedMap.find(LEFT_GRIP) != _buttonPressedMap.end() ? HYSTERESIS_OFFSET : 0.0f; + float RIGHT_HYSTERESIS_OFFSET = _buttonPressedMap.find(RIGHT_GRIP) != _buttonPressedMap.end() ? HYSTERESIS_OFFSET : 0.0f; + _poseStateMap.clear(); _buttonPressedMap.clear(); @@ -206,6 +211,16 @@ void OculusControllerManager::TouchDevice::update(float deltaTime, const control _buttonPressedMap.insert(pair.second); } } + // Map pressed hand triggers to grip buttons + // This is temporary in order to support the grab/equip scripts + const float handTriggerThreshold = 0.9f; + if (inputState.HandTrigger[ovrHand_Left] >= handTriggerThreshold + LEFT_HYSTERESIS_OFFSET) { + _buttonPressedMap.insert(LEFT_GRIP); + } + if (inputState.HandTrigger[ovrHand_Right] >= handTriggerThreshold + RIGHT_HYSTERESIS_OFFSET) { + _buttonPressedMap.insert(RIGHT_GRIP); + } + // Touches for (const auto& pair : TOUCH_MAP) { if (inputState.Touches & pair.first) { @@ -261,7 +276,7 @@ void OculusControllerManager::TouchDevice::handlePose(float deltaTime, // // An approximate offset for the Touch can be obtained by inspection: // - // Qoffset = glm::inverse(glm::angleAxis(sign * PI/2.0f, zAxis) + // Qoffset = glm::inverse(glm::angleAxis(sign * PI/2.0f, zAxis) * glm::angleAxis(PI/4.0f, xAxis)) // // So the full equation is: // @@ -280,14 +295,26 @@ void OculusControllerManager::TouchDevice::handlePose(float deltaTime, static const glm::quat leftQuarterZ = glm::angleAxis(-PI_OVER_TWO, Vectors::UNIT_Z); static const glm::quat rightQuarterZ = glm::angleAxis(PI_OVER_TWO, Vectors::UNIT_Z); + static const glm::quat eighthX = glm::angleAxis(PI / 4.0f, Vectors::UNIT_X); - static const glm::quat leftRotationOffset = glm::inverse(leftQuarterZ) * touchToHand; - static const glm::quat rightRotationOffset = glm::inverse(rightQuarterZ) * touchToHand; + static const glm::quat leftRotationOffset = glm::inverse(leftQuarterZ * eighthX) * touchToHand; + static const glm::quat rightRotationOffset = glm::inverse(rightQuarterZ * eighthX) * touchToHand; + static const float CONTROLLER_LENGTH_OFFSET = 0.0762f; // three inches + static const glm::vec3 CONTROLLER_OFFSET = glm::vec3(CONTROLLER_LENGTH_OFFSET / 2.0f, + CONTROLLER_LENGTH_OFFSET / 2.0f, + CONTROLLER_LENGTH_OFFSET * 2.0f); + static const glm::vec3 leftTranslationOffset = glm::vec3(-1.0f, 1.0f, 1.0f) * CONTROLLER_OFFSET; + static const glm::vec3 rightTranslationOffset = CONTROLLER_OFFSET; + + auto translationOffset = (hand == ovrHand_Left ? leftTranslationOffset : rightTranslationOffset); auto rotationOffset = (hand == ovrHand_Left ? leftRotationOffset : rightRotationOffset); + glm::quat rotation = toGlm(handPose.ThePose.Orientation); + pose.translation = toGlm(handPose.ThePose.Position); - pose.rotation = toGlm(handPose.ThePose.Orientation)*rotationOffset; + pose.translation += rotation * translationOffset; + pose.rotation = rotation * rotationOffset; pose.angularVelocity = toGlm(handPose.AngularVelocity); pose.velocity = toGlm(handPose.LinearVelocity); pose.valid = true; @@ -300,27 +327,54 @@ void OculusControllerManager::TouchDevice::handlePose(float deltaTime, controller::Input::NamedVector OculusControllerManager::TouchDevice::getAvailableInputs() const { using namespace controller; QVector availableInputs{ - // Trackpad analogs + // buttons + makePair(A, "A"), + makePair(B, "B"), + makePair(X, "X"), + makePair(Y, "Y"), + + // trackpad analogs makePair(LX, "LX"), makePair(LY, "LY"), makePair(RX, "RX"), makePair(RY, "RY"), - // trigger analogs + + // triggers makePair(LT, "LT"), makePair(RT, "RT"), - makePair(LB, "LB"), - makePair(RB, "RB"), + // trigger buttons + //makePair(LB, "LB"), + //makePair(RB, "RB"), + // side grip triggers + makePair(LG, "LG"), + makePair(RG, "RG"), + makePair(LEFT_GRIP, "LeftGrip"), + makePair(RIGHT_GRIP, "RightGrip"), + + // joystick buttons makePair(LS, "LS"), makePair(RS, "RS"), + makePair(LEFT_HAND, "LeftHand"), makePair(RIGHT_HAND, "RightHand"), - makePair(LEFT_PRIMARY_THUMB, "LeftPrimaryThumb"), - makePair(LEFT_SECONDARY_THUMB, "LeftSecondaryThumb"), - makePair(RIGHT_PRIMARY_THUMB, "RightPrimaryThumb"), - makePair(RIGHT_SECONDARY_THUMB, "RightSecondaryThumb"), + makePair(LEFT_PRIMARY_THUMB_TOUCH, "LeftPrimaryThumbTouch"), + makePair(LEFT_SECONDARY_THUMB_TOUCH, "LeftSecondaryThumbTouch"), + makePair(RIGHT_PRIMARY_THUMB_TOUCH, "RightPrimaryThumbTouch"), + makePair(RIGHT_SECONDARY_THUMB_TOUCH, "RightSecondaryThumbTouch"), + makePair(LEFT_PRIMARY_INDEX_TOUCH, "LeftPrimaryIndexTouch"), + makePair(RIGHT_PRIMARY_INDEX_TOUCH, "RightPrimaryIndexTouch"), + makePair(LS_TOUCH, "LSTouch"), + makePair(RS_TOUCH, "RSTouch"), + makePair(LEFT_THUMB_UP, "LeftThumbUp"), + makePair(RIGHT_THUMB_UP, "RightThumbUp"), + makePair(LEFT_INDEX_POINT, "LeftIndexPoint"), + makePair(RIGHT_INDEX_POINT, "RightIndexPoint"), + + makePair(BACK, "LeftApplicationMenu"), + makePair(START, "RightApplicationMenu"), }; return availableInputs; } From f6644ad2bb4692f75bcf8f78ed41c2b8aaf1e2c3 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Thu, 2 Jun 2016 16:58:48 -0700 Subject: [PATCH 37/89] change artemis url --- unpublishedScripts/DomainContent/Home/reset.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index ffa26fb8b3..9b00bc647a 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -63,7 +63,7 @@ var TRANSFORMER_URL_WILL = 'atp:/dressingRoom/will_T.fbx'; - var TRANSFORMER_URL_STYLIZED_FEMALE = 'atp:/dressingRoom/stylized_female.fbx'; + var TRANSFORMER_URL_STYLIZED_FEMALE = 'atp:/dressingRoom/ArtemisJacketOn.fbx'; var TRANSFORMER_URL_PRISCILLA = 'atp:/dressingRoom/priscilla.fbx'; From 85055d82bfe9342cc297d0c0329cb6711aeadc5a Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Thu, 2 Jun 2016 17:05:58 -0700 Subject: [PATCH 38/89] Regenerate Domain metadata on user (dis)connect --- domain-server/src/DomainMetadata.cpp | 2 +- domain-server/src/DomainMetadata.h | 9 ++++--- domain-server/src/DomainServer.cpp | 36 +++++++++++++++++++--------- domain-server/src/DomainServer.h | 2 ++ 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/domain-server/src/DomainMetadata.cpp b/domain-server/src/DomainMetadata.cpp index 224fe1939b..c45a07e646 100644 --- a/domain-server/src/DomainMetadata.cpp +++ b/domain-server/src/DomainMetadata.cpp @@ -15,7 +15,7 @@ #include "DomainServerNodeData.h" -void DomainMetadata::generate() { +void DomainMetadata::usersChanged() { static const QString DEFAULT_HOSTNAME = "*"; auto nodeList = DependencyManager::get(); diff --git a/domain-server/src/DomainMetadata.h b/domain-server/src/DomainMetadata.h index 5096f1bb3e..f92c40ce61 100644 --- a/domain-server/src/DomainMetadata.h +++ b/domain-server/src/DomainMetadata.h @@ -16,12 +16,11 @@ class DomainMetadata { public: - QVariantMap toVariantMap() { generate(); return _metadata; } - QJsonObject toJSON() { generate(); return QJsonObject::fromVariantMap(_metadata); } + QVariantMap toVariantMap() { return _metadata; } + QJsonObject toJSON() { return QJsonObject::fromVariantMap(_metadata); } -protected slots: - // TODO: Connect appropriate signals to obviate JIT generation - void generate(); +public slots: + void usersChanged(); protected: QVariantMap _metadata; diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 9b1fbb1d84..5a9fc816c5 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -97,6 +97,10 @@ DomainServer::DomainServer(int argc, char* argv[]) : // make sure we hear about newly connected nodes from our gatekeeper connect(&_gatekeeper, &DomainGatekeeper::connectedNode, this, &DomainServer::handleConnectedNode); + // update the metadata when a user (dis)connects + connect(this, &DomainServer::userConnected, &_metadata, &DomainMetadata::usersChanged); + connect(this, &DomainServer::userDisconnected, &_metadata, &DomainMetadata::usersChanged); + if (optionallyReadX509KeyAndCertificate() && optionallySetupOAuth()) { // we either read a certificate and private key or were not passed one // and completed login or did not need to @@ -767,12 +771,16 @@ QUrl DomainServer::oauthAuthorizationURL(const QUuid& stateUUID) { } void DomainServer::handleConnectedNode(SharedNodePointer newNode) { - - DomainServerNodeData* nodeData = reinterpret_cast(newNode->getLinkedData()); - + DomainServerNodeData* nodeData = static_cast(newNode->getLinkedData()); + // reply back to the user with a PacketType::DomainList sendDomainListToNode(newNode, nodeData->getSendingSockAddr()); - + + // if this node is a user (unassigned Agent), signal + if (newNode->getType() == NodeType::Agent && !nodeData->wasAssigned()) { + emit userConnected(); + } + // send out this node to our other connected nodes broadcastNewNode(newNode); } @@ -1890,11 +1898,10 @@ void DomainServer::nodeAdded(SharedNodePointer node) { } void DomainServer::nodeKilled(SharedNodePointer node) { - // if this peer connected via ICE then remove them from our ICE peers hash _gatekeeper.removeICEPeer(node->getUUID()); - DomainServerNodeData* nodeData = reinterpret_cast(node->getLinkedData()); + DomainServerNodeData* nodeData = static_cast(node->getLinkedData()); if (nodeData) { // if this node's UUID matches a static assignment we need to throw it back in the assignment queue @@ -1906,15 +1913,22 @@ void DomainServer::nodeKilled(SharedNodePointer node) { } } - // If this node was an Agent ask DomainServerNodeData to potentially remove the interpolation we stored - nodeData->removeOverrideForKey(USERNAME_UUID_REPLACEMENT_STATS_KEY, - uuidStringWithoutCurlyBraces(node->getUUID())); - // cleanup the connection secrets that we set up for this node (on the other nodes) foreach (const QUuid& otherNodeSessionUUID, nodeData->getSessionSecretHash().keys()) { SharedNodePointer otherNode = DependencyManager::get()->nodeWithUUID(otherNodeSessionUUID); if (otherNode) { - reinterpret_cast(otherNode->getLinkedData())->getSessionSecretHash().remove(node->getUUID()); + static_cast(otherNode->getLinkedData())->getSessionSecretHash().remove(node->getUUID()); + } + } + + if (node->getType() == NodeType::Agent) { + // if this node was an Agent ask DomainServerNodeData to remove the interpolation we potentially stored + nodeData->removeOverrideForKey(USERNAME_UUID_REPLACEMENT_STATS_KEY, + uuidStringWithoutCurlyBraces(node->getUUID())); + + // if this node is a user (unassigned Agent), signal + if (!nodeData->wasAssigned()) { + emit userDisconnected(); } } } diff --git a/domain-server/src/DomainServer.h b/domain-server/src/DomainServer.h index 0a1df41f50..acda550ce5 100644 --- a/domain-server/src/DomainServer.h +++ b/domain-server/src/DomainServer.h @@ -92,6 +92,8 @@ private slots: signals: void iceServerChanged(); + void userConnected(); + void userDisconnected(); private: void setupNodeListAndAssignments(const QUuid& sessionUUID = QUuid::createUuid()); From 5c293646b960007ab8dfff83712909db57f84861 Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Thu, 2 Jun 2016 17:22:39 -0700 Subject: [PATCH 39/89] Segment metadata users --- domain-server/src/DomainMetadata.cpp | 17 +++++++++++------ domain-server/src/DomainMetadata.h | 10 ++++++++-- domain-server/src/DomainServer.cpp | 2 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/domain-server/src/DomainMetadata.cpp b/domain-server/src/DomainMetadata.cpp index c45a07e646..c92303ee7b 100644 --- a/domain-server/src/DomainMetadata.cpp +++ b/domain-server/src/DomainMetadata.cpp @@ -15,6 +15,14 @@ #include "DomainServerNodeData.h" +const QString DomainMetadata::USERS_KEY = "users"; +const QString DomainMetadata::USERS_NUM_KEY = "num_users"; +const QString DomainMetadata::USERS_HOSTNAMES_KEY = "users_hostnames"; + +DomainMetadata::DomainMetadata() : + _metadata{{ USERS_KEY, {} }} { +} + void DomainMetadata::usersChanged() { static const QString DEFAULT_HOSTNAME = "*"; @@ -39,13 +47,10 @@ void DomainMetadata::usersChanged() { } }); - static const QString HEARTBEAT_NUM_USERS_KEY = "num_users"; - _metadata[HEARTBEAT_NUM_USERS_KEY] = numConnectedUnassigned; - - static const QString HEARTBEAT_USER_HOSTNAMES_KEY = "user_hostnames"; - _metadata[HEARTBEAT_USER_HOSTNAMES_KEY] = userHostnames; + QVariantMap users = {{ USERS_NUM_KEY, numConnectedUnassigned }, { USERS_HOSTNAMES_KEY, userHostnames }}; + _metadata[USERS_KEY] = users; #if DEV_BUILD - qDebug() << "Regenerated domain metadata - users:" << _metadata; + qDebug() << "Regenerated domain metadata - users:" << users; #endif } diff --git a/domain-server/src/DomainMetadata.h b/domain-server/src/DomainMetadata.h index f92c40ce61..ae6dfe10a1 100644 --- a/domain-server/src/DomainMetadata.h +++ b/domain-server/src/DomainMetadata.h @@ -15,9 +15,15 @@ #include class DomainMetadata { + static const QString USERS_KEY; + static const QString USERS_NUM_KEY; + static const QString USERS_HOSTNAMES_KEY; + public: - QVariantMap toVariantMap() { return _metadata; } - QJsonObject toJSON() { return QJsonObject::fromVariantMap(_metadata); } + DomainMetadata(); + + QJsonObject get() { return QJsonObject::fromVariantMap(_metadata); } + QJsonObject getUsers() { return QJsonObject::fromVariantMap(_metadata[USERS_KEY].toMap()); } public slots: void usersChanged(); diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 5a9fc816c5..c24fd02727 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1098,7 +1098,7 @@ void DomainServer::sendHeartbeatToMetaverse(const QString& networkAddress) { // Add the metadata to the heartbeat static const QString DOMAIN_HEARTBEAT_KEY = "heartbeat"; - domainObject[DOMAIN_HEARTBEAT_KEY] = _metadata.toJSON(); + domainObject[DOMAIN_HEARTBEAT_KEY] = _metadata.getUsers(); QString domainUpdateJSON = QString("{\"domain\":%1}").arg(QString(QJsonDocument(domainObject).toJson(QJsonDocument::Compact))); From 912b35693b32f5302bbdf32a7b9bac531341dc47 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Thu, 2 Jun 2016 18:13:33 -0700 Subject: [PATCH 40/89] added vive single pulse haptics --- plugins/openvr/src/ViveControllerManager.cpp | 18 ++++++++++++++++++ plugins/openvr/src/ViveControllerManager.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index 6e75454b5f..6b19646512 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -442,6 +442,24 @@ void ViveControllerManager::InputDevice::handlePoseEvent(float deltaTime, const _poseStateMap[isLeftHand ? controller::LEFT_HAND : controller::RIGHT_HAND] = avatarPose.transform(controllerToAvatar); } +// Vive Controllers do not support duration +bool ViveControllerManager::InputDevice::triggerHapticPulse(float strength, float duration, bool leftHand) { + auto handRole = leftHand ? vr::TrackedControllerRole_LeftHand : vr::TrackedControllerRole_RightHand; + auto deviceIndex = _system->GetTrackedDeviceIndexForControllerRole(handRole); + + if (_system->IsTrackedDeviceConnected(deviceIndex) && + _system->GetTrackedDeviceClass(deviceIndex) == vr::TrackedDeviceClass_Controller && + _trackedDevicePose[deviceIndex].bPoseIsValid) { + // the documentation says the third argument to TriggerHapticPulse is duration + // but it seems to instead be strength, and is between 0 and 3999 + // https://github.com/ValveSoftware/openvr/wiki/IVRSystem::TriggerHapticPulse + const float MAX_HAPTIC_STRENGTH = 3999.0f; + _system->TriggerHapticPulse(deviceIndex, 0, strength*MAX_HAPTIC_STRENGTH); + return true; + } + return false; +} + controller::Input::NamedVector ViveControllerManager::InputDevice::getAvailableInputs() const { using namespace controller; QVector availableInputs{ diff --git a/plugins/openvr/src/ViveControllerManager.h b/plugins/openvr/src/ViveControllerManager.h index bd5d4a39f4..c108d3087f 100644 --- a/plugins/openvr/src/ViveControllerManager.h +++ b/plugins/openvr/src/ViveControllerManager.h @@ -56,6 +56,8 @@ private: void update(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) override; void focusOutEvent() override; + bool triggerHapticPulse(float strength, float duration, bool leftHand) override; + void handleHandController(float deltaTime, uint32_t deviceIndex, const controller::InputCalibrationData& inputCalibrationData, bool isLeftHand); void handleButtonEvent(float deltaTime, uint32_t button, bool pressed, bool touched, bool isLeftHand); void handleAxisEvent(float deltaTime, uint32_t axis, float x, float y, bool isLeftHand); From e2c4b4d3064707ac5310e755566f8c51e23ce252 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Fri, 3 Jun 2016 10:17:08 -0700 Subject: [PATCH 41/89] added haptic support to sdl and touch (needs testing) --- plugins/hifiSdl2/src/Joystick.cpp | 11 ++++++- plugins/hifiSdl2/src/Joystick.h | 3 ++ plugins/hifiSdl2/src/SDL2Manager.cpp | 2 +- .../oculus/src/OculusControllerManager.cpp | 31 +++++++++++++++++++ plugins/oculus/src/OculusControllerManager.h | 11 +++++++ 5 files changed, 56 insertions(+), 2 deletions(-) diff --git a/plugins/hifiSdl2/src/Joystick.cpp b/plugins/hifiSdl2/src/Joystick.cpp index a109656489..136c021913 100644 --- a/plugins/hifiSdl2/src/Joystick.cpp +++ b/plugins/hifiSdl2/src/Joystick.cpp @@ -21,9 +21,10 @@ Joystick::Joystick(SDL_JoystickID instanceId, SDL_GameController* sdlGameControl InputDevice("GamePad"), _sdlGameController(sdlGameController), _sdlJoystick(SDL_GameControllerGetJoystick(_sdlGameController)), + _sdlHaptic(SDL_HapticOpenFromJoystick(_sdlJoystick)), _instanceId(instanceId) { - + SDL_HapticRumbleInit(_sdlHaptic); } Joystick::~Joystick() { @@ -31,6 +32,7 @@ Joystick::~Joystick() { } void Joystick::closeJoystick() { + SDL_HapticClose(_sdlHaptic); SDL_GameControllerClose(_sdlGameController); } @@ -62,6 +64,13 @@ void Joystick::handleButtonEvent(const SDL_ControllerButtonEvent& event) { } } +bool Joystick::triggerHapticPulse(float strength, float duration, bool leftHand) { + if (SDL_HapticRumblePlay(_sdlHaptic, strength, duration) != 0) { + return false; + } + return true; +} + controller::Input::NamedVector Joystick::getAvailableInputs() const { using namespace controller; static const Input::NamedVector availableInputs{ diff --git a/plugins/hifiSdl2/src/Joystick.h b/plugins/hifiSdl2/src/Joystick.h index e2eaeaef8b..4f785f85ce 100644 --- a/plugins/hifiSdl2/src/Joystick.h +++ b/plugins/hifiSdl2/src/Joystick.h @@ -36,6 +36,8 @@ public: virtual QString getDefaultMappingConfig() const override; virtual void update(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) override; virtual void focusOutEvent() override; + + bool triggerHapticPulse(float strength, float duration, bool leftHand) override; Joystick() : InputDevice("GamePad") {} ~Joystick(); @@ -52,6 +54,7 @@ public: private: SDL_GameController* _sdlGameController; SDL_Joystick* _sdlJoystick; + SDL_Haptic* _sdlHaptic; SDL_JoystickID _instanceId; }; diff --git a/plugins/hifiSdl2/src/SDL2Manager.cpp b/plugins/hifiSdl2/src/SDL2Manager.cpp index 0bdb68f830..09e783864c 100644 --- a/plugins/hifiSdl2/src/SDL2Manager.cpp +++ b/plugins/hifiSdl2/src/SDL2Manager.cpp @@ -49,7 +49,7 @@ SDL_JoystickID SDL2Manager::getInstanceId(SDL_GameController* controller) { } void SDL2Manager::init() { - bool initSuccess = (SDL_Init(SDL_INIT_GAMECONTROLLER) == 0); + bool initSuccess = (SDL_Init(SDL_INIT_GAMECONTROLLER | SDL_INIT_HAPTIC) == 0); if (initSuccess) { int joystickCount = SDL_NumJoysticks(); diff --git a/plugins/oculus/src/OculusControllerManager.cpp b/plugins/oculus/src/OculusControllerManager.cpp index 09ab6ec159..3151db1d90 100644 --- a/plugins/oculus/src/OculusControllerManager.cpp +++ b/plugins/oculus/src/OculusControllerManager.cpp @@ -55,6 +55,11 @@ bool OculusControllerManager::activate() { userInputMapper->registerDevice(_touch); } + _leftHapticTimer.setSingleShot(true); + _rightHapticTimer.setSingleShot(true); + connect(&_leftHapticTimer, SIGNAL(timeout()), this, SLOT(stopHapticPulse(true))); + connect(&_rightHapticTimer, SIGNAL(timeout()), this, SLOT(stopHapticPulse(false))); + return true; } @@ -105,6 +110,12 @@ void OculusControllerManager::pluginFocusOutEvent() { } } +void OculusControllerManager::stopHapticPulse(bool leftHand) { + if (_touch) { + _touch->stopHapticPulse(leftHand); + } +} + using namespace controller; static const std::vector> BUTTON_MAP { { @@ -228,6 +239,26 @@ void OculusControllerManager::TouchDevice::handlePose(float deltaTime, pose.velocity = toGlm(handPose.LinearVelocity); } +bool OculusControllerManager::TouchDevice::triggerHapticPulse(float strength, float duration, bool leftHand) { + auto handType = (leftHand ? ovrControllerType_LTouch : ovrControllerType_RTouch); + if (ovr_SetControllerVibration(_parent._session, handType, 1.0f, strength) != ovrSuccess) { + return false; + } + + if (leftHand) { + _parent._leftHapticTimer.start(duration); + } else { + _parent._rightHapticTimer.start(duration); + } + + return true; +} + +void OculusControllerManager::TouchDevice::stopHapticPulse(bool leftHand) { + auto handType = (leftHand ? ovrControllerType_LTouch : ovrControllerType_RTouch); + ovr_SetControllerVibration(_parent._session, handType, 0.0f, 0.0f); +} + controller::Input::NamedVector OculusControllerManager::TouchDevice::getAvailableInputs() const { using namespace controller; QVector availableInputs{ diff --git a/plugins/oculus/src/OculusControllerManager.h b/plugins/oculus/src/OculusControllerManager.h index 980e1286f8..20e5726dff 100644 --- a/plugins/oculus/src/OculusControllerManager.h +++ b/plugins/oculus/src/OculusControllerManager.h @@ -10,6 +10,7 @@ #define hifi__OculusControllerManager #include +#include #include #include @@ -32,6 +33,9 @@ public: void pluginFocusOutEvent() override; void pluginUpdate(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) override; +private slots: + void stopHapticPulse(bool leftHand); + private: class OculusInputDevice : public controller::InputDevice { public: @@ -64,6 +68,11 @@ private: void update(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) override; void focusOutEvent() override; + bool triggerHapticPulse(float strength, float duration, bool leftHand) override; + + private: + void stopHapticPulse(bool leftHand); + private: void handlePose(float deltaTime, const controller::InputCalibrationData& inputCalibrationData, ovrHandType hand, const ovrPoseStatef& handPose); int _trackedControllers { 0 }; @@ -73,6 +82,8 @@ private: ovrSession _session { nullptr }; ovrInputState _inputState {}; RemoteDevice::Pointer _remote; + QTimer _leftHapticTimer; + QTimer _rightHapticTimer; TouchDevice::Pointer _touch; static const QString NAME; }; From c1eab612418a81357e127f9918b4654413007a2f Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Fri, 3 Jun 2016 11:22:06 -0700 Subject: [PATCH 42/89] sdl haptics aren't working, but might be a bug in sdl: http://stackoverflow.com/questions/23974908/why-is-sdl-hapticopenfromjoystick-not-working-in-sdl-2 --- plugins/hifiSdl2/src/Joystick.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/hifiSdl2/src/Joystick.cpp b/plugins/hifiSdl2/src/Joystick.cpp index 136c021913..cf7dde371b 100644 --- a/plugins/hifiSdl2/src/Joystick.cpp +++ b/plugins/hifiSdl2/src/Joystick.cpp @@ -24,6 +24,9 @@ Joystick::Joystick(SDL_JoystickID instanceId, SDL_GameController* sdlGameControl _sdlHaptic(SDL_HapticOpenFromJoystick(_sdlJoystick)), _instanceId(instanceId) { + if (!_sdlHaptic) { + qDebug(SDL_GetError()); + } SDL_HapticRumbleInit(_sdlHaptic); } From 9292a9ce0b244579900f66143795ffb4ef29bd2f Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Fri, 3 Jun 2016 13:56:32 -0700 Subject: [PATCH 43/89] Added MyAvatar.hmdLeanRecenterEnabled property Used to disable the 'room-scale' avatar re-centering code. Disabling this can prevent sliding when the avatar is supposed to be sitting or mounted on a stationary object. Also, removed a bunch of old, unused leaning and torso twisting code. --- interface/src/avatar/Avatar.cpp | 1 - interface/src/avatar/Avatar.h | 1 - interface/src/avatar/Head.cpp | 21 +-------------- interface/src/avatar/Head.h | 9 +------ interface/src/avatar/MyAvatar.cpp | 36 +++++++++----------------- interface/src/avatar/MyAvatar.h | 11 +++++--- interface/src/avatar/SkeletonModel.cpp | 5 ---- interface/src/ui/PreferencesDialog.cpp | 10 ------- libraries/animation/src/Rig.cpp | 14 ---------- libraries/animation/src/Rig.h | 6 ----- libraries/avatars/src/HeadData.cpp | 15 ----------- libraries/avatars/src/HeadData.h | 14 ---------- 12 files changed, 21 insertions(+), 122 deletions(-) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 3e22448386..f46a906af8 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -84,7 +84,6 @@ Avatar::Avatar(RigPointer rig) : _acceleration(0.0f), _lastAngularVelocity(0.0f), _lastOrientation(), - _leanScale(0.5f), _worldUpDirection(DEFAULT_UP_DIRECTION), _moving(false), _initialized(false), diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index 79952e8f58..064f0a9533 100644 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -210,7 +210,6 @@ protected: glm::vec3 _angularAcceleration; glm::quat _lastOrientation; - float _leanScale; glm::vec3 _worldUpDirection; float _stringLength; bool _moving; ///< set when position is changing diff --git a/interface/src/avatar/Head.cpp b/interface/src/avatar/Head.cpp index 3af8b8a423..928f46facb 100644 --- a/interface/src/avatar/Head.cpp +++ b/interface/src/avatar/Head.cpp @@ -54,8 +54,6 @@ Head::Head(Avatar* owningAvatar) : _deltaPitch(0.0f), _deltaYaw(0.0f), _deltaRoll(0.0f), - _deltaLeanSideways(0.0f), - _deltaLeanForward(0.0f), _isCameraMoving(false), _isLookingAtMe(false), _lookingAtMeStarted(0), @@ -70,7 +68,6 @@ void Head::init() { void Head::reset() { _baseYaw = _basePitch = _baseRoll = 0.0f; - _leanForward = _leanSideways = 0.0f; } void Head::simulate(float deltaTime, bool isMine, bool billboard) { @@ -118,13 +115,6 @@ void Head::simulate(float deltaTime, bool isMine, bool billboard) { auto eyeTracker = DependencyManager::get(); _isEyeTrackerConnected = eyeTracker->isTracking(); } - - // Twist the upper body to follow the rotation of the head, but only do this with my avatar, - // since everyone else will see the full joint rotations for other people. - const float BODY_FOLLOW_HEAD_YAW_RATE = 0.1f; - const float BODY_FOLLOW_HEAD_FACTOR = 0.66f; - float currentTwist = getTorsoTwist(); - setTorsoTwist(currentTwist + (getFinalYaw() * BODY_FOLLOW_HEAD_FACTOR - currentTwist) * BODY_FOLLOW_HEAD_YAW_RATE); } if (!(_isFaceTrackerConnected || billboard)) { @@ -301,17 +291,13 @@ void Head::applyEyelidOffset(glm::quat headOrientation) { } } -void Head::relaxLean(float deltaTime) { +void Head::relax(float deltaTime) { // restore rotation, lean to neutral positions const float LEAN_RELAXATION_PERIOD = 0.25f; // seconds float relaxationFactor = 1.0f - glm::min(deltaTime / LEAN_RELAXATION_PERIOD, 1.0f); _deltaYaw *= relaxationFactor; _deltaPitch *= relaxationFactor; _deltaRoll *= relaxationFactor; - _leanSideways *= relaxationFactor; - _leanForward *= relaxationFactor; - _deltaLeanSideways *= relaxationFactor; - _deltaLeanForward *= relaxationFactor; } void Head::setScale (float scale) { @@ -419,8 +405,3 @@ float Head::getFinalPitch() const { float Head::getFinalRoll() const { return glm::clamp(_baseRoll + _deltaRoll, MIN_HEAD_ROLL, MAX_HEAD_ROLL); } - -void Head::addLeanDeltas(float sideways, float forward) { - _deltaLeanSideways += sideways; - _deltaLeanForward += forward; -} diff --git a/interface/src/avatar/Head.h b/interface/src/avatar/Head.h index e4b8fefea5..33ea180d33 100644 --- a/interface/src/avatar/Head.h +++ b/interface/src/avatar/Head.h @@ -59,8 +59,6 @@ public: glm::vec3 getRightDirection() const { return getOrientation() * IDENTITY_RIGHT; } glm::vec3 getUpDirection() const { return getOrientation() * IDENTITY_UP; } glm::vec3 getFrontDirection() const { return getOrientation() * IDENTITY_FRONT; } - float getFinalLeanSideways() const { return _leanSideways + _deltaLeanSideways; } - float getFinalLeanForward() const { return _leanForward + _deltaLeanForward; } glm::quat getEyeRotation(const glm::vec3& eyePosition) const; @@ -91,8 +89,7 @@ public: virtual float getFinalYaw() const; virtual float getFinalRoll() const; - void relaxLean(float deltaTime); - void addLeanDeltas(float sideways, float forward); + void relax(float deltaTime); float getTimeWithoutTalking() const { return _timeWithoutTalking; } @@ -132,10 +129,6 @@ private: float _deltaYaw; float _deltaRoll; - // delta lean angles for lean perturbations (driven by collisions) - float _deltaLeanSideways; - float _deltaLeanForward; - bool _isCameraMoving; bool _isLookingAtMe; quint64 _lookingAtMeStarted; diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 6fdcd8f797..0f723d29e3 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -190,9 +190,6 @@ MyAvatar::MyAvatar(RigPointer rig) : if (!headData->getBlendshapeCoefficients().isEmpty()) { _headData->setBlendshapeCoefficients(headData->getBlendshapeCoefficients()); } - // head lean - _headData->setLeanForward(headData->getLeanForward()); - _headData->setLeanSideways(headData->getLeanSideways()); // head orientation _headData->setLookAtPosition(headData->getLookAtPosition()); } @@ -306,7 +303,7 @@ void MyAvatar::update(float deltaTime) { } Head* head = getHead(); - head->relaxLean(deltaTime); + head->relax(deltaTime); updateFromTrackers(deltaTime); // Get audio loudness data from audio input device @@ -574,16 +571,6 @@ void MyAvatar::updateFromTrackers(float deltaTime) { head->setDeltaYaw(estimatedRotation.y * magnifyFieldOfView); head->setDeltaRoll(estimatedRotation.z); } - - // Update torso lean distance based on accelerometer data - const float TORSO_LENGTH = 0.5f; - glm::vec3 relativePosition = estimatedPosition - glm::vec3(0.0f, -TORSO_LENGTH, 0.0f); - - const float MAX_LEAN = 45.0f; - head->setLeanSideways(glm::clamp(glm::degrees(atanf(relativePosition.x * _leanScale / TORSO_LENGTH)), - -MAX_LEAN, MAX_LEAN)); - head->setLeanForward(glm::clamp(glm::degrees(atanf(relativePosition.z * _leanScale / TORSO_LENGTH)), - -MAX_LEAN, MAX_LEAN)); } glm::vec3 MyAvatar::getLeftHandPosition() const { @@ -692,7 +679,6 @@ void MyAvatar::saveData() { settings.setValue("headPitch", getHead()->getBasePitch()); - settings.setValue("leanScale", _leanScale); settings.setValue("scale", _targetScale); settings.setValue("fullAvatarURL", @@ -809,7 +795,6 @@ void MyAvatar::loadData() { getHead()->setBasePitch(loadSetting(settings, "headPitch", 0.0f)); - _leanScale = loadSetting(settings, "leanScale", 0.05f); _targetScale = loadSetting(settings, "scale", 1.0f); setScale(glm::vec3(_targetScale)); @@ -2052,14 +2037,17 @@ bool MyAvatar::FollowHelper::shouldActivateVertical(const MyAvatar& myAvatar, co void MyAvatar::FollowHelper::prePhysicsUpdate(MyAvatar& myAvatar, const glm::mat4& desiredBodyMatrix, const glm::mat4& currentBodyMatrix, bool hasDriveInput) { _desiredBodyMatrix = desiredBodyMatrix; - if (!isActive(Rotation) && shouldActivateRotation(myAvatar, desiredBodyMatrix, currentBodyMatrix)) { - activate(Rotation); - } - if (!isActive(Horizontal) && shouldActivateHorizontal(myAvatar, desiredBodyMatrix, currentBodyMatrix)) { - activate(Horizontal); - } - if (!isActive(Vertical) && (shouldActivateVertical(myAvatar, desiredBodyMatrix, currentBodyMatrix) || hasDriveInput)) { - activate(Vertical); + + if (myAvatar.getHMDLeanRecenterEnabled()) { + if (!isActive(Rotation) && shouldActivateRotation(myAvatar, desiredBodyMatrix, currentBodyMatrix)) { + activate(Rotation); + } + if (!isActive(Horizontal) && shouldActivateHorizontal(myAvatar, desiredBodyMatrix, currentBodyMatrix)) { + activate(Horizontal); + } + if (!isActive(Vertical) && (shouldActivateVertical(myAvatar, desiredBodyMatrix, currentBodyMatrix) || hasDriveInput)) { + activate(Vertical); + } } glm::mat4 desiredWorldMatrix = myAvatar.getSensorToWorldMatrix() * _desiredBodyMatrix; diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index d3da32e0ed..a938aea675 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -69,7 +69,6 @@ class MyAvatar : public Avatar { Q_PROPERTY(AudioListenerMode audioListenerModeCustom READ getAudioListenerModeCustom) //TODO: make gravity feature work Q_PROPERTY(glm::vec3 gravity READ getGravity WRITE setGravity) - Q_PROPERTY(glm::vec3 leftHandPosition READ getLeftHandPosition) Q_PROPERTY(glm::vec3 rightHandPosition READ getRightHandPosition) Q_PROPERTY(glm::vec3 leftHandTipPosition READ getLeftHandTipPosition) @@ -84,6 +83,8 @@ class MyAvatar : public Avatar { Q_PROPERTY(float energy READ getEnergy WRITE setEnergy) + Q_PROPERTY(bool hmdLeanRecenterEnabled READ getHMDLeanRecenterEnabled WRITE setHMDLeanRecenterEnabled) + public: explicit MyAvatar(RigPointer rig); ~MyAvatar(); @@ -123,9 +124,6 @@ public: void setRealWorldFieldOfView(float realWorldFov) { _realWorldFieldOfView.set(realWorldFov); } - void setLeanScale(float scale) { _leanScale = scale; } - float getLeanScale() const { return _leanScale; } - Q_INVOKABLE glm::vec3 getDefaultEyePosition() const; float getRealWorldFieldOfView() { return _realWorldFieldOfView.get(); } @@ -163,6 +161,9 @@ public: Q_INVOKABLE bool getClearOverlayWhenDriving() const { return _clearOverlayWhenDriving; } Q_INVOKABLE void setClearOverlayWhenDriving(bool on) { _clearOverlayWhenDriving = on; } + Q_INVOKABLE void setHMDLeanRecenterEnabled(bool value) { _hmdLeanRecenterEnabled = value; } + Q_INVOKABLE bool getHMDLeanRecenterEnabled() const { return _hmdLeanRecenterEnabled; } + // get/set avatar data void saveData(); void loadData(); @@ -470,6 +471,8 @@ private: ThreadSafeValueCache _leftHandControllerPoseInSensorFrameCache { controller::Pose() }; ThreadSafeValueCache _rightHandControllerPoseInSensorFrameCache { controller::Pose() }; + bool _hmdLeanRecenterEnabled = true; + float AVATAR_MOVEMENT_ENERGY_CONSTANT { 0.001f }; float AUDIO_ENERGY_CONSTANT { 0.000001f }; float MAX_AVATAR_MOVEMENT_PER_FRAME { 30.0f }; diff --git a/interface/src/avatar/SkeletonModel.cpp b/interface/src/avatar/SkeletonModel.cpp index 5deeb545a1..889f0ef36b 100644 --- a/interface/src/avatar/SkeletonModel.cpp +++ b/interface/src/avatar/SkeletonModel.cpp @@ -106,10 +106,6 @@ void SkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) { MyAvatar* myAvatar = static_cast(_owningAvatar); Rig::HeadParameters headParams; - headParams.enableLean = qApp->isHMDMode(); - headParams.leanSideways = head->getFinalLeanSideways(); - headParams.leanForward = head->getFinalLeanForward(); - headParams.torsoTwist = head->getTorsoTwist(); if (qApp->isHMDMode()) { headParams.isInHMD = true; @@ -131,7 +127,6 @@ void SkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) { headParams.worldHeadOrientation = head->getFinalOrientationInWorldFrame(); } - headParams.leanJointIndex = geometry.leanJointIndex; headParams.neckJointIndex = geometry.neckJointIndex; headParams.isTalking = head->getTimeWithoutTalking() <= 1.5f; diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index ce7bcc6323..6decef3240 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -129,16 +129,6 @@ void setupPreferences() { preference->setStep(1); preferences->addPreference(preference); } - { - auto getter = [=]()->float { return myAvatar->getLeanScale(); }; - auto setter = [=](float value) { myAvatar->setLeanScale(value); }; - auto preference = new SpinnerPreference(AVATAR_TUNING, "Lean scale (applies to Faceshift users)", getter, setter); - preference->setMin(0); - preference->setMax(99.9f); - preference->setDecimals(2); - preference->setStep(1); - preferences->addPreference(preference); - } { auto getter = [=]()->float { return myAvatar->getUniformScale(); }; auto setter = [=](float value) { myAvatar->setTargetScaleVerbose(value); }; // The hell? diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp index 9bba9ffc33..b21f5a0e84 100644 --- a/libraries/animation/src/Rig.cpp +++ b/libraries/animation/src/Rig.cpp @@ -931,11 +931,6 @@ glm::quat Rig::getJointDefaultRotationInParentFrame(int jointIndex) { } void Rig::updateFromHeadParameters(const HeadParameters& params, float dt) { - if (params.enableLean) { - updateLeanJoint(params.leanJointIndex, params.leanSideways, params.leanForward, params.torsoTwist); - } else { - _animVars.unset("lean"); - } updateNeckJoint(params.neckJointIndex, params); _animVars.set("isTalking", params.isTalking); @@ -953,15 +948,6 @@ static const glm::vec3 X_AXIS(1.0f, 0.0f, 0.0f); static const glm::vec3 Y_AXIS(0.0f, 1.0f, 0.0f); static const glm::vec3 Z_AXIS(0.0f, 0.0f, 1.0f); -void Rig::updateLeanJoint(int index, float leanSideways, float leanForward, float torsoTwist) { - if (isIndexValid(index)) { - glm::quat absRot = (glm::angleAxis(-RADIANS_PER_DEGREE * leanSideways, Z_AXIS) * - glm::angleAxis(-RADIANS_PER_DEGREE * leanForward, X_AXIS) * - glm::angleAxis(RADIANS_PER_DEGREE * torsoTwist, Y_AXIS)); - _animVars.set("lean", absRot); - } -} - void Rig::computeHeadNeckAnimVars(const AnimPose& hmdPose, glm::vec3& headPositionOut, glm::quat& headOrientationOut, glm::vec3& neckPositionOut, glm::quat& neckOrientationOut) const { diff --git a/libraries/animation/src/Rig.h b/libraries/animation/src/Rig.h index 891d9fdb92..e2193e8479 100644 --- a/libraries/animation/src/Rig.h +++ b/libraries/animation/src/Rig.h @@ -42,15 +42,10 @@ public: }; struct HeadParameters { - float leanSideways = 0.0f; // degrees - float leanForward = 0.0f; // degrees - float torsoTwist = 0.0f; // degrees - bool enableLean = false; glm::quat worldHeadOrientation = glm::quat(); // world space (-z forward) glm::quat rigHeadOrientation = glm::quat(); // rig space (-z forward) glm::vec3 rigHeadPosition = glm::vec3(); // rig space bool isInHMD = false; - int leanJointIndex = -1; int neckJointIndex = -1; bool isTalking = false; }; @@ -222,7 +217,6 @@ protected: void applyOverridePoses(); void buildAbsoluteRigPoses(const AnimPoseVec& relativePoses, AnimPoseVec& absolutePosesOut); - void updateLeanJoint(int index, float leanSideways, float leanForward, float torsoTwist); void updateNeckJoint(int index, const HeadParameters& params); void computeHeadNeckAnimVars(const AnimPose& hmdPose, glm::vec3& headPositionOut, glm::quat& headOrientationOut, glm::vec3& neckPositionOut, glm::quat& neckOrientationOut) const; diff --git a/libraries/avatars/src/HeadData.cpp b/libraries/avatars/src/HeadData.cpp index 1aee85b2cd..72516d9740 100644 --- a/libraries/avatars/src/HeadData.cpp +++ b/libraries/avatars/src/HeadData.cpp @@ -31,9 +31,6 @@ HeadData::HeadData(AvatarData* owningAvatar) : _baseYaw(0.0f), _basePitch(0.0f), _baseRoll(0.0f), - _leanSideways(0.0f), - _leanForward(0.0f), - _torsoTwist(0.0f), _lookAtPosition(0.0f, 0.0f, 0.0f), _audioLoudness(0.0f), _isFaceTrackerConnected(false), @@ -132,12 +129,6 @@ QJsonObject HeadData::toJson() const { if (getRawOrientation() != quat()) { headJson[JSON_AVATAR_HEAD_ROTATION] = toJsonValue(getRawOrientation()); } - if (getLeanForward() != 0.0f) { - headJson[JSON_AVATAR_HEAD_LEAN_FORWARD] = getLeanForward(); - } - if (getLeanSideways() != 0.0f) { - headJson[JSON_AVATAR_HEAD_LEAN_SIDEWAYS] = getLeanSideways(); - } auto lookat = getLookAtPosition(); if (lookat != vec3()) { vec3 relativeLookAt = glm::inverse(_owningAvatar->getOrientation()) * @@ -171,12 +162,6 @@ void HeadData::fromJson(const QJsonObject& json) { if (json.contains(JSON_AVATAR_HEAD_ROTATION)) { setOrientation(quatFromJsonValue(json[JSON_AVATAR_HEAD_ROTATION])); } - if (json.contains(JSON_AVATAR_HEAD_LEAN_FORWARD)) { - setLeanForward((float)json[JSON_AVATAR_HEAD_LEAN_FORWARD].toDouble()); - } - if (json.contains(JSON_AVATAR_HEAD_LEAN_SIDEWAYS)) { - setLeanSideways((float)json[JSON_AVATAR_HEAD_LEAN_SIDEWAYS].toDouble()); - } if (json.contains(JSON_AVATAR_HEAD_LOOKAT)) { auto relativeLookAt = vec3FromJsonValue(json[JSON_AVATAR_HEAD_LOOKAT]); diff --git a/libraries/avatars/src/HeadData.h b/libraries/avatars/src/HeadData.h index 535aa12847..af657339ba 100644 --- a/libraries/avatars/src/HeadData.h +++ b/libraries/avatars/src/HeadData.h @@ -68,17 +68,6 @@ public: const glm::vec3& getLookAtPosition() const { return _lookAtPosition; } void setLookAtPosition(const glm::vec3& lookAtPosition) { _lookAtPosition = lookAtPosition; } - - float getLeanSideways() const { return _leanSideways; } - float getLeanForward() const { return _leanForward; } - float getTorsoTwist() const { return _torsoTwist; } - virtual float getFinalLeanSideways() const { return _leanSideways; } - virtual float getFinalLeanForward() const { return _leanForward; } - - void setLeanSideways(float leanSideways) { _leanSideways = leanSideways; } - void setLeanForward(float leanForward) { _leanForward = leanForward; } - void setTorsoTwist(float torsoTwist) { _torsoTwist = torsoTwist; } - friend class AvatarData; QJsonObject toJson() const; @@ -89,9 +78,6 @@ protected: float _baseYaw; float _basePitch; float _baseRoll; - float _leanSideways; - float _leanForward; - float _torsoTwist; glm::vec3 _lookAtPosition; float _audioLoudness; From 9c63a6417e709dde9b2fa2fae80630802f34887f Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 3 Jun 2016 14:24:07 -0700 Subject: [PATCH 44/89] fix attached entities manager and add to default scripts --- scripts/defaultScripts.js | 1 + scripts/system/attachedEntitiesManager.js | 85 ++++++++++++----------- 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index 2a050d183e..f460ddf88f 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -21,3 +21,4 @@ Script.load("system/controllers/handControllerPointer.js"); Script.load("system/controllers/squeezeHands.js"); Script.load("system/controllers/grab.js"); Script.load("system/dialTone.js"); +Script.load("system/attachedEntitiesManager.js"); \ No newline at end of file diff --git a/scripts/system/attachedEntitiesManager.js b/scripts/system/attachedEntitiesManager.js index 79c5973a6e..fcd48b664c 100644 --- a/scripts/system/attachedEntitiesManager.js +++ b/scripts/system/attachedEntitiesManager.js @@ -22,7 +22,7 @@ var MINIMUM_DROP_DISTANCE_FROM_JOINT = 0.8; var ATTACHED_ENTITY_SEARCH_DISTANCE = 10.0; var ATTACHED_ENTITIES_SETTINGS_KEY = "ATTACHED_ENTITIES"; var DRESSING_ROOM_DISTANCE = 2.0; -var SHOW_TOOL_BAR = true; +var SHOW_TOOL_BAR = false; // tool bar @@ -71,12 +71,11 @@ Script.scriptEnding.connect(scriptEnding); - // attached entites function AttachedEntitiesManager() { - var clothingLocked = true; + var clothingLocked = false; this.subscribeToMessages = function() { Messages.subscribe('Hifi-Object-Manipulation'); @@ -106,7 +105,7 @@ function AttachedEntitiesManager() { // ignore } else if (parsedMessage.action === 'release') { manager.handleEntityRelease(parsedMessage.grabbedEntity, parsedMessage.joint) - // manager.saveAttachedEntities(); + // manager.saveAttachedEntities(); } else if (parsedMessage.action === 'equip') { // manager.saveAttachedEntities(); } else { @@ -156,7 +155,8 @@ function AttachedEntitiesManager() { var wearProps = Entities.getEntityProperties(grabbedEntity); wearProps.parentID = MyAvatar.sessionUUID; wearProps.parentJointIndex = bestJointIndex; - + delete wearProps.localPosition; + delete wearProps.localRotation; var updatePresets = false; if (bestJointOffset && bestJointOffset.constructor === Array) { if (!clothingLocked || bestJointOffset.length < 2) { @@ -170,21 +170,23 @@ function AttachedEntitiesManager() { } Entities.deleteEntity(grabbedEntity); - grabbedEntity = Entities.addEntity(wearProps, true); + //the true boolean here after add entity adds it as an 'avatar entity', which can travel with you from server to server. + + var newEntity = Entities.addEntity(wearProps, true); + if (updatePresets) { - this.updateRelativeOffsets(grabbedEntity); + this.updateRelativeOffsets(newEntity); } } else if (props.parentID != NULL_UUID) { // drop the entity and set it to have no parent (not on the avatar), unless it's being equipped in a hand. if (props.parentID === MyAvatar.sessionUUID && (props.parentJointIndex == MyAvatar.getJointIndex("RightHand") || - props.parentJointIndex == MyAvatar.getJointIndex("LeftHand"))) { + props.parentJointIndex == MyAvatar.getJointIndex("LeftHand"))) { // this is equipped on a hand -- don't clear the parent. } else { var wearProps = Entities.getEntityProperties(grabbedEntity); wearProps.parentID = NULL_UUID; wearProps.parentJointIndex = -1; - delete wearProps.id; delete wearProps.created; delete wearProps.age; @@ -198,7 +200,6 @@ function AttachedEntitiesManager() { delete wearProps.owningAvatarID; delete wearProps.localPosition; delete wearProps.localRotation; - Entities.deleteEntity(grabbedEntity); Entities.addEntity(wearProps); } @@ -220,16 +221,16 @@ function AttachedEntitiesManager() { return false; } - this.toggleLocked = function() { - print("toggleLocked"); - if (clothingLocked) { - clothingLocked = false; - toolBar.setImageURL(Script.resolvePath("assets/images/unlock.svg"), lockButton); - } else { - clothingLocked = true; - toolBar.setImageURL(Script.resolvePath("assets/images/lock.svg"), lockButton); - } - } + // this.toggleLocked = function() { + // print("toggleLocked"); + // if (clothingLocked) { + // clothingLocked = false; + // toolBar.setImageURL(Script.resolvePath("assets/images/unlock.svg"), lockButton); + // } else { + // clothingLocked = true; + // toolBar.setImageURL(Script.resolvePath("assets/images/lock.svg"), lockButton); + // } + // } // this.saveAttachedEntities = function() { // print("--- saving attached entities ---"); @@ -246,27 +247,27 @@ function AttachedEntitiesManager() { // Settings.setValue(ATTACHED_ENTITIES_SETTINGS_KEY, JSON.stringify(saveData)); // } - this.scrubProperties = function(props) { - var toScrub = ["queryAACube", "position", "rotation", - "created", "ageAsText", "naturalDimensions", - "naturalPosition", "velocity", "acceleration", - "angularVelocity", "boundingBox"]; - toScrub.forEach(function(propertyName) { - delete props[propertyName]; - }); - // if the userData has a grabKey, clear old state - if ("userData" in props) { - try { - parsedUserData = JSON.parse(props.userData); - if ("grabKey" in parsedUserData) { - parsedUserData.grabKey.refCount = 0; - delete parsedUserData.grabKey["avatarId"]; - props["userData"] = JSON.stringify(parsedUserData); - } - } catch (e) { - } - } - } + // this.scrubProperties = function(props) { + // var toScrub = ["queryAACube", "position", "rotation", + // "created", "ageAsText", "naturalDimensions", + // "naturalPosition", "velocity", "acceleration", + // "angularVelocity", "boundingBox"]; + // toScrub.forEach(function(propertyName) { + // delete props[propertyName]; + // }); + // // if the userData has a grabKey, clear old state + // if ("userData" in props) { + // try { + // parsedUserData = JSON.parse(props.userData); + // if ("grabKey" in parsedUserData) { + // parsedUserData.grabKey.refCount = 0; + // delete parsedUserData.grabKey["avatarId"]; + // props["userData"] = JSON.stringify(parsedUserData); + // } + // } catch (e) { + // } + // } + // } // this.loadAttachedEntities = function(grabbedEntity) { // print("--- loading attached entities ---"); @@ -302,4 +303,4 @@ function AttachedEntitiesManager() { } var manager = new AttachedEntitiesManager(); -manager.subscribeToMessages(); +manager.subscribeToMessages(); \ No newline at end of file From 55e5c1f6e0bdbe1e2e23d73296954eaaee371f0b Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Thu, 2 Jun 2016 18:01:59 -0700 Subject: [PATCH 45/89] Declare metadata descriptors --- domain-server/src/DomainMetadata.cpp | 73 +++++++++++++++++++++++----- domain-server/src/DomainMetadata.h | 30 ++++++++++-- domain-server/src/DomainServer.cpp | 9 ++-- 3 files changed, 93 insertions(+), 19 deletions(-) diff --git a/domain-server/src/DomainMetadata.cpp b/domain-server/src/DomainMetadata.cpp index c92303ee7b..0481e9911d 100644 --- a/domain-server/src/DomainMetadata.cpp +++ b/domain-server/src/DomainMetadata.cpp @@ -15,29 +15,77 @@ #include "DomainServerNodeData.h" -const QString DomainMetadata::USERS_KEY = "users"; -const QString DomainMetadata::USERS_NUM_KEY = "num_users"; -const QString DomainMetadata::USERS_HOSTNAMES_KEY = "users_hostnames"; +const QString DomainMetadata::USERS = "users"; +const QString DomainMetadata::USERS_NUM_TOTAL = "num_users"; +const QString DomainMetadata::USERS_NUM_ANON = "num_anon_users"; +const QString DomainMetadata::USERS_HOSTNAMES = "user_hostnames"; +// users metadata will appear as (JSON): +// { "num_users": Number, +// "num_anon_users": Number, +// "user_hostnames": { : Number } +// } -DomainMetadata::DomainMetadata() : - _metadata{{ USERS_KEY, {} }} { +const QString DomainMetadata::DESCRIPTORS = "descriptors"; +const QString DomainMetadata::DESCRIPTORS_DESCRIPTION = "description"; +const QString DomainMetadata::DESCRIPTORS_CAPACITY = "capacity"; // parsed from security +const QString DomainMetadata::DESCRIPTORS_RESTRICTION = "restriction"; // parsed from ACL +const QString DomainMetadata::DESCRIPTORS_MATURITY = "maturity"; +const QString DomainMetadata::DESCRIPTORS_HOSTS = "hosts"; +const QString DomainMetadata::DESCRIPTORS_TAGS = "tags"; +// descriptors metadata will appear as (JSON): +// { "capacity": Number, +// TODO: "hours": String, // UTF-8 representation of the week, split into 15" segments +// "restriction": String, // enum of either OPEN, RESTRICTED_HIFI, RESTRICTED_ACL +// "maturity": String, // enum corresponding to ESRB ratings +// "hosts": [ String ], // capped list of usernames +// "description": String, // capped description +// TODO: "img": { +// "src": String, +// "type": String, +// "size": Number, +// "updated_at": Number, +// }, +// "tags": [ String ], // capped list of tags +// } + +// metadata will appear as (JSON): +// { users: , descriptors: } +// +// it is meant to be sent to and consumed by an external API + +DomainMetadata::DomainMetadata() { + _metadata[USERS] = {}; + _metadata[DESCRIPTORS] = {}; +} + +void DomainMetadata::setDescriptors(QVariantMap& settings) { + // TODO + + QVariantMap descriptors; + + #if DEV_BUILD || PR_BUILD + qDebug() << "Regenerated domain metadata - descriptors:" << descriptors; +#endif } void DomainMetadata::usersChanged() { static const QString DEFAULT_HOSTNAME = "*"; auto nodeList = DependencyManager::get(); - int numConnectedUnassigned = 0; + int numConnected = 0; + int numConnectedAnonymously = 0; QVariantMap userHostnames; // figure out the breakdown of currently connected interface clients - nodeList->eachNode([&numConnectedUnassigned, &userHostnames](const SharedNodePointer& node) { + nodeList->eachNode([&numConnected, &numConnectedAnonymously, &userHostnames](const SharedNodePointer& node) { auto linkedData = node->getLinkedData(); if (linkedData) { auto nodeData = static_cast(linkedData); if (!nodeData->wasAssigned()) { - ++numConnectedUnassigned; + ++numConnected; + + // TODO: numConnectedAnonymously // increment the count for this hostname (or the default if we don't have one) auto placeName = nodeData->getPlaceName(); @@ -47,10 +95,13 @@ void DomainMetadata::usersChanged() { } }); - QVariantMap users = {{ USERS_NUM_KEY, numConnectedUnassigned }, { USERS_HOSTNAMES_KEY, userHostnames }}; - _metadata[USERS_KEY] = users; + QVariantMap users = { + { USERS_NUM_TOTAL, numConnected }, + { USERS_NUM_ANON, numConnectedAnonymously }, + { USERS_HOSTNAMES, userHostnames }}; + _metadata[USERS] = users; -#if DEV_BUILD +#if DEV_BUILD || PR_BUILD qDebug() << "Regenerated domain metadata - users:" << users; #endif } diff --git a/domain-server/src/DomainMetadata.h b/domain-server/src/DomainMetadata.h index ae6dfe10a1..e2f4674afc 100644 --- a/domain-server/src/DomainMetadata.h +++ b/domain-server/src/DomainMetadata.h @@ -14,16 +14,36 @@ #include #include -class DomainMetadata { - static const QString USERS_KEY; - static const QString USERS_NUM_KEY; - static const QString USERS_HOSTNAMES_KEY; +class DomainMetadata : public QObject { +Q_OBJECT + + static const QString USERS; + static const QString USERS_NUM_TOTAL; + static const QString USERS_NUM_ANON; + static const QString USERS_HOSTNAMES; + + static const QString DESCRIPTORS; + static const QString DESCRIPTORS_DESCRIPTION; + static const QString DESCRIPTORS_CAPACITY; + static const QString DESCRIPTORS_HOURS; + static const QString DESCRIPTORS_RESTRICTION; + static const QString DESCRIPTORS_MATURITY; + static const QString DESCRIPTORS_HOSTS; + static const QString DESCRIPTORS_TAGS; + static const QString DESCRIPTORS_IMG; + static const QString DESCRIPTORS_IMG_SRC; + static const QString DESCRIPTORS_IMG_TYPE; + static const QString DESCRIPTORS_IMG_SIZE; + static const QString DESCRIPTORS_IMG_UPDATED_AT; public: DomainMetadata(); QJsonObject get() { return QJsonObject::fromVariantMap(_metadata); } - QJsonObject getUsers() { return QJsonObject::fromVariantMap(_metadata[USERS_KEY].toMap()); } + QJsonObject getUsers() { return QJsonObject::fromVariantMap(_metadata[USERS].toMap()); } + QJsonObject getDescriptors() { return QJsonObject::fromVariantMap(_metadata[DESCRIPTORS].toMap()); } + + void setDescriptors(QVariantMap& settings); public slots: void usersChanged(); diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index c24fd02727..88c4e215b2 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -94,13 +94,13 @@ DomainServer::DomainServer(int argc, char* argv[]) : qRegisterMetaType("DomainServerWebSessionData"); qRegisterMetaTypeStreamOperators("DomainServerWebSessionData"); - // make sure we hear about newly connected nodes from our gatekeeper - connect(&_gatekeeper, &DomainGatekeeper::connectedNode, this, &DomainServer::handleConnectedNode); - // update the metadata when a user (dis)connects connect(this, &DomainServer::userConnected, &_metadata, &DomainMetadata::usersChanged); connect(this, &DomainServer::userDisconnected, &_metadata, &DomainMetadata::usersChanged); + // make sure we hear about newly connected nodes from our gatekeeper + connect(&_gatekeeper, &DomainGatekeeper::connectedNode, this, &DomainServer::handleConnectedNode); + if (optionallyReadX509KeyAndCertificate() && optionallySetupOAuth()) { // we either read a certificate and private key or were not passed one // and completed login or did not need to @@ -116,6 +116,9 @@ DomainServer::DomainServer(int argc, char* argv[]) : optionallyGetTemporaryName(args); } + + // update the metadata with current descriptors + _metadata.setDescriptors(_settingsManager.getSettingsMap()); } DomainServer::~DomainServer() { From 209ace1b867ae8cf64678e3b983c5137e7407ec7 Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Fri, 3 Jun 2016 11:11:06 -0700 Subject: [PATCH 46/89] Include anonymously connected user metadata --- domain-server/src/DomainMetadata.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/domain-server/src/DomainMetadata.cpp b/domain-server/src/DomainMetadata.cpp index 0481e9911d..75ff0d697c 100644 --- a/domain-server/src/DomainMetadata.cpp +++ b/domain-server/src/DomainMetadata.cpp @@ -85,7 +85,9 @@ void DomainMetadata::usersChanged() { if (!nodeData->wasAssigned()) { ++numConnected; - // TODO: numConnectedAnonymously + if (nodeData->getUsername().isEmpty()) { + ++numConnectedAnonymously; + } // increment the count for this hostname (or the default if we don't have one) auto placeName = nodeData->getPlaceName(); From e04c6e8c44f716ac8497b3e2d6a9f78a63a4b709 Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Fri, 3 Jun 2016 14:36:43 -0700 Subject: [PATCH 47/89] Add description/hosts/rating to settings UI --- .../resources/describe-settings.json | 72 ++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/domain-server/resources/describe-settings.json b/domain-server/resources/describe-settings.json index cac0d28e1e..ba00392cd7 100644 --- a/domain-server/resources/describe-settings.json +++ b/domain-server/resources/describe-settings.json @@ -1,5 +1,5 @@ { - "version": 1.2, + "version": 1.3, "settings": [ { "name": "metaverse", @@ -71,6 +71,76 @@ } ] }, + { + "name": "descriptors", + "label": "Description", + "help": "This data will be queryable from your server. It may be collected by High Fidelity and used to share your domain with others.", + "settings": [ + { + "name": "description", + "label": "Description", + "help": "A description of your domain (256 character limit)." + }, + { + "name": "maturity", + "label": "Maturity", + "help": "A maturity rating, available as a guideline for content on your domain.", + "default": "unrated", + "type": "select", + "options": [ + { + "value": "unrated", + "label": "Unrated" + }, + { + "value": "everyone", + "label": "Everyone" + }, + { + "value": "teen", + "label": "Teen (13+)" + }, + { + "value": "mature", + "label": "Mature (17+)" + }, + { + "value": "adult", + "label": "Adult (18+)" + } + ] + + }, + { + "name": "hosts", + "label": "Hosts", + "type": "table", + "help": "Usernames of hosts who can reliably show your domain to new visitors.", + "numbered": false, + "columns": [ + { + "name": "host", + "label": "Username", + "can_set": true + } + ] + }, + { + "name": "tags", + "label": "Tags", + "type": "table", + "help": "Common categories under which your domain falls.", + "numbered": false, + "columns": [ + { + "name": "tag", + "label": "Tag", + "can_set": true + } + ] + } + ] + }, { "name": "security", "label": "Security", From 2367cb199566d8054a30c3c0435ba9143b7d837d Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Fri, 3 Jun 2016 15:07:21 -0700 Subject: [PATCH 48/89] fixing input mapping for vive/touch grip button/trigger, script needs fixing --- .../resources/controllers/oculus_touch.json | 6 +-- interface/resources/controllers/vive.json | 4 +- .../src/controllers/StandardControls.h | 8 ++-- .../oculus/src/OculusControllerManager.cpp | 21 +-------- plugins/openvr/src/ViveControllerManager.cpp | 2 +- .../system/controllers/handControllerGrab.js | 47 ++++++++++++++----- 6 files changed, 44 insertions(+), 44 deletions(-) diff --git a/interface/resources/controllers/oculus_touch.json b/interface/resources/controllers/oculus_touch.json index 8cb512a526..b59bf54e5b 100644 --- a/interface/resources/controllers/oculus_touch.json +++ b/interface/resources/controllers/oculus_touch.json @@ -10,16 +10,14 @@ { "from": "OculusTouch.LX", "to": "Standard.LX" }, { "from": "OculusTouch.LT", "to": "Standard.LT" }, { "from": "OculusTouch.LS", "to": "Standard.LS" }, - { "from": "OculusTouch.LG", "to": "Standard.LG" }, - { "from": "OculusTouch.LeftGrip", "to": "Standard.LB" }, + { "from": "OculusTouch.LeftGrip", "to": "Standard.LeftGrip" }, { "from": "OculusTouch.LeftHand", "to": "Standard.LeftHand" }, { "from": "OculusTouch.RY", "filters": "invert", "to": "Standard.RY" }, { "from": "OculusTouch.RX", "to": "Standard.RX" }, { "from": "OculusTouch.RT", "to": "Standard.RT" }, { "from": "OculusTouch.RS", "to": "Standard.RS" }, - { "from": "OculusTouch.RG", "to": "Standard.RG" }, - { "from": "OculusTouch.RightGrip", "to": "Standard.RB" }, + { "from": "OculusTouch.RightGrip", "to": "Standard.RightGrip" }, { "from": "OculusTouch.RightHand", "to": "Standard.RightHand" }, { "from": "OculusTouch.LeftApplicationMenu", "to": "Standard.Back" }, diff --git a/interface/resources/controllers/vive.json b/interface/resources/controllers/vive.json index 60a46ba3ce..dc3ca3755e 100644 --- a/interface/resources/controllers/vive.json +++ b/interface/resources/controllers/vive.json @@ -5,7 +5,7 @@ { "from": "Vive.LX", "when": "Vive.LSOuter", "to": "Standard.LX" }, { "from": "Vive.LT", "to": "Standard.LT" }, - { "from": "Vive.LeftGrip", "to": "Standard.LB" }, + { "from": "Vive.LeftGrip", "to": "Standard.LeftGrip" }, { "from": "Vive.LS", "to": "Standard.LS" }, { "from": "Vive.LSTouch", "to": "Standard.LSTouch" }, @@ -13,7 +13,7 @@ { "from": "Vive.RX", "when": "Vive.RSOuter", "to": "Standard.RX" }, { "from": "Vive.RT", "to": "Standard.RT" }, - { "from": "Vive.RightGrip", "to": "Standard.RB" }, + { "from": "Vive.RightGrip", "to": "Standard.RightGrip" }, { "from": "Vive.RS", "to": "Standard.RS" }, { "from": "Vive.RSTouch", "to": "Standard.RSTouch" }, diff --git a/libraries/controllers/src/controllers/StandardControls.h b/libraries/controllers/src/controllers/StandardControls.h index 79c23bc6ee..d7eb3de2c2 100644 --- a/libraries/controllers/src/controllers/StandardControls.h +++ b/libraries/controllers/src/controllers/StandardControls.h @@ -66,9 +66,7 @@ namespace controller { RIGHT_SECONDARY_INDEX_TOUCH, RIGHT_INDEX_POINT, - LEFT_GRIP, LEFT_GRIP_TOUCH, - RIGHT_GRIP, RIGHT_GRIP_TOUCH, NUM_STANDARD_BUTTONS @@ -85,9 +83,9 @@ namespace controller { // Triggers LT, RT, - // Grips (Oculus touch squeeze) - LG, - RG, + // Grips + LEFT_GRIP, + RIGHT_GRIP, NUM_STANDARD_AXES, LZ = LT, RZ = RT diff --git a/plugins/oculus/src/OculusControllerManager.cpp b/plugins/oculus/src/OculusControllerManager.cpp index e84fdcbfc7..9eadb83ea7 100644 --- a/plugins/oculus/src/OculusControllerManager.cpp +++ b/plugins/oculus/src/OculusControllerManager.cpp @@ -173,11 +173,6 @@ void OculusControllerManager::RemoteDevice::focusOutEvent() { } void OculusControllerManager::TouchDevice::update(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) { - // Check past values of button map for hysteresis before clearing map - const float HYSTERESIS_OFFSET = -0.1f; - float LEFT_HYSTERESIS_OFFSET = _buttonPressedMap.find(LEFT_GRIP) != _buttonPressedMap.end() ? HYSTERESIS_OFFSET : 0.0f; - float RIGHT_HYSTERESIS_OFFSET = _buttonPressedMap.find(RIGHT_GRIP) != _buttonPressedMap.end() ? HYSTERESIS_OFFSET : 0.0f; - _poseStateMap.clear(); _buttonPressedMap.clear(); @@ -198,12 +193,12 @@ void OculusControllerManager::TouchDevice::update(float deltaTime, const control _axisStateMap[LX] = inputState.Thumbstick[ovrHand_Left].x; _axisStateMap[LY] = inputState.Thumbstick[ovrHand_Left].y; _axisStateMap[LT] = inputState.IndexTrigger[ovrHand_Left]; - _axisStateMap[LG] = inputState.HandTrigger[ovrHand_Left]; + _axisStateMap[LEFT_GRIP] = inputState.HandTrigger[ovrHand_Left]; _axisStateMap[RX] = inputState.Thumbstick[ovrHand_Right].x; _axisStateMap[RY] = inputState.Thumbstick[ovrHand_Right].y; _axisStateMap[RT] = inputState.IndexTrigger[ovrHand_Right]; - _axisStateMap[RG] = inputState.HandTrigger[ovrHand_Right]; + _axisStateMap[RIGHT_GRIP] = inputState.HandTrigger[ovrHand_Right]; // Buttons for (const auto& pair : BUTTON_MAP) { @@ -211,16 +206,6 @@ void OculusControllerManager::TouchDevice::update(float deltaTime, const control _buttonPressedMap.insert(pair.second); } } - // Map pressed hand triggers to grip buttons - // This is temporary in order to support the grab/equip scripts - const float handTriggerThreshold = 0.9f; - if (inputState.HandTrigger[ovrHand_Left] >= handTriggerThreshold + LEFT_HYSTERESIS_OFFSET) { - _buttonPressedMap.insert(LEFT_GRIP); - } - if (inputState.HandTrigger[ovrHand_Right] >= handTriggerThreshold + RIGHT_HYSTERESIS_OFFSET) { - _buttonPressedMap.insert(RIGHT_GRIP); - } - // Touches for (const auto& pair : TOUCH_MAP) { if (inputState.Touches & pair.first) { @@ -348,8 +333,6 @@ controller::Input::NamedVector OculusControllerManager::TouchDevice::getAvailabl //makePair(RB, "RB"), // side grip triggers - makePair(LG, "LG"), - makePair(RG, "RG"), makePair(LEFT_GRIP, "LeftGrip"), makePair(RIGHT_GRIP, "RightGrip"), diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index 6e75454b5f..bddbb91316 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -342,7 +342,7 @@ void ViveControllerManager::InputDevice::handleButtonEvent(float deltaTime, uint if (button == vr::k_EButton_ApplicationMenu) { _buttonPressedMap.insert(isLeftHand ? LEFT_APP_MENU : RIGHT_APP_MENU); } else if (button == vr::k_EButton_Grip) { - _buttonPressedMap.insert(isLeftHand ? LEFT_GRIP : RIGHT_GRIP); + _axisStateMap[isLeftHand ? LEFT_GRIP : RIGHT_GRIP] = 1.0f; } else if (button == vr::k_EButton_SteamVR_Trigger) { _buttonPressedMap.insert(isLeftHand ? LT : RT); } else if (button == vr::k_EButton_SteamVR_Touchpad) { diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 06549a38b5..4f4b7e32ad 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -33,6 +33,9 @@ var TRIGGER_OFF_VALUE = 0.15; var BUMPER_ON_VALUE = 0.5; +var GRIP_ON_VALUE = 0.9; +var GRIP_OFF_VALUE = 0.8; + var THUMB_ON_VALUE = 0.5; var HAND_HEAD_MIX_RATIO = 0.0; // 0 = only use hands for search/move. 1 = only use head for search/move. @@ -271,6 +274,7 @@ function MyController(hand) { this.triggerValue = 0; // rolling average of trigger value this.rawTriggerValue = 0; + this.rawGripValue = 0; this.rawBumperValue = 0; this.rawThumbValue = 0; @@ -509,10 +513,10 @@ function MyController(hand) { var searchSphereLocation = Vec3.sum(distantPickRay.origin, Vec3.multiply(distantPickRay.direction, this.searchSphereDistance)); this.searchSphereOn(searchSphereLocation, SEARCH_SPHERE_SIZE * this.searchSphereDistance, - (this.triggerSmoothedGrab() || this.bumperSqueezed()) ? INTERSECT_COLOR : NO_INTERSECT_COLOR); + (this.triggerSmoothedGrab() || (this.bumperSqueezed() || this.gripSqueezed())) ? INTERSECT_COLOR : NO_INTERSECT_COLOR); if ((USE_OVERLAY_LINES_FOR_SEARCHING === true) && PICK_WITH_HAND_RAY) { this.overlayLineOn(handPosition, searchSphereLocation, - (this.triggerSmoothedGrab() || this.bumperSqueezed()) ? INTERSECT_COLOR : NO_INTERSECT_COLOR); + (this.triggerSmoothedGrab() || (this.bumperSqueezed() || this.gripSqueezed())) ? INTERSECT_COLOR : NO_INTERSECT_COLOR); } } @@ -772,6 +776,10 @@ function MyController(hand) { _this.rawBumperValue = value; }; + this.gripPress = function(value) { + _this.rawGripValue = value; + }; + this.updateSmoothedTrigger = function() { var triggerValue = this.rawTriggerValue; // smooth out trigger value @@ -799,6 +807,14 @@ function MyController(hand) { return _this.rawBumperValue < BUMPER_ON_VALUE; }; + this.gripSqueezed = function() { + return _this.rawGripValue > GRIP_ON_VALUE; + }; + + this.gripReleased = function() { + return _this.rawGripValue < GRIP_OFF_VALUE; + }; + // this.triggerOrBumperSqueezed = function() { // return triggerSmoothedSqueezed() || bumperSqueezed(); // } @@ -820,13 +836,13 @@ function MyController(hand) { }; this.off = function() { - if (this.triggerSmoothedSqueezed() || this.bumperSqueezed()) { + if (this.triggerSmoothedSqueezed() || (this.bumperSqueezed() || this.gripSqueezed())) { this.lastPickTime = 0; var controllerHandInput = (this.hand === RIGHT_HAND) ? Controller.Standard.RightHand : Controller.Standard.LeftHand; this.startingHandRotation = Controller.getPoseValue(controllerHandInput).rotation; if (this.triggerSmoothedSqueezed()) { this.setState(STATE_SEARCHING); - } else if (this.bumperSqueezed()) { + } else if (this.bumperSqueezed() || this.gripSqueezed()) { this.setState(STATE_HOLD_SEARCHING); } } @@ -839,11 +855,13 @@ function MyController(hand) { this.checkForStrayChildren(); + print("bumper: " + this.bumperReleased() + " grip: " + this.gripReleased()); + if (this.state == STATE_SEARCHING && this.triggerSmoothedReleased()) { this.setState(STATE_RELEASE); return; } - if (this.state == STATE_HOLD_SEARCHING && this.bumperReleased()) { + if (this.state == STATE_HOLD_SEARCHING && (this.bumperReleased() || this.gripReleased())) { this.setState(STATE_RELEASE); return; } @@ -1000,7 +1018,7 @@ function MyController(hand) { grabbableData = grabbableDataForCandidate; } } - if ((this.grabbedEntity !== null) && (this.triggerSmoothedGrab() || this.bumperSqueezed())) { + if ((this.grabbedEntity !== null) && (this.triggerSmoothedGrab() || (this.bumperSqueezed() || this.gripSqueezed()))) { // We are squeezing enough to grab, and we've found an entity that we'll try to do something with. var near = (nearPickedCandidateEntities.indexOf(this.grabbedEntity) >= 0) || minDistance <= NEAR_PICK_MAX_DISTANCE; var isPhysical = this.propsArePhysical(props); @@ -1166,7 +1184,7 @@ function MyController(hand) { }; this.continueDistanceHolding = function() { - if (this.triggerSmoothedReleased() && this.bumperReleased()) { + if (this.triggerSmoothedReleased() && (this.bumperReleased() || this.gripReleased())) { this.setState(STATE_RELEASE); this.callEntityMethodOnGrabbed("releaseGrab"); return; @@ -1390,7 +1408,7 @@ function MyController(hand) { this.callEntityMethodOnGrabbed("releaseGrab"); return; } - if (this.state == STATE_HOLD && this.bumperReleased()) { + if (this.state == STATE_HOLD && (this.bumperReleased() || this.gripReleased())) { this.setState(STATE_RELEASE); this.callEntityMethodOnGrabbed("releaseGrab"); return; @@ -1504,7 +1522,7 @@ function MyController(hand) { this.callEntityMethodOnGrabbed("releaseGrab"); return; } - if (this.state == STATE_CONTINUE_HOLD && this.bumperReleased()) { + if (this.state == STATE_CONTINUE_HOLD && (this.bumperReleased() || this.gripReleased())) { this.setState(STATE_RELEASE); this.callEntityMethodOnGrabbed("releaseEquip"); return; @@ -1633,7 +1651,7 @@ function MyController(hand) { }; this.nearTrigger = function() { - if (this.triggerSmoothedReleased() && this.bumperReleased()) { + if (this.triggerSmoothedReleased() && (this.bumperReleased() || this.gripReleased())) { this.setState(STATE_RELEASE); this.callEntityMethodOnGrabbed("stopNearTrigger"); return; @@ -1643,7 +1661,7 @@ function MyController(hand) { }; this.farTrigger = function() { - if (this.triggerSmoothedReleased() && this.bumperReleased()) { + if (this.triggerSmoothedReleased() && (this.bumperReleased() || this.gripReleased())) { this.setState(STATE_RELEASE); this.callEntityMethodOnGrabbed("stopFarTrigger"); return; @@ -1653,7 +1671,7 @@ function MyController(hand) { }; this.continueNearTrigger = function() { - if (this.triggerSmoothedReleased() && this.bumperReleased()) { + if (this.triggerSmoothedReleased() && (this.bumperReleased() || this.gripReleased())) { this.setState(STATE_RELEASE); this.callEntityMethodOnGrabbed("stopNearTrigger"); return; @@ -1662,7 +1680,7 @@ function MyController(hand) { }; this.continueFarTrigger = function() { - if (this.triggerSmoothedReleased() && this.bumperReleased()) { + if (this.triggerSmoothedReleased() && (this.bumperReleased() || this.gripReleased())) { this.setState(STATE_RELEASE); this.callEntityMethodOnGrabbed("stopFarTrigger"); return; @@ -1945,6 +1963,9 @@ mapping.from([Controller.Standard.LT]).peek().to(leftController.triggerPress); mapping.from([Controller.Standard.RB]).peek().to(rightController.bumperPress); mapping.from([Controller.Standard.LB]).peek().to(leftController.bumperPress); +mapping.from([Controller.Standard.RightGrip]).peek().to(rightController.gripPress); +mapping.from([Controller.Standard.LeftGrip]).peek().to(leftController.gripPress); + mapping.from([Controller.Standard.LeftPrimaryThumb]).peek().to(leftController.thumbPress); mapping.from([Controller.Standard.RightPrimaryThumb]).peek().to(rightController.thumbPress); From 09e0a2ced70d03fa1e4e17b74dbd9e25f41c89df Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Fri, 3 Jun 2016 14:59:58 -0700 Subject: [PATCH 49/89] Parse basic metadata into DomainMetadata --- domain-server/src/DomainMetadata.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/domain-server/src/DomainMetadata.cpp b/domain-server/src/DomainMetadata.cpp index 75ff0d697c..8fdbc2bbd1 100644 --- a/domain-server/src/DomainMetadata.cpp +++ b/domain-server/src/DomainMetadata.cpp @@ -10,6 +10,7 @@ #include "DomainMetadata.h" +#include #include #include @@ -35,7 +36,7 @@ const QString DomainMetadata::DESCRIPTORS_TAGS = "tags"; // descriptors metadata will appear as (JSON): // { "capacity": Number, // TODO: "hours": String, // UTF-8 representation of the week, split into 15" segments -// "restriction": String, // enum of either OPEN, RESTRICTED_HIFI, RESTRICTED_ACL +// "restriction": String, // enum of either open, hifi, or acl // "maturity": String, // enum corresponding to ESRB ratings // "hosts": [ String ], // capped list of usernames // "description": String, // capped description @@ -59,11 +60,25 @@ DomainMetadata::DomainMetadata() { } void DomainMetadata::setDescriptors(QVariantMap& settings) { - // TODO + const QString CAPACITY = "security.maximum_user_capacity"; + const QVariant* capacityVariant = valueForKeyPath(settings, CAPACITY); + unsigned int capacity = capacityVariant ? capacityVariant->toUInt() : 0; - QVariantMap descriptors; + // TODO: Keep parity with ACL development. + const QString RESTRICTION = "security.restricted_access"; + const QString RESTRICTION_OPEN = "open"; + // const QString RESTRICTION_HIFI = "hifi"; + const QString RESTRICTION_ACL = "acl"; + const QVariant* isRestrictedVariant = valueForKeyPath(settings, RESTRICTION); + bool isRestricted = isRestrictedVariant ? isRestrictedVariant->toBool() : false; + QString restriction = isRestricted ? RESTRICTION_ACL : RESTRICTION_OPEN; - #if DEV_BUILD || PR_BUILD + QVariantMap descriptors = settings[DESCRIPTORS].toMap(); + descriptors[DESCRIPTORS_CAPACITY] = capacity; + descriptors[DESCRIPTORS_RESTRICTION] = restriction; + _metadata[DESCRIPTORS] = descriptors; + +#if DEV_BUILD || PR_BUILD qDebug() << "Regenerated domain metadata - descriptors:" << descriptors; #endif } From 27594e6df2bdc0bc8a0ce943cb52b823296f5ac9 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 3 Jun 2016 17:07:08 -0700 Subject: [PATCH 50/89] remove afro --- .../kineticObjects/dressingRoomBricabrac.json | 38 ------------------- 1 file changed, 38 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json b/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json index aa4c944427..fdfb505846 100644 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json @@ -549,44 +549,6 @@ "shapeType": "compound", "type": "Model", "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }, { - "name": "home_model_dressing_room_bricabrac", - "collisionsWillMove": 1, - "compoundShapeURL": "atp:/dressingRoom/afro.obj", - "created": "2016-05-17T23:58:24Z", - "dimensions": { - "x": 0.35398837924003601, - "y": 0.33958616852760315, - "z": 0.35055956244468689 - }, - "dynamic": 1, - "gravity": { - "x": 0, - "y": -5, - "z": 0 - }, - "id": "{d163c628-8247-4d13-a465-c1692825b4fe}", - "modelURL": "atp:/dressingRoom/afro.fbx", - "position": { - "x": 0.1300048828125, - "y": 0.9853515625, - "z": 0.4675140380859375 - }, - "queryAACube": { - "scale": 0.60292500257492065, - "x": -0.17145761847496033, - "y": 0.68388903141021729, - "z": 0.16605153679847717 - }, - "rotation": { - "w": 0.73046457767486572, - "x": 0.14757001399993896, - "y": 0.58101773262023926, - "z": -0.32719922065734863 - }, - "shapeType": "compound", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }], "Version": 57 } \ No newline at end of file From 4fb8eac8ea7853b54b64a8a07e7a0034dbfe3488 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Fri, 3 Jun 2016 18:12:47 -0700 Subject: [PATCH 51/89] much better way of fixing script --- .../system/controllers/handControllerGrab.js | 77 +++++++------------ 1 file changed, 29 insertions(+), 48 deletions(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 4f4b7e32ad..986a4c0722 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -33,9 +33,6 @@ var TRIGGER_OFF_VALUE = 0.15; var BUMPER_ON_VALUE = 0.5; -var GRIP_ON_VALUE = 0.9; -var GRIP_OFF_VALUE = 0.8; - var THUMB_ON_VALUE = 0.5; var HAND_HEAD_MIX_RATIO = 0.0; // 0 = only use hands for search/move. 1 = only use head for search/move. @@ -274,8 +271,7 @@ function MyController(hand) { this.triggerValue = 0; // rolling average of trigger value this.rawTriggerValue = 0; - this.rawGripValue = 0; - this.rawBumperValue = 0; + this.rawSecondaryValue = 0; this.rawThumbValue = 0; //for visualizations @@ -513,10 +509,10 @@ function MyController(hand) { var searchSphereLocation = Vec3.sum(distantPickRay.origin, Vec3.multiply(distantPickRay.direction, this.searchSphereDistance)); this.searchSphereOn(searchSphereLocation, SEARCH_SPHERE_SIZE * this.searchSphereDistance, - (this.triggerSmoothedGrab() || (this.bumperSqueezed() || this.gripSqueezed())) ? INTERSECT_COLOR : NO_INTERSECT_COLOR); + (this.triggerSmoothedGrab() || this.secondarySqueezed()) ? INTERSECT_COLOR : NO_INTERSECT_COLOR); if ((USE_OVERLAY_LINES_FOR_SEARCHING === true) && PICK_WITH_HAND_RAY) { this.overlayLineOn(handPosition, searchSphereLocation, - (this.triggerSmoothedGrab() || (this.bumperSqueezed() || this.gripSqueezed())) ? INTERSECT_COLOR : NO_INTERSECT_COLOR); + (this.triggerSmoothedGrab() || this.secondarySqueezed()) ? INTERSECT_COLOR : NO_INTERSECT_COLOR); } } @@ -772,12 +768,8 @@ function MyController(hand) { _this.rawTriggerValue = value; }; - this.bumperPress = function(value) { - _this.rawBumperValue = value; - }; - - this.gripPress = function(value) { - _this.rawGripValue = value; + this.secondaryPress = function(value) { + _this.rawSecondaryValue = value; }; this.updateSmoothedTrigger = function() { @@ -799,28 +791,20 @@ function MyController(hand) { return this.triggerValue < TRIGGER_OFF_VALUE; }; - this.bumperSqueezed = function() { - return _this.rawBumperValue > BUMPER_ON_VALUE; + this.secondarySqueezed = function() { + return _this.rawSecondaryValue > BUMPER_ON_VALUE; }; - this.bumperReleased = function() { - return _this.rawBumperValue < BUMPER_ON_VALUE; + this.secondaryReleased = function() { + return _this.rawSecondaryValue < BUMPER_ON_VALUE; }; - this.gripSqueezed = function() { - return _this.rawGripValue > GRIP_ON_VALUE; - }; - - this.gripReleased = function() { - return _this.rawGripValue < GRIP_OFF_VALUE; - }; - - // this.triggerOrBumperSqueezed = function() { - // return triggerSmoothedSqueezed() || bumperSqueezed(); + // this.triggerOrsecondarySqueezed = function() { + // return triggerSmoothedSqueezed() || secondarySqueezed(); // } - // this.triggerAndBumperReleased = function() { - // return triggerSmoothedReleased() && bumperReleased(); + // this.triggerAndSecondaryReleased = function() { + // return triggerSmoothedReleased() && secondaryReleased(); // } this.thumbPress = function(value) { @@ -836,13 +820,13 @@ function MyController(hand) { }; this.off = function() { - if (this.triggerSmoothedSqueezed() || (this.bumperSqueezed() || this.gripSqueezed())) { + if (this.triggerSmoothedSqueezed() || this.secondarySqueezed()) { this.lastPickTime = 0; var controllerHandInput = (this.hand === RIGHT_HAND) ? Controller.Standard.RightHand : Controller.Standard.LeftHand; this.startingHandRotation = Controller.getPoseValue(controllerHandInput).rotation; if (this.triggerSmoothedSqueezed()) { this.setState(STATE_SEARCHING); - } else if (this.bumperSqueezed() || this.gripSqueezed()) { + } else if (this.secondarySqueezed()) { this.setState(STATE_HOLD_SEARCHING); } } @@ -855,13 +839,11 @@ function MyController(hand) { this.checkForStrayChildren(); - print("bumper: " + this.bumperReleased() + " grip: " + this.gripReleased()); - if (this.state == STATE_SEARCHING && this.triggerSmoothedReleased()) { this.setState(STATE_RELEASE); return; } - if (this.state == STATE_HOLD_SEARCHING && (this.bumperReleased() || this.gripReleased())) { + if (this.state == STATE_HOLD_SEARCHING && this.secondaryReleased()) { this.setState(STATE_RELEASE); return; } @@ -1018,7 +1000,7 @@ function MyController(hand) { grabbableData = grabbableDataForCandidate; } } - if ((this.grabbedEntity !== null) && (this.triggerSmoothedGrab() || (this.bumperSqueezed() || this.gripSqueezed()))) { + if ((this.grabbedEntity !== null) && (this.triggerSmoothedGrab() || this.secondarySqueezed())) { // We are squeezing enough to grab, and we've found an entity that we'll try to do something with. var near = (nearPickedCandidateEntities.indexOf(this.grabbedEntity) >= 0) || minDistance <= NEAR_PICK_MAX_DISTANCE; var isPhysical = this.propsArePhysical(props); @@ -1184,7 +1166,7 @@ function MyController(hand) { }; this.continueDistanceHolding = function() { - if (this.triggerSmoothedReleased() && (this.bumperReleased() || this.gripReleased())) { + if (this.triggerSmoothedReleased() && this.secondaryReleased()) { this.setState(STATE_RELEASE); this.callEntityMethodOnGrabbed("releaseGrab"); return; @@ -1408,7 +1390,7 @@ function MyController(hand) { this.callEntityMethodOnGrabbed("releaseGrab"); return; } - if (this.state == STATE_HOLD && (this.bumperReleased() || this.gripReleased())) { + if (this.state == STATE_HOLD && this.secondaryReleased()) { this.setState(STATE_RELEASE); this.callEntityMethodOnGrabbed("releaseGrab"); return; @@ -1522,7 +1504,7 @@ function MyController(hand) { this.callEntityMethodOnGrabbed("releaseGrab"); return; } - if (this.state == STATE_CONTINUE_HOLD && (this.bumperReleased() || this.gripReleased())) { + if (this.state == STATE_CONTINUE_HOLD && this.secondaryReleased()) { this.setState(STATE_RELEASE); this.callEntityMethodOnGrabbed("releaseEquip"); return; @@ -1651,7 +1633,7 @@ function MyController(hand) { }; this.nearTrigger = function() { - if (this.triggerSmoothedReleased() && (this.bumperReleased() || this.gripReleased())) { + if (this.triggerSmoothedReleased() && this.secondaryReleased()) { this.setState(STATE_RELEASE); this.callEntityMethodOnGrabbed("stopNearTrigger"); return; @@ -1661,7 +1643,7 @@ function MyController(hand) { }; this.farTrigger = function() { - if (this.triggerSmoothedReleased() && (this.bumperReleased() || this.gripReleased())) { + if (this.triggerSmoothedReleased() && this.secondaryReleased()) { this.setState(STATE_RELEASE); this.callEntityMethodOnGrabbed("stopFarTrigger"); return; @@ -1671,7 +1653,7 @@ function MyController(hand) { }; this.continueNearTrigger = function() { - if (this.triggerSmoothedReleased() && (this.bumperReleased() || this.gripReleased())) { + if (this.triggerSmoothedReleased() && this.secondaryReleased()) { this.setState(STATE_RELEASE); this.callEntityMethodOnGrabbed("stopNearTrigger"); return; @@ -1680,7 +1662,7 @@ function MyController(hand) { }; this.continueFarTrigger = function() { - if (this.triggerSmoothedReleased() && (this.bumperReleased() || this.gripReleased())) { + if (this.triggerSmoothedReleased() && this.secondaryReleased()) { this.setState(STATE_RELEASE); this.callEntityMethodOnGrabbed("stopFarTrigger"); return; @@ -1960,11 +1942,10 @@ var mapping = Controller.newMapping(MAPPING_NAME); mapping.from([Controller.Standard.RT]).peek().to(rightController.triggerPress); mapping.from([Controller.Standard.LT]).peek().to(leftController.triggerPress); -mapping.from([Controller.Standard.RB]).peek().to(rightController.bumperPress); -mapping.from([Controller.Standard.LB]).peek().to(leftController.bumperPress); - -mapping.from([Controller.Standard.RightGrip]).peek().to(rightController.gripPress); -mapping.from([Controller.Standard.LeftGrip]).peek().to(leftController.gripPress); +mapping.from([Controller.Standard.RB]).peek().to(rightController.secondaryPress); +mapping.from([Controller.Standard.LB]).peek().to(leftController.secondaryPress); +mapping.from([Controller.Standard.LeftGrip]).peek().to(leftController.secondaryPress); +mapping.from([Controller.Standard.RightGrip]).peek().to(rightController.secondaryPress); mapping.from([Controller.Standard.LeftPrimaryThumb]).peek().to(leftController.thumbPress); mapping.from([Controller.Standard.RightPrimaryThumb]).peek().to(rightController.thumbPress); @@ -2057,4 +2038,4 @@ function cleanup() { Reticle.setVisible(true); } Script.scriptEnding.connect(cleanup); -Script.update.connect(update); +Script.update.connect(update); \ No newline at end of file From 47a84fe91d4e92233dfce7f3e9a86e10eae5aa5a Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Sat, 4 Jun 2016 20:51:46 -0700 Subject: [PATCH 52/89] make shelf stuff wearable --- .../Home/kineticObjects/stuff_on_shelves.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/stuff_on_shelves.json b/unpublishedScripts/DomainContent/Home/kineticObjects/stuff_on_shelves.json index cecd02197a..ee5d44d49c 100644 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/stuff_on_shelves.json +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/stuff_on_shelves.json @@ -35,7 +35,7 @@ }, "shapeType": "box", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "collisionsWillMove": 1, "created": "2016-03-31T23:06:57Z", @@ -72,7 +72,7 @@ }, "shapeType": "box", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "collisionsWillMove": 1, "created": "2016-03-31T22:45:06Z", @@ -109,7 +109,7 @@ }, "shapeType": "box", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "collisionsWillMove": 1, "created": "2016-03-31T23:06:57Z", @@ -146,7 +146,7 @@ }, "shapeType": "box", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "collisionsWillMove": 1, "created": "2016-03-31T22:47:17Z", @@ -183,7 +183,7 @@ }, "shapeType": "box", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "collisionsWillMove": 1, "created": "2016-03-31T22:49:28Z", @@ -220,7 +220,7 @@ }, "shapeType": "box", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }], "Version": 57 } \ No newline at end of file From eb3cafb4f93f2ef64c584cfc18ed71119f91ed02 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Mon, 6 Jun 2016 08:59:41 -0700 Subject: [PATCH 53/89] shelf things --- .../kineticObjects/dressingRoomBricabrac.json | 26 +++++++++---------- .../Home/kineticObjects/stuff_on_shelves.json | 12 ++++----- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json b/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json index fdfb505846..c87fd7bc98 100644 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/dressingRoomBricabrac.json @@ -36,7 +36,7 @@ }, "shapeType": "compound", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "name": "home_model_dressing_room_bricabrac", "collisionsWillMove": 1, @@ -74,7 +74,7 @@ }, "shapeType": "compound", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "name": "home_model_dressing_room_bricabrac", "collisionsWillMove": 1, @@ -112,7 +112,7 @@ }, "shapeType": "compound", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "name": "home_model_dressing_room_bricabrac", "collidesWith": "static,dynamic,kinematic,otherAvatar,", @@ -152,7 +152,7 @@ }, "shapeType": "compound", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "name": "home_model_dressing_room_bricabrac", "collidesWith": "static,dynamic,kinematic,otherAvatar,", @@ -192,7 +192,7 @@ }, "shapeType": "compound", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "name": "home_model_dressing_room_bricabrac", "collisionsWillMove": 1, @@ -231,7 +231,7 @@ }, "shapeType": "compound", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "name": "home_model_dressing_room_bricabrac", "collidesWith": "static,dynamic,kinematic,otherAvatar,", @@ -271,7 +271,7 @@ }, "shapeType": "compound", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "name": "home_model_dressing_room_bricabrac", "collidesWith": "static,dynamic,kinematic,otherAvatar,", @@ -311,7 +311,7 @@ }, "shapeType": "compound", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "name": "home_model_dressing_room_bricabrac", "collidesWith": "static,dynamic,kinematic,otherAvatar,", @@ -351,7 +351,7 @@ }, "shapeType": "compound", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "name": "home_model_dressing_room_bricabrac", "collisionsWillMove": 1, @@ -389,7 +389,7 @@ }, "shapeType": "compound", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "name": "home_model_dressing_room_bricabrac", "collisionsWillMove": 1, @@ -428,7 +428,7 @@ }, "shapeType": "compound", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "name": "home_model_dressing_room_bricabrac", "collidesWith": "static,dynamic,kinematic,otherAvatar,", @@ -468,7 +468,7 @@ }, "shapeType": "compound", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }, { "name": "home_model_dressing_room_bricabrac", "collidesWith": "static,dynamic,kinematic,otherAvatar,", @@ -548,7 +548,7 @@ }, "shapeType": "compound", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" }], "Version": 57 } \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/stuff_on_shelves.json b/unpublishedScripts/DomainContent/Home/kineticObjects/stuff_on_shelves.json index ee5d44d49c..cecd02197a 100644 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/stuff_on_shelves.json +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/stuff_on_shelves.json @@ -35,7 +35,7 @@ }, "shapeType": "box", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { "collisionsWillMove": 1, "created": "2016-03-31T23:06:57Z", @@ -72,7 +72,7 @@ }, "shapeType": "box", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { "collisionsWillMove": 1, "created": "2016-03-31T22:45:06Z", @@ -109,7 +109,7 @@ }, "shapeType": "box", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { "collisionsWillMove": 1, "created": "2016-03-31T23:06:57Z", @@ -146,7 +146,7 @@ }, "shapeType": "box", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { "collisionsWillMove": 1, "created": "2016-03-31T22:47:17Z", @@ -183,7 +183,7 @@ }, "shapeType": "box", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }, { "collisionsWillMove": 1, "created": "2016-03-31T22:49:28Z", @@ -220,7 +220,7 @@ }, "shapeType": "box", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true},\"wearable\":{\"joints\":{\"head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"Head\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"hair\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}],\"neck\":[{\"x\":0,\"y\":0,\"z\":0},{\"w\":0,\"x\":0,\"y\":0,\"z\":0}]}}}" + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" }], "Version": 57 } \ No newline at end of file From 3603c8cf2ec2d0067dc22112203563e88d7ae983 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Mon, 6 Jun 2016 09:12:07 -0700 Subject: [PATCH 54/89] add hover game scripts --- .../DomainContent/Home/hoverGame/hoverBall.js | 60 +++++++++++++++ .../Home/hoverGame/hoverContainer.js | 28 +++++++ .../DomainContent/Home/hoverGame/wrapper.js | 77 +++++++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 unpublishedScripts/DomainContent/Home/hoverGame/hoverBall.js create mode 100644 unpublishedScripts/DomainContent/Home/hoverGame/hoverContainer.js create mode 100644 unpublishedScripts/DomainContent/Home/hoverGame/wrapper.js diff --git a/unpublishedScripts/DomainContent/Home/hoverGame/hoverBall.js b/unpublishedScripts/DomainContent/Home/hoverGame/hoverBall.js new file mode 100644 index 0000000000..b4072d4b69 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/hoverGame/hoverBall.js @@ -0,0 +1,60 @@ +(function() { + var _this; + HoverBall = function() { + _this = this; + } + + var MIN_DISTANCE_THRESHOLD = 0.075; + + var CENTER_POINT_LOCATION = { + x: 0, + y: 0, + z: 0 + }; + + HoverBall.prototype = { + preload: function(entityID) { + this.entityID = entityID; + + }, + unload: function() { + + }, + startDistanceGrab: function() { + + }, + continueDistantGrab: function() { + var position = Entities.getEntityProperties(_this.entityID).position; + var distanceFromCenterPoint = Vec3.distance(position, CENTER_POINT_LOCATION); + if (distanceFromCenterPoint < MIN_DISTANCE_THRESHOLD) { + + _this.turnOnGlow(); + } else { + _this.turnOffGlow(); + } + }, + releaseGrab: function() { + _this.turnOffGlow(); + }, + turnOnGlow: function() { + + }, + turnOffGlow: function() { + + }, + findHoverContainer: function() { + var position = Entities.getEntityProperties(_this.entityID).position; + var results = Entities.findEntities(position, 3); + results.forEach(function(item) { + var props = Entities.getEntityProperties(item); + if (props.name.indexOf('hoverGame_container') > -1) { + return item + } + }) + }, + + } + + return new HoverBall(); + +}) \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/hoverGame/hoverContainer.js b/unpublishedScripts/DomainContent/Home/hoverGame/hoverContainer.js new file mode 100644 index 0000000000..3391879793 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/hoverGame/hoverContainer.js @@ -0,0 +1,28 @@ +(function() { + + HoverContainer = function() { + + } + + HoverContainer.prototype = { + preload: function(entityID) { + this.entityID = entityID; + + var data = { + action: 'add', + id: this.entityID + }; + Messages.sendLocalMessage('Hifi-Hand-RayPick-Blacklist', JSON.stringify(data)) + }, + unload: function() { + var data = { + action: 'remove', + id: this.entityID + }; + Messages.sendLocalMessage('Hifi-Hand-RayPick-Blacklist', JSON.stringify(data)) + } + } + + return new HoverContainer(); + +}) \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/hoverGame/wrapper.js b/unpublishedScripts/DomainContent/Home/hoverGame/wrapper.js new file mode 100644 index 0000000000..d38d4d47c3 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/hoverGame/wrapper.js @@ -0,0 +1,77 @@ +// createPingPongGun.js +// +// Script Type: Entity Spawner +// Created by James B. Pollack on 9/30/2015 +// Copyright 2015 High Fidelity, Inc. +// +// This script creates a gun that shoots ping pong balls when you pull the trigger on a hand controller. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + + +HoverGame = function(spawnPosition, spawnRotation) { + + var scriptURL = "atp:/hoverGame/hoverInner.js"; + + var hoverContainerProps = { + type: 'Model', + modelURL: 'atp:/hoverGame/hover.fbx', + name: 'home_model_hoverGame_container', + dimensions: { + x: 0.2543, + y: 0.3269, + z: 0.4154 + }, + compoundShapeURL: 'atp:/hoverGame/hoverHull.obj', + rotation: spawnRotation, + script: scriptURL, + userData: JSON.stringify({ + "grabbableKey": { + "grabbable":false + }, + 'hifiHomeKey': { + 'reset': true + } + }), + dynamic: true, + position: spawnPosition + }; + + var hoverBall = { + type: 'Sphere', + name: 'home_model_hoverGame_sphere', + dimensions: { + x: 0.25, + y: 0.25, + z: 0.25, + }, + compoundShapeURL: 'atp:/hoverGame/hoverHull.obj', + rotation: spawnRotation, + script: scriptURL, + userData: JSON.stringify({ + 'hifiHomeKey': { + 'reset': true + } + }), + dynamic: true, + gravity:{ + x:0, + y:-9.8, + z:0 + }, + position: spawnPosition + }; + + var hoverContainer = Entities.addEntity(hoverContainerProps); + + function cleanup() { + print('HOVER GAME CLEANUP!') + Entities.deleteEntity(hoverInner); + } + + this.cleanup = cleanup; + + print('HOME CREATED HOVER GAME') + +} \ No newline at end of file From f51cb7ce0c8b847e27e7d017fb1dd5e392fe5abf Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Mon, 6 Jun 2016 10:34:32 -0700 Subject: [PATCH 55/89] trying to add duration support for vive --- plugins/oculus/src/OculusControllerManager.h | 2 - plugins/openvr/src/ViveControllerManager.cpp | 46 +++++++++++++++++--- plugins/openvr/src/ViveControllerManager.h | 17 +++++++- 3 files changed, 56 insertions(+), 9 deletions(-) diff --git a/plugins/oculus/src/OculusControllerManager.h b/plugins/oculus/src/OculusControllerManager.h index 20e5726dff..e62c5f45ea 100644 --- a/plugins/oculus/src/OculusControllerManager.h +++ b/plugins/oculus/src/OculusControllerManager.h @@ -72,8 +72,6 @@ private: private: void stopHapticPulse(bool leftHand); - - private: void handlePose(float deltaTime, const controller::InputCalibrationData& inputCalibrationData, ovrHandType hand, const ovrPoseStatef& handPose); int _trackedControllers { 0 }; friend class OculusControllerManager; diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index 6b19646512..7d66429ed6 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -126,6 +126,11 @@ bool ViveControllerManager::activate() { userInputMapper->registerDevice(_inputDevice); _registeredWithInputMapper = true; + _leftHapticTimer.setSingleShot(true); + _rightHapticTimer.setSingleShot(true); + connect(&_leftHapticTimer, SIGNAL(timeout()), this, SLOT(hapticPulseHelper(true))); + connect(&_rightHapticTimer, SIGNAL(timeout()), this, SLOT(hapticPulseHelper(false))); + return true; } @@ -442,7 +447,20 @@ void ViveControllerManager::InputDevice::handlePoseEvent(float deltaTime, const _poseStateMap[isLeftHand ? controller::LEFT_HAND : controller::RIGHT_HAND] = avatarPose.transform(controllerToAvatar); } -// Vive Controllers do not support duration +void ViveControllerManager::hapticPulseHelper(bool leftHand) { + if (_inputDevice) { + _inputDevice->hapticPulseHelper(leftHand); + } +} + +void ViveControllerManager::InputDevice::hapticPulseHelper(bool leftHand) { + if (leftHand) { + triggerHapticPulse(prevLeftHapticStrength, prevLeftHapticDuration, leftHand); + } else { + triggerHapticPulse(prevRightHapticStrength, prevRightHapticDuration, leftHand); + } +} + bool ViveControllerManager::InputDevice::triggerHapticPulse(float strength, float duration, bool leftHand) { auto handRole = leftHand ? vr::TrackedControllerRole_LeftHand : vr::TrackedControllerRole_RightHand; auto deviceIndex = _system->GetTrackedDeviceIndexForControllerRole(handRole); @@ -450,11 +468,29 @@ bool ViveControllerManager::InputDevice::triggerHapticPulse(float strength, floa if (_system->IsTrackedDeviceConnected(deviceIndex) && _system->GetTrackedDeviceClass(deviceIndex) == vr::TrackedDeviceClass_Controller && _trackedDevicePose[deviceIndex].bPoseIsValid) { - // the documentation says the third argument to TriggerHapticPulse is duration - // but it seems to instead be strength, and is between 0 and 3999 + // Vive Controllers only support duration up to 4 ms, which is short enough that any variation feels more like strength + const float MAX_HAPTIC_TIME = 3999.0f; // in microseconds + float hapticTime = strength*MAX_HAPTIC_TIME; + if (hapticTime < duration*1000.0f) { + _system->TriggerHapticPulse(deviceIndex, 0, hapticTime); + } + + // Must wait 5 ms before triggering another pulse on this controller // https://github.com/ValveSoftware/openvr/wiki/IVRSystem::TriggerHapticPulse - const float MAX_HAPTIC_STRENGTH = 3999.0f; - _system->TriggerHapticPulse(deviceIndex, 0, strength*MAX_HAPTIC_STRENGTH); + const float HAPTIC_RESET_TIME = 5.0f; + float remainingHapticTime = duration - (hapticTime / 1000.0f + HAPTIC_RESET_TIME); // in milliseconds + if (remainingHapticTime > 0.0f) { + if (leftHand) { + prevLeftHapticStrength = strength; + prevLeftHapticDuration = remainingHapticTime; + _parent._leftHapticTimer.start(remainingHapticTime); + } + else { + prevRightHapticStrength = strength; + prevRightHapticDuration = remainingHapticTime; + _parent._rightHapticTimer.start(remainingHapticTime); + } + } return true; } return false; diff --git a/plugins/openvr/src/ViveControllerManager.h b/plugins/openvr/src/ViveControllerManager.h index c108d3087f..67fe43c15a 100644 --- a/plugins/openvr/src/ViveControllerManager.h +++ b/plugins/openvr/src/ViveControllerManager.h @@ -13,6 +13,7 @@ #define hifi__ViveControllerManager #include +#include #include #include @@ -45,10 +46,13 @@ public: void setRenderControllers(bool renderControllers) { _renderControllers = renderControllers; } +private slots: + void hapticPulseHelper(bool leftHand); + private: class InputDevice : public controller::InputDevice { public: - InputDevice(vr::IVRSystem*& system) : controller::InputDevice("Vive"), _system(system) {} + InputDevice(ViveControllerManager& parent, vr::IVRSystem*& system) : controller::InputDevice("Vive"), _parent(parent), _system(system) {} private: // Device functions controller::Input::NamedVector getAvailableInputs() const override; @@ -56,6 +60,7 @@ private: void update(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) override; void focusOutEvent() override; + void hapticPulseHelper(bool leftHand); bool triggerHapticPulse(float strength, float duration, bool leftHand) override; void handleHandController(float deltaTime, uint32_t deviceIndex, const controller::InputCalibrationData& inputCalibrationData, bool isLeftHand); @@ -94,6 +99,11 @@ private: int _trackedControllers { 0 }; vr::IVRSystem*& _system; + ViveControllerManager& _parent; + float prevLeftHapticStrength; + float prevLeftHapticDuration; + float prevRightHapticStrength; + float prevRightHapticDuration; friend class ViveControllerManager; }; @@ -109,7 +119,10 @@ private: bool _renderControllers { false }; vr::IVRSystem* _system { nullptr }; - std::shared_ptr _inputDevice { std::make_shared(_system) }; + std::shared_ptr _inputDevice { std::make_shared(*this, _system) }; + + QTimer _leftHapticTimer; + QTimer _rightHapticTimer; static const QString NAME; }; From 34f46b860b26ee9c284647a188d48e0b721c4afc Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Mon, 6 Jun 2016 11:54:18 -0700 Subject: [PATCH 56/89] AVX2 optimized audio resampler --- libraries/audio/src/AudioSRC.cpp | 195 ++++++++++++++++++++++--------- libraries/audio/src/AudioSRC.h | 28 ++++- 2 files changed, 163 insertions(+), 60 deletions(-) diff --git a/libraries/audio/src/AudioSRC.cpp b/libraries/audio/src/AudioSRC.cpp index c187d381a4..6c594db234 100644 --- a/libraries/audio/src/AudioSRC.cpp +++ b/libraries/audio/src/AudioSRC.cpp @@ -544,22 +544,9 @@ static const float prototypeFilter[PROTOTYPE_TAPS * PROTOTYPE_PHASES] = { 8.99882100e-06f, 7.61267073e-06f, 6.57702907e-06f, 5.59829210e-06f, 4.27698546e-06f, 1.03248674e-05f, }; -// -// polyphase filter -// -static const int SRC_PHASEBITS = 8; -static const int SRC_PHASES = (1 << SRC_PHASEBITS); -static const int SRC_FRACBITS = 32 - SRC_PHASEBITS; -static const uint32_t SRC_FRACMASK = (1 << SRC_FRACBITS) - 1; - -static const float QFRAC_TO_FLOAT = 1.0f / (1 << SRC_FRACBITS); -static const float Q32_TO_FLOAT = 1.0f / (1ULL << 32); - -// blocking size in frames, chosen so block processing fits in L1 cache -static const int SRC_BLOCK = 1024; - -#define lo32(a) ((uint32_t)(a)) -#define hi32(a) ((int32_t)((a) >> 32)) +// high/low part of int64_t +#define LO32(a) ((uint32_t)(a)) +#define HI32(a) ((int32_t)((a) >> 32)) // // Portable aligned malloc/free @@ -610,8 +597,8 @@ static void cubicInterpolation(const float* input, float* output, int inputSize, // Lagrange interpolation using Farrow structure for (int j = 0; j < outputSize; j++) { - int32_t i = hi32(offset); - uint32_t f = lo32(offset); + int32_t i = HI32(offset); + uint32_t f = LO32(offset); // values outside the window are zero float x0 = (i - 1 < 0) ? 0.0f : input[i - 1]; @@ -649,7 +636,7 @@ int AudioSRC::createRationalFilter(int upFactor, int downFactor, float gain) { numTaps = (numCoefs + upFactor - 1) / upFactor; gain *= (float)oldCoefs / numCoefs; } - numTaps = (numTaps + 3) & ~3; // SIMD4 + numTaps = (numTaps + 7) & ~7; // SIMD8 // interpolate the coefficients of the prototype filter float* tempFilter = new float[numTaps * numPhases]; @@ -658,7 +645,7 @@ int AudioSRC::createRationalFilter(int upFactor, int downFactor, float gain) { cubicInterpolation(prototypeFilter, tempFilter, prototypeCoefs, numCoefs, gain); // create the polyphase filter - _polyphaseFilter = (float*)aligned_malloc(numTaps * numPhases * sizeof(float), 16); // SIMD4 + _polyphaseFilter = (float*)aligned_malloc(numTaps * numPhases * sizeof(float), 32); // SIMD8 // rearrange into polyphase form, ordered by use for (int i = 0; i < numPhases; i++) { @@ -699,7 +686,7 @@ int AudioSRC::createIrrationalFilter(int upFactor, int downFactor, float gain) { numTaps = (numCoefs + upFactor - 1) / upFactor; gain *= (float)oldCoefs / numCoefs; } - numTaps = (numTaps + 3) & ~3; // SIMD4 + numTaps = (numTaps + 7) & ~7; // SIMD8 // interpolate the coefficients of the prototype filter float* tempFilter = new float[numTaps * numPhases]; @@ -708,7 +695,7 @@ int AudioSRC::createIrrationalFilter(int upFactor, int downFactor, float gain) { cubicInterpolation(prototypeFilter, tempFilter, prototypeCoefs, numCoefs, gain); // create the polyphase filter, with extra phase at the end to simplify coef interpolation - _polyphaseFilter = (float*)aligned_malloc(numTaps * (numPhases + 1) * sizeof(float), 16); // SIMD4 + _polyphaseFilter = (float*)aligned_malloc(numTaps * (numPhases + 1) * sizeof(float), 32); // SIMD8 // rearrange into polyphase form, ordered by fractional delay for (int phase = 0; phase < numPhases; phase++) { @@ -741,14 +728,14 @@ int AudioSRC::createIrrationalFilter(int upFactor, int downFactor, float gain) { #include -int AudioSRC::multirateFilter1(const float* input0, float* output0, int inputFrames) { +int AudioSRC::multirateFilter1_SSE(const float* input0, float* output0, int inputFrames) { int outputFrames = 0; - assert((_numTaps & 0x3) == 0); // SIMD4 + assert(_numTaps % 4 == 0); // SIMD4 if (_step == 0) { // rational - int32_t i = hi32(_offset); + int32_t i = HI32(_offset); while (i < inputFrames) { @@ -761,7 +748,7 @@ int AudioSRC::multirateFilter1(const float* input0, float* output0, int inputFra //float coef = c0[j]; __m128 coef0 = _mm_loadu_ps(&c0[j]); - //acc0 += input0[i + j] * coef; + //acc += input[i + j] * coef; acc0 = _mm_add_ps(_mm_mul_ps(_mm_loadu_ps(&input0[i + j]), coef0), acc0); } @@ -781,10 +768,10 @@ int AudioSRC::multirateFilter1(const float* input0, float* output0, int inputFra } else { // irrational - while (hi32(_offset) < inputFrames) { + while (HI32(_offset) < inputFrames) { - int32_t i = hi32(_offset); - uint32_t f = lo32(_offset); + int32_t i = HI32(_offset); + uint32_t f = LO32(_offset); uint32_t phase = f >> SRC_FRACBITS; __m128 frac = _mm_set1_ps((f & SRC_FRACMASK) * QFRAC_TO_FLOAT); @@ -802,7 +789,7 @@ int AudioSRC::multirateFilter1(const float* input0, float* output0, int inputFra coef1 = _mm_sub_ps(coef1, coef0); coef0 = _mm_add_ps(_mm_mul_ps(coef1, frac), coef0); - //acc0 += input0[i + j] * coef; + //acc += input[i + j] * coef; acc0 = _mm_add_ps(_mm_mul_ps(_mm_loadu_ps(&input0[i + j]), coef0), acc0); } @@ -821,14 +808,14 @@ int AudioSRC::multirateFilter1(const float* input0, float* output0, int inputFra return outputFrames; } -int AudioSRC::multirateFilter2(const float* input0, const float* input1, float* output0, float* output1, int inputFrames) { +int AudioSRC::multirateFilter2_SSE(const float* input0, const float* input1, float* output0, float* output1, int inputFrames) { int outputFrames = 0; - assert((_numTaps & 0x3) == 0); // SIMD4 + assert(_numTaps % 4 == 0); // SIMD4 if (_step == 0) { // rational - int32_t i = hi32(_offset); + int32_t i = HI32(_offset); while (i < inputFrames) { @@ -842,7 +829,7 @@ int AudioSRC::multirateFilter2(const float* input0, const float* input1, float* //float coef = c0[j]; __m128 coef0 = _mm_loadu_ps(&c0[j]); - //acc0 += input0[i + j] * coef; + //acc += input[i + j] * coef; acc0 = _mm_add_ps(_mm_mul_ps(_mm_loadu_ps(&input0[i + j]), coef0), acc0); acc1 = _mm_add_ps(_mm_mul_ps(_mm_loadu_ps(&input1[i + j]), coef0), acc1); } @@ -866,10 +853,10 @@ int AudioSRC::multirateFilter2(const float* input0, const float* input1, float* } else { // irrational - while (hi32(_offset) < inputFrames) { + while (HI32(_offset) < inputFrames) { - int32_t i = hi32(_offset); - uint32_t f = lo32(_offset); + int32_t i = HI32(_offset); + uint32_t f = LO32(_offset); uint32_t phase = f >> SRC_FRACBITS; __m128 frac = _mm_set1_ps((f & SRC_FRACMASK) * QFRAC_TO_FLOAT); @@ -888,7 +875,7 @@ int AudioSRC::multirateFilter2(const float* input0, const float* input1, float* coef1 = _mm_sub_ps(coef1, coef0); coef0 = _mm_add_ps(_mm_mul_ps(coef1, frac), coef0); - //acc0 += input0[i + j] * coef; + //acc += input[i + j] * coef; acc0 = _mm_add_ps(_mm_mul_ps(_mm_loadu_ps(&input0[i + j]), coef0), acc0); acc1 = _mm_add_ps(_mm_mul_ps(_mm_loadu_ps(&input1[i + j]), coef0), acc1); } @@ -911,6 +898,107 @@ int AudioSRC::multirateFilter2(const float* input0, const float* input1, float* return outputFrames; } +// +// Detect AVX/AVX2 support +// + +#if defined(_MSC_VER) + +#include + +static bool cpuSupportsAVX() { + int info[4]; + int mask = (1 << 27) | (1 << 28); // OSXSAVE and AVX + + __cpuidex(info, 0x1, 0); + + bool result = false; + if ((info[2] & mask) == mask) { + + if ((_xgetbv(_XCR_XFEATURE_ENABLED_MASK) & 0x6) == 0x6) { + result = true; + } + } + return result; +} + +static bool cpuSupportsAVX2() { + int info[4]; + int mask = (1 << 5); // AVX2 + + bool result = false; + if (cpuSupportsAVX()) { + + __cpuidex(info, 0x7, 0); + + if ((info[1] & mask) == mask) { + result = true; + } + } + return result; +} + +#elif defined(__GNUC__) + +#include + +static bool cpuSupportsAVX() { + unsigned int eax, ebx, ecx, edx; + unsigned int mask = (1 << 27) | (1 << 28); // OSXSAVE and AVX + + bool result = false; + if (__get_cpuid(0x1, &eax, &ebx, &ecx, &edx) && ((ecx & mask) == mask)) { + + __asm__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(0)); + if ((eax & 0x6) == 0x6) { + result = true; + } + } + return result; +} + +static bool cpuSupportsAVX2() { + unsigned int eax, ebx, ecx, edx; + unsigned mask = (1 << 5); // AVX2 + + bool result = false; + if (cpuSupportsAVX()) { + + if (__get_cpuid(0x7, &eax, &ebx, &ecx, &edx) && ((ebx & mask) == mask)) { + result = true; + } + } + return result; +} + +#else + +static bool cpuSupportsAVX() { + return false; +} + +static bool cpuSupportsAVX2() { + return false; +} + +#endif + +// +// Runtime CPU dispatch +// + +int AudioSRC::multirateFilter1(const float* input0, float* output0, int inputFrames) { + + static auto f = cpuSupportsAVX2() ? &AudioSRC::multirateFilter1_AVX2 : &AudioSRC::multirateFilter1_SSE; + return (this->*f)(input0, output0, inputFrames); // dispatch +} + +int AudioSRC::multirateFilter2(const float* input0, const float* input1, float* output0, float* output1, int inputFrames) { + + static auto f = cpuSupportsAVX2() ? &AudioSRC::multirateFilter2_AVX2 : &AudioSRC::multirateFilter2_SSE; + return (this->*f)(input0, input1, output0, output1, inputFrames); // dispatch +} + // convert int16_t to float, deinterleave stereo void AudioSRC::convertInputFromInt16(const int16_t* input, float** outputs, int numFrames) { __m128 scale = _mm_set1_ps(1/32768.0f); @@ -1069,7 +1157,7 @@ int AudioSRC::multirateFilter1(const float* input0, float* output0, int inputFra if (_step == 0) { // rational - int32_t i = hi32(_offset); + int32_t i = HI32(_offset); while (i < inputFrames) { @@ -1096,10 +1184,10 @@ int AudioSRC::multirateFilter1(const float* input0, float* output0, int inputFra } else { // irrational - while (hi32(_offset) < inputFrames) { + while (HI32(_offset) < inputFrames) { - int32_t i = hi32(_offset); - uint32_t f = lo32(_offset); + int32_t i = HI32(_offset); + uint32_t f = LO32(_offset); uint32_t phase = f >> SRC_FRACBITS; float frac = (f & SRC_FRACMASK) * QFRAC_TO_FLOAT; @@ -1132,7 +1220,7 @@ int AudioSRC::multirateFilter2(const float* input0, const float* input1, float* if (_step == 0) { // rational - int32_t i = hi32(_offset); + int32_t i = HI32(_offset); while (i < inputFrames) { @@ -1162,10 +1250,10 @@ int AudioSRC::multirateFilter2(const float* input0, const float* input1, float* } else { // irrational - while (hi32(_offset) < inputFrames) { + while (HI32(_offset) < inputFrames) { - int32_t i = hi32(_offset); - uint32_t f = lo32(_offset); + int32_t i = HI32(_offset); + uint32_t f = LO32(_offset); uint32_t phase = f >> SRC_FRACBITS; float frac = (f & SRC_FRACMASK) * QFRAC_TO_FLOAT; @@ -1320,7 +1408,7 @@ AudioSRC::AudioSRC(int inputSampleRate, int outputSampleRate, int numChannels) { assert(inputSampleRate > 0); assert(outputSampleRate > 0); assert(numChannels > 0); - assert(numChannels <= MAX_CHANNELS); + assert(numChannels <= SRC_MAX_CHANNELS); _inputSampleRate = inputSampleRate; _outputSampleRate = outputSampleRate; @@ -1349,7 +1437,7 @@ AudioSRC::AudioSRC(int inputSampleRate, int outputSampleRate, int numChannels) { _numTaps = createIrrationalFilter(_upFactor, _downFactor, 1.0f); } - //printf("up=%d down=%.3f taps=%d\n", _upFactor, _downFactor + (lo32(_step)< +static const int SRC_MAX_CHANNELS = 2; + +// polyphase filter +static const int SRC_PHASEBITS = 8; +static const int SRC_PHASES = (1 << SRC_PHASEBITS); +static const int SRC_FRACBITS = 32 - SRC_PHASEBITS; +static const uint32_t SRC_FRACMASK = (1 << SRC_FRACBITS) - 1; + +static const float QFRAC_TO_FLOAT = 1.0f / (1 << SRC_FRACBITS); +static const float Q32_TO_FLOAT = 1.0f / (1ULL << 32); + +// blocking size in frames, chosen so block processing fits in L1 cache +static const int SRC_BLOCK = 256; + class AudioSRC { public: - static const int MAX_CHANNELS = 2; - AudioSRC(int inputSampleRate, int outputSampleRate, int numChannels); ~AudioSRC(); @@ -33,9 +45,9 @@ private: float* _polyphaseFilter; int* _stepTable; - float* _history[MAX_CHANNELS]; - float* _inputs[MAX_CHANNELS]; - float* _outputs[MAX_CHANNELS]; + float* _history[SRC_MAX_CHANNELS]; + float* _inputs[SRC_MAX_CHANNELS]; + float* _outputs[SRC_MAX_CHANNELS]; int _inputSampleRate; int _outputSampleRate; @@ -57,6 +69,12 @@ private: int multirateFilter1(const float* input0, float* output0, int inputFrames); int multirateFilter2(const float* input0, const float* input1, float* output0, float* output1, int inputFrames); + int multirateFilter1_SSE(const float* input0, float* output0, int inputFrames); + int multirateFilter2_SSE(const float* input0, const float* input1, float* output0, float* output1, int inputFrames); + + int multirateFilter1_AVX2(const float* input0, float* output0, int inputFrames); + int multirateFilter2_AVX2(const float* input0, const float* input1, float* output0, float* output1, int inputFrames); + void convertInputFromInt16(const int16_t* input, float** outputs, int numFrames); void convertOutputToInt16(float** inputs, int16_t* output, int numFrames); From 4f35d3df02745fae23da01527aa19faea02f0cbc Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Mon, 6 Jun 2016 11:57:17 -0700 Subject: [PATCH 57/89] AVX2 code must be in /avx for CMAKE to compile it properly --- libraries/audio/src/avx/AudioSRC_avx.cpp | 201 +++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 libraries/audio/src/avx/AudioSRC_avx.cpp diff --git a/libraries/audio/src/avx/AudioSRC_avx.cpp b/libraries/audio/src/avx/AudioSRC_avx.cpp new file mode 100644 index 0000000000..dcc56b94ad --- /dev/null +++ b/libraries/audio/src/avx/AudioSRC_avx.cpp @@ -0,0 +1,201 @@ +// +// AudioSRC_avx.cpp +// libraries/audio/src +// +// Created by Ken Cooke on 6/5/16. +// Copyright 2016 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 +// + +#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__x86_64__) + +#include +#include + +#include "../AudioSRC.h" + +#ifndef __AVX__ +#error Must be compiled with /arch:AVX or -mavx. +#endif + +// high/low part of int64_t +#define LO32(a) ((uint32_t)(a)) +#define HI32(a) ((int32_t)((a) >> 32)) + +int AudioSRC::multirateFilter1_AVX2(const float* input0, float* output0, int inputFrames) { + int outputFrames = 0; + + assert(_numTaps % 8 == 0); // SIMD8 + + if (_step == 0) { // rational + + int32_t i = HI32(_offset); + + while (i < inputFrames) { + + const float* c0 = &_polyphaseFilter[_numTaps * _phase]; + + __m256 acc0 = _mm256_setzero_ps(); + + for (int j = 0; j < _numTaps; j += 8) { + + //float coef = c0[j]; + __m256 coef0 = _mm256_loadu_ps(&c0[j]); + + //acc += input[i + j] * coef; + acc0 = _mm256_fmadd_ps(_mm256_loadu_ps(&input0[i + j]), coef0, acc0); + } + + // horizontal sum + acc0 = _mm256_hadd_ps(acc0, acc0); + __m128 t0 = _mm_add_ps(_mm256_castps256_ps128(acc0), _mm256_extractf128_ps(acc0, 1)); + t0 = _mm_add_ps(t0, _mm_movehdup_ps(t0)); + + _mm_store_ss(&output0[outputFrames], t0); + outputFrames += 1; + + i += _stepTable[_phase]; + if (++_phase == _upFactor) { + _phase = 0; + } + } + _offset = (int64_t)(i - inputFrames) << 32; + + } else { // irrational + + while (HI32(_offset) < inputFrames) { + + int32_t i = HI32(_offset); + uint32_t f = LO32(_offset); + + uint32_t phase = f >> SRC_FRACBITS; + float ftmp = (f & SRC_FRACMASK) * QFRAC_TO_FLOAT; + + const float* c0 = &_polyphaseFilter[_numTaps * (phase + 0)]; + const float* c1 = &_polyphaseFilter[_numTaps * (phase + 1)]; + + __m256 acc0 = _mm256_setzero_ps(); + __m256 frac = _mm256_broadcast_ss(&ftmp); + + for (int j = 0; j < _numTaps; j += 8) { + + //float coef = c0[j] + frac * (c1[j] - c0[j]); + __m256 coef0 = _mm256_loadu_ps(&c0[j]); + __m256 coef1 = _mm256_loadu_ps(&c1[j]); + coef1 = _mm256_sub_ps(coef1, coef0); + coef0 = _mm256_fmadd_ps(coef1, frac, coef0); + + //acc += input[i + j] * coef; + acc0 = _mm256_fmadd_ps(_mm256_loadu_ps(&input0[i + j]), coef0, acc0); + } + + // horizontal sum + acc0 = _mm256_hadd_ps(acc0, acc0); + __m128 t0 = _mm_add_ps(_mm256_castps256_ps128(acc0), _mm256_extractf128_ps(acc0, 1)); + t0 = _mm_add_ps(t0, _mm_movehdup_ps(t0)); + + _mm_store_ss(&output0[outputFrames], t0); + outputFrames += 1; + + _offset += _step; + } + _offset -= (int64_t)inputFrames << 32; + } + _mm256_zeroupper(); + + return outputFrames; +} + +int AudioSRC::multirateFilter2_AVX2(const float* input0, const float* input1, float* output0, float* output1, int inputFrames) { + int outputFrames = 0; + + assert(_numTaps % 8 == 0); // SIMD8 + + if (_step == 0) { // rational + + int32_t i = HI32(_offset); + + while (i < inputFrames) { + + const float* c0 = &_polyphaseFilter[_numTaps * _phase]; + + __m256 acc0 = _mm256_setzero_ps(); + __m256 acc1 = _mm256_setzero_ps(); + + for (int j = 0; j < _numTaps; j += 8) { + + //float coef = c0[j]; + __m256 coef0 = _mm256_loadu_ps(&c0[j]); + + //acc += input[i + j] * coef; + acc0 = _mm256_fmadd_ps(_mm256_loadu_ps(&input0[i + j]), coef0, acc0); + acc1 = _mm256_fmadd_ps(_mm256_loadu_ps(&input1[i + j]), coef0, acc1); + } + + // horizontal sum + acc0 = _mm256_hadd_ps(acc0, acc1); + __m128 t0 = _mm_add_ps(_mm256_castps256_ps128(acc0), _mm256_extractf128_ps(acc0, 1)); + t0 = _mm_add_ps(t0, _mm_movehdup_ps(t0)); + + _mm_store_ss(&output0[outputFrames], t0); + _mm_store_ss(&output1[outputFrames], _mm_shuffle_ps(t0, t0, _MM_SHUFFLE(0,0,0,2))); + outputFrames += 1; + + i += _stepTable[_phase]; + if (++_phase == _upFactor) { + _phase = 0; + } + } + _offset = (int64_t)(i - inputFrames) << 32; + + } else { // irrational + + while (HI32(_offset) < inputFrames) { + + int32_t i = HI32(_offset); + uint32_t f = LO32(_offset); + + uint32_t phase = f >> SRC_FRACBITS; + float ftmp = (f & SRC_FRACMASK) * QFRAC_TO_FLOAT; + + const float* c0 = &_polyphaseFilter[_numTaps * (phase + 0)]; + const float* c1 = &_polyphaseFilter[_numTaps * (phase + 1)]; + + __m256 acc0 = _mm256_setzero_ps(); + __m256 acc1 = _mm256_setzero_ps(); + __m256 frac = _mm256_broadcast_ss(&ftmp); + + for (int j = 0; j < _numTaps; j += 8) { + + //float coef = c0[j] + frac * (c1[j] - c0[j]); + __m256 coef0 = _mm256_loadu_ps(&c0[j]); + __m256 coef1 = _mm256_loadu_ps(&c1[j]); + coef1 = _mm256_sub_ps(coef1, coef0); + coef0 = _mm256_fmadd_ps(coef1, frac, coef0); + + //acc += input[i + j] * coef; + acc0 = _mm256_fmadd_ps(_mm256_loadu_ps(&input0[i + j]), coef0, acc0); + acc1 = _mm256_fmadd_ps(_mm256_loadu_ps(&input1[i + j]), coef0, acc1); + } + + // horizontal sum + acc0 = _mm256_hadd_ps(acc0, acc1); + __m128 t0 = _mm_add_ps(_mm256_castps256_ps128(acc0), _mm256_extractf128_ps(acc0, 1)); + t0 = _mm_add_ps(t0, _mm_movehdup_ps(t0)); + + _mm_store_ss(&output0[outputFrames], t0); + _mm_store_ss(&output1[outputFrames], _mm_shuffle_ps(t0, t0, _MM_SHUFFLE(0,0,0,2))); + outputFrames += 1; + + _offset += _step; + } + _offset -= (int64_t)inputFrames << 32; + } + _mm256_zeroupper(); + + return outputFrames; +} + +#endif From 8faaa36913b219e9e235135a9d456ba9e3d592ab Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Mon, 6 Jun 2016 12:05:48 -0700 Subject: [PATCH 58/89] moved table of precomputed data into AudioSRCData.h --- libraries/audio/src/AudioSRC.cpp | 530 +--------------------------- libraries/audio/src/AudioSRCData.h | 548 +++++++++++++++++++++++++++++ 2 files changed, 549 insertions(+), 529 deletions(-) create mode 100644 libraries/audio/src/AudioSRCData.h diff --git a/libraries/audio/src/AudioSRC.cpp b/libraries/audio/src/AudioSRC.cpp index 6c594db234..fbe109803e 100644 --- a/libraries/audio/src/AudioSRC.cpp +++ b/libraries/audio/src/AudioSRC.cpp @@ -14,535 +14,7 @@ #include #include "AudioSRC.h" - -// -// prototype lowpass filter -// -// Minimum-phase equiripple FIR -// taps = 96, oversampling = 32 -// -// passband = 0.918 -// stopband = 1.010 -// passband ripple = +-0.01dB -// stopband attn = -125dB (-70dB at 1.000) -// -static const int PROTOTYPE_TAPS = 96; // filter taps per phase -static const int PROTOTYPE_PHASES = 32; // oversampling factor - -static const float prototypeFilter[PROTOTYPE_TAPS * PROTOTYPE_PHASES] = { - 0.00000000e+00f, 1.55021703e-05f, 1.46054865e-05f, 2.07057160e-05f, 2.91335519e-05f, 4.00091078e-05f, - 5.33544450e-05f, 7.03618468e-05f, 9.10821639e-05f, 1.16484613e-04f, 1.47165999e-04f, 1.84168304e-04f, - 2.28429617e-04f, 2.80913884e-04f, 3.42940399e-04f, 4.15773039e-04f, 5.01023255e-04f, 6.00234953e-04f, - 7.15133271e-04f, 8.47838855e-04f, 1.00032516e-03f, 1.17508881e-03f, 1.37452550e-03f, 1.60147614e-03f, - 1.85886458e-03f, 2.14985024e-03f, 2.47783071e-03f, 2.84666764e-03f, 3.26016878e-03f, 3.72252797e-03f, - 4.23825900e-03f, 4.81207874e-03f, 5.44904143e-03f, 6.15447208e-03f, 6.93399929e-03f, 7.79337059e-03f, - 8.73903392e-03f, 9.77729117e-03f, 1.09149561e-02f, 1.21591316e-02f, 1.35171164e-02f, 1.49965439e-02f, - 1.66053136e-02f, 1.83515384e-02f, 2.02435362e-02f, 2.22899141e-02f, 2.44995340e-02f, 2.68813362e-02f, - 2.94443254e-02f, 3.21979928e-02f, 3.51514690e-02f, 3.83143719e-02f, 4.16960560e-02f, 4.53060504e-02f, - 4.91538115e-02f, 5.32486197e-02f, 5.75998650e-02f, 6.22164253e-02f, 6.71072811e-02f, 7.22809789e-02f, - 7.77457552e-02f, 8.35095233e-02f, 8.95796944e-02f, 9.59631768e-02f, 1.02666457e-01f, 1.09695215e-01f, - 1.17054591e-01f, 1.24748885e-01f, 1.32781656e-01f, 1.41155521e-01f, 1.49872243e-01f, 1.58932534e-01f, - 1.68335961e-01f, 1.78081143e-01f, 1.88165339e-01f, 1.98584621e-01f, 2.09333789e-01f, 2.20406193e-01f, - 2.31793899e-01f, 2.43487398e-01f, 2.55475740e-01f, 2.67746404e-01f, 2.80285305e-01f, 2.93076743e-01f, - 3.06103423e-01f, 3.19346351e-01f, 3.32784916e-01f, 3.46396772e-01f, 3.60158039e-01f, 3.74043042e-01f, - 3.88024564e-01f, 4.02073759e-01f, 4.16160177e-01f, 4.30251886e-01f, 4.44315429e-01f, 4.58315954e-01f, - 4.72217175e-01f, 4.85981675e-01f, 4.99570709e-01f, 5.12944586e-01f, 5.26062401e-01f, 5.38882630e-01f, - 5.51362766e-01f, 5.63459860e-01f, 5.75130384e-01f, 5.86330458e-01f, 5.97016050e-01f, 6.07143161e-01f, - 6.16667840e-01f, 6.25546499e-01f, 6.33735979e-01f, 6.41193959e-01f, 6.47878856e-01f, 6.53750084e-01f, - 6.58768549e-01f, 6.62896349e-01f, 6.66097381e-01f, 6.68337353e-01f, 6.69583869e-01f, 6.69807061e-01f, - 6.68979117e-01f, 6.67075139e-01f, 6.64072812e-01f, 6.59952827e-01f, 6.54699116e-01f, 6.48298688e-01f, - 6.40742160e-01f, 6.32023668e-01f, 6.22141039e-01f, 6.11095903e-01f, 5.98893921e-01f, 5.85544600e-01f, - 5.71061707e-01f, 5.55463040e-01f, 5.38770639e-01f, 5.21010762e-01f, 5.02213839e-01f, 4.82414572e-01f, - 4.61651859e-01f, 4.39968628e-01f, 4.17412000e-01f, 3.94032951e-01f, 3.69886464e-01f, 3.45031084e-01f, - 3.19529091e-01f, 2.93446187e-01f, 2.66851164e-01f, 2.39815999e-01f, 2.12415399e-01f, 1.84726660e-01f, - 1.56829293e-01f, 1.28804933e-01f, 1.00736965e-01f, 7.27100355e-02f, 4.48100810e-02f, 1.71237415e-02f, - -1.02620228e-02f, -3.72599591e-02f, -6.37832871e-02f, -8.97457733e-02f, -1.15062201e-01f, -1.39648782e-01f, - -1.63423488e-01f, -1.86306368e-01f, -2.08220103e-01f, -2.29090072e-01f, -2.48845046e-01f, -2.67417270e-01f, - -2.84742946e-01f, -3.00762597e-01f, -3.15421127e-01f, -3.28668542e-01f, -3.40459849e-01f, -3.50755400e-01f, - -3.59521402e-01f, -3.66729768e-01f, -3.72358475e-01f, -3.76391839e-01f, -3.78820421e-01f, -3.79641287e-01f, - -3.78858203e-01f, -3.76481336e-01f, -3.72527677e-01f, -3.67020780e-01f, -3.59990760e-01f, -3.51474372e-01f, - -3.41514630e-01f, -3.30160971e-01f, -3.17468898e-01f, -3.03499788e-01f, -2.88320749e-01f, -2.72004315e-01f, - -2.54628056e-01f, -2.36274454e-01f, -2.17030464e-01f, -1.96986952e-01f, -1.76238733e-01f, -1.54883647e-01f, - -1.33022496e-01f, -1.10758449e-01f, -8.81964466e-02f, -6.54430504e-02f, -4.26055475e-02f, -1.97916415e-02f, - 2.89108184e-03f, 2.53355868e-02f, 4.74362201e-02f, 6.90887518e-02f, 9.01914308e-02f, 1.10644978e-01f, - 1.30353494e-01f, 1.49224772e-01f, 1.67170735e-01f, 1.84107975e-01f, 1.99958067e-01f, 2.14648181e-01f, - 2.28111323e-01f, 2.40286622e-01f, 2.51119890e-01f, 2.60563701e-01f, 2.68577740e-01f, 2.75129027e-01f, - 2.80192144e-01f, 2.83749177e-01f, 2.85790223e-01f, 2.86312986e-01f, 2.85323221e-01f, 2.82834421e-01f, - 2.78867915e-01f, 2.73452721e-01f, 2.66625431e-01f, 2.58429983e-01f, 2.48917457e-01f, 2.38145826e-01f, - 2.26179680e-01f, 2.13089734e-01f, 1.98952740e-01f, 1.83850758e-01f, 1.67870897e-01f, 1.51104879e-01f, - 1.33648388e-01f, 1.15600665e-01f, 9.70639763e-02f, 7.81429119e-02f, 5.89439889e-02f, 3.95749746e-02f, - 2.01442353e-02f, 7.60241152e-04f, -1.84690990e-02f, -3.74370397e-02f, -5.60385970e-02f, -7.41711039e-02f, - -9.17348686e-02f, -1.08633632e-01f, -1.24775254e-01f, -1.40071993e-01f, -1.54441372e-01f, -1.67806284e-01f, - -1.80095654e-01f, -1.91244732e-01f, -2.01195605e-01f, -2.09897310e-01f, -2.17306320e-01f, -2.23386736e-01f, - -2.28110407e-01f, -2.31457193e-01f, -2.33415044e-01f, -2.33980051e-01f, -2.33156463e-01f, -2.30956673e-01f, - -2.27401097e-01f, -2.22518148e-01f, -2.16343899e-01f, -2.08921985e-01f, -2.00303365e-01f, -1.90545790e-01f, - -1.79713804e-01f, -1.67877977e-01f, -1.55114789e-01f, -1.41505907e-01f, -1.27137921e-01f, -1.12101628e-01f, - -9.64915640e-02f, -8.04054232e-02f, -6.39434707e-02f, -4.72078814e-02f, -3.03021635e-02f, -1.33305082e-02f, - 3.60284977e-03f, 2.03942507e-02f, 3.69413014e-02f, 5.31433810e-02f, 6.89024656e-02f, 8.41234679e-02f, - 9.87150268e-02f, 1.12589969e-01f, 1.25665865e-01f, 1.37865538e-01f, 1.49117506e-01f, 1.59356490e-01f, - 1.68523664e-01f, 1.76567229e-01f, 1.83442499e-01f, 1.89112308e-01f, 1.93547212e-01f, 1.96725586e-01f, - 1.98633878e-01f, 1.99266486e-01f, 1.98625999e-01f, 1.96723008e-01f, 1.93576075e-01f, 1.89211557e-01f, - 1.83663562e-01f, 1.76973516e-01f, 1.69190033e-01f, 1.60368490e-01f, 1.50570805e-01f, 1.39864815e-01f, - 1.28324021e-01f, 1.16026978e-01f, 1.03056879e-01f, 8.95008829e-02f, 7.54496798e-02f, 6.09968238e-02f, - 4.62380664e-02f, 3.12708901e-02f, 1.61936956e-02f, 1.10531988e-03f, -1.38957653e-02f, -2.87119784e-02f, - -4.32472742e-02f, -5.74078385e-02f, -7.11026311e-02f, -8.42439713e-02f, -9.67481917e-02f, -1.08536049e-01f, - -1.19533350e-01f, -1.29671345e-01f, -1.38887238e-01f, -1.47124498e-01f, -1.54333373e-01f, -1.60470968e-01f, - -1.65501755e-01f, -1.69397631e-01f, -1.72138140e-01f, -1.73710602e-01f, -1.74110159e-01f, -1.73339798e-01f, - -1.71410274e-01f, -1.68340111e-01f, -1.64155335e-01f, -1.58889414e-01f, -1.52582850e-01f, -1.45283122e-01f, - -1.37044042e-01f, -1.27925722e-01f, -1.17993860e-01f, -1.07319421e-01f, -9.59781808e-02f, -8.40500777e-02f, - -7.16188049e-02f, -5.87710561e-02f, -4.55961475e-02f, -3.21851919e-02f, -1.86306406e-02f, -5.02554942e-03f, - 8.53698384e-03f, 2.19645467e-02f, 3.51659468e-02f, 4.80518693e-02f, 6.05355056e-02f, 7.25330700e-02f, - 8.39645094e-02f, 9.47537898e-02f, 1.04829753e-01f, 1.14126254e-01f, 1.22582788e-01f, 1.30144907e-01f, - 1.36764459e-01f, 1.42400029e-01f, 1.47017076e-01f, 1.50588312e-01f, 1.53093700e-01f, 1.54520736e-01f, - 1.54864367e-01f, 1.54127119e-01f, 1.52318991e-01f, 1.49457408e-01f, 1.45567062e-01f, 1.40679709e-01f, - 1.34833933e-01f, 1.28074855e-01f, 1.20453893e-01f, 1.12028129e-01f, 1.02860307e-01f, 9.30178765e-02f, - 8.25730032e-02f, 7.16016450e-02f, 6.01833134e-02f, 4.84002546e-02f, 3.63370724e-02f, 2.40800037e-02f, - 1.17163168e-02f, -6.66217400e-04f, -1.29801121e-02f, -2.51385315e-02f, -3.70562030e-02f, -4.86497748e-02f, - -5.98384928e-02f, -7.05447859e-02f, -8.06947592e-02f, -9.02187441e-02f, -9.90517313e-02f, -1.07133911e-01f, - -1.14410951e-01f, -1.20834483e-01f, -1.26362422e-01f, -1.30959116e-01f, -1.34595787e-01f, -1.37250547e-01f, - -1.38908600e-01f, -1.39562374e-01f, -1.39211442e-01f, -1.37862602e-01f, -1.35529795e-01f, -1.32233909e-01f, - -1.28002721e-01f, -1.22870611e-01f, -1.16878278e-01f, -1.10072477e-01f, -1.02505698e-01f, -9.42356124e-02f, - -8.53248753e-02f, -7.58404912e-02f, -6.58532924e-02f, -5.54376360e-02f, -4.46705953e-02f, -3.36315414e-02f, - -2.24015972e-02f, -1.10628991e-02f, 3.01894735e-04f, 1.16101918e-02f, 2.27801642e-02f, 3.37311642e-02f, - 4.43845430e-02f, 5.46640016e-02f, 6.44962637e-02f, 7.38115400e-02f, 8.25440784e-02f, 9.06325572e-02f, - 9.80206066e-02f, 1.04657146e-01f, 1.10496723e-01f, 1.15499920e-01f, 1.19633523e-01f, 1.22870824e-01f, - 1.25191729e-01f, 1.26582959e-01f, 1.27038061e-01f, 1.26557494e-01f, 1.25148528e-01f, 1.22825305e-01f, - 1.19608512e-01f, 1.15525479e-01f, 1.10609643e-01f, 1.04900592e-01f, 9.84435537e-02f, 9.12890948e-02f, - 8.34927732e-02f, 7.51146973e-02f, 6.62190194e-02f, 5.68735547e-02f, 4.71491262e-02f, 3.71191855e-02f, - 2.68591932e-02f, 1.64459573e-02f, 5.95731808e-03f, -4.52874940e-03f, -1.49344723e-02f, -2.51829130e-02f, - -3.51986373e-02f, -4.49081427e-02f, -5.42404654e-02f, -6.31276969e-02f, -7.15054163e-02f, -7.93132713e-02f, - -8.64953327e-02f, -9.30005042e-02f, -9.87829011e-02f, -1.03802223e-01f, -1.08023943e-01f, -1.11419636e-01f, - -1.13967111e-01f, -1.15650603e-01f, -1.16460855e-01f, -1.16395152e-01f, -1.15457368e-01f, -1.13657871e-01f, - -1.11013433e-01f, -1.07547117e-01f, -1.03288073e-01f, -9.82712708e-02f, -9.25372646e-02f, -8.61318657e-02f, - -7.91057486e-02f, -7.15141053e-02f, -6.34161588e-02f, -5.48747791e-02f, -4.59559696e-02f, -3.67282941e-02f, - -2.72624874e-02f, -1.76307914e-02f, -7.90648674e-03f, 1.83670340e-03f, 1.15251424e-02f, 2.10858716e-02f, - 3.04471304e-02f, 3.95388944e-02f, 4.82933904e-02f, 5.66456655e-02f, 6.45340054e-02f, 7.19003487e-02f, - 7.86908695e-02f, 8.48562395e-02f, 9.03519908e-02f, 9.51389501e-02f, 9.91834077e-02f, 1.02457361e-01f, - 1.04938834e-01f, 1.06611872e-01f, 1.07466724e-01f, 1.07499917e-01f, 1.06714213e-01f, 1.05118588e-01f, - 1.02728167e-01f, 9.95640680e-02f, 9.56532488e-02f, 9.10282406e-02f, 8.57269309e-02f, 7.97922261e-02f, - 7.32717395e-02f, 6.62174249e-02f, 5.86850536e-02f, 5.07339959e-02f, 4.24265058e-02f, 3.38274345e-02f, - 2.50036502e-02f, 1.60234844e-02f, 6.95628026e-03f, -2.12820655e-03f, -1.11602438e-02f, -2.00708281e-02f, - -2.87920337e-02f, -3.72576320e-02f, -4.54035426e-02f, -5.31684173e-02f, -6.04938939e-02f, -6.73253212e-02f, - -7.36119310e-02f, -7.93072981e-02f, -8.43697556e-02f, -8.87625537e-02f, -9.24542939e-02f, -9.54189981e-02f, - -9.76364402e-02f, -9.90921435e-02f, -9.97776003e-02f, -9.96902366e-02f, -9.88334463e-02f, -9.72165780e-02f, - -9.48547668e-02f, -9.17688999e-02f, -8.79853312e-02f, -8.35357688e-02f, -7.84569594e-02f, -7.27903677e-02f, - -6.65818940e-02f, -5.98814932e-02f, -5.27427333e-02f, -4.52224733e-02f, -3.73802459e-02f, -2.92780037e-02f, - -2.09794209e-02f, -1.25495498e-02f, -4.05425988e-03f, 4.44034349e-03f, 1.28682571e-02f, 2.11643361e-02f, - 2.92645357e-02f, 3.71066200e-02f, 4.46305203e-02f, 5.17788267e-02f, 5.84972389e-02f, 6.47349496e-02f, - 7.04450836e-02f, 7.55849928e-02f, 8.01165748e-02f, 8.40066506e-02f, 8.72270848e-02f, 8.97550618e-02f, - 9.15732179e-02f, 9.26698315e-02f, 9.30387881e-02f, 9.26796720e-02f, 9.15978025e-02f, 8.98040443e-02f, - 8.73148489e-02f, 8.41520461e-02f, 8.03426093e-02f, 7.59185468e-02f, 7.09165136e-02f, 6.53776255e-02f, - 5.93470480e-02f, 5.28736293e-02f, 4.60095655e-02f, 3.88099545e-02f, 3.13323302e-02f, 2.36362162e-02f, - 1.57827398e-02f, 7.83395091e-03f, -1.47413782e-04f, -8.09864153e-03f, -1.59574406e-02f, -2.36623595e-02f, - -3.11534717e-02f, -3.83725840e-02f, -4.52638947e-02f, -5.17743411e-02f, -5.78539729e-02f, -6.34564348e-02f, - -6.85392092e-02f, -7.30640654e-02f, -7.69971954e-02f, -8.03096220e-02f, -8.29772975e-02f, -8.49813524e-02f, - -8.63081836e-02f, -8.69495746e-02f, -8.69027157e-02f, -8.61702687e-02f, -8.47602668e-02f, -8.26860569e-02f, - -7.99661981e-02f, -7.66242997e-02f, -7.26887788e-02f, -6.81926752e-02f, -6.31733712e-02f, -5.76722279e-02f, - -5.17343061e-02f, -4.54080069e-02f, -3.87446321e-02f, -3.17980032e-02f, -2.46239897e-02f, -1.72801497e-02f, - -9.82518156e-03f, -2.31845300e-03f, 5.18037510e-03f, 1.26119044e-02f, 1.99174857e-02f, 2.70395921e-02f, - 3.39223499e-02f, 4.05119404e-02f, 4.67570465e-02f, 5.26092142e-02f, 5.80232695e-02f, 6.29576539e-02f, - 6.73747113e-02f, 7.12410320e-02f, 7.45276905e-02f, 7.72104218e-02f, 7.92698394e-02f, 8.06915952e-02f, - 8.14664004e-02f, 8.15901977e-02f, 8.10640907e-02f, 7.98943315e-02f, 7.80922975e-02f, 7.56743792e-02f, - 7.26617861e-02f, 6.90804346e-02f, 6.49606433e-02f, 6.03370049e-02f, 5.52479503e-02f, 4.97355660e-02f, - 4.38451300e-02f, 3.76248662e-02f, 3.11254263e-02f, 2.43995757e-02f, 1.75017105e-02f, 1.04874823e-02f, - 3.41321948e-03f, -3.66433362e-03f, -1.06886566e-02f, -1.76037566e-02f, -2.43547422e-02f, -3.08881238e-02f, - -3.71523818e-02f, -4.30982377e-02f, -4.86791529e-02f, -5.38515978e-02f, -5.85754991e-02f, -6.28144137e-02f, - -6.65359631e-02f, -6.97119559e-02f, -7.23186409e-02f, -7.43369897e-02f, -7.57526047e-02f, -7.65560812e-02f, - -7.67428560e-02f, -7.63134051e-02f, -7.52730583e-02f, -7.36321241e-02f, -7.14055927e-02f, -6.86132027e-02f, - -6.52791213e-02f, -6.14318004e-02f, -5.71037475e-02f, -5.23312158e-02f, -4.71539306e-02f, -4.16147519e-02f, - -3.57593331e-02f, -2.96357023e-02f, -2.32939478e-02f, -1.67857228e-02f, -1.01639251e-02f, -3.48213128e-03f, - 3.20566951e-03f, 9.84566549e-03f, 1.63845318e-02f, 2.27699627e-02f, 2.89509937e-02f, 3.48784838e-02f, - 4.05054571e-02f, 4.57875191e-02f, 5.06831561e-02f, 5.51541055e-02f, 5.91656321e-02f, 6.26867948e-02f, - 6.56907214e-02f, 6.81547545e-02f, 7.00607045e-02f, 7.13948753e-02f, 7.21482790e-02f, 7.23165894e-02f, - 7.19002973e-02f, 7.09044846e-02f, 6.93390331e-02f, 6.72183039e-02f, 6.45611568e-02f, 6.13906537e-02f, - 5.77340810e-02f, 5.36223917e-02f, 4.90902973e-02f, 4.41756853e-02f, 3.89195025e-02f, 3.33653266e-02f, - 2.75589553e-02f, 2.15482187e-02f, 1.53823433e-02f, 9.11173206e-03f, 2.78750380e-03f, -3.53899736e-03f, - -9.81648845e-03f, -1.59942887e-02f, -2.20226002e-02f, -2.78530676e-02f, -3.34389835e-02f, -3.87358558e-02f, - -4.37015752e-02f, -4.82968641e-02f, -5.24856104e-02f, -5.62350079e-02f, -5.95160314e-02f, -6.23034090e-02f, - -6.45760369e-02f, -6.63170246e-02f, -6.75138263e-02f, -6.81583864e-02f, -6.82471093e-02f, -6.77809819e-02f, - -6.67654439e-02f, -6.52104027e-02f, -6.31301405e-02f, -6.05431381e-02f, -5.74719510e-02f, -5.39430121e-02f, - -4.99864152e-02f, -4.56356108e-02f, -4.09271785e-02f, -3.59005358e-02f, -3.05975021e-02f, -2.50620982e-02f, - -1.93400931e-02f, -1.34786109e-02f, -7.52582921e-03f, -1.53047296e-03f, 4.45846396e-03f, 1.03922252e-02f, - 1.62226043e-02f, 2.19024111e-02f, 2.73857927e-02f, 3.26286453e-02f, 3.75889120e-02f, 4.22270162e-02f, - 4.65060678e-02f, 5.03922602e-02f, 5.38550360e-02f, 5.68673912e-02f, 5.94061299e-02f, 6.14518959e-02f, - 6.29894927e-02f, 6.40078422e-02f, 6.45002081e-02f, 6.44641312e-02f, 6.39014463e-02f, 6.28183549e-02f, - 6.12252434e-02f, 5.91366226e-02f, 5.65710713e-02f, 5.35509478e-02f, 5.01023211e-02f, 4.62546289e-02f, - 4.20405644e-02f, 3.74956324e-02f, 3.26580309e-02f, 2.75681921e-02f, 2.22685138e-02f, 1.68029869e-02f, - 1.12168479e-02f, 5.55616360e-03f, -1.32475496e-04f, -5.80242145e-03f, -1.14072870e-02f, -1.69013632e-02f, - -2.22399629e-02f, -2.73798231e-02f, -3.22793559e-02f, -3.68992177e-02f, -4.12022700e-02f, -4.51542301e-02f, - -4.87237130e-02f, -5.18825743e-02f, -5.46061242e-02f, -5.68733215e-02f, -5.86668721e-02f, -5.99735198e-02f, - -6.07838952e-02f, -6.10928895e-02f, -6.08993923e-02f, -6.02064781e-02f, -5.90213291e-02f, -5.73550887e-02f, - -5.52228853e-02f, -5.26435817e-02f, -4.96396897e-02f, -4.62371294e-02f, -4.24650256e-02f, -3.83554628e-02f, - -3.39432096e-02f, -2.92654225e-02f, -2.43613233e-02f, -1.92718970e-02f, -1.40395616e-02f, -8.70771728e-03f, - -3.32056777e-03f, 2.07744785e-03f, 7.44190391e-03f, 1.27287222e-02f, 1.78946228e-02f, 2.28975002e-02f, - 2.76965843e-02f, 3.22530140e-02f, 3.65299534e-02f, 4.04930363e-02f, 4.41105069e-02f, 4.73536159e-02f, - 5.01967201e-02f, 5.26175750e-02f, 5.45974724e-02f, 5.61213729e-02f, 5.71780843e-02f, 5.77601946e-02f, - 5.78643759e-02f, 5.74910914e-02f, 5.66448597e-02f, 5.53340158e-02f, 5.35707338e-02f, 5.13708843e-02f, - 4.87538683e-02f, 4.57425137e-02f, 4.23627999e-02f, 3.86437075e-02f, 3.46169024e-02f, 3.03165387e-02f, - 2.57788894e-02f, 2.10421222e-02f, 1.61459251e-02f, 1.11311994e-02f, 6.03970466e-03f, 9.13695817e-04f, - -4.20433431e-03f, -9.27218149e-03f, -1.42480682e-02f, -1.90911878e-02f, -2.37618648e-02f, -2.82220093e-02f, - -3.24353766e-02f, -3.63678336e-02f, -3.99876924e-02f, -4.32659237e-02f, -4.61764207e-02f, -4.86961602e-02f, - -5.08054551e-02f, -5.24880386e-02f, -5.37312181e-02f, -5.45260166e-02f, -5.48671104e-02f, -5.47530531e-02f, - -5.41860463e-02f, -5.31721475e-02f, -5.17210363e-02f, -4.98459868e-02f, -4.75637647e-02f, -4.48944406e-02f, - -4.18612746e-02f, -3.84904206e-02f, -3.48107925e-02f, -3.08537797e-02f, -2.66529685e-02f, -2.22438695e-02f, - -1.76636682e-02f, -1.29507560e-02f, -8.14466071e-03f, -3.28544776e-03f, 1.58643018e-03f, 6.43050440e-03f, - 1.12067405e-02f, 1.58756642e-02f, 2.03989020e-02f, 2.47393345e-02f, 2.88614617e-02f, 3.27317634e-02f, - 3.63187992e-02f, 3.95936470e-02f, 4.25300387e-02f, 4.51045672e-02f, 4.72968940e-02f, 4.90899703e-02f, - 5.04700047e-02f, 5.14267809e-02f, 5.19535643e-02f, 5.20472034e-02f, 5.17082287e-02f, 5.09406434e-02f, - 4.97521048e-02f, 4.81537188e-02f, 4.61599131e-02f, 4.37884262e-02f, 4.10600706e-02f, 3.79985488e-02f, - 3.46302622e-02f, 3.09841217e-02f, 2.70912412e-02f, 2.29847199e-02f, 1.86992847e-02f, 1.42711599e-02f, - 9.73752669e-03f, 5.13643650e-03f, 5.06379454e-04f, -4.11408166e-03f, -8.68649476e-03f, -1.31729621e-02f, - -1.75363807e-02f, -2.17408089e-02f, -2.57516979e-02f, -2.95362143e-02f, -3.30635093e-02f, -3.63049622e-02f, - -3.92344048e-02f, -4.18283298e-02f, -4.40661418e-02f, -4.59301913e-02f, -4.74060505e-02f, -4.84825511e-02f, - -4.91518827e-02f, -4.94096235e-02f, -4.92548579e-02f, -4.86900251e-02f, -4.77210458e-02f, -4.63571741e-02f, - -4.46108878e-02f, -4.24979107e-02f, -4.00368564e-02f, -3.72492987e-02f, -3.41594108e-02f, -3.07938448e-02f, - -2.71814552e-02f, -2.33531198e-02f, -1.93413598e-02f, -1.51802063e-02f, -1.09048013e-02f, -6.55114338e-03f, - -2.15581014e-03f, 2.24443555e-03f, 6.61280814e-03f, 1.09129453e-02f, 1.51091980e-02f, 1.91667630e-02f, - 2.30522168e-02f, 2.67335907e-02f, 3.01807365e-02f, 3.33655579e-02f, 3.62622051e-02f, 3.88473226e-02f, - 4.11002204e-02f, 4.30030300e-02f, 4.45408790e-02f, 4.57019705e-02f, 4.64777109e-02f, 4.68627135e-02f, - 4.68549093e-02f, 4.64554958e-02f, 4.56689373e-02f, 4.45029599e-02f, 4.29683919e-02f, 4.10791386e-02f, - 3.88520159e-02f, 3.63066475e-02f, 3.34652385e-02f, 3.03523892e-02f, 2.69949681e-02f, 2.34217263e-02f, - 1.96632025e-02f, 1.57513974e-02f, 1.17194459e-02f, 7.60145677e-03f, 3.43215481e-03f, -7.53454950e-04f, - -4.92025229e-03f, -9.03345904e-03f, -1.30587503e-02f, -1.69627406e-02f, -2.07130441e-02f, -2.42787472e-02f, - -2.76304969e-02f, -3.07408842e-02f, -3.35845310e-02f, -3.61384026e-02f, -3.83819804e-02f, -4.02973364e-02f, - -4.18693911e-02f, -4.30859849e-02f, -4.39379525e-02f, -4.44192202e-02f, -4.45268207e-02f, -4.42609489e-02f, - -4.36249417e-02f, -4.26251693e-02f, -4.12710965e-02f, -3.95751119e-02f, -3.75524034e-02f, -3.52209020e-02f, - -3.26010732e-02f, -2.97156826e-02f, -2.65897306e-02f, -2.32501339e-02f, -1.97255230e-02f, -1.60459906e-02f, - -1.22428645e-02f, -8.34840613e-03f, -4.39555788e-03f, -4.17641093e-04f, 3.55186529e-03f, 7.47969548e-03f, - 1.13330289e-02f, 1.50796895e-02f, 1.86886063e-02f, 2.21298440e-02f, 2.53750227e-02f, 2.83974776e-02f, - 3.11724713e-02f, 3.36774564e-02f, 3.58921485e-02f, 3.77988281e-02f, 3.93823848e-02f, 4.06304645e-02f, - 4.15335460e-02f, 4.20850895e-02f, 4.22814530e-02f, 4.21220657e-02f, 4.16092724e-02f, 4.07484568e-02f, - 3.95478256e-02f, 3.80185099e-02f, 3.61742882e-02f, 3.40316228e-02f, 3.16093467e-02f, 2.89286854e-02f, - 2.60129143e-02f, 2.28872072e-02f, 1.95785162e-02f, 1.61151429e-02f, 1.25266872e-02f, 8.84367289e-03f, - 5.09737541e-03f, 1.31946573e-03f, -2.45819207e-03f, -6.20382907e-03f, -9.88599514e-03f, -1.34739714e-02f, - -1.69377975e-02f, -2.02487225e-02f, -2.33793144e-02f, -2.63038233e-02f, -2.89981802e-02f, -3.14404213e-02f, - -3.36107546e-02f, -3.54916723e-02f, -3.70682427e-02f, -3.83280672e-02f, -3.92614736e-02f, -3.98615776e-02f, - -4.01243243e-02f, -4.00484517e-02f, -3.96356708e-02f, -3.88903731e-02f, -3.78198781e-02f, -3.64341365e-02f, - -3.47457457e-02f, -3.27698392e-02f, -3.05238882e-02f, -2.80276282e-02f, -2.53028218e-02f, -2.23730957e-02f, - -1.92637467e-02f, -1.60015029e-02f, -1.26142882e-02f, -9.13104283e-03f, -5.58138981e-03f, -1.99542434e-03f, - 1.59649307e-03f, 5.16408174e-03f, 8.67737144e-03f, 1.21068581e-02f, 1.54239205e-02f, 1.86009100e-02f, - 2.16114772e-02f, 2.44306994e-02f, 2.70354163e-02f, 2.94042665e-02f, 3.15179985e-02f, 3.33595356e-02f, - 3.49141593e-02f, 3.61696229e-02f, 3.71161871e-02f, 3.77468512e-02f, 3.80571878e-02f, 3.80455485e-02f, - 3.77129900e-02f, 3.70632810e-02f, 3.61028508e-02f, 3.48407199e-02f, 3.32884428e-02f, 3.14600053e-02f, - 2.93716228e-02f, 2.70417408e-02f, 2.44907277e-02f, 2.17407576e-02f, 1.88156734e-02f, 1.57406803e-02f, - 1.25421761e-02f, 9.24754692e-03f, 5.88488640e-03f, 2.48280587e-03f, -9.29864758e-04f, -4.32426314e-03f, - -7.67179184e-03f, -1.09442952e-02f, -1.41143886e-02f, -1.71555974e-02f, -2.00425787e-02f, -2.27514891e-02f, - -2.52599054e-02f, -2.75472706e-02f, -2.95949315e-02f, -3.13863062e-02f, -3.29069832e-02f, -3.41450096e-02f, - -3.50907101e-02f, -3.57369992e-02f, -3.60793163e-02f, -3.61156751e-02f, -3.58467080e-02f, -3.52755740e-02f, - -3.44080617e-02f, -3.32523628e-02f, -3.18191314e-02f, -3.01213186e-02f, -2.81740846e-02f, -2.59946393e-02f, - -2.36021125e-02f, -2.10173975e-02f, -1.82629132e-02f, -1.53624700e-02f, -1.23410560e-02f, -9.22456599e-03f, - -6.03967755e-03f, -2.81350877e-03f, 4.26514319e-04f, 3.65292660e-03f, 6.83848944e-03f, 9.95638508e-03f, - 1.29804234e-02f, 1.58853076e-02f, 1.86468203e-02f, 2.12420277e-02f, 2.36494909e-02f, 2.58493792e-02f, - 2.78237450e-02f, 2.95565060e-02f, 3.10338053e-02f, 3.22438572e-02f, 3.31772716e-02f, 3.38269627e-02f, - 3.41883176e-02f, 3.42591610e-02f, 3.40397435e-02f, 3.35328606e-02f, 3.27436351e-02f, 3.16796573e-02f, - 3.03507246e-02f, 2.87689689e-02f, 2.69484839e-02f, 2.49054827e-02f, 2.26579086e-02f, 2.02254442e-02f, - 1.76292617e-02f, 1.48918382e-02f, 1.20368159e-02f, 9.08872468e-03f, 6.07283273e-03f, 3.01489838e-03f, - -5.90212194e-05f, -3.12287666e-03f, -6.15069532e-03f, -9.11695091e-03f, -1.19967033e-02f, -1.47657868e-02f, - -1.74011004e-02f, -1.98807214e-02f, -2.21841025e-02f, -2.42922632e-02f, -2.61879368e-02f, -2.78557311e-02f, - -2.92821801e-02f, -3.04559562e-02f, -3.13678907e-02f, -3.20110632e-02f, -3.23808087e-02f, -3.24749193e-02f, - -3.22933847e-02f, -3.18386269e-02f, -3.11153366e-02f, -3.01304804e-02f, -2.88932552e-02f, -2.74148734e-02f, - -2.57086673e-02f, -2.37898314e-02f, -2.16752343e-02f, -1.93835013e-02f, -1.69345799e-02f, -1.43497284e-02f, - -1.16513243e-02f, -8.86259097e-03f, -6.00748525e-03f, -3.11044903e-03f, -1.96143386e-04f, 2.71056658e-03f, - 5.58512222e-03f, 8.40318833e-03f, 1.11410160e-02f, 1.37756382e-02f, 1.62850338e-02f, 1.86482666e-02f, - 2.08457445e-02f, 2.28593437e-02f, 2.46725329e-02f, 2.62705694e-02f, 2.76405329e-02f, 2.87715470e-02f, - 2.96547092e-02f, 3.02833419e-02f, 3.06529059e-02f, 3.07610441e-02f, 3.06076742e-02f, 3.01949567e-02f, - 2.95271502e-02f, 2.86107876e-02f, 2.74543883e-02f, 2.60685701e-02f, 2.44657863e-02f, 2.26603655e-02f, - 2.06682557e-02f, 1.85070033e-02f, 1.61954603e-02f, 1.37537720e-02f, 1.12030588e-02f, 8.56537064e-03f, - 5.86336215e-03f, 3.12021752e-03f, 3.59345288e-04f, -2.39571357e-03f, -5.12158252e-03f, -7.79518527e-03f, - -1.03939536e-02f, -1.28961026e-02f, -1.52805838e-02f, -1.75275761e-02f, -1.96183935e-02f, -2.15357712e-02f, - -2.32639542e-02f, -2.47888545e-02f, -2.60981899e-02f, -2.71814567e-02f, -2.80302370e-02f, -2.86380088e-02f, - -2.90003996e-02f, -2.91151172e-02f, -2.89819544e-02f, -2.86028697e-02f, -2.79818317e-02f, -2.71249297e-02f, - -2.60401957e-02f, -2.47375751e-02f, -2.32288414e-02f, -2.15275091e-02f, -1.96486443e-02f, -1.76087964e-02f, - -1.54258426e-02f, -1.31187994e-02f, -1.07076937e-02f, -8.21335282e-03f, -5.65730582e-03f, -3.06143405e-03f, - -4.47990175e-04f, 2.16074548e-03f, 4.74260737e-03f, 7.27569124e-03f, 9.73864733e-03f, 1.21106824e-02f, - 1.43719841e-02f, 1.65036001e-02f, 1.84878471e-02f, 2.03083286e-02f, 2.19500531e-02f, 2.33996493e-02f, - 2.46453861e-02f, 2.56773512e-02f, 2.64874345e-02f, 2.70694463e-02f, 2.74192279e-02f, 2.75344951e-02f, - 2.74150667e-02f, 2.70627089e-02f, 2.64811913e-02f, 2.56761950e-02f, 2.46553112e-02f, 2.34279326e-02f, - 2.20051823e-02f, 2.03998041e-02f, 1.86260730e-02f, 1.66996483e-02f, 1.46373888e-02f, 1.24573628e-02f, - 1.01784699e-02f, 7.82046099e-03f, 5.40366356e-03f, 2.94886537e-03f, 4.77074685e-04f, -1.99056008e-03f, - -4.43309957e-03f, -6.82975366e-03f, -9.16032780e-03f, -1.14051392e-02f, -1.35453571e-02f, -1.55631186e-02f, - -1.74416221e-02f, -1.91653203e-02f, -2.07200521e-02f, -2.20931290e-02f, -2.32734389e-02f, -2.42515770e-02f, - -2.50198790e-02f, -2.55724740e-02f, -2.59053977e-02f, -2.60165073e-02f, -2.59056121e-02f, -2.55744100e-02f, - -2.50263861e-02f, -2.42670139e-02f, -2.33034172e-02f, -2.21444752e-02f, -2.08007704e-02f, -1.92843016e-02f, - -1.76086143e-02f, -1.57885066e-02f, -1.38399632e-02f, -1.17800468e-02f, -9.62665505e-03f, -7.39846180e-03f, - -5.11473979e-03f, -2.79509520e-03f, -4.59475153e-04f, 1.87219411e-03f, 4.18004886e-03f, 6.44446028e-03f, - 8.64630036e-03f, 1.07670050e-02f, 1.27887263e-02f, 1.46946183e-02f, 1.64687696e-02f, 1.80965074e-02f, - 1.95644657e-02f, 2.08606409e-02f, 2.19745569e-02f, 2.28973400e-02f, 2.36217678e-02f, 2.41423032e-02f, - 2.44552329e-02f, 2.45585559e-02f, 2.44521268e-02f, 2.41375247e-02f, 2.36181843e-02f, 2.28991883e-02f, - 2.19873596e-02f, 2.08911372e-02f, 1.96204854e-02f, 1.81868423e-02f, 1.66029686e-02f, 1.48829260e-02f, - 1.30418196e-02f, 1.10957823e-02f, 9.06176569e-03f, 6.95742371e-03f, 4.80095797e-03f, 2.61094572e-03f, - 4.06163422e-04f, -1.79448120e-03f, -3.97227507e-03f, -6.10867089e-03f, -8.18559133e-03f, -1.01855447e-02f, - -1.20916775e-02f, -1.38880736e-02f, -1.55597947e-02f, -1.70929424e-02f, -1.84749792e-02f, -1.96945768e-02f, - -2.07419008e-02f, -2.16086011e-02f, -2.22879060e-02f, -2.27746496e-02f, -2.30653527e-02f, -2.31582122e-02f, - -2.30530853e-02f, -2.27516002e-02f, -2.22569518e-02f, -2.15740851e-02f, -2.07094459e-02f, -1.96710504e-02f, - -1.84683607e-02f, -1.71122258e-02f, -1.56147530e-02f, -1.39891960e-02f, -1.22499260e-02f, -1.04121226e-02f, - -8.49187069e-03f, -6.50583812e-03f, -4.47121574e-03f, -2.40553061e-03f, -3.26560349e-04f, 1.74792849e-03f, - 3.80020986e-03f, 5.81284812e-03f, 7.76878436e-03f, 9.65152189e-03f, 1.14452321e-02f, 1.31348903e-02f, - 1.47064602e-02f, 1.61469015e-02f, 1.74443880e-02f, 1.85883329e-02f, 1.95694960e-02f, 2.03800747e-02f, - 2.10137416e-02f, 2.14657028e-02f, 2.17327470e-02f, 2.18132189e-02f, 2.17071096e-02f, 2.14159688e-02f, - 2.09429396e-02f, 2.02927056e-02f, 1.94714591e-02f, 1.84867806e-02f, 1.73476996e-02f, 1.60644888e-02f, - 1.46486021e-02f, 1.31126305e-02f, 1.14700918e-02f, 9.73543186e-03f, 7.92379251e-03f, 6.05090462e-03f, - 4.13301608e-03f, 2.18669055e-03f, 2.28581333e-04f, -1.72441072e-03f, -3.65572200e-03f, -5.54887990e-03f, - -7.38782061e-03f, -9.15706782e-03f, -1.08417082e-02f, -1.24276657e-02f, -1.39017311e-02f, -1.52516970e-02f, - -1.64664949e-02f, -1.75361817e-02f, -1.84521823e-02f, -1.92071599e-02f, -1.97953056e-02f, -2.02121243e-02f, - -2.04547147e-02f, -2.05216098e-02f, -2.04128534e-02f, -2.01300439e-02f, -1.96761990e-02f, -1.90558123e-02f, - -1.82748056e-02f, -1.73404276e-02f, -1.62612067e-02f, -1.50469098e-02f, -1.37084115e-02f, -1.22575769e-02f, - -1.07072432e-02f, -9.07102930e-03f, -7.36320826e-03f, -5.59869147e-03f, -3.79270806e-03f, -1.96092013e-03f, - -1.19027325e-04f, 1.71713152e-03f, 3.53191747e-03f, 5.30986343e-03f, 7.03590331e-03f, 8.69547560e-03f, - 1.02746006e-02f, 1.17601122e-02f, 1.31396009e-02f, 1.44016653e-02f, 1.55359973e-02f, 1.65332483e-02f, - 1.73855033e-02f, 1.80859434e-02f, 1.86291305e-02f, 1.90110277e-02f, 1.92289384e-02f, 1.92815880e-02f, - 1.91691688e-02f, 1.88932135e-02f, 1.84567183e-02f, 1.78639790e-02f, 1.71206377e-02f, 1.62336473e-02f, - 1.52110920e-02f, 1.40622274e-02f, 1.27973510e-02f, 1.14277163e-02f, 9.96541843e-03f, 8.42333112e-03f, - 6.81491991e-03f, 5.15420944e-03f, 3.45559138e-03f, 1.73374462e-03f, 3.49154958e-06f, -1.72033182e-03f, - -3.42300908e-03f, -5.09002877e-03f, -6.70728983e-03f, -8.26110592e-03f, -9.73843101e-03f, -1.11269177e-02f, - -1.24149972e-02f, -1.35920411e-02f, -1.46483675e-02f, -1.55754162e-02f, -1.63657097e-02f, -1.70130158e-02f, - -1.75123254e-02f, -1.78599156e-02f, -1.80533642e-02f, -1.80916471e-02f, -1.79749596e-02f, -1.77049199e-02f, - -1.72844059e-02f, -1.67175734e-02f, -1.60098348e-02f, -1.51677846e-02f, -1.41991369e-02f, -1.31126308e-02f, - -1.19180614e-02f, -1.06260158e-02f, -9.24795820e-03f, -7.79599691e-03f, -6.28282689e-03f, -4.72166017e-03f, - -3.12602130e-03f, -1.50971188e-03f, 1.13358008e-04f, 1.72924640e-03f, 3.32419869e-03f, 4.88457483e-03f, - 6.39719332e-03f, 7.84928507e-03f, 9.22860374e-03f, 1.05236737e-02f, 1.17237027e-02f, 1.28187631e-02f, - 1.37999219e-02f, 1.46591627e-02f, 1.53896448e-02f, 1.59855771e-02f, 1.64423748e-02f, 1.67566705e-02f, - 1.69263151e-02f, 1.69504088e-02f, 1.68293192e-02f, 1.65646048e-02f, 1.61591292e-02f, 1.56168830e-02f, - 1.49430466e-02f, 1.41438870e-02f, 1.32267343e-02f, 1.21999194e-02f, 1.10726150e-02f, 9.85491162e-03f, - 8.55755480e-03f, 7.19198626e-03f, 5.77013714e-03f, 4.30443841e-03f, 2.80758857e-03f, 1.29252809e-03f, - -2.27683018e-04f, -1.74000213e-03f, -3.23153173e-03f, -4.68956247e-03f, -6.10171563e-03f, -7.45612506e-03f, - -8.74136426e-03f, -9.94672023e-03f, -1.10621909e-02f, -1.20785406e-02f, -1.29874795e-02f, -1.37816456e-02f, - -1.44546479e-02f, -1.50012468e-02f, -1.54172106e-02f, -1.56995155e-02f, -1.58462779e-02f, -1.58567437e-02f, - -1.57313825e-02f, -1.54717967e-02f, -1.50807184e-02f, -1.45620705e-02f, -1.39207297e-02f, -1.31627253e-02f, - -1.22950111e-02f, -1.13254027e-02f, -1.02626834e-02f, -9.11627932e-03f, -7.89634415e-03f, -6.61364765e-03f, - -5.27939952e-03f, -3.90525708e-03f, -2.50314317e-03f, -1.08517576e-03f, 3.36418391e-04f, 1.74945190e-03f, - 3.14186033e-03f, 4.50178261e-03f, 5.81769448e-03f, 7.07851939e-03f, 8.27365386e-03f, 9.39310326e-03f, - 1.04276320e-02f, 1.13686527e-02f, 1.22085379e-02f, 1.29404450e-02f, 1.35585678e-02f, 1.40580446e-02f, - 1.44350939e-02f, 1.46869568e-02f, 1.48120098e-02f, 1.48096348e-02f, 1.46804295e-02f, 1.44259781e-02f, - 1.40489668e-02f, 1.35531325e-02f, 1.29432014e-02f, 1.22248563e-02f, 1.14046959e-02f, 1.04901687e-02f, - 9.48948107e-03f, 8.41156632e-03f, 7.26596347e-03f, 6.06280447e-03f, 4.81257444e-03f, 3.52622627e-03f, - 2.21492506e-03f, 8.89983592e-04f, -4.37153812e-04f, -1.75513167e-03f, -3.05265494e-03f, -4.31872834e-03f, - -5.54261874e-03f, -6.71396264e-03f, -7.82302244e-03f, -8.86045250e-03f, -9.81773278e-03f, -1.06869351e-02f, - -1.14610023e-02f, -1.21336754e-02f, -1.26995953e-02f, -1.31543908e-02f, -1.34945718e-02f, -1.37177266e-02f, - -1.38224110e-02f, -1.38082286e-02f, -1.36757739e-02f, -1.34266887e-02f, -1.30635886e-02f, -1.25900369e-02f, - -1.20105709e-02f, -1.13305978e-02f, -1.05563538e-02f, -9.69485926e-03f, -8.75389081e-03f, -7.74181164e-03f, - -6.66761679e-03f, -5.54076187e-03f, -4.37111830e-03f, -3.16893052e-03f, -1.94457115e-03f, -7.08705149e-04f, - 5.28079290e-04f, 1.75515870e-03f, 2.96204304e-03f, 4.13848585e-03f, 5.27451557e-03f, 6.36060039e-03f, - 7.38755863e-03f, 8.34692530e-03f, 9.23070802e-03f, 1.00316534e-02f, 1.07432528e-02f, 1.13597680e-02f, - 1.18763350e-02f, 1.22889283e-02f, 1.25944631e-02f, 1.27907515e-02f, 1.28765994e-02f, 1.28517102e-02f, - 1.27167966e-02f, 1.24734480e-02f, 1.21242371e-02f, 1.16725839e-02f, 1.11228281e-02f, 1.04800592e-02f, - 9.75022575e-03f, 8.93990424e-03f, 8.05644990e-03f, 7.10768601e-03f, 6.10205625e-03f, 5.04843878e-03f, - 3.95605458e-03f, 2.83441418e-03f, 1.69331277e-03f, 5.42568186e-04f, -6.07877124e-04f, -1.74818575e-03f, - -2.86860405e-03f, -3.95962685e-03f, -5.01201657e-03f, -6.01690058e-03f, -6.96589716e-03f, -7.85110424e-03f, - -8.66518231e-03f, -9.40145619e-03f, -1.00540095e-02f, -1.06175123e-02f, -1.10876024e-02f, -1.14606062e-02f, - -1.17337519e-02f, -1.19051415e-02f, -1.19737311e-02f, -1.19393909e-02f, -1.18028751e-02f, -1.15657387e-02f, - -1.12305357e-02f, -1.08005049e-02f, -1.02797519e-02f, -9.67318729e-03f, -8.98632838e-03f, -8.22543877e-03f, - -7.39737215e-03f, -6.50950785e-03f, -5.56975395e-03f, -4.58632875e-03f, -3.56792674e-03f, -2.52340823e-03f, - -1.46183597e-03f, -3.92391156e-04f, 6.75701684e-04f, 1.73331709e-03f, 2.77141530e-03f, 3.78118353e-03f, - 4.75407672e-03f, 5.68193005e-03f, 6.55698994e-03f, 7.37195674e-03f, 8.12013345e-03f, 8.79539509e-03f, - 9.39225030e-03f, 9.90597190e-03f, 1.03324819e-02f, 1.06685242e-02f, 1.09116177e-02f, 1.10600973e-02f, - 1.11130936e-02f, 1.10705983e-02f, 1.09333788e-02f, 1.07030445e-02f, 1.03819949e-02f, 9.97335332e-03f, - 9.48107464e-03f, 8.90968434e-03f, 8.26449756e-03f, 7.55132972e-03f, 6.77664458e-03f, 5.94731079e-03f, - 5.07073939e-03f, 4.15462520e-03f, 3.20700306e-03f, 2.23616222e-03f, 1.25050340e-03f, 2.58592562e-04f, - -7.31105992e-04f, -1.71003848e-03f, -2.66991104e-03f, -3.60254805e-03f, -4.50009626e-03f, -5.35500152e-03f, - -6.16013372e-03f, -6.90880302e-03f, -7.59484887e-03f, -8.21267759e-03f, -8.75730297e-03f, -9.22437062e-03f, - -9.61022818e-03f, -9.91196266e-03f, -1.01273334e-02f, -1.02549146e-02f, -1.02939949e-02f, -1.02446487e-02f, - -1.01077102e-02f, -9.88473930e-03f, -9.57804506e-03f, -9.19065219e-03f, -8.72623997e-03f, -8.18914967e-03f, - -7.58431711e-03f, -6.91725624e-03f, -6.19393169e-03f, -5.42085678e-03f, -4.60486090e-03f, -3.75314479e-03f, - -2.87318400e-03f, -1.97263669e-03f, -1.05936420e-03f, -1.41184633e-04f, 7.73935206e-04f, 1.67818033e-03f, - 2.56387121e-03f, 3.42348245e-03f, 4.24972968e-03f, 5.03575853e-03f, 5.77493594e-03f, 6.46117800e-03f, - 7.08885263e-03f, 7.65282423e-03f, 8.14856911e-03f, 8.57214716e-03f, 8.92027019e-03f, 9.19029194e-03f, - 9.38027470e-03f, 9.48895025e-03f, 9.51578399e-03f, 9.46091429e-03f, 9.32518284e-03f, 9.11016180e-03f, - 8.81806173e-03f, 8.45171440e-03f, 8.01466407e-03f, 7.51094572e-03f, 6.94521826e-03f, 6.32261691e-03f, - 5.64875255e-03f, 4.92963671e-03f, 4.17165548e-03f, 3.38149573e-03f, 2.56610069e-03f, 1.73253154e-03f, - 8.88083719e-04f, 4.00140997e-05f, -8.04377007e-04f, -1.63786496e-03f, -2.45336348e-03f, -3.24394120e-03f, - -4.00297149e-03f, -4.72406012e-03f, -5.40122825e-03f, -6.02886353e-03f, -6.60184564e-03f, -7.11547043e-03f, - -7.56567204e-03f, -7.94886879e-03f, -8.26207948e-03f, -8.50298133e-03f, -8.66984745e-03f, -8.76158174e-03f, - -8.77778600e-03f, -8.71866903e-03f, -8.58510255e-03f, -8.37858953e-03f, -8.10125332e-03f, -7.75580633e-03f, - -7.34555568e-03f, -6.87431135e-03f, -6.34642360e-03f, -5.76669768e-03f, -5.14031767e-03f, -4.47294897e-03f, - -3.77043291e-03f, -3.03903272e-03f, -2.28511456e-03f, -1.51527024e-03f, -7.36178447e-04f, 4.54225562e-05f, - 8.22859022e-04f, 1.58943109e-03f, 2.33866278e-03f, 3.06420334e-03f, 3.75990680e-03f, 4.42002538e-03f, - 5.03901750e-03f, 5.61180111e-03f, 6.13366220e-03f, 6.60043272e-03f, 7.00831931e-03f, 7.35414500e-03f, - 7.63524392e-03f, 7.84953557e-03f, 7.99547645e-03f, 8.07218955e-03f, 8.07933095e-03f, 8.01721906e-03f, - 7.88666864e-03f, 7.68919343e-03f, 7.42679720e-03f, 7.10202788e-03f, 6.71802523e-03f, 6.27832934e-03f, - 5.78702253e-03f, 5.24853339e-03f, 4.66776048e-03f, 4.04985033e-03f, 3.40032055e-03f, 2.72486114e-03f, - 2.02943382e-03f, 1.32005555e-03f, 6.02922229e-04f, -1.15810889e-04f, -8.29962401e-04f, -1.53344695e-03f, - -2.22024937e-03f, -2.88460828e-03f, -3.52090915e-03f, -4.12386103e-03f, -4.68844782e-03f, -5.21000854e-03f, - -5.68433641e-03f, -6.10753890e-03f, -6.47629357e-03f, -6.78770430e-03f, -7.03936807e-03f, -7.22944790e-03f, - -7.35662441e-03f, -7.42012069e-03f, -7.41971164e-03f, -7.35573757e-03f, -7.22905724e-03f, -7.04107429e-03f, - -6.79370122e-03f, -6.48940038e-03f, -6.13102314e-03f, -5.72192873e-03f, -5.26590521e-03f, -4.76707464e-03f, - -4.22993214e-03f, -3.65930825e-03f, -3.06022345e-03f, -2.43797793e-03f, -1.79803310e-03f, -1.14594988e-03f, - -4.87389180e-04f, 1.71985886e-04f, 8.26505744e-04f, 1.47057292e-03f, 2.09875564e-03f, 2.70572827e-03f, - 3.28638788e-03f, 3.83592350e-03f, 4.34975506e-03f, 4.82368759e-03f, 5.25383132e-03f, 5.63677359e-03f, - 5.96942535e-03f, 6.24924092e-03f, 6.47405650e-03f, 6.64226721e-03f, 6.75269253e-03f, 6.80469430e-03f, - 6.79815717e-03f, 6.73340631e-03f, 6.61130455e-03f, 6.43322863e-03f, 6.20094526e-03f, 5.91677710e-03f, - 5.58340169e-03f, 5.20393196e-03f, 4.78187614e-03f, 4.32106320e-03f, 3.82565711e-03f, 3.30005613e-03f, - 2.74895362e-03f, 2.17719303e-03f, 1.58978015e-03f, 9.91844057e-04f, 3.88540330e-04f, -2.14916878e-04f, - -8.13361192e-04f, -1.40168257e-03f, -1.97489740e-03f, -2.52818059e-03f, -3.05688539e-03f, -3.55662656e-03f, - -4.02326574e-03f, -4.45296958e-03f, -4.84228652e-03f, -5.18803438e-03f, -5.48755315e-03f, -5.73848611e-03f, - -5.93891991e-03f, -6.08745626e-03f, -6.18305471e-03f, -6.22520840e-03f, -6.21382472e-03f, -6.14928419e-03f, - -6.03244633e-03f, -5.86455879e-03f, -5.64736180e-03f, -5.38296537e-03f, -5.07389363e-03f, -4.72301916e-03f, - -4.33361321e-03f, -3.90915761e-03f, -3.45353173e-03f, -2.97077347e-03f, -2.46516689e-03f, -1.94119584e-03f, - -1.40340595e-03f, -8.56512644e-04f, -3.05232133e-04f, 2.45691031e-04f, 7.91538060e-04f, 1.32763724e-03f, - 1.84949345e-03f, 2.35267547e-03f, 2.83299113e-03f, 3.28645035e-03f, 3.70931698e-03f, 4.09812665e-03f, - 4.44973511e-03f, 4.76135341e-03f, 5.03050354e-03f, 5.25513155e-03f, 5.43353323e-03f, 5.56447821e-03f, - 5.64705544e-03f, 5.68083601e-03f, 5.66583437e-03f, 5.60238431e-03f, 5.49135375e-03f, 5.33391723e-03f, - 5.13169207e-03f, 4.88664671e-03f, 4.60113202e-03f, 4.27780860e-03f, 3.91964875e-03f, 3.52989866e-03f, - 3.11212090e-03f, 2.66999053e-03f, 2.20744344e-03f, 1.72859110e-03f, 1.23756351e-03f, 7.38678150e-04f, - 2.36236760e-04f, -2.65462378e-04f, -7.62072815e-04f, -1.24943395e-03f, -1.72337956e-03f, -2.17993754e-03f, - -2.61530935e-03f, -3.02588421e-03f, -3.40825196e-03f, -3.75935360e-03f, -4.07630652e-03f, -4.35660760e-03f, - -4.59808398e-03f, -4.79883718e-03f, -4.95743843e-03f, -5.07271280e-03f, -5.14393833e-03f, -5.17077608e-03f, - -5.15318763e-03f, -5.09164480e-03f, -4.98686807e-03f, -4.84002285e-03f, -4.65260103e-03f, -4.42642977e-03f, - -4.16366446e-03f, -3.86678300e-03f, -3.53847751e-03f, -3.18177292e-03f, -2.79986847e-03f, -2.39618401e-03f, - -1.97429017e-03f, -1.53788782e-03f, -1.09083664e-03f, -6.36973406e-04f, -1.80264329e-04f, 2.75399352e-04f, - 7.26104424e-04f, 1.16802598e-03f, 1.59744046e-03f, 2.01073128e-03f, 2.40446819e-03f, 2.77538562e-03f, - 3.12044615e-03f, 3.43683203e-03f, 3.72202393e-03f, 3.97374850e-03f, 4.19002854e-03f, 4.36925418e-03f, - 4.51006070e-03f, 4.61152219e-03f, 4.67293053e-03f, 4.69404975e-03f, 4.67490366e-03f, 4.61589307e-03f, - 4.51775252e-03f, 4.38154991e-03f, 4.20868532e-03f, 4.00082377e-03f, 3.75997274e-03f, 3.48836415e-03f, - 3.18851504e-03f, 2.86314343e-03f, 2.51519536e-03f, 2.14776743e-03f, 1.76411750e-03f, 1.36763070e-03f, - 9.61751835e-04f, 5.50052405e-04f, 1.36015058e-04f, -2.76720943e-04f, -6.84698152e-04f, -1.08442387e-03f, - -1.47253691e-03f, -1.84578853e-03f, -2.20105818e-03f, -2.53544188e-03f, -2.84616998e-03f, -3.13076058e-03f, - -3.38689733e-03f, -3.61260297e-03f, -3.80606518e-03f, -3.96589267e-03f, -4.09087232e-03f, -4.18013173e-03f, - -4.23315965e-03f, -4.24970953e-03f, -4.22981560e-03f, -4.17392494e-03f, -4.08267808e-03f, -3.95709577e-03f, - -3.79845153e-03f, -3.60829670e-03f, -3.38844338e-03f, -3.14094669e-03f, -2.86809742e-03f, -2.57237442e-03f, - -2.25643831e-03f, -1.92312165e-03f, -1.57535841e-03f, -1.21624129e-03f, -8.48868370e-04f, -4.76457354e-04f, - -1.02227062e-04f, 2.70659894e-04f, 6.38948957e-04f, 9.99596773e-04f, 1.34950884e-03f, 1.68579412e-03f, - 2.00565112e-03f, 2.30644176e-03f, 2.58570970e-03f, 2.84121989e-03f, 3.07087670e-03f, 3.27296771e-03f, - 3.44584695e-03f, 3.58825627e-03f, 3.69915439e-03f, 3.77779535e-03f, 3.82369144e-03f, 3.83666312e-03f, - 3.81678507e-03f, 3.76444486e-03f, 3.68027755e-03f, 3.56519883e-03f, 3.42038694e-03f, 3.24725992e-03f, - 3.04745181e-03f, 2.82287635e-03f, 2.57555610e-03f, 2.30778342e-03f, 2.02193938e-03f, 1.72060684e-03f, - 1.40642226e-03f, 1.08218540e-03f, 7.50708128e-04f, 4.14852040e-04f, 7.75468400e-05f, -2.58336678e-04f, - -5.89954675e-04f, -9.14464553e-04f, -1.22917409e-03f, -1.53142096e-03f, -1.81874942e-03f, -2.08875765e-03f, - -2.33925204e-03f, -2.56824046e-03f, -2.77387464e-03f, -2.95457151e-03f, -3.10891286e-03f, -3.23576957e-03f, - -3.33422309e-03f, -3.40361730e-03f, -3.44352432e-03f, -3.45380945e-03f, -3.43454926e-03f, -3.38612359e-03f, - -3.30910238e-03f, -3.20434413e-03f, -3.07289782e-03f, -2.91605448e-03f, -2.73534798e-03f, -2.53242439e-03f, - -2.30918427e-03f, -2.06766744e-03f, -1.81002532e-03f, -1.53857461e-03f, -1.25572213e-03f, -9.63956082e-04f, - -6.65804929e-04f, -3.63875198e-04f, -6.07622519e-05f, 2.40955893e-04f, 5.38685581e-04f, 8.29936911e-04f, - 1.11224977e-03f, 1.38328230e-03f, 1.64080028e-03f, 1.88265574e-03f, 2.10694670e-03f, 2.31181334e-03f, - 2.49567938e-03f, 2.65707799e-03f, 2.79477329e-03f, 2.90778929e-03f, 2.99526804e-03f, 3.05666792e-03f, - 3.09159989e-03f, 3.09996074e-03f, 3.08183486e-03f, 3.03757314e-03f, 2.96768997e-03f, 2.87296391e-03f, - 2.75438271e-03f, 2.61305979e-03f, 2.45041225e-03f, 2.26792371e-03f, 2.06728115e-03f, 1.85034398e-03f, - 1.61901728e-03f, 1.37543970e-03f, 1.12168235e-03f, 8.60048928e-04f, 5.92781787e-04f, 3.22217129e-04f, - 5.06437951e-05f, -2.19547817e-04f, -4.86132510e-04f, -7.46817210e-04f, -9.99443627e-04f, -1.24188233e-03f, - -1.47217245e-03f, -1.68839648e-03f, -1.88883105e-03f, -2.07184785e-03f, -2.23601745e-03f, -2.38006048e-03f, - -2.50288118e-03f, -2.60358292e-03f, -2.68144174e-03f, -2.73595307e-03f, -2.76679595e-03f, -2.77388624e-03f, - -2.75729794e-03f, -2.71735188e-03f, -2.65451985e-03f, -2.56952130e-03f, -2.46319204e-03f, -2.33660956e-03f, - -2.19096493e-03f, -2.02765268e-03f, -1.84815939e-03f, -1.65412932e-03f, -1.44731483e-03f, -1.22956426e-03f, - -1.00280075e-03f, -7.69022668e-04f, -5.30268510e-04f, -2.88586883e-04f, -4.60956253e-05f, 1.95186584e-04f, - 4.33161045e-04f, 6.65873263e-04f, 8.91328897e-04f, 1.10770620e-03f, 1.31316296e-03f, 1.50610067e-03f, - 1.68489795e-03f, 1.84814923e-03f, 1.99458512e-03f, 2.12304250e-03f, 2.23258384e-03f, 2.32237953e-03f, - 2.39181962e-03f, 2.44043032e-03f, 2.46796938e-03f, 2.47430968e-03f, 2.45957831e-03f, 2.42401283e-03f, - 2.36808884e-03f, 2.29238471e-03f, 2.19773378e-03f, 2.08501666e-03f, 1.95534528e-03f, 1.80993801e-03f, - 1.65014053e-03f, 1.47739854e-03f, 1.29329221e-03f, 1.09944593e-03f, 8.97596290e-04f, 6.89486470e-04f, - 4.76967544e-04f, 2.61847472e-04f, 4.59979030e-05f, -1.68770369e-04f, -3.80612759e-04f, -5.87744421e-04f, - -7.88452414e-04f, -9.81081718e-04f, -1.16402219e-03f, -1.33580811e-03f, -1.49504859e-03f, -1.64047131e-03f, - -1.77095587e-03f, -1.88548340e-03f, -1.98318254e-03f, -2.06335667e-03f, -2.12544333e-03f, -2.16903096e-03f, - -2.19389731e-03f, -2.19994674e-03f, -2.18726700e-03f, -2.15609170e-03f, -2.10683457e-03f, -2.04002290e-03f, - -1.95633800e-03f, -1.85665258e-03f, -1.74189023e-03f, -1.61313165e-03f, -1.47159921e-03f, -1.31856217e-03f, - -1.15541374e-03f, -9.83590913e-04f, -8.04645529e-04f, -6.20138811e-04f, -4.31664744e-04f, -2.40859759e-04f, - -4.93718861e-05f, 1.41183920e-04f, 3.29184443e-04f, 5.13049545e-04f, 6.91252710e-04f, 8.62329668e-04f, - 1.02486089e-03f, 1.17753306e-03f, 1.31912530e-03f, 1.44851584e-03f, 1.56468190e-03f, 1.66675270e-03f, - 1.75393226e-03f, 1.82562545e-03f, 1.88129935e-03f, 1.92062935e-03f, 1.94336360e-03f, 1.94946381e-03f, - 1.93898469e-03f, 1.91211060e-03f, 1.86925265e-03f, 1.81081128e-03f, 1.73745800e-03f, 1.64989979e-03f, - 1.54896085e-03f, 1.43565148e-03f, 1.31095906e-03f, 1.17607031e-03f, 1.03219054e-03f, 8.80596006e-04f, - 7.22634695e-04f, 5.59715925e-04f, 3.93223384e-04f, 2.24602808e-04f, 5.53223372e-05f, -1.13204206e-04f, - -2.79527886e-04f, -4.42273875e-04f, -6.00090187e-04f, -7.51646708e-04f, -8.95738714e-04f, -1.03117771e-03f, - -1.15687770e-03f, -1.27187587e-03f, -1.37523688e-03f, -1.46618576e-03f, -1.54403989e-03f, -1.60825931e-03f, - -1.65836399e-03f, -1.69405240e-03f, -1.71514183e-03f, -1.72154028e-03f, -1.71331327e-03f, -1.69063272e-03f, - -1.65381037e-03f, -1.60326168e-03f, -1.53948863e-03f, -1.46318779e-03f, -1.37503217e-03f, -1.27591969e-03f, - -1.16672308e-03f, -1.04846883e-03f, -9.22232848e-04f, -7.89108246e-04f, -6.50329911e-04f, -5.07057241e-04f, - -3.60579584e-04f, -2.12138548e-04f, -6.30166060e-05f, 8.55107333e-05f, 2.32212191e-04f, 3.75851456e-04f, - 5.15213418e-04f, 6.49182851e-04f, 7.76642588e-04f, 8.96585347e-04f, 1.00803198e-03f, 1.11010987e-03f, - 1.20203475e-03f, 1.28308439e-03f, 1.35268783e-03f, 1.41030687e-03f, 1.45558664e-03f, 1.48819124e-03f, - 1.50798717e-03f, 1.51486502e-03f, 1.50888467e-03f, 1.49022209e-03f, 1.45906012e-03f, 1.41583581e-03f, - 1.36095722e-03f, 1.29499749e-03f, 1.21859138e-03f, 1.13249419e-03f, 1.03745344e-03f, 9.34384957e-04f, - 8.24209226e-04f, 7.07921644e-04f, 5.86535461e-04f, 4.61118668e-04f, 3.32797940e-04f, 2.02615430e-04f, - 7.17560319e-05f, -5.87215139e-05f, -1.87700771e-04f, -3.14093799e-04f, -4.36855019e-04f, -5.54982470e-04f, - -6.67514567e-04f, -7.73539543e-04f, -8.72216549e-04f, -9.62754726e-04f, -1.04446836e-03f, -1.11673823e-03f, - -1.17901020e-03f, -1.23084835e-03f, -1.27191263e-03f, -1.30189831e-03f, -1.32066941e-03f, -1.32816613e-03f, - -1.32437715e-03f, -1.30944714e-03f, -1.28360668e-03f, -1.24710492e-03f, -1.20038313e-03f, -1.14391116e-03f, - -1.07822250e-03f, -1.00394823e-03f, -9.21799577e-04f, -8.32520513e-04f, -7.36916195e-04f, -6.35853312e-04f, - -5.30218398e-04f, -4.20950684e-04f, -3.08981087e-04f, -1.95310152e-04f, -8.08721649e-05f, 3.33481785e-05f, - 1.46369769e-04f, 2.57271691e-04f, 3.65123878e-04f, 4.69053422e-04f, 5.68205019e-04f, 6.61777482e-04f, - 7.49035427e-04f, 8.29295760e-04f, 9.01919035e-04f, 9.66370937e-04f, 1.02218113e-03f, 1.06892877e-03f, - 1.10630552e-03f, 1.13406370e-03f, 1.15204451e-03f, 1.16019052e-03f, 1.15848806e-03f, 1.14706630e-03f, - 1.12606449e-03f, 1.09574589e-03f, 1.05645362e-03f, 1.00859266e-03f, 9.52601766e-04f, 8.89057609e-04f, - 8.18535938e-04f, 7.41697389e-04f, 6.59241262e-04f, 5.71884368e-04f, 4.80414698e-04f, 3.85677252e-04f, - 2.88406796e-04f, 1.89536836e-04f, 8.98491837e-05f, -9.79888746e-06f, -1.08531507e-04f, -2.05575498e-04f, - -3.00092231e-04f, -3.91327952e-04f, -4.78537671e-04f, -5.61003964e-04f, -6.38090388e-04f, -7.09209697e-04f, - -7.73747838e-04f, -8.31297964e-04f, -8.81364804e-04f, -9.23641236e-04f, -9.57793553e-04f, -9.83624619e-04f, - -1.00098424e-03f, -1.00979404e-03f, -1.01003977e-03f, -1.00180772e-03f, -9.85219816e-04f, -9.60506778e-04f, - -9.27905874e-04f, -8.87790902e-04f, -8.40553609e-04f, -7.86632276e-04f, -7.26559669e-04f, -6.60872173e-04f, - -5.90177860e-04f, -5.15099219e-04f, -4.36341554e-04f, -3.54526447e-04f, -2.70436804e-04f, -1.84757234e-04f, - -9.82406108e-05f, -1.16228429e-05f, 7.44116225e-05f, 1.59099493e-04f, 2.41739119e-04f, 3.21707034e-04f, - 3.98276352e-04f, 4.70887555e-04f, 5.38973046e-04f, 6.01940918e-04f, 6.59368174e-04f, 7.10783030e-04f, - 7.55802336e-04f, 7.94127086e-04f, 8.25478803e-04f, 8.49639386e-04f, 8.66487952e-04f, 8.75935969e-04f, - 8.77948893e-04f, 8.72611584e-04f, 8.59994515e-04f, 8.40271458e-04f, 8.13696181e-04f, 7.80491851e-04f, - 7.41053306e-04f, 6.95727202e-04f, 6.44936090e-04f, 5.89181503e-04f, 5.28946796e-04f, 4.64790448e-04f, - 3.97272420e-04f, 3.27000597e-04f, 2.54559578e-04f, 1.80597276e-04f, 1.05760446e-04f, 3.06209047e-05f, - -4.41172003e-05f, -1.17884760e-04f, -1.90032814e-04f, -2.60000039e-04f, -3.27213235e-04f, -3.91110007e-04f, - -4.51226928e-04f, -5.07042112e-04f, -5.58194586e-04f, -6.04189222e-04f, -6.44816381e-04f, -6.79653847e-04f, - -7.08557315e-04f, -7.31282579e-04f, -7.47702169e-04f, -7.57731688e-04f, -7.61359812e-04f, -7.58589885e-04f, - -7.49503361e-04f, -7.34226582e-04f, -7.12935677e-04f, -6.85882645e-04f, -6.53307567e-04f, -6.15569562e-04f, - -5.72978650e-04f, -5.25977418e-04f, -4.74963705e-04f, -4.20426590e-04f, -3.62819514e-04f, -3.02647353e-04f, - -2.40497241e-04f, -1.76810216e-04f, -1.12210871e-04f, -4.71976690e-05f, 1.76624641e-05f, 8.18440593e-05f, - 1.44804207e-04f, 2.06021410e-04f, 2.65025446e-04f, 3.21327783e-04f, 3.74487008e-04f, 4.24062432e-04f, - 4.69715655e-04f, 5.11042943e-04f, 5.47794530e-04f, 5.79655168e-04f, 6.06446384e-04f, 6.27934546e-04f, - 6.44010762e-04f, 6.54614698e-04f, 6.59636425e-04f, 6.59157826e-04f, 6.53158826e-04f, 6.41794049e-04f, - 6.25154916e-04f, 6.03470855e-04f, 5.76917242e-04f, 5.45789736e-04f, 5.10368292e-04f, 4.70998661e-04f, - 4.28021656e-04f, 3.81834126e-04f, 3.32863326e-04f, 2.81489629e-04f, 2.28231239e-04f, 1.73484261e-04f, - 1.17756607e-04f, 6.14881351e-05f, 5.17778269e-06f, -5.07352374e-05f, -1.05745987e-04f, -1.59454662e-04f, - -2.11394268e-04f, -2.61151905e-04f, -3.08351703e-04f, -3.52598590e-04f, -3.93545002e-04f, -4.30916147e-04f, - -4.64387406e-04f, -4.93756593e-04f, -5.18755281e-04f, -5.39265493e-04f, -5.55137934e-04f, -5.66259303e-04f, - -5.72606783e-04f, -5.74140344e-04f, -5.70903292e-04f, -5.62934741e-04f, -5.50388898e-04f, -5.33351962e-04f, - -5.12028510e-04f, -4.86612455e-04f, -4.57392981e-04f, -4.24578939e-04f, -3.88503808e-04f, -3.49487518e-04f, - -3.07895836e-04f, -2.64036522e-04f, -2.18356445e-04f, -1.71198300e-04f, -1.22998901e-04f, -7.41392080e-05f, - -2.50280393e-05f, 2.38852047e-05f, 7.22663332e-05f, 1.19659647e-04f, 1.65718806e-04f, 2.10055385e-04f, - 2.52324173e-04f, 2.92190427e-04f, 3.29337577e-04f, 3.63510150e-04f, 3.94385715e-04f, 4.21803288e-04f, - 4.45519433e-04f, 4.65391876e-04f, 4.81270460e-04f, 4.93057625e-04f, 5.00688030e-04f, 5.04121708e-04f, - 5.03379627e-04f, 4.98485604e-04f, 4.89499566e-04f, 4.76539317e-04f, 4.59760023e-04f, 4.39274612e-04f, - 4.15334876e-04f, 3.88103885e-04f, 3.57902146e-04f, 3.24908089e-04f, 2.89490480e-04f, 2.51922687e-04f, - 2.12512220e-04f, 1.71637404e-04f, 1.29609890e-04f, 8.67866183e-05f, 4.35312276e-05f, 1.98808307e-07f, - -4.28589070e-05f, -8.52865394e-05f, -1.26765698e-04f, -1.66922292e-04f, -2.05456466e-04f, -2.42095652e-04f, - -2.76487494e-04f, -3.08425602e-04f, -3.37638832e-04f, -3.63923042e-04f, -3.87022898e-04f, -4.06875144e-04f, - -4.23245129e-04f, -4.36071615e-04f, -4.45236993e-04f, -4.50724682e-04f, -4.52491230e-04f, -4.50548104e-04f, - -4.44936790e-04f, -4.35725612e-04f, -4.22987381e-04f, -4.06882738e-04f, -3.87548587e-04f, -3.65123104e-04f, - -3.39860288e-04f, -3.11947486e-04f, -2.81618569e-04f, -2.49166817e-04f, -2.14824344e-04f, -1.78876370e-04f, - -1.41684861e-04f, -1.03466427e-04f, -6.45996088e-05f, -2.53738050e-05f, 1.39035721e-05f, 5.28977578e-05f, - 9.13010773e-05f, 1.28809554e-04f, 1.65139924e-04f, 2.00005346e-04f, 2.33095696e-04f, 2.64232233e-04f, - 2.93070034e-04f, 3.19508024e-04f, 3.43252648e-04f, 3.64165224e-04f, 3.82074036e-04f, 3.96868082e-04f, - 4.08408250e-04f, 4.16671952e-04f, 4.21556517e-04f, 4.23035822e-04f, 4.21172111e-04f, 4.15928838e-04f, - 4.07377025e-04f, 3.95568598e-04f, 3.80628038e-04f, 3.62729177e-04f, 3.41921136e-04f, 3.18489958e-04f, - 2.92497406e-04f, 2.64266550e-04f, 2.33955571e-04f, 2.01809261e-04f, 1.68092145e-04f, 1.33141461e-04f, - 9.71043460e-05f, 6.03452880e-05f, 2.31264055e-05f, -1.43105089e-05f, -5.15607083e-05f, -8.84833364e-05f, - -1.24679461e-04f, -1.59910519e-04f, -1.93952723e-04f, -2.26496145e-04f, -2.57307566e-04f, -2.86175538e-04f, - -3.12853472e-04f, -3.37140613e-04f, -3.58914997e-04f, -3.77932329e-04f, -3.94117065e-04f, -4.07317063e-04f, - -4.17422308e-04f, -4.24419479e-04f, -4.28161231e-04f, -4.28700484e-04f, -4.26016659e-04f, -4.20088126e-04f, - -4.11009185e-04f, -3.98835037e-04f, -3.83585114e-04f, -3.65493072e-04f, -3.44616197e-04f, -3.21064387e-04f, - -2.95119418e-04f, -2.66863117e-04f, -2.36549174e-04f, -2.04391686e-04f, -1.70585806e-04f, -1.35432614e-04f, - -9.91006984e-05f, -6.19152828e-05f, -2.41012311e-05f, 1.40621144e-05f, 5.22867497e-05f, 9.03199843e-05f, - 1.27917614e-04f, 1.64740292e-04f, 2.00634478e-04f, 2.35261402e-04f, 2.68377430e-04f, 2.99818019e-04f, - 3.29273634e-04f, 3.56562766e-04f, 3.81532332e-04f, 4.03948113e-04f, 4.23655375e-04f, 4.40488930e-04f, - 4.54376777e-04f, 4.65137195e-04f, 4.72679704e-04f, 4.77014073e-04f, 4.77982201e-04f, 4.75625277e-04f, - 4.69878507e-04f, 4.60802987e-04f, 4.48367418e-04f, 4.32641679e-04f, 4.13709630e-04f, 3.91634147e-04f, - 3.66512902e-04f, 3.38481392e-04f, 3.07634938e-04f, 2.74189182e-04f, 2.38229594e-04f, 1.99985879e-04f, - 1.59632210e-04f, 1.17351364e-04f, 7.33404728e-05f, 2.78844831e-05f, -1.89099461e-05f, -6.67343638e-05f, - -1.15367449e-04f, -1.64649983e-04f, -2.14224348e-04f, -2.64019844e-04f, -3.13654244e-04f, -3.62990333e-04f, - -4.11800705e-04f, -4.59821928e-04f, -5.06946486e-04f, -5.52847863e-04f, -5.97397068e-04f, -6.40454770e-04f, - -6.81765968e-04f, -7.21210131e-04f, -7.58634477e-04f, -7.93939572e-04f, -8.26964876e-04f, -8.57585335e-04f, - -8.85733438e-04f, -9.11351007e-04f, -9.34300512e-04f, -9.54617442e-04f, -9.72159416e-04f, -9.87012089e-04f, - -9.99095133e-04f, -1.00846242e-03f, -1.01506022e-03f, -1.01897105e-03f, -1.02021427e-03f, -1.01887259e-03f, - -1.01497557e-03f, -1.00861358e-03f, -9.99877741e-04f, -9.88823136e-04f, -9.75617693e-04f, -9.60303769e-04f, - -9.43035535e-04f, -9.23922797e-04f, -9.03105429e-04f, -8.80708716e-04f, -8.56853281e-04f, -8.31685264e-04f, - -8.05348207e-04f, -7.77961627e-04f, -7.49713086e-04f, -7.20674604e-04f, -6.91032783e-04f, -6.60888020e-04f, - -6.30372917e-04f, -5.99673349e-04f, -5.68830563e-04f, -5.38013304e-04f, -5.07353303e-04f, -4.76915043e-04f, - -4.46832926e-04f, -4.17179291e-04f, -3.88083307e-04f, -3.59575024e-04f, -3.31820735e-04f, -3.04804303e-04f, - -2.78616041e-04f, -2.53335964e-04f, -2.28986996e-04f, -2.05619529e-04f, -1.83318449e-04f, -1.61979425e-04f, - -1.41791423e-04f, -1.22648816e-04f, -1.04625498e-04f, -8.77122910e-05f, -7.18653457e-05f, -5.71787106e-05f, - -4.34807639e-05f, -3.09618857e-05f, -1.94074401e-05f, -8.88017971e-06f, 6.09625220e-07f, 9.14020334e-06f, - 1.67805558e-05f, 2.35369965e-05f, 2.94278194e-05f, 3.45049751e-05f, 3.88373828e-05f, 4.24291966e-05f, - 4.53445665e-05f, 4.76965834e-05f, 4.93395567e-05f, 5.05392111e-05f, 5.12257065e-05f, 5.14579340e-05f, - 5.12651750e-05f, 5.07312551e-05f, 4.98486765e-05f, 4.87082573e-05f, 4.73439631e-05f, 4.56740817e-05f, - 4.38653618e-05f, 4.19399075e-05f, 3.99125668e-05f, 3.77616021e-05f, 3.56135997e-05f, 3.33554815e-05f, - 3.11656899e-05f, 2.89038150e-05f, 2.67281634e-05f, 2.46192762e-05f, 2.24899205e-05f, 2.04698700e-05f, - 1.84927655e-05f, 1.66762886e-05f, 1.49393771e-05f, 1.32258081e-05f, 1.16985586e-05f, 1.01874391e-05f, - 8.99882100e-06f, 7.61267073e-06f, 6.57702907e-06f, 5.59829210e-06f, 4.27698546e-06f, 1.03248674e-05f, -}; +#include "AudioSRCData.h" // high/low part of int64_t #define LO32(a) ((uint32_t)(a)) diff --git a/libraries/audio/src/AudioSRCData.h b/libraries/audio/src/AudioSRCData.h new file mode 100644 index 0000000000..8ab868e898 --- /dev/null +++ b/libraries/audio/src/AudioSRCData.h @@ -0,0 +1,548 @@ +// +// AudioSRCData.h +// libraries/audio/src +// +// Created by Ken Cooke on 6/6/16. +// Copyright 2016 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 +// + +// +// Prototype filter coefficients for audio sampling rate conversion. +// +// See "Design of Optimal Minimum Phase Digital FIR Filters Using Discrete Hilbert Transforms" +// IEEE TRANSACTIONS ON SIGNAL PROCESSING, May 2000 +// +// Minimum-phase equiripple FIR lowpass +// taps = 96, phases = 32 +// +// passband = 0.918 (20.2khz @ 44.1khz sampling rate) +// stopband = 1.010 (22.2khz @ 44.1khz sampling rate) +// passband ripple = +-0.01dB +// stopband attn = -125dB (-70dB at 1.000) +// +// Resampling algorithm: +// One of two methods is used, depending on whether the conversion is reducible to a ratio of small integers L/M. +// For rational ratio, the prototype is upsampled to L/M polyphase filter using 3rd-order Lagrange interpolation. +// For irrational ratio, the prototype is upsampled to 256/M polyphase filter, followed by linear interpolation. +// For both cases, oversampling at each stage ensures the original passband and stopband specifications are met. +// +static const int PROTOTYPE_TAPS = 96; // filter taps per phase +static const int PROTOTYPE_PHASES = 32; // oversampling factor + +static const float prototypeFilter[PROTOTYPE_TAPS * PROTOTYPE_PHASES] = { + 0.00000000e+00f, 1.55021703e-05f, 1.46054865e-05f, 2.07057160e-05f, 2.91335519e-05f, 4.00091078e-05f, + 5.33544450e-05f, 7.03618468e-05f, 9.10821639e-05f, 1.16484613e-04f, 1.47165999e-04f, 1.84168304e-04f, + 2.28429617e-04f, 2.80913884e-04f, 3.42940399e-04f, 4.15773039e-04f, 5.01023255e-04f, 6.00234953e-04f, + 7.15133271e-04f, 8.47838855e-04f, 1.00032516e-03f, 1.17508881e-03f, 1.37452550e-03f, 1.60147614e-03f, + 1.85886458e-03f, 2.14985024e-03f, 2.47783071e-03f, 2.84666764e-03f, 3.26016878e-03f, 3.72252797e-03f, + 4.23825900e-03f, 4.81207874e-03f, 5.44904143e-03f, 6.15447208e-03f, 6.93399929e-03f, 7.79337059e-03f, + 8.73903392e-03f, 9.77729117e-03f, 1.09149561e-02f, 1.21591316e-02f, 1.35171164e-02f, 1.49965439e-02f, + 1.66053136e-02f, 1.83515384e-02f, 2.02435362e-02f, 2.22899141e-02f, 2.44995340e-02f, 2.68813362e-02f, + 2.94443254e-02f, 3.21979928e-02f, 3.51514690e-02f, 3.83143719e-02f, 4.16960560e-02f, 4.53060504e-02f, + 4.91538115e-02f, 5.32486197e-02f, 5.75998650e-02f, 6.22164253e-02f, 6.71072811e-02f, 7.22809789e-02f, + 7.77457552e-02f, 8.35095233e-02f, 8.95796944e-02f, 9.59631768e-02f, 1.02666457e-01f, 1.09695215e-01f, + 1.17054591e-01f, 1.24748885e-01f, 1.32781656e-01f, 1.41155521e-01f, 1.49872243e-01f, 1.58932534e-01f, + 1.68335961e-01f, 1.78081143e-01f, 1.88165339e-01f, 1.98584621e-01f, 2.09333789e-01f, 2.20406193e-01f, + 2.31793899e-01f, 2.43487398e-01f, 2.55475740e-01f, 2.67746404e-01f, 2.80285305e-01f, 2.93076743e-01f, + 3.06103423e-01f, 3.19346351e-01f, 3.32784916e-01f, 3.46396772e-01f, 3.60158039e-01f, 3.74043042e-01f, + 3.88024564e-01f, 4.02073759e-01f, 4.16160177e-01f, 4.30251886e-01f, 4.44315429e-01f, 4.58315954e-01f, + 4.72217175e-01f, 4.85981675e-01f, 4.99570709e-01f, 5.12944586e-01f, 5.26062401e-01f, 5.38882630e-01f, + 5.51362766e-01f, 5.63459860e-01f, 5.75130384e-01f, 5.86330458e-01f, 5.97016050e-01f, 6.07143161e-01f, + 6.16667840e-01f, 6.25546499e-01f, 6.33735979e-01f, 6.41193959e-01f, 6.47878856e-01f, 6.53750084e-01f, + 6.58768549e-01f, 6.62896349e-01f, 6.66097381e-01f, 6.68337353e-01f, 6.69583869e-01f, 6.69807061e-01f, + 6.68979117e-01f, 6.67075139e-01f, 6.64072812e-01f, 6.59952827e-01f, 6.54699116e-01f, 6.48298688e-01f, + 6.40742160e-01f, 6.32023668e-01f, 6.22141039e-01f, 6.11095903e-01f, 5.98893921e-01f, 5.85544600e-01f, + 5.71061707e-01f, 5.55463040e-01f, 5.38770639e-01f, 5.21010762e-01f, 5.02213839e-01f, 4.82414572e-01f, + 4.61651859e-01f, 4.39968628e-01f, 4.17412000e-01f, 3.94032951e-01f, 3.69886464e-01f, 3.45031084e-01f, + 3.19529091e-01f, 2.93446187e-01f, 2.66851164e-01f, 2.39815999e-01f, 2.12415399e-01f, 1.84726660e-01f, + 1.56829293e-01f, 1.28804933e-01f, 1.00736965e-01f, 7.27100355e-02f, 4.48100810e-02f, 1.71237415e-02f, + -1.02620228e-02f, -3.72599591e-02f, -6.37832871e-02f, -8.97457733e-02f, -1.15062201e-01f, -1.39648782e-01f, + -1.63423488e-01f, -1.86306368e-01f, -2.08220103e-01f, -2.29090072e-01f, -2.48845046e-01f, -2.67417270e-01f, + -2.84742946e-01f, -3.00762597e-01f, -3.15421127e-01f, -3.28668542e-01f, -3.40459849e-01f, -3.50755400e-01f, + -3.59521402e-01f, -3.66729768e-01f, -3.72358475e-01f, -3.76391839e-01f, -3.78820421e-01f, -3.79641287e-01f, + -3.78858203e-01f, -3.76481336e-01f, -3.72527677e-01f, -3.67020780e-01f, -3.59990760e-01f, -3.51474372e-01f, + -3.41514630e-01f, -3.30160971e-01f, -3.17468898e-01f, -3.03499788e-01f, -2.88320749e-01f, -2.72004315e-01f, + -2.54628056e-01f, -2.36274454e-01f, -2.17030464e-01f, -1.96986952e-01f, -1.76238733e-01f, -1.54883647e-01f, + -1.33022496e-01f, -1.10758449e-01f, -8.81964466e-02f, -6.54430504e-02f, -4.26055475e-02f, -1.97916415e-02f, + 2.89108184e-03f, 2.53355868e-02f, 4.74362201e-02f, 6.90887518e-02f, 9.01914308e-02f, 1.10644978e-01f, + 1.30353494e-01f, 1.49224772e-01f, 1.67170735e-01f, 1.84107975e-01f, 1.99958067e-01f, 2.14648181e-01f, + 2.28111323e-01f, 2.40286622e-01f, 2.51119890e-01f, 2.60563701e-01f, 2.68577740e-01f, 2.75129027e-01f, + 2.80192144e-01f, 2.83749177e-01f, 2.85790223e-01f, 2.86312986e-01f, 2.85323221e-01f, 2.82834421e-01f, + 2.78867915e-01f, 2.73452721e-01f, 2.66625431e-01f, 2.58429983e-01f, 2.48917457e-01f, 2.38145826e-01f, + 2.26179680e-01f, 2.13089734e-01f, 1.98952740e-01f, 1.83850758e-01f, 1.67870897e-01f, 1.51104879e-01f, + 1.33648388e-01f, 1.15600665e-01f, 9.70639763e-02f, 7.81429119e-02f, 5.89439889e-02f, 3.95749746e-02f, + 2.01442353e-02f, 7.60241152e-04f, -1.84690990e-02f, -3.74370397e-02f, -5.60385970e-02f, -7.41711039e-02f, + -9.17348686e-02f, -1.08633632e-01f, -1.24775254e-01f, -1.40071993e-01f, -1.54441372e-01f, -1.67806284e-01f, + -1.80095654e-01f, -1.91244732e-01f, -2.01195605e-01f, -2.09897310e-01f, -2.17306320e-01f, -2.23386736e-01f, + -2.28110407e-01f, -2.31457193e-01f, -2.33415044e-01f, -2.33980051e-01f, -2.33156463e-01f, -2.30956673e-01f, + -2.27401097e-01f, -2.22518148e-01f, -2.16343899e-01f, -2.08921985e-01f, -2.00303365e-01f, -1.90545790e-01f, + -1.79713804e-01f, -1.67877977e-01f, -1.55114789e-01f, -1.41505907e-01f, -1.27137921e-01f, -1.12101628e-01f, + -9.64915640e-02f, -8.04054232e-02f, -6.39434707e-02f, -4.72078814e-02f, -3.03021635e-02f, -1.33305082e-02f, + 3.60284977e-03f, 2.03942507e-02f, 3.69413014e-02f, 5.31433810e-02f, 6.89024656e-02f, 8.41234679e-02f, + 9.87150268e-02f, 1.12589969e-01f, 1.25665865e-01f, 1.37865538e-01f, 1.49117506e-01f, 1.59356490e-01f, + 1.68523664e-01f, 1.76567229e-01f, 1.83442499e-01f, 1.89112308e-01f, 1.93547212e-01f, 1.96725586e-01f, + 1.98633878e-01f, 1.99266486e-01f, 1.98625999e-01f, 1.96723008e-01f, 1.93576075e-01f, 1.89211557e-01f, + 1.83663562e-01f, 1.76973516e-01f, 1.69190033e-01f, 1.60368490e-01f, 1.50570805e-01f, 1.39864815e-01f, + 1.28324021e-01f, 1.16026978e-01f, 1.03056879e-01f, 8.95008829e-02f, 7.54496798e-02f, 6.09968238e-02f, + 4.62380664e-02f, 3.12708901e-02f, 1.61936956e-02f, 1.10531988e-03f, -1.38957653e-02f, -2.87119784e-02f, + -4.32472742e-02f, -5.74078385e-02f, -7.11026311e-02f, -8.42439713e-02f, -9.67481917e-02f, -1.08536049e-01f, + -1.19533350e-01f, -1.29671345e-01f, -1.38887238e-01f, -1.47124498e-01f, -1.54333373e-01f, -1.60470968e-01f, + -1.65501755e-01f, -1.69397631e-01f, -1.72138140e-01f, -1.73710602e-01f, -1.74110159e-01f, -1.73339798e-01f, + -1.71410274e-01f, -1.68340111e-01f, -1.64155335e-01f, -1.58889414e-01f, -1.52582850e-01f, -1.45283122e-01f, + -1.37044042e-01f, -1.27925722e-01f, -1.17993860e-01f, -1.07319421e-01f, -9.59781808e-02f, -8.40500777e-02f, + -7.16188049e-02f, -5.87710561e-02f, -4.55961475e-02f, -3.21851919e-02f, -1.86306406e-02f, -5.02554942e-03f, + 8.53698384e-03f, 2.19645467e-02f, 3.51659468e-02f, 4.80518693e-02f, 6.05355056e-02f, 7.25330700e-02f, + 8.39645094e-02f, 9.47537898e-02f, 1.04829753e-01f, 1.14126254e-01f, 1.22582788e-01f, 1.30144907e-01f, + 1.36764459e-01f, 1.42400029e-01f, 1.47017076e-01f, 1.50588312e-01f, 1.53093700e-01f, 1.54520736e-01f, + 1.54864367e-01f, 1.54127119e-01f, 1.52318991e-01f, 1.49457408e-01f, 1.45567062e-01f, 1.40679709e-01f, + 1.34833933e-01f, 1.28074855e-01f, 1.20453893e-01f, 1.12028129e-01f, 1.02860307e-01f, 9.30178765e-02f, + 8.25730032e-02f, 7.16016450e-02f, 6.01833134e-02f, 4.84002546e-02f, 3.63370724e-02f, 2.40800037e-02f, + 1.17163168e-02f, -6.66217400e-04f, -1.29801121e-02f, -2.51385315e-02f, -3.70562030e-02f, -4.86497748e-02f, + -5.98384928e-02f, -7.05447859e-02f, -8.06947592e-02f, -9.02187441e-02f, -9.90517313e-02f, -1.07133911e-01f, + -1.14410951e-01f, -1.20834483e-01f, -1.26362422e-01f, -1.30959116e-01f, -1.34595787e-01f, -1.37250547e-01f, + -1.38908600e-01f, -1.39562374e-01f, -1.39211442e-01f, -1.37862602e-01f, -1.35529795e-01f, -1.32233909e-01f, + -1.28002721e-01f, -1.22870611e-01f, -1.16878278e-01f, -1.10072477e-01f, -1.02505698e-01f, -9.42356124e-02f, + -8.53248753e-02f, -7.58404912e-02f, -6.58532924e-02f, -5.54376360e-02f, -4.46705953e-02f, -3.36315414e-02f, + -2.24015972e-02f, -1.10628991e-02f, 3.01894735e-04f, 1.16101918e-02f, 2.27801642e-02f, 3.37311642e-02f, + 4.43845430e-02f, 5.46640016e-02f, 6.44962637e-02f, 7.38115400e-02f, 8.25440784e-02f, 9.06325572e-02f, + 9.80206066e-02f, 1.04657146e-01f, 1.10496723e-01f, 1.15499920e-01f, 1.19633523e-01f, 1.22870824e-01f, + 1.25191729e-01f, 1.26582959e-01f, 1.27038061e-01f, 1.26557494e-01f, 1.25148528e-01f, 1.22825305e-01f, + 1.19608512e-01f, 1.15525479e-01f, 1.10609643e-01f, 1.04900592e-01f, 9.84435537e-02f, 9.12890948e-02f, + 8.34927732e-02f, 7.51146973e-02f, 6.62190194e-02f, 5.68735547e-02f, 4.71491262e-02f, 3.71191855e-02f, + 2.68591932e-02f, 1.64459573e-02f, 5.95731808e-03f, -4.52874940e-03f, -1.49344723e-02f, -2.51829130e-02f, + -3.51986373e-02f, -4.49081427e-02f, -5.42404654e-02f, -6.31276969e-02f, -7.15054163e-02f, -7.93132713e-02f, + -8.64953327e-02f, -9.30005042e-02f, -9.87829011e-02f, -1.03802223e-01f, -1.08023943e-01f, -1.11419636e-01f, + -1.13967111e-01f, -1.15650603e-01f, -1.16460855e-01f, -1.16395152e-01f, -1.15457368e-01f, -1.13657871e-01f, + -1.11013433e-01f, -1.07547117e-01f, -1.03288073e-01f, -9.82712708e-02f, -9.25372646e-02f, -8.61318657e-02f, + -7.91057486e-02f, -7.15141053e-02f, -6.34161588e-02f, -5.48747791e-02f, -4.59559696e-02f, -3.67282941e-02f, + -2.72624874e-02f, -1.76307914e-02f, -7.90648674e-03f, 1.83670340e-03f, 1.15251424e-02f, 2.10858716e-02f, + 3.04471304e-02f, 3.95388944e-02f, 4.82933904e-02f, 5.66456655e-02f, 6.45340054e-02f, 7.19003487e-02f, + 7.86908695e-02f, 8.48562395e-02f, 9.03519908e-02f, 9.51389501e-02f, 9.91834077e-02f, 1.02457361e-01f, + 1.04938834e-01f, 1.06611872e-01f, 1.07466724e-01f, 1.07499917e-01f, 1.06714213e-01f, 1.05118588e-01f, + 1.02728167e-01f, 9.95640680e-02f, 9.56532488e-02f, 9.10282406e-02f, 8.57269309e-02f, 7.97922261e-02f, + 7.32717395e-02f, 6.62174249e-02f, 5.86850536e-02f, 5.07339959e-02f, 4.24265058e-02f, 3.38274345e-02f, + 2.50036502e-02f, 1.60234844e-02f, 6.95628026e-03f, -2.12820655e-03f, -1.11602438e-02f, -2.00708281e-02f, + -2.87920337e-02f, -3.72576320e-02f, -4.54035426e-02f, -5.31684173e-02f, -6.04938939e-02f, -6.73253212e-02f, + -7.36119310e-02f, -7.93072981e-02f, -8.43697556e-02f, -8.87625537e-02f, -9.24542939e-02f, -9.54189981e-02f, + -9.76364402e-02f, -9.90921435e-02f, -9.97776003e-02f, -9.96902366e-02f, -9.88334463e-02f, -9.72165780e-02f, + -9.48547668e-02f, -9.17688999e-02f, -8.79853312e-02f, -8.35357688e-02f, -7.84569594e-02f, -7.27903677e-02f, + -6.65818940e-02f, -5.98814932e-02f, -5.27427333e-02f, -4.52224733e-02f, -3.73802459e-02f, -2.92780037e-02f, + -2.09794209e-02f, -1.25495498e-02f, -4.05425988e-03f, 4.44034349e-03f, 1.28682571e-02f, 2.11643361e-02f, + 2.92645357e-02f, 3.71066200e-02f, 4.46305203e-02f, 5.17788267e-02f, 5.84972389e-02f, 6.47349496e-02f, + 7.04450836e-02f, 7.55849928e-02f, 8.01165748e-02f, 8.40066506e-02f, 8.72270848e-02f, 8.97550618e-02f, + 9.15732179e-02f, 9.26698315e-02f, 9.30387881e-02f, 9.26796720e-02f, 9.15978025e-02f, 8.98040443e-02f, + 8.73148489e-02f, 8.41520461e-02f, 8.03426093e-02f, 7.59185468e-02f, 7.09165136e-02f, 6.53776255e-02f, + 5.93470480e-02f, 5.28736293e-02f, 4.60095655e-02f, 3.88099545e-02f, 3.13323302e-02f, 2.36362162e-02f, + 1.57827398e-02f, 7.83395091e-03f, -1.47413782e-04f, -8.09864153e-03f, -1.59574406e-02f, -2.36623595e-02f, + -3.11534717e-02f, -3.83725840e-02f, -4.52638947e-02f, -5.17743411e-02f, -5.78539729e-02f, -6.34564348e-02f, + -6.85392092e-02f, -7.30640654e-02f, -7.69971954e-02f, -8.03096220e-02f, -8.29772975e-02f, -8.49813524e-02f, + -8.63081836e-02f, -8.69495746e-02f, -8.69027157e-02f, -8.61702687e-02f, -8.47602668e-02f, -8.26860569e-02f, + -7.99661981e-02f, -7.66242997e-02f, -7.26887788e-02f, -6.81926752e-02f, -6.31733712e-02f, -5.76722279e-02f, + -5.17343061e-02f, -4.54080069e-02f, -3.87446321e-02f, -3.17980032e-02f, -2.46239897e-02f, -1.72801497e-02f, + -9.82518156e-03f, -2.31845300e-03f, 5.18037510e-03f, 1.26119044e-02f, 1.99174857e-02f, 2.70395921e-02f, + 3.39223499e-02f, 4.05119404e-02f, 4.67570465e-02f, 5.26092142e-02f, 5.80232695e-02f, 6.29576539e-02f, + 6.73747113e-02f, 7.12410320e-02f, 7.45276905e-02f, 7.72104218e-02f, 7.92698394e-02f, 8.06915952e-02f, + 8.14664004e-02f, 8.15901977e-02f, 8.10640907e-02f, 7.98943315e-02f, 7.80922975e-02f, 7.56743792e-02f, + 7.26617861e-02f, 6.90804346e-02f, 6.49606433e-02f, 6.03370049e-02f, 5.52479503e-02f, 4.97355660e-02f, + 4.38451300e-02f, 3.76248662e-02f, 3.11254263e-02f, 2.43995757e-02f, 1.75017105e-02f, 1.04874823e-02f, + 3.41321948e-03f, -3.66433362e-03f, -1.06886566e-02f, -1.76037566e-02f, -2.43547422e-02f, -3.08881238e-02f, + -3.71523818e-02f, -4.30982377e-02f, -4.86791529e-02f, -5.38515978e-02f, -5.85754991e-02f, -6.28144137e-02f, + -6.65359631e-02f, -6.97119559e-02f, -7.23186409e-02f, -7.43369897e-02f, -7.57526047e-02f, -7.65560812e-02f, + -7.67428560e-02f, -7.63134051e-02f, -7.52730583e-02f, -7.36321241e-02f, -7.14055927e-02f, -6.86132027e-02f, + -6.52791213e-02f, -6.14318004e-02f, -5.71037475e-02f, -5.23312158e-02f, -4.71539306e-02f, -4.16147519e-02f, + -3.57593331e-02f, -2.96357023e-02f, -2.32939478e-02f, -1.67857228e-02f, -1.01639251e-02f, -3.48213128e-03f, + 3.20566951e-03f, 9.84566549e-03f, 1.63845318e-02f, 2.27699627e-02f, 2.89509937e-02f, 3.48784838e-02f, + 4.05054571e-02f, 4.57875191e-02f, 5.06831561e-02f, 5.51541055e-02f, 5.91656321e-02f, 6.26867948e-02f, + 6.56907214e-02f, 6.81547545e-02f, 7.00607045e-02f, 7.13948753e-02f, 7.21482790e-02f, 7.23165894e-02f, + 7.19002973e-02f, 7.09044846e-02f, 6.93390331e-02f, 6.72183039e-02f, 6.45611568e-02f, 6.13906537e-02f, + 5.77340810e-02f, 5.36223917e-02f, 4.90902973e-02f, 4.41756853e-02f, 3.89195025e-02f, 3.33653266e-02f, + 2.75589553e-02f, 2.15482187e-02f, 1.53823433e-02f, 9.11173206e-03f, 2.78750380e-03f, -3.53899736e-03f, + -9.81648845e-03f, -1.59942887e-02f, -2.20226002e-02f, -2.78530676e-02f, -3.34389835e-02f, -3.87358558e-02f, + -4.37015752e-02f, -4.82968641e-02f, -5.24856104e-02f, -5.62350079e-02f, -5.95160314e-02f, -6.23034090e-02f, + -6.45760369e-02f, -6.63170246e-02f, -6.75138263e-02f, -6.81583864e-02f, -6.82471093e-02f, -6.77809819e-02f, + -6.67654439e-02f, -6.52104027e-02f, -6.31301405e-02f, -6.05431381e-02f, -5.74719510e-02f, -5.39430121e-02f, + -4.99864152e-02f, -4.56356108e-02f, -4.09271785e-02f, -3.59005358e-02f, -3.05975021e-02f, -2.50620982e-02f, + -1.93400931e-02f, -1.34786109e-02f, -7.52582921e-03f, -1.53047296e-03f, 4.45846396e-03f, 1.03922252e-02f, + 1.62226043e-02f, 2.19024111e-02f, 2.73857927e-02f, 3.26286453e-02f, 3.75889120e-02f, 4.22270162e-02f, + 4.65060678e-02f, 5.03922602e-02f, 5.38550360e-02f, 5.68673912e-02f, 5.94061299e-02f, 6.14518959e-02f, + 6.29894927e-02f, 6.40078422e-02f, 6.45002081e-02f, 6.44641312e-02f, 6.39014463e-02f, 6.28183549e-02f, + 6.12252434e-02f, 5.91366226e-02f, 5.65710713e-02f, 5.35509478e-02f, 5.01023211e-02f, 4.62546289e-02f, + 4.20405644e-02f, 3.74956324e-02f, 3.26580309e-02f, 2.75681921e-02f, 2.22685138e-02f, 1.68029869e-02f, + 1.12168479e-02f, 5.55616360e-03f, -1.32475496e-04f, -5.80242145e-03f, -1.14072870e-02f, -1.69013632e-02f, + -2.22399629e-02f, -2.73798231e-02f, -3.22793559e-02f, -3.68992177e-02f, -4.12022700e-02f, -4.51542301e-02f, + -4.87237130e-02f, -5.18825743e-02f, -5.46061242e-02f, -5.68733215e-02f, -5.86668721e-02f, -5.99735198e-02f, + -6.07838952e-02f, -6.10928895e-02f, -6.08993923e-02f, -6.02064781e-02f, -5.90213291e-02f, -5.73550887e-02f, + -5.52228853e-02f, -5.26435817e-02f, -4.96396897e-02f, -4.62371294e-02f, -4.24650256e-02f, -3.83554628e-02f, + -3.39432096e-02f, -2.92654225e-02f, -2.43613233e-02f, -1.92718970e-02f, -1.40395616e-02f, -8.70771728e-03f, + -3.32056777e-03f, 2.07744785e-03f, 7.44190391e-03f, 1.27287222e-02f, 1.78946228e-02f, 2.28975002e-02f, + 2.76965843e-02f, 3.22530140e-02f, 3.65299534e-02f, 4.04930363e-02f, 4.41105069e-02f, 4.73536159e-02f, + 5.01967201e-02f, 5.26175750e-02f, 5.45974724e-02f, 5.61213729e-02f, 5.71780843e-02f, 5.77601946e-02f, + 5.78643759e-02f, 5.74910914e-02f, 5.66448597e-02f, 5.53340158e-02f, 5.35707338e-02f, 5.13708843e-02f, + 4.87538683e-02f, 4.57425137e-02f, 4.23627999e-02f, 3.86437075e-02f, 3.46169024e-02f, 3.03165387e-02f, + 2.57788894e-02f, 2.10421222e-02f, 1.61459251e-02f, 1.11311994e-02f, 6.03970466e-03f, 9.13695817e-04f, + -4.20433431e-03f, -9.27218149e-03f, -1.42480682e-02f, -1.90911878e-02f, -2.37618648e-02f, -2.82220093e-02f, + -3.24353766e-02f, -3.63678336e-02f, -3.99876924e-02f, -4.32659237e-02f, -4.61764207e-02f, -4.86961602e-02f, + -5.08054551e-02f, -5.24880386e-02f, -5.37312181e-02f, -5.45260166e-02f, -5.48671104e-02f, -5.47530531e-02f, + -5.41860463e-02f, -5.31721475e-02f, -5.17210363e-02f, -4.98459868e-02f, -4.75637647e-02f, -4.48944406e-02f, + -4.18612746e-02f, -3.84904206e-02f, -3.48107925e-02f, -3.08537797e-02f, -2.66529685e-02f, -2.22438695e-02f, + -1.76636682e-02f, -1.29507560e-02f, -8.14466071e-03f, -3.28544776e-03f, 1.58643018e-03f, 6.43050440e-03f, + 1.12067405e-02f, 1.58756642e-02f, 2.03989020e-02f, 2.47393345e-02f, 2.88614617e-02f, 3.27317634e-02f, + 3.63187992e-02f, 3.95936470e-02f, 4.25300387e-02f, 4.51045672e-02f, 4.72968940e-02f, 4.90899703e-02f, + 5.04700047e-02f, 5.14267809e-02f, 5.19535643e-02f, 5.20472034e-02f, 5.17082287e-02f, 5.09406434e-02f, + 4.97521048e-02f, 4.81537188e-02f, 4.61599131e-02f, 4.37884262e-02f, 4.10600706e-02f, 3.79985488e-02f, + 3.46302622e-02f, 3.09841217e-02f, 2.70912412e-02f, 2.29847199e-02f, 1.86992847e-02f, 1.42711599e-02f, + 9.73752669e-03f, 5.13643650e-03f, 5.06379454e-04f, -4.11408166e-03f, -8.68649476e-03f, -1.31729621e-02f, + -1.75363807e-02f, -2.17408089e-02f, -2.57516979e-02f, -2.95362143e-02f, -3.30635093e-02f, -3.63049622e-02f, + -3.92344048e-02f, -4.18283298e-02f, -4.40661418e-02f, -4.59301913e-02f, -4.74060505e-02f, -4.84825511e-02f, + -4.91518827e-02f, -4.94096235e-02f, -4.92548579e-02f, -4.86900251e-02f, -4.77210458e-02f, -4.63571741e-02f, + -4.46108878e-02f, -4.24979107e-02f, -4.00368564e-02f, -3.72492987e-02f, -3.41594108e-02f, -3.07938448e-02f, + -2.71814552e-02f, -2.33531198e-02f, -1.93413598e-02f, -1.51802063e-02f, -1.09048013e-02f, -6.55114338e-03f, + -2.15581014e-03f, 2.24443555e-03f, 6.61280814e-03f, 1.09129453e-02f, 1.51091980e-02f, 1.91667630e-02f, + 2.30522168e-02f, 2.67335907e-02f, 3.01807365e-02f, 3.33655579e-02f, 3.62622051e-02f, 3.88473226e-02f, + 4.11002204e-02f, 4.30030300e-02f, 4.45408790e-02f, 4.57019705e-02f, 4.64777109e-02f, 4.68627135e-02f, + 4.68549093e-02f, 4.64554958e-02f, 4.56689373e-02f, 4.45029599e-02f, 4.29683919e-02f, 4.10791386e-02f, + 3.88520159e-02f, 3.63066475e-02f, 3.34652385e-02f, 3.03523892e-02f, 2.69949681e-02f, 2.34217263e-02f, + 1.96632025e-02f, 1.57513974e-02f, 1.17194459e-02f, 7.60145677e-03f, 3.43215481e-03f, -7.53454950e-04f, + -4.92025229e-03f, -9.03345904e-03f, -1.30587503e-02f, -1.69627406e-02f, -2.07130441e-02f, -2.42787472e-02f, + -2.76304969e-02f, -3.07408842e-02f, -3.35845310e-02f, -3.61384026e-02f, -3.83819804e-02f, -4.02973364e-02f, + -4.18693911e-02f, -4.30859849e-02f, -4.39379525e-02f, -4.44192202e-02f, -4.45268207e-02f, -4.42609489e-02f, + -4.36249417e-02f, -4.26251693e-02f, -4.12710965e-02f, -3.95751119e-02f, -3.75524034e-02f, -3.52209020e-02f, + -3.26010732e-02f, -2.97156826e-02f, -2.65897306e-02f, -2.32501339e-02f, -1.97255230e-02f, -1.60459906e-02f, + -1.22428645e-02f, -8.34840613e-03f, -4.39555788e-03f, -4.17641093e-04f, 3.55186529e-03f, 7.47969548e-03f, + 1.13330289e-02f, 1.50796895e-02f, 1.86886063e-02f, 2.21298440e-02f, 2.53750227e-02f, 2.83974776e-02f, + 3.11724713e-02f, 3.36774564e-02f, 3.58921485e-02f, 3.77988281e-02f, 3.93823848e-02f, 4.06304645e-02f, + 4.15335460e-02f, 4.20850895e-02f, 4.22814530e-02f, 4.21220657e-02f, 4.16092724e-02f, 4.07484568e-02f, + 3.95478256e-02f, 3.80185099e-02f, 3.61742882e-02f, 3.40316228e-02f, 3.16093467e-02f, 2.89286854e-02f, + 2.60129143e-02f, 2.28872072e-02f, 1.95785162e-02f, 1.61151429e-02f, 1.25266872e-02f, 8.84367289e-03f, + 5.09737541e-03f, 1.31946573e-03f, -2.45819207e-03f, -6.20382907e-03f, -9.88599514e-03f, -1.34739714e-02f, + -1.69377975e-02f, -2.02487225e-02f, -2.33793144e-02f, -2.63038233e-02f, -2.89981802e-02f, -3.14404213e-02f, + -3.36107546e-02f, -3.54916723e-02f, -3.70682427e-02f, -3.83280672e-02f, -3.92614736e-02f, -3.98615776e-02f, + -4.01243243e-02f, -4.00484517e-02f, -3.96356708e-02f, -3.88903731e-02f, -3.78198781e-02f, -3.64341365e-02f, + -3.47457457e-02f, -3.27698392e-02f, -3.05238882e-02f, -2.80276282e-02f, -2.53028218e-02f, -2.23730957e-02f, + -1.92637467e-02f, -1.60015029e-02f, -1.26142882e-02f, -9.13104283e-03f, -5.58138981e-03f, -1.99542434e-03f, + 1.59649307e-03f, 5.16408174e-03f, 8.67737144e-03f, 1.21068581e-02f, 1.54239205e-02f, 1.86009100e-02f, + 2.16114772e-02f, 2.44306994e-02f, 2.70354163e-02f, 2.94042665e-02f, 3.15179985e-02f, 3.33595356e-02f, + 3.49141593e-02f, 3.61696229e-02f, 3.71161871e-02f, 3.77468512e-02f, 3.80571878e-02f, 3.80455485e-02f, + 3.77129900e-02f, 3.70632810e-02f, 3.61028508e-02f, 3.48407199e-02f, 3.32884428e-02f, 3.14600053e-02f, + 2.93716228e-02f, 2.70417408e-02f, 2.44907277e-02f, 2.17407576e-02f, 1.88156734e-02f, 1.57406803e-02f, + 1.25421761e-02f, 9.24754692e-03f, 5.88488640e-03f, 2.48280587e-03f, -9.29864758e-04f, -4.32426314e-03f, + -7.67179184e-03f, -1.09442952e-02f, -1.41143886e-02f, -1.71555974e-02f, -2.00425787e-02f, -2.27514891e-02f, + -2.52599054e-02f, -2.75472706e-02f, -2.95949315e-02f, -3.13863062e-02f, -3.29069832e-02f, -3.41450096e-02f, + -3.50907101e-02f, -3.57369992e-02f, -3.60793163e-02f, -3.61156751e-02f, -3.58467080e-02f, -3.52755740e-02f, + -3.44080617e-02f, -3.32523628e-02f, -3.18191314e-02f, -3.01213186e-02f, -2.81740846e-02f, -2.59946393e-02f, + -2.36021125e-02f, -2.10173975e-02f, -1.82629132e-02f, -1.53624700e-02f, -1.23410560e-02f, -9.22456599e-03f, + -6.03967755e-03f, -2.81350877e-03f, 4.26514319e-04f, 3.65292660e-03f, 6.83848944e-03f, 9.95638508e-03f, + 1.29804234e-02f, 1.58853076e-02f, 1.86468203e-02f, 2.12420277e-02f, 2.36494909e-02f, 2.58493792e-02f, + 2.78237450e-02f, 2.95565060e-02f, 3.10338053e-02f, 3.22438572e-02f, 3.31772716e-02f, 3.38269627e-02f, + 3.41883176e-02f, 3.42591610e-02f, 3.40397435e-02f, 3.35328606e-02f, 3.27436351e-02f, 3.16796573e-02f, + 3.03507246e-02f, 2.87689689e-02f, 2.69484839e-02f, 2.49054827e-02f, 2.26579086e-02f, 2.02254442e-02f, + 1.76292617e-02f, 1.48918382e-02f, 1.20368159e-02f, 9.08872468e-03f, 6.07283273e-03f, 3.01489838e-03f, + -5.90212194e-05f, -3.12287666e-03f, -6.15069532e-03f, -9.11695091e-03f, -1.19967033e-02f, -1.47657868e-02f, + -1.74011004e-02f, -1.98807214e-02f, -2.21841025e-02f, -2.42922632e-02f, -2.61879368e-02f, -2.78557311e-02f, + -2.92821801e-02f, -3.04559562e-02f, -3.13678907e-02f, -3.20110632e-02f, -3.23808087e-02f, -3.24749193e-02f, + -3.22933847e-02f, -3.18386269e-02f, -3.11153366e-02f, -3.01304804e-02f, -2.88932552e-02f, -2.74148734e-02f, + -2.57086673e-02f, -2.37898314e-02f, -2.16752343e-02f, -1.93835013e-02f, -1.69345799e-02f, -1.43497284e-02f, + -1.16513243e-02f, -8.86259097e-03f, -6.00748525e-03f, -3.11044903e-03f, -1.96143386e-04f, 2.71056658e-03f, + 5.58512222e-03f, 8.40318833e-03f, 1.11410160e-02f, 1.37756382e-02f, 1.62850338e-02f, 1.86482666e-02f, + 2.08457445e-02f, 2.28593437e-02f, 2.46725329e-02f, 2.62705694e-02f, 2.76405329e-02f, 2.87715470e-02f, + 2.96547092e-02f, 3.02833419e-02f, 3.06529059e-02f, 3.07610441e-02f, 3.06076742e-02f, 3.01949567e-02f, + 2.95271502e-02f, 2.86107876e-02f, 2.74543883e-02f, 2.60685701e-02f, 2.44657863e-02f, 2.26603655e-02f, + 2.06682557e-02f, 1.85070033e-02f, 1.61954603e-02f, 1.37537720e-02f, 1.12030588e-02f, 8.56537064e-03f, + 5.86336215e-03f, 3.12021752e-03f, 3.59345288e-04f, -2.39571357e-03f, -5.12158252e-03f, -7.79518527e-03f, + -1.03939536e-02f, -1.28961026e-02f, -1.52805838e-02f, -1.75275761e-02f, -1.96183935e-02f, -2.15357712e-02f, + -2.32639542e-02f, -2.47888545e-02f, -2.60981899e-02f, -2.71814567e-02f, -2.80302370e-02f, -2.86380088e-02f, + -2.90003996e-02f, -2.91151172e-02f, -2.89819544e-02f, -2.86028697e-02f, -2.79818317e-02f, -2.71249297e-02f, + -2.60401957e-02f, -2.47375751e-02f, -2.32288414e-02f, -2.15275091e-02f, -1.96486443e-02f, -1.76087964e-02f, + -1.54258426e-02f, -1.31187994e-02f, -1.07076937e-02f, -8.21335282e-03f, -5.65730582e-03f, -3.06143405e-03f, + -4.47990175e-04f, 2.16074548e-03f, 4.74260737e-03f, 7.27569124e-03f, 9.73864733e-03f, 1.21106824e-02f, + 1.43719841e-02f, 1.65036001e-02f, 1.84878471e-02f, 2.03083286e-02f, 2.19500531e-02f, 2.33996493e-02f, + 2.46453861e-02f, 2.56773512e-02f, 2.64874345e-02f, 2.70694463e-02f, 2.74192279e-02f, 2.75344951e-02f, + 2.74150667e-02f, 2.70627089e-02f, 2.64811913e-02f, 2.56761950e-02f, 2.46553112e-02f, 2.34279326e-02f, + 2.20051823e-02f, 2.03998041e-02f, 1.86260730e-02f, 1.66996483e-02f, 1.46373888e-02f, 1.24573628e-02f, + 1.01784699e-02f, 7.82046099e-03f, 5.40366356e-03f, 2.94886537e-03f, 4.77074685e-04f, -1.99056008e-03f, + -4.43309957e-03f, -6.82975366e-03f, -9.16032780e-03f, -1.14051392e-02f, -1.35453571e-02f, -1.55631186e-02f, + -1.74416221e-02f, -1.91653203e-02f, -2.07200521e-02f, -2.20931290e-02f, -2.32734389e-02f, -2.42515770e-02f, + -2.50198790e-02f, -2.55724740e-02f, -2.59053977e-02f, -2.60165073e-02f, -2.59056121e-02f, -2.55744100e-02f, + -2.50263861e-02f, -2.42670139e-02f, -2.33034172e-02f, -2.21444752e-02f, -2.08007704e-02f, -1.92843016e-02f, + -1.76086143e-02f, -1.57885066e-02f, -1.38399632e-02f, -1.17800468e-02f, -9.62665505e-03f, -7.39846180e-03f, + -5.11473979e-03f, -2.79509520e-03f, -4.59475153e-04f, 1.87219411e-03f, 4.18004886e-03f, 6.44446028e-03f, + 8.64630036e-03f, 1.07670050e-02f, 1.27887263e-02f, 1.46946183e-02f, 1.64687696e-02f, 1.80965074e-02f, + 1.95644657e-02f, 2.08606409e-02f, 2.19745569e-02f, 2.28973400e-02f, 2.36217678e-02f, 2.41423032e-02f, + 2.44552329e-02f, 2.45585559e-02f, 2.44521268e-02f, 2.41375247e-02f, 2.36181843e-02f, 2.28991883e-02f, + 2.19873596e-02f, 2.08911372e-02f, 1.96204854e-02f, 1.81868423e-02f, 1.66029686e-02f, 1.48829260e-02f, + 1.30418196e-02f, 1.10957823e-02f, 9.06176569e-03f, 6.95742371e-03f, 4.80095797e-03f, 2.61094572e-03f, + 4.06163422e-04f, -1.79448120e-03f, -3.97227507e-03f, -6.10867089e-03f, -8.18559133e-03f, -1.01855447e-02f, + -1.20916775e-02f, -1.38880736e-02f, -1.55597947e-02f, -1.70929424e-02f, -1.84749792e-02f, -1.96945768e-02f, + -2.07419008e-02f, -2.16086011e-02f, -2.22879060e-02f, -2.27746496e-02f, -2.30653527e-02f, -2.31582122e-02f, + -2.30530853e-02f, -2.27516002e-02f, -2.22569518e-02f, -2.15740851e-02f, -2.07094459e-02f, -1.96710504e-02f, + -1.84683607e-02f, -1.71122258e-02f, -1.56147530e-02f, -1.39891960e-02f, -1.22499260e-02f, -1.04121226e-02f, + -8.49187069e-03f, -6.50583812e-03f, -4.47121574e-03f, -2.40553061e-03f, -3.26560349e-04f, 1.74792849e-03f, + 3.80020986e-03f, 5.81284812e-03f, 7.76878436e-03f, 9.65152189e-03f, 1.14452321e-02f, 1.31348903e-02f, + 1.47064602e-02f, 1.61469015e-02f, 1.74443880e-02f, 1.85883329e-02f, 1.95694960e-02f, 2.03800747e-02f, + 2.10137416e-02f, 2.14657028e-02f, 2.17327470e-02f, 2.18132189e-02f, 2.17071096e-02f, 2.14159688e-02f, + 2.09429396e-02f, 2.02927056e-02f, 1.94714591e-02f, 1.84867806e-02f, 1.73476996e-02f, 1.60644888e-02f, + 1.46486021e-02f, 1.31126305e-02f, 1.14700918e-02f, 9.73543186e-03f, 7.92379251e-03f, 6.05090462e-03f, + 4.13301608e-03f, 2.18669055e-03f, 2.28581333e-04f, -1.72441072e-03f, -3.65572200e-03f, -5.54887990e-03f, + -7.38782061e-03f, -9.15706782e-03f, -1.08417082e-02f, -1.24276657e-02f, -1.39017311e-02f, -1.52516970e-02f, + -1.64664949e-02f, -1.75361817e-02f, -1.84521823e-02f, -1.92071599e-02f, -1.97953056e-02f, -2.02121243e-02f, + -2.04547147e-02f, -2.05216098e-02f, -2.04128534e-02f, -2.01300439e-02f, -1.96761990e-02f, -1.90558123e-02f, + -1.82748056e-02f, -1.73404276e-02f, -1.62612067e-02f, -1.50469098e-02f, -1.37084115e-02f, -1.22575769e-02f, + -1.07072432e-02f, -9.07102930e-03f, -7.36320826e-03f, -5.59869147e-03f, -3.79270806e-03f, -1.96092013e-03f, + -1.19027325e-04f, 1.71713152e-03f, 3.53191747e-03f, 5.30986343e-03f, 7.03590331e-03f, 8.69547560e-03f, + 1.02746006e-02f, 1.17601122e-02f, 1.31396009e-02f, 1.44016653e-02f, 1.55359973e-02f, 1.65332483e-02f, + 1.73855033e-02f, 1.80859434e-02f, 1.86291305e-02f, 1.90110277e-02f, 1.92289384e-02f, 1.92815880e-02f, + 1.91691688e-02f, 1.88932135e-02f, 1.84567183e-02f, 1.78639790e-02f, 1.71206377e-02f, 1.62336473e-02f, + 1.52110920e-02f, 1.40622274e-02f, 1.27973510e-02f, 1.14277163e-02f, 9.96541843e-03f, 8.42333112e-03f, + 6.81491991e-03f, 5.15420944e-03f, 3.45559138e-03f, 1.73374462e-03f, 3.49154958e-06f, -1.72033182e-03f, + -3.42300908e-03f, -5.09002877e-03f, -6.70728983e-03f, -8.26110592e-03f, -9.73843101e-03f, -1.11269177e-02f, + -1.24149972e-02f, -1.35920411e-02f, -1.46483675e-02f, -1.55754162e-02f, -1.63657097e-02f, -1.70130158e-02f, + -1.75123254e-02f, -1.78599156e-02f, -1.80533642e-02f, -1.80916471e-02f, -1.79749596e-02f, -1.77049199e-02f, + -1.72844059e-02f, -1.67175734e-02f, -1.60098348e-02f, -1.51677846e-02f, -1.41991369e-02f, -1.31126308e-02f, + -1.19180614e-02f, -1.06260158e-02f, -9.24795820e-03f, -7.79599691e-03f, -6.28282689e-03f, -4.72166017e-03f, + -3.12602130e-03f, -1.50971188e-03f, 1.13358008e-04f, 1.72924640e-03f, 3.32419869e-03f, 4.88457483e-03f, + 6.39719332e-03f, 7.84928507e-03f, 9.22860374e-03f, 1.05236737e-02f, 1.17237027e-02f, 1.28187631e-02f, + 1.37999219e-02f, 1.46591627e-02f, 1.53896448e-02f, 1.59855771e-02f, 1.64423748e-02f, 1.67566705e-02f, + 1.69263151e-02f, 1.69504088e-02f, 1.68293192e-02f, 1.65646048e-02f, 1.61591292e-02f, 1.56168830e-02f, + 1.49430466e-02f, 1.41438870e-02f, 1.32267343e-02f, 1.21999194e-02f, 1.10726150e-02f, 9.85491162e-03f, + 8.55755480e-03f, 7.19198626e-03f, 5.77013714e-03f, 4.30443841e-03f, 2.80758857e-03f, 1.29252809e-03f, + -2.27683018e-04f, -1.74000213e-03f, -3.23153173e-03f, -4.68956247e-03f, -6.10171563e-03f, -7.45612506e-03f, + -8.74136426e-03f, -9.94672023e-03f, -1.10621909e-02f, -1.20785406e-02f, -1.29874795e-02f, -1.37816456e-02f, + -1.44546479e-02f, -1.50012468e-02f, -1.54172106e-02f, -1.56995155e-02f, -1.58462779e-02f, -1.58567437e-02f, + -1.57313825e-02f, -1.54717967e-02f, -1.50807184e-02f, -1.45620705e-02f, -1.39207297e-02f, -1.31627253e-02f, + -1.22950111e-02f, -1.13254027e-02f, -1.02626834e-02f, -9.11627932e-03f, -7.89634415e-03f, -6.61364765e-03f, + -5.27939952e-03f, -3.90525708e-03f, -2.50314317e-03f, -1.08517576e-03f, 3.36418391e-04f, 1.74945190e-03f, + 3.14186033e-03f, 4.50178261e-03f, 5.81769448e-03f, 7.07851939e-03f, 8.27365386e-03f, 9.39310326e-03f, + 1.04276320e-02f, 1.13686527e-02f, 1.22085379e-02f, 1.29404450e-02f, 1.35585678e-02f, 1.40580446e-02f, + 1.44350939e-02f, 1.46869568e-02f, 1.48120098e-02f, 1.48096348e-02f, 1.46804295e-02f, 1.44259781e-02f, + 1.40489668e-02f, 1.35531325e-02f, 1.29432014e-02f, 1.22248563e-02f, 1.14046959e-02f, 1.04901687e-02f, + 9.48948107e-03f, 8.41156632e-03f, 7.26596347e-03f, 6.06280447e-03f, 4.81257444e-03f, 3.52622627e-03f, + 2.21492506e-03f, 8.89983592e-04f, -4.37153812e-04f, -1.75513167e-03f, -3.05265494e-03f, -4.31872834e-03f, + -5.54261874e-03f, -6.71396264e-03f, -7.82302244e-03f, -8.86045250e-03f, -9.81773278e-03f, -1.06869351e-02f, + -1.14610023e-02f, -1.21336754e-02f, -1.26995953e-02f, -1.31543908e-02f, -1.34945718e-02f, -1.37177266e-02f, + -1.38224110e-02f, -1.38082286e-02f, -1.36757739e-02f, -1.34266887e-02f, -1.30635886e-02f, -1.25900369e-02f, + -1.20105709e-02f, -1.13305978e-02f, -1.05563538e-02f, -9.69485926e-03f, -8.75389081e-03f, -7.74181164e-03f, + -6.66761679e-03f, -5.54076187e-03f, -4.37111830e-03f, -3.16893052e-03f, -1.94457115e-03f, -7.08705149e-04f, + 5.28079290e-04f, 1.75515870e-03f, 2.96204304e-03f, 4.13848585e-03f, 5.27451557e-03f, 6.36060039e-03f, + 7.38755863e-03f, 8.34692530e-03f, 9.23070802e-03f, 1.00316534e-02f, 1.07432528e-02f, 1.13597680e-02f, + 1.18763350e-02f, 1.22889283e-02f, 1.25944631e-02f, 1.27907515e-02f, 1.28765994e-02f, 1.28517102e-02f, + 1.27167966e-02f, 1.24734480e-02f, 1.21242371e-02f, 1.16725839e-02f, 1.11228281e-02f, 1.04800592e-02f, + 9.75022575e-03f, 8.93990424e-03f, 8.05644990e-03f, 7.10768601e-03f, 6.10205625e-03f, 5.04843878e-03f, + 3.95605458e-03f, 2.83441418e-03f, 1.69331277e-03f, 5.42568186e-04f, -6.07877124e-04f, -1.74818575e-03f, + -2.86860405e-03f, -3.95962685e-03f, -5.01201657e-03f, -6.01690058e-03f, -6.96589716e-03f, -7.85110424e-03f, + -8.66518231e-03f, -9.40145619e-03f, -1.00540095e-02f, -1.06175123e-02f, -1.10876024e-02f, -1.14606062e-02f, + -1.17337519e-02f, -1.19051415e-02f, -1.19737311e-02f, -1.19393909e-02f, -1.18028751e-02f, -1.15657387e-02f, + -1.12305357e-02f, -1.08005049e-02f, -1.02797519e-02f, -9.67318729e-03f, -8.98632838e-03f, -8.22543877e-03f, + -7.39737215e-03f, -6.50950785e-03f, -5.56975395e-03f, -4.58632875e-03f, -3.56792674e-03f, -2.52340823e-03f, + -1.46183597e-03f, -3.92391156e-04f, 6.75701684e-04f, 1.73331709e-03f, 2.77141530e-03f, 3.78118353e-03f, + 4.75407672e-03f, 5.68193005e-03f, 6.55698994e-03f, 7.37195674e-03f, 8.12013345e-03f, 8.79539509e-03f, + 9.39225030e-03f, 9.90597190e-03f, 1.03324819e-02f, 1.06685242e-02f, 1.09116177e-02f, 1.10600973e-02f, + 1.11130936e-02f, 1.10705983e-02f, 1.09333788e-02f, 1.07030445e-02f, 1.03819949e-02f, 9.97335332e-03f, + 9.48107464e-03f, 8.90968434e-03f, 8.26449756e-03f, 7.55132972e-03f, 6.77664458e-03f, 5.94731079e-03f, + 5.07073939e-03f, 4.15462520e-03f, 3.20700306e-03f, 2.23616222e-03f, 1.25050340e-03f, 2.58592562e-04f, + -7.31105992e-04f, -1.71003848e-03f, -2.66991104e-03f, -3.60254805e-03f, -4.50009626e-03f, -5.35500152e-03f, + -6.16013372e-03f, -6.90880302e-03f, -7.59484887e-03f, -8.21267759e-03f, -8.75730297e-03f, -9.22437062e-03f, + -9.61022818e-03f, -9.91196266e-03f, -1.01273334e-02f, -1.02549146e-02f, -1.02939949e-02f, -1.02446487e-02f, + -1.01077102e-02f, -9.88473930e-03f, -9.57804506e-03f, -9.19065219e-03f, -8.72623997e-03f, -8.18914967e-03f, + -7.58431711e-03f, -6.91725624e-03f, -6.19393169e-03f, -5.42085678e-03f, -4.60486090e-03f, -3.75314479e-03f, + -2.87318400e-03f, -1.97263669e-03f, -1.05936420e-03f, -1.41184633e-04f, 7.73935206e-04f, 1.67818033e-03f, + 2.56387121e-03f, 3.42348245e-03f, 4.24972968e-03f, 5.03575853e-03f, 5.77493594e-03f, 6.46117800e-03f, + 7.08885263e-03f, 7.65282423e-03f, 8.14856911e-03f, 8.57214716e-03f, 8.92027019e-03f, 9.19029194e-03f, + 9.38027470e-03f, 9.48895025e-03f, 9.51578399e-03f, 9.46091429e-03f, 9.32518284e-03f, 9.11016180e-03f, + 8.81806173e-03f, 8.45171440e-03f, 8.01466407e-03f, 7.51094572e-03f, 6.94521826e-03f, 6.32261691e-03f, + 5.64875255e-03f, 4.92963671e-03f, 4.17165548e-03f, 3.38149573e-03f, 2.56610069e-03f, 1.73253154e-03f, + 8.88083719e-04f, 4.00140997e-05f, -8.04377007e-04f, -1.63786496e-03f, -2.45336348e-03f, -3.24394120e-03f, + -4.00297149e-03f, -4.72406012e-03f, -5.40122825e-03f, -6.02886353e-03f, -6.60184564e-03f, -7.11547043e-03f, + -7.56567204e-03f, -7.94886879e-03f, -8.26207948e-03f, -8.50298133e-03f, -8.66984745e-03f, -8.76158174e-03f, + -8.77778600e-03f, -8.71866903e-03f, -8.58510255e-03f, -8.37858953e-03f, -8.10125332e-03f, -7.75580633e-03f, + -7.34555568e-03f, -6.87431135e-03f, -6.34642360e-03f, -5.76669768e-03f, -5.14031767e-03f, -4.47294897e-03f, + -3.77043291e-03f, -3.03903272e-03f, -2.28511456e-03f, -1.51527024e-03f, -7.36178447e-04f, 4.54225562e-05f, + 8.22859022e-04f, 1.58943109e-03f, 2.33866278e-03f, 3.06420334e-03f, 3.75990680e-03f, 4.42002538e-03f, + 5.03901750e-03f, 5.61180111e-03f, 6.13366220e-03f, 6.60043272e-03f, 7.00831931e-03f, 7.35414500e-03f, + 7.63524392e-03f, 7.84953557e-03f, 7.99547645e-03f, 8.07218955e-03f, 8.07933095e-03f, 8.01721906e-03f, + 7.88666864e-03f, 7.68919343e-03f, 7.42679720e-03f, 7.10202788e-03f, 6.71802523e-03f, 6.27832934e-03f, + 5.78702253e-03f, 5.24853339e-03f, 4.66776048e-03f, 4.04985033e-03f, 3.40032055e-03f, 2.72486114e-03f, + 2.02943382e-03f, 1.32005555e-03f, 6.02922229e-04f, -1.15810889e-04f, -8.29962401e-04f, -1.53344695e-03f, + -2.22024937e-03f, -2.88460828e-03f, -3.52090915e-03f, -4.12386103e-03f, -4.68844782e-03f, -5.21000854e-03f, + -5.68433641e-03f, -6.10753890e-03f, -6.47629357e-03f, -6.78770430e-03f, -7.03936807e-03f, -7.22944790e-03f, + -7.35662441e-03f, -7.42012069e-03f, -7.41971164e-03f, -7.35573757e-03f, -7.22905724e-03f, -7.04107429e-03f, + -6.79370122e-03f, -6.48940038e-03f, -6.13102314e-03f, -5.72192873e-03f, -5.26590521e-03f, -4.76707464e-03f, + -4.22993214e-03f, -3.65930825e-03f, -3.06022345e-03f, -2.43797793e-03f, -1.79803310e-03f, -1.14594988e-03f, + -4.87389180e-04f, 1.71985886e-04f, 8.26505744e-04f, 1.47057292e-03f, 2.09875564e-03f, 2.70572827e-03f, + 3.28638788e-03f, 3.83592350e-03f, 4.34975506e-03f, 4.82368759e-03f, 5.25383132e-03f, 5.63677359e-03f, + 5.96942535e-03f, 6.24924092e-03f, 6.47405650e-03f, 6.64226721e-03f, 6.75269253e-03f, 6.80469430e-03f, + 6.79815717e-03f, 6.73340631e-03f, 6.61130455e-03f, 6.43322863e-03f, 6.20094526e-03f, 5.91677710e-03f, + 5.58340169e-03f, 5.20393196e-03f, 4.78187614e-03f, 4.32106320e-03f, 3.82565711e-03f, 3.30005613e-03f, + 2.74895362e-03f, 2.17719303e-03f, 1.58978015e-03f, 9.91844057e-04f, 3.88540330e-04f, -2.14916878e-04f, + -8.13361192e-04f, -1.40168257e-03f, -1.97489740e-03f, -2.52818059e-03f, -3.05688539e-03f, -3.55662656e-03f, + -4.02326574e-03f, -4.45296958e-03f, -4.84228652e-03f, -5.18803438e-03f, -5.48755315e-03f, -5.73848611e-03f, + -5.93891991e-03f, -6.08745626e-03f, -6.18305471e-03f, -6.22520840e-03f, -6.21382472e-03f, -6.14928419e-03f, + -6.03244633e-03f, -5.86455879e-03f, -5.64736180e-03f, -5.38296537e-03f, -5.07389363e-03f, -4.72301916e-03f, + -4.33361321e-03f, -3.90915761e-03f, -3.45353173e-03f, -2.97077347e-03f, -2.46516689e-03f, -1.94119584e-03f, + -1.40340595e-03f, -8.56512644e-04f, -3.05232133e-04f, 2.45691031e-04f, 7.91538060e-04f, 1.32763724e-03f, + 1.84949345e-03f, 2.35267547e-03f, 2.83299113e-03f, 3.28645035e-03f, 3.70931698e-03f, 4.09812665e-03f, + 4.44973511e-03f, 4.76135341e-03f, 5.03050354e-03f, 5.25513155e-03f, 5.43353323e-03f, 5.56447821e-03f, + 5.64705544e-03f, 5.68083601e-03f, 5.66583437e-03f, 5.60238431e-03f, 5.49135375e-03f, 5.33391723e-03f, + 5.13169207e-03f, 4.88664671e-03f, 4.60113202e-03f, 4.27780860e-03f, 3.91964875e-03f, 3.52989866e-03f, + 3.11212090e-03f, 2.66999053e-03f, 2.20744344e-03f, 1.72859110e-03f, 1.23756351e-03f, 7.38678150e-04f, + 2.36236760e-04f, -2.65462378e-04f, -7.62072815e-04f, -1.24943395e-03f, -1.72337956e-03f, -2.17993754e-03f, + -2.61530935e-03f, -3.02588421e-03f, -3.40825196e-03f, -3.75935360e-03f, -4.07630652e-03f, -4.35660760e-03f, + -4.59808398e-03f, -4.79883718e-03f, -4.95743843e-03f, -5.07271280e-03f, -5.14393833e-03f, -5.17077608e-03f, + -5.15318763e-03f, -5.09164480e-03f, -4.98686807e-03f, -4.84002285e-03f, -4.65260103e-03f, -4.42642977e-03f, + -4.16366446e-03f, -3.86678300e-03f, -3.53847751e-03f, -3.18177292e-03f, -2.79986847e-03f, -2.39618401e-03f, + -1.97429017e-03f, -1.53788782e-03f, -1.09083664e-03f, -6.36973406e-04f, -1.80264329e-04f, 2.75399352e-04f, + 7.26104424e-04f, 1.16802598e-03f, 1.59744046e-03f, 2.01073128e-03f, 2.40446819e-03f, 2.77538562e-03f, + 3.12044615e-03f, 3.43683203e-03f, 3.72202393e-03f, 3.97374850e-03f, 4.19002854e-03f, 4.36925418e-03f, + 4.51006070e-03f, 4.61152219e-03f, 4.67293053e-03f, 4.69404975e-03f, 4.67490366e-03f, 4.61589307e-03f, + 4.51775252e-03f, 4.38154991e-03f, 4.20868532e-03f, 4.00082377e-03f, 3.75997274e-03f, 3.48836415e-03f, + 3.18851504e-03f, 2.86314343e-03f, 2.51519536e-03f, 2.14776743e-03f, 1.76411750e-03f, 1.36763070e-03f, + 9.61751835e-04f, 5.50052405e-04f, 1.36015058e-04f, -2.76720943e-04f, -6.84698152e-04f, -1.08442387e-03f, + -1.47253691e-03f, -1.84578853e-03f, -2.20105818e-03f, -2.53544188e-03f, -2.84616998e-03f, -3.13076058e-03f, + -3.38689733e-03f, -3.61260297e-03f, -3.80606518e-03f, -3.96589267e-03f, -4.09087232e-03f, -4.18013173e-03f, + -4.23315965e-03f, -4.24970953e-03f, -4.22981560e-03f, -4.17392494e-03f, -4.08267808e-03f, -3.95709577e-03f, + -3.79845153e-03f, -3.60829670e-03f, -3.38844338e-03f, -3.14094669e-03f, -2.86809742e-03f, -2.57237442e-03f, + -2.25643831e-03f, -1.92312165e-03f, -1.57535841e-03f, -1.21624129e-03f, -8.48868370e-04f, -4.76457354e-04f, + -1.02227062e-04f, 2.70659894e-04f, 6.38948957e-04f, 9.99596773e-04f, 1.34950884e-03f, 1.68579412e-03f, + 2.00565112e-03f, 2.30644176e-03f, 2.58570970e-03f, 2.84121989e-03f, 3.07087670e-03f, 3.27296771e-03f, + 3.44584695e-03f, 3.58825627e-03f, 3.69915439e-03f, 3.77779535e-03f, 3.82369144e-03f, 3.83666312e-03f, + 3.81678507e-03f, 3.76444486e-03f, 3.68027755e-03f, 3.56519883e-03f, 3.42038694e-03f, 3.24725992e-03f, + 3.04745181e-03f, 2.82287635e-03f, 2.57555610e-03f, 2.30778342e-03f, 2.02193938e-03f, 1.72060684e-03f, + 1.40642226e-03f, 1.08218540e-03f, 7.50708128e-04f, 4.14852040e-04f, 7.75468400e-05f, -2.58336678e-04f, + -5.89954675e-04f, -9.14464553e-04f, -1.22917409e-03f, -1.53142096e-03f, -1.81874942e-03f, -2.08875765e-03f, + -2.33925204e-03f, -2.56824046e-03f, -2.77387464e-03f, -2.95457151e-03f, -3.10891286e-03f, -3.23576957e-03f, + -3.33422309e-03f, -3.40361730e-03f, -3.44352432e-03f, -3.45380945e-03f, -3.43454926e-03f, -3.38612359e-03f, + -3.30910238e-03f, -3.20434413e-03f, -3.07289782e-03f, -2.91605448e-03f, -2.73534798e-03f, -2.53242439e-03f, + -2.30918427e-03f, -2.06766744e-03f, -1.81002532e-03f, -1.53857461e-03f, -1.25572213e-03f, -9.63956082e-04f, + -6.65804929e-04f, -3.63875198e-04f, -6.07622519e-05f, 2.40955893e-04f, 5.38685581e-04f, 8.29936911e-04f, + 1.11224977e-03f, 1.38328230e-03f, 1.64080028e-03f, 1.88265574e-03f, 2.10694670e-03f, 2.31181334e-03f, + 2.49567938e-03f, 2.65707799e-03f, 2.79477329e-03f, 2.90778929e-03f, 2.99526804e-03f, 3.05666792e-03f, + 3.09159989e-03f, 3.09996074e-03f, 3.08183486e-03f, 3.03757314e-03f, 2.96768997e-03f, 2.87296391e-03f, + 2.75438271e-03f, 2.61305979e-03f, 2.45041225e-03f, 2.26792371e-03f, 2.06728115e-03f, 1.85034398e-03f, + 1.61901728e-03f, 1.37543970e-03f, 1.12168235e-03f, 8.60048928e-04f, 5.92781787e-04f, 3.22217129e-04f, + 5.06437951e-05f, -2.19547817e-04f, -4.86132510e-04f, -7.46817210e-04f, -9.99443627e-04f, -1.24188233e-03f, + -1.47217245e-03f, -1.68839648e-03f, -1.88883105e-03f, -2.07184785e-03f, -2.23601745e-03f, -2.38006048e-03f, + -2.50288118e-03f, -2.60358292e-03f, -2.68144174e-03f, -2.73595307e-03f, -2.76679595e-03f, -2.77388624e-03f, + -2.75729794e-03f, -2.71735188e-03f, -2.65451985e-03f, -2.56952130e-03f, -2.46319204e-03f, -2.33660956e-03f, + -2.19096493e-03f, -2.02765268e-03f, -1.84815939e-03f, -1.65412932e-03f, -1.44731483e-03f, -1.22956426e-03f, + -1.00280075e-03f, -7.69022668e-04f, -5.30268510e-04f, -2.88586883e-04f, -4.60956253e-05f, 1.95186584e-04f, + 4.33161045e-04f, 6.65873263e-04f, 8.91328897e-04f, 1.10770620e-03f, 1.31316296e-03f, 1.50610067e-03f, + 1.68489795e-03f, 1.84814923e-03f, 1.99458512e-03f, 2.12304250e-03f, 2.23258384e-03f, 2.32237953e-03f, + 2.39181962e-03f, 2.44043032e-03f, 2.46796938e-03f, 2.47430968e-03f, 2.45957831e-03f, 2.42401283e-03f, + 2.36808884e-03f, 2.29238471e-03f, 2.19773378e-03f, 2.08501666e-03f, 1.95534528e-03f, 1.80993801e-03f, + 1.65014053e-03f, 1.47739854e-03f, 1.29329221e-03f, 1.09944593e-03f, 8.97596290e-04f, 6.89486470e-04f, + 4.76967544e-04f, 2.61847472e-04f, 4.59979030e-05f, -1.68770369e-04f, -3.80612759e-04f, -5.87744421e-04f, + -7.88452414e-04f, -9.81081718e-04f, -1.16402219e-03f, -1.33580811e-03f, -1.49504859e-03f, -1.64047131e-03f, + -1.77095587e-03f, -1.88548340e-03f, -1.98318254e-03f, -2.06335667e-03f, -2.12544333e-03f, -2.16903096e-03f, + -2.19389731e-03f, -2.19994674e-03f, -2.18726700e-03f, -2.15609170e-03f, -2.10683457e-03f, -2.04002290e-03f, + -1.95633800e-03f, -1.85665258e-03f, -1.74189023e-03f, -1.61313165e-03f, -1.47159921e-03f, -1.31856217e-03f, + -1.15541374e-03f, -9.83590913e-04f, -8.04645529e-04f, -6.20138811e-04f, -4.31664744e-04f, -2.40859759e-04f, + -4.93718861e-05f, 1.41183920e-04f, 3.29184443e-04f, 5.13049545e-04f, 6.91252710e-04f, 8.62329668e-04f, + 1.02486089e-03f, 1.17753306e-03f, 1.31912530e-03f, 1.44851584e-03f, 1.56468190e-03f, 1.66675270e-03f, + 1.75393226e-03f, 1.82562545e-03f, 1.88129935e-03f, 1.92062935e-03f, 1.94336360e-03f, 1.94946381e-03f, + 1.93898469e-03f, 1.91211060e-03f, 1.86925265e-03f, 1.81081128e-03f, 1.73745800e-03f, 1.64989979e-03f, + 1.54896085e-03f, 1.43565148e-03f, 1.31095906e-03f, 1.17607031e-03f, 1.03219054e-03f, 8.80596006e-04f, + 7.22634695e-04f, 5.59715925e-04f, 3.93223384e-04f, 2.24602808e-04f, 5.53223372e-05f, -1.13204206e-04f, + -2.79527886e-04f, -4.42273875e-04f, -6.00090187e-04f, -7.51646708e-04f, -8.95738714e-04f, -1.03117771e-03f, + -1.15687770e-03f, -1.27187587e-03f, -1.37523688e-03f, -1.46618576e-03f, -1.54403989e-03f, -1.60825931e-03f, + -1.65836399e-03f, -1.69405240e-03f, -1.71514183e-03f, -1.72154028e-03f, -1.71331327e-03f, -1.69063272e-03f, + -1.65381037e-03f, -1.60326168e-03f, -1.53948863e-03f, -1.46318779e-03f, -1.37503217e-03f, -1.27591969e-03f, + -1.16672308e-03f, -1.04846883e-03f, -9.22232848e-04f, -7.89108246e-04f, -6.50329911e-04f, -5.07057241e-04f, + -3.60579584e-04f, -2.12138548e-04f, -6.30166060e-05f, 8.55107333e-05f, 2.32212191e-04f, 3.75851456e-04f, + 5.15213418e-04f, 6.49182851e-04f, 7.76642588e-04f, 8.96585347e-04f, 1.00803198e-03f, 1.11010987e-03f, + 1.20203475e-03f, 1.28308439e-03f, 1.35268783e-03f, 1.41030687e-03f, 1.45558664e-03f, 1.48819124e-03f, + 1.50798717e-03f, 1.51486502e-03f, 1.50888467e-03f, 1.49022209e-03f, 1.45906012e-03f, 1.41583581e-03f, + 1.36095722e-03f, 1.29499749e-03f, 1.21859138e-03f, 1.13249419e-03f, 1.03745344e-03f, 9.34384957e-04f, + 8.24209226e-04f, 7.07921644e-04f, 5.86535461e-04f, 4.61118668e-04f, 3.32797940e-04f, 2.02615430e-04f, + 7.17560319e-05f, -5.87215139e-05f, -1.87700771e-04f, -3.14093799e-04f, -4.36855019e-04f, -5.54982470e-04f, + -6.67514567e-04f, -7.73539543e-04f, -8.72216549e-04f, -9.62754726e-04f, -1.04446836e-03f, -1.11673823e-03f, + -1.17901020e-03f, -1.23084835e-03f, -1.27191263e-03f, -1.30189831e-03f, -1.32066941e-03f, -1.32816613e-03f, + -1.32437715e-03f, -1.30944714e-03f, -1.28360668e-03f, -1.24710492e-03f, -1.20038313e-03f, -1.14391116e-03f, + -1.07822250e-03f, -1.00394823e-03f, -9.21799577e-04f, -8.32520513e-04f, -7.36916195e-04f, -6.35853312e-04f, + -5.30218398e-04f, -4.20950684e-04f, -3.08981087e-04f, -1.95310152e-04f, -8.08721649e-05f, 3.33481785e-05f, + 1.46369769e-04f, 2.57271691e-04f, 3.65123878e-04f, 4.69053422e-04f, 5.68205019e-04f, 6.61777482e-04f, + 7.49035427e-04f, 8.29295760e-04f, 9.01919035e-04f, 9.66370937e-04f, 1.02218113e-03f, 1.06892877e-03f, + 1.10630552e-03f, 1.13406370e-03f, 1.15204451e-03f, 1.16019052e-03f, 1.15848806e-03f, 1.14706630e-03f, + 1.12606449e-03f, 1.09574589e-03f, 1.05645362e-03f, 1.00859266e-03f, 9.52601766e-04f, 8.89057609e-04f, + 8.18535938e-04f, 7.41697389e-04f, 6.59241262e-04f, 5.71884368e-04f, 4.80414698e-04f, 3.85677252e-04f, + 2.88406796e-04f, 1.89536836e-04f, 8.98491837e-05f, -9.79888746e-06f, -1.08531507e-04f, -2.05575498e-04f, + -3.00092231e-04f, -3.91327952e-04f, -4.78537671e-04f, -5.61003964e-04f, -6.38090388e-04f, -7.09209697e-04f, + -7.73747838e-04f, -8.31297964e-04f, -8.81364804e-04f, -9.23641236e-04f, -9.57793553e-04f, -9.83624619e-04f, + -1.00098424e-03f, -1.00979404e-03f, -1.01003977e-03f, -1.00180772e-03f, -9.85219816e-04f, -9.60506778e-04f, + -9.27905874e-04f, -8.87790902e-04f, -8.40553609e-04f, -7.86632276e-04f, -7.26559669e-04f, -6.60872173e-04f, + -5.90177860e-04f, -5.15099219e-04f, -4.36341554e-04f, -3.54526447e-04f, -2.70436804e-04f, -1.84757234e-04f, + -9.82406108e-05f, -1.16228429e-05f, 7.44116225e-05f, 1.59099493e-04f, 2.41739119e-04f, 3.21707034e-04f, + 3.98276352e-04f, 4.70887555e-04f, 5.38973046e-04f, 6.01940918e-04f, 6.59368174e-04f, 7.10783030e-04f, + 7.55802336e-04f, 7.94127086e-04f, 8.25478803e-04f, 8.49639386e-04f, 8.66487952e-04f, 8.75935969e-04f, + 8.77948893e-04f, 8.72611584e-04f, 8.59994515e-04f, 8.40271458e-04f, 8.13696181e-04f, 7.80491851e-04f, + 7.41053306e-04f, 6.95727202e-04f, 6.44936090e-04f, 5.89181503e-04f, 5.28946796e-04f, 4.64790448e-04f, + 3.97272420e-04f, 3.27000597e-04f, 2.54559578e-04f, 1.80597276e-04f, 1.05760446e-04f, 3.06209047e-05f, + -4.41172003e-05f, -1.17884760e-04f, -1.90032814e-04f, -2.60000039e-04f, -3.27213235e-04f, -3.91110007e-04f, + -4.51226928e-04f, -5.07042112e-04f, -5.58194586e-04f, -6.04189222e-04f, -6.44816381e-04f, -6.79653847e-04f, + -7.08557315e-04f, -7.31282579e-04f, -7.47702169e-04f, -7.57731688e-04f, -7.61359812e-04f, -7.58589885e-04f, + -7.49503361e-04f, -7.34226582e-04f, -7.12935677e-04f, -6.85882645e-04f, -6.53307567e-04f, -6.15569562e-04f, + -5.72978650e-04f, -5.25977418e-04f, -4.74963705e-04f, -4.20426590e-04f, -3.62819514e-04f, -3.02647353e-04f, + -2.40497241e-04f, -1.76810216e-04f, -1.12210871e-04f, -4.71976690e-05f, 1.76624641e-05f, 8.18440593e-05f, + 1.44804207e-04f, 2.06021410e-04f, 2.65025446e-04f, 3.21327783e-04f, 3.74487008e-04f, 4.24062432e-04f, + 4.69715655e-04f, 5.11042943e-04f, 5.47794530e-04f, 5.79655168e-04f, 6.06446384e-04f, 6.27934546e-04f, + 6.44010762e-04f, 6.54614698e-04f, 6.59636425e-04f, 6.59157826e-04f, 6.53158826e-04f, 6.41794049e-04f, + 6.25154916e-04f, 6.03470855e-04f, 5.76917242e-04f, 5.45789736e-04f, 5.10368292e-04f, 4.70998661e-04f, + 4.28021656e-04f, 3.81834126e-04f, 3.32863326e-04f, 2.81489629e-04f, 2.28231239e-04f, 1.73484261e-04f, + 1.17756607e-04f, 6.14881351e-05f, 5.17778269e-06f, -5.07352374e-05f, -1.05745987e-04f, -1.59454662e-04f, + -2.11394268e-04f, -2.61151905e-04f, -3.08351703e-04f, -3.52598590e-04f, -3.93545002e-04f, -4.30916147e-04f, + -4.64387406e-04f, -4.93756593e-04f, -5.18755281e-04f, -5.39265493e-04f, -5.55137934e-04f, -5.66259303e-04f, + -5.72606783e-04f, -5.74140344e-04f, -5.70903292e-04f, -5.62934741e-04f, -5.50388898e-04f, -5.33351962e-04f, + -5.12028510e-04f, -4.86612455e-04f, -4.57392981e-04f, -4.24578939e-04f, -3.88503808e-04f, -3.49487518e-04f, + -3.07895836e-04f, -2.64036522e-04f, -2.18356445e-04f, -1.71198300e-04f, -1.22998901e-04f, -7.41392080e-05f, + -2.50280393e-05f, 2.38852047e-05f, 7.22663332e-05f, 1.19659647e-04f, 1.65718806e-04f, 2.10055385e-04f, + 2.52324173e-04f, 2.92190427e-04f, 3.29337577e-04f, 3.63510150e-04f, 3.94385715e-04f, 4.21803288e-04f, + 4.45519433e-04f, 4.65391876e-04f, 4.81270460e-04f, 4.93057625e-04f, 5.00688030e-04f, 5.04121708e-04f, + 5.03379627e-04f, 4.98485604e-04f, 4.89499566e-04f, 4.76539317e-04f, 4.59760023e-04f, 4.39274612e-04f, + 4.15334876e-04f, 3.88103885e-04f, 3.57902146e-04f, 3.24908089e-04f, 2.89490480e-04f, 2.51922687e-04f, + 2.12512220e-04f, 1.71637404e-04f, 1.29609890e-04f, 8.67866183e-05f, 4.35312276e-05f, 1.98808307e-07f, + -4.28589070e-05f, -8.52865394e-05f, -1.26765698e-04f, -1.66922292e-04f, -2.05456466e-04f, -2.42095652e-04f, + -2.76487494e-04f, -3.08425602e-04f, -3.37638832e-04f, -3.63923042e-04f, -3.87022898e-04f, -4.06875144e-04f, + -4.23245129e-04f, -4.36071615e-04f, -4.45236993e-04f, -4.50724682e-04f, -4.52491230e-04f, -4.50548104e-04f, + -4.44936790e-04f, -4.35725612e-04f, -4.22987381e-04f, -4.06882738e-04f, -3.87548587e-04f, -3.65123104e-04f, + -3.39860288e-04f, -3.11947486e-04f, -2.81618569e-04f, -2.49166817e-04f, -2.14824344e-04f, -1.78876370e-04f, + -1.41684861e-04f, -1.03466427e-04f, -6.45996088e-05f, -2.53738050e-05f, 1.39035721e-05f, 5.28977578e-05f, + 9.13010773e-05f, 1.28809554e-04f, 1.65139924e-04f, 2.00005346e-04f, 2.33095696e-04f, 2.64232233e-04f, + 2.93070034e-04f, 3.19508024e-04f, 3.43252648e-04f, 3.64165224e-04f, 3.82074036e-04f, 3.96868082e-04f, + 4.08408250e-04f, 4.16671952e-04f, 4.21556517e-04f, 4.23035822e-04f, 4.21172111e-04f, 4.15928838e-04f, + 4.07377025e-04f, 3.95568598e-04f, 3.80628038e-04f, 3.62729177e-04f, 3.41921136e-04f, 3.18489958e-04f, + 2.92497406e-04f, 2.64266550e-04f, 2.33955571e-04f, 2.01809261e-04f, 1.68092145e-04f, 1.33141461e-04f, + 9.71043460e-05f, 6.03452880e-05f, 2.31264055e-05f, -1.43105089e-05f, -5.15607083e-05f, -8.84833364e-05f, + -1.24679461e-04f, -1.59910519e-04f, -1.93952723e-04f, -2.26496145e-04f, -2.57307566e-04f, -2.86175538e-04f, + -3.12853472e-04f, -3.37140613e-04f, -3.58914997e-04f, -3.77932329e-04f, -3.94117065e-04f, -4.07317063e-04f, + -4.17422308e-04f, -4.24419479e-04f, -4.28161231e-04f, -4.28700484e-04f, -4.26016659e-04f, -4.20088126e-04f, + -4.11009185e-04f, -3.98835037e-04f, -3.83585114e-04f, -3.65493072e-04f, -3.44616197e-04f, -3.21064387e-04f, + -2.95119418e-04f, -2.66863117e-04f, -2.36549174e-04f, -2.04391686e-04f, -1.70585806e-04f, -1.35432614e-04f, + -9.91006984e-05f, -6.19152828e-05f, -2.41012311e-05f, 1.40621144e-05f, 5.22867497e-05f, 9.03199843e-05f, + 1.27917614e-04f, 1.64740292e-04f, 2.00634478e-04f, 2.35261402e-04f, 2.68377430e-04f, 2.99818019e-04f, + 3.29273634e-04f, 3.56562766e-04f, 3.81532332e-04f, 4.03948113e-04f, 4.23655375e-04f, 4.40488930e-04f, + 4.54376777e-04f, 4.65137195e-04f, 4.72679704e-04f, 4.77014073e-04f, 4.77982201e-04f, 4.75625277e-04f, + 4.69878507e-04f, 4.60802987e-04f, 4.48367418e-04f, 4.32641679e-04f, 4.13709630e-04f, 3.91634147e-04f, + 3.66512902e-04f, 3.38481392e-04f, 3.07634938e-04f, 2.74189182e-04f, 2.38229594e-04f, 1.99985879e-04f, + 1.59632210e-04f, 1.17351364e-04f, 7.33404728e-05f, 2.78844831e-05f, -1.89099461e-05f, -6.67343638e-05f, + -1.15367449e-04f, -1.64649983e-04f, -2.14224348e-04f, -2.64019844e-04f, -3.13654244e-04f, -3.62990333e-04f, + -4.11800705e-04f, -4.59821928e-04f, -5.06946486e-04f, -5.52847863e-04f, -5.97397068e-04f, -6.40454770e-04f, + -6.81765968e-04f, -7.21210131e-04f, -7.58634477e-04f, -7.93939572e-04f, -8.26964876e-04f, -8.57585335e-04f, + -8.85733438e-04f, -9.11351007e-04f, -9.34300512e-04f, -9.54617442e-04f, -9.72159416e-04f, -9.87012089e-04f, + -9.99095133e-04f, -1.00846242e-03f, -1.01506022e-03f, -1.01897105e-03f, -1.02021427e-03f, -1.01887259e-03f, + -1.01497557e-03f, -1.00861358e-03f, -9.99877741e-04f, -9.88823136e-04f, -9.75617693e-04f, -9.60303769e-04f, + -9.43035535e-04f, -9.23922797e-04f, -9.03105429e-04f, -8.80708716e-04f, -8.56853281e-04f, -8.31685264e-04f, + -8.05348207e-04f, -7.77961627e-04f, -7.49713086e-04f, -7.20674604e-04f, -6.91032783e-04f, -6.60888020e-04f, + -6.30372917e-04f, -5.99673349e-04f, -5.68830563e-04f, -5.38013304e-04f, -5.07353303e-04f, -4.76915043e-04f, + -4.46832926e-04f, -4.17179291e-04f, -3.88083307e-04f, -3.59575024e-04f, -3.31820735e-04f, -3.04804303e-04f, + -2.78616041e-04f, -2.53335964e-04f, -2.28986996e-04f, -2.05619529e-04f, -1.83318449e-04f, -1.61979425e-04f, + -1.41791423e-04f, -1.22648816e-04f, -1.04625498e-04f, -8.77122910e-05f, -7.18653457e-05f, -5.71787106e-05f, + -4.34807639e-05f, -3.09618857e-05f, -1.94074401e-05f, -8.88017971e-06f, 6.09625220e-07f, 9.14020334e-06f, + 1.67805558e-05f, 2.35369965e-05f, 2.94278194e-05f, 3.45049751e-05f, 3.88373828e-05f, 4.24291966e-05f, + 4.53445665e-05f, 4.76965834e-05f, 4.93395567e-05f, 5.05392111e-05f, 5.12257065e-05f, 5.14579340e-05f, + 5.12651750e-05f, 5.07312551e-05f, 4.98486765e-05f, 4.87082573e-05f, 4.73439631e-05f, 4.56740817e-05f, + 4.38653618e-05f, 4.19399075e-05f, 3.99125668e-05f, 3.77616021e-05f, 3.56135997e-05f, 3.33554815e-05f, + 3.11656899e-05f, 2.89038150e-05f, 2.67281634e-05f, 2.46192762e-05f, 2.24899205e-05f, 2.04698700e-05f, + 1.84927655e-05f, 1.66762886e-05f, 1.49393771e-05f, 1.32258081e-05f, 1.16985586e-05f, 1.01874391e-05f, + 8.99882100e-06f, 7.61267073e-06f, 6.57702907e-06f, 5.59829210e-06f, 4.27698546e-06f, 1.03248674e-05f, +}; From afca0ec2c9542cc39bfd6f141525fb625e3bfa2e Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Mon, 6 Jun 2016 13:25:05 -0700 Subject: [PATCH 59/89] moved vive pulses to correct thread, works with duration --- plugins/openvr/src/ViveControllerManager.cpp | 65 ++++++++++---------- plugins/openvr/src/ViveControllerManager.h | 29 +++++---- 2 files changed, 45 insertions(+), 49 deletions(-) diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index 7d66429ed6..39b5e620ad 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -125,12 +125,6 @@ bool ViveControllerManager::activate() { auto userInputMapper = DependencyManager::get(); userInputMapper->registerDevice(_inputDevice); _registeredWithInputMapper = true; - - _leftHapticTimer.setSingleShot(true); - _rightHapticTimer.setSingleShot(true); - connect(&_leftHapticTimer, SIGNAL(timeout()), this, SLOT(hapticPulseHelper(true))); - connect(&_rightHapticTimer, SIGNAL(timeout()), this, SLOT(hapticPulseHelper(false))); - return true; } @@ -250,6 +244,17 @@ void ViveControllerManager::InputDevice::update(float deltaTime, const controlle handleHandController(deltaTime, leftHandDeviceIndex, inputCalibrationData, true); handleHandController(deltaTime, rightHandDeviceIndex, inputCalibrationData, false); + // handle haptics + { + Locker locker(_lock); + if (_leftHapticDuration > 0.0f) { + hapticsHelper(deltaTime, true); + } + if (_rightHapticDuration > 0.0f) { + hapticsHelper(deltaTime, false); + } + } + int numTrackedControllers = 0; if (leftHandDeviceIndex != vr::k_unTrackedDeviceIndexInvalid) { numTrackedControllers++; @@ -447,27 +452,28 @@ void ViveControllerManager::InputDevice::handlePoseEvent(float deltaTime, const _poseStateMap[isLeftHand ? controller::LEFT_HAND : controller::RIGHT_HAND] = avatarPose.transform(controllerToAvatar); } -void ViveControllerManager::hapticPulseHelper(bool leftHand) { - if (_inputDevice) { - _inputDevice->hapticPulseHelper(leftHand); - } -} - -void ViveControllerManager::InputDevice::hapticPulseHelper(bool leftHand) { - if (leftHand) { - triggerHapticPulse(prevLeftHapticStrength, prevLeftHapticDuration, leftHand); - } else { - triggerHapticPulse(prevRightHapticStrength, prevRightHapticDuration, leftHand); - } -} - bool ViveControllerManager::InputDevice::triggerHapticPulse(float strength, float duration, bool leftHand) { + Locker locker(_lock); + if (leftHand) { + _leftHapticStrength = strength; + _leftHapticDuration = duration; + } else { + _rightHapticStrength = strength; + _rightHapticDuration = duration; + } + return true; +} + +void ViveControllerManager::InputDevice::hapticsHelper(float deltaTime, bool leftHand) { auto handRole = leftHand ? vr::TrackedControllerRole_LeftHand : vr::TrackedControllerRole_RightHand; auto deviceIndex = _system->GetTrackedDeviceIndexForControllerRole(handRole); if (_system->IsTrackedDeviceConnected(deviceIndex) && _system->GetTrackedDeviceClass(deviceIndex) == vr::TrackedDeviceClass_Controller && _trackedDevicePose[deviceIndex].bPoseIsValid) { + float strength = leftHand ? _leftHapticStrength : _rightHapticStrength; + float duration = leftHand ? _leftHapticDuration : _rightHapticDuration; + // Vive Controllers only support duration up to 4 ms, which is short enough that any variation feels more like strength const float MAX_HAPTIC_TIME = 3999.0f; // in microseconds float hapticTime = strength*MAX_HAPTIC_TIME; @@ -478,22 +484,13 @@ bool ViveControllerManager::InputDevice::triggerHapticPulse(float strength, floa // Must wait 5 ms before triggering another pulse on this controller // https://github.com/ValveSoftware/openvr/wiki/IVRSystem::TriggerHapticPulse const float HAPTIC_RESET_TIME = 5.0f; - float remainingHapticTime = duration - (hapticTime / 1000.0f + HAPTIC_RESET_TIME); // in milliseconds - if (remainingHapticTime > 0.0f) { - if (leftHand) { - prevLeftHapticStrength = strength; - prevLeftHapticDuration = remainingHapticTime; - _parent._leftHapticTimer.start(remainingHapticTime); - } - else { - prevRightHapticStrength = strength; - prevRightHapticDuration = remainingHapticTime; - _parent._rightHapticTimer.start(remainingHapticTime); - } + float remainingHapticTime = duration - (hapticTime / 1000.0f + deltaTime * 1000.0f); // in milliseconds + if (leftHand) { + _leftHapticDuration = remainingHapticTime; + } else { + _rightHapticDuration = remainingHapticTime; } - return true; } - return false; } controller::Input::NamedVector ViveControllerManager::InputDevice::getAvailableInputs() const { diff --git a/plugins/openvr/src/ViveControllerManager.h b/plugins/openvr/src/ViveControllerManager.h index 67fe43c15a..9bdbd0370e 100644 --- a/plugins/openvr/src/ViveControllerManager.h +++ b/plugins/openvr/src/ViveControllerManager.h @@ -13,7 +13,6 @@ #define hifi__ViveControllerManager #include -#include #include #include @@ -46,13 +45,10 @@ public: void setRenderControllers(bool renderControllers) { _renderControllers = renderControllers; } -private slots: - void hapticPulseHelper(bool leftHand); - private: class InputDevice : public controller::InputDevice { public: - InputDevice(ViveControllerManager& parent, vr::IVRSystem*& system) : controller::InputDevice("Vive"), _parent(parent), _system(system) {} + InputDevice(vr::IVRSystem*& system) : controller::InputDevice("Vive"), _system(system), _leftHapticDuration(0.0f), _rightHapticDuration(0.0f) {} private: // Device functions controller::Input::NamedVector getAvailableInputs() const override; @@ -60,8 +56,8 @@ private: void update(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) override; void focusOutEvent() override; - void hapticPulseHelper(bool leftHand); bool triggerHapticPulse(float strength, float duration, bool leftHand) override; + void hapticsHelper(float deltaTime, bool leftHand); void handleHandController(float deltaTime, uint32_t deviceIndex, const controller::InputCalibrationData& inputCalibrationData, bool isLeftHand); void handleButtonEvent(float deltaTime, uint32_t button, bool pressed, bool touched, bool isLeftHand); @@ -97,13 +93,19 @@ private: FilteredStick _filteredLeftStick; FilteredStick _filteredRightStick; + // perform an action when the InputDevice mutex is acquired. + using Locker = std::unique_lock; + template + void withLock(F&& f) { Locker locker(_lock); f(); } + int _trackedControllers { 0 }; vr::IVRSystem*& _system; - ViveControllerManager& _parent; - float prevLeftHapticStrength; - float prevLeftHapticDuration; - float prevRightHapticStrength; - float prevRightHapticDuration; + float _leftHapticStrength; + float _leftHapticDuration; + float _rightHapticStrength; + float _rightHapticDuration; + mutable std::recursive_mutex _lock; + friend class ViveControllerManager; }; @@ -119,10 +121,7 @@ private: bool _renderControllers { false }; vr::IVRSystem* _system { nullptr }; - std::shared_ptr _inputDevice { std::make_shared(*this, _system) }; - - QTimer _leftHapticTimer; - QTimer _rightHapticTimer; + std::shared_ptr _inputDevice { std::make_shared(_system) }; static const QString NAME; }; From b60b9bb312a4528b620dc384cdfd9b5101f5d117 Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Mon, 6 Jun 2016 14:54:15 -0700 Subject: [PATCH 60/89] compiler fixes for GCC/clang --- cmake/macros/SetupHifiLibrary.cmake | 10 ++++++++++ .../{avx/AudioSRC_avx.cpp => avx2/AudioSRC_avx2.cpp} | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) rename libraries/audio/src/{avx/AudioSRC_avx.cpp => avx2/AudioSRC_avx2.cpp} (98%) diff --git a/cmake/macros/SetupHifiLibrary.cmake b/cmake/macros/SetupHifiLibrary.cmake index 628f65b278..26c769c6e6 100644 --- a/cmake/macros/SetupHifiLibrary.cmake +++ b/cmake/macros/SetupHifiLibrary.cmake @@ -24,6 +24,16 @@ macro(SETUP_HIFI_LIBRARY) set_source_files_properties(${SRC} PROPERTIES COMPILE_FLAGS -mavx) endif() endforeach() + + # add compiler flags to AVX2 source files + file(GLOB_RECURSE AVX2_SRCS "src/avx2/*.cpp" "src/avx2/*.c") + foreach(SRC ${AVX2_SRCS}) + if (WIN32) + set_source_files_properties(${SRC} PROPERTIES COMPILE_FLAGS /arch:AVX2) + elseif (APPLE OR UNIX) + set_source_files_properties(${SRC} PROPERTIES COMPILE_FLAGS "-mavx2 -mfma") + endif() + endforeach() setup_memory_debugger() diff --git a/libraries/audio/src/avx/AudioSRC_avx.cpp b/libraries/audio/src/avx2/AudioSRC_avx2.cpp similarity index 98% rename from libraries/audio/src/avx/AudioSRC_avx.cpp rename to libraries/audio/src/avx2/AudioSRC_avx2.cpp index dcc56b94ad..e634554bfb 100644 --- a/libraries/audio/src/avx/AudioSRC_avx.cpp +++ b/libraries/audio/src/avx2/AudioSRC_avx2.cpp @@ -1,5 +1,5 @@ // -// AudioSRC_avx.cpp +// AudioSRC_avx2.cpp // libraries/audio/src // // Created by Ken Cooke on 6/5/16. @@ -16,8 +16,8 @@ #include "../AudioSRC.h" -#ifndef __AVX__ -#error Must be compiled with /arch:AVX or -mavx. +#ifndef __AVX2__ +#error Must be compiled with /arch:AVX2 or -mavx2 -mfma. #endif // high/low part of int64_t From e7743cd8e2603927da7099ea6e82e696e237fd1c Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Mon, 6 Jun 2016 15:03:08 -0700 Subject: [PATCH 61/89] added options for both hands (default), all devices, short pulse, and fixed touch timing mechanism --- .../controllers/src/controllers/InputDevice.h | 8 +++- .../src/controllers/ScriptingInterface.cpp | 18 +++++++- .../src/controllers/ScriptingInterface.h | 5 ++- .../src/controllers/UserInputMapper.cpp | 25 ++++++++++- .../src/controllers/UserInputMapper.h | 4 +- plugins/hifiSdl2/src/Joystick.cpp | 2 +- plugins/hifiSdl2/src/Joystick.h | 2 +- .../oculus/src/OculusControllerManager.cpp | 45 ++++++++++++------- plugins/oculus/src/OculusControllerManager.h | 15 +++++-- plugins/openvr/src/ViveControllerManager.cpp | 10 ++--- plugins/openvr/src/ViveControllerManager.h | 12 ++--- 11 files changed, 105 insertions(+), 41 deletions(-) diff --git a/libraries/controllers/src/controllers/InputDevice.h b/libraries/controllers/src/controllers/InputDevice.h index cc158497e0..10e1a104f4 100644 --- a/libraries/controllers/src/controllers/InputDevice.h +++ b/libraries/controllers/src/controllers/InputDevice.h @@ -31,6 +31,12 @@ namespace controller { class Endpoint; using EndpointPointer = std::shared_ptr; +enum Hand { + LEFT = 0, + RIGHT, + BOTH +}; + // NOTE: If something inherits from both InputDevice and InputPlugin, InputPlugin must go first. // e.g. class Example : public InputPlugin, public InputDevice // instead of class Example : public InputDevice, public InputPlugin @@ -56,7 +62,7 @@ public: const QString& getName() const { return _name; } // By default, Input Devices do not support haptics - virtual bool triggerHapticPulse(float strength, float duration, bool leftHand) { return false; } + virtual bool triggerHapticPulse(float strength, float duration, controller::Hand hand) { return false; } // Update call MUST be called once per simulation loop // It takes care of updating the action states and deltas diff --git a/libraries/controllers/src/controllers/ScriptingInterface.cpp b/libraries/controllers/src/controllers/ScriptingInterface.cpp index 97b7a9ddd9..78e9378c18 100644 --- a/libraries/controllers/src/controllers/ScriptingInterface.cpp +++ b/libraries/controllers/src/controllers/ScriptingInterface.cpp @@ -140,8 +140,22 @@ namespace controller { return DependencyManager::get()->getActionNames(); } - bool ScriptingInterface::triggerHapticPulse(unsigned int device, float strength, float duration, bool leftHand) const { - return DependencyManager::get()->triggerHapticPulse(device, strength, duration, leftHand); + bool ScriptingInterface::triggerHapticPulse(float strength, float duration, controller::Hand hand) const { + return DependencyManager::get()->triggerHapticPulse(strength, duration, hand); + } + + bool ScriptingInterface::triggerShortHapticPulse(float strength, controller::Hand hand) const { + const float SHORT_HAPTIC_DURATION_MS = 250.0f; + return DependencyManager::get()->triggerHapticPulse(strength, SHORT_HAPTIC_DURATION_MS, hand); + } + + bool ScriptingInterface::triggerHapticPulseOnDevice(unsigned int device, float strength, float duration, controller::Hand hand) const { + return DependencyManager::get()->triggerHapticPulseOnDevice(device, strength, duration, hand); + } + + bool ScriptingInterface::triggerShortHapticPulseOnDevice(unsigned int device, float strength, controller::Hand hand) const { + const float SHORT_HAPTIC_DURATION_MS = 250.0f; + return DependencyManager::get()->triggerHapticPulseOnDevice(device, strength, SHORT_HAPTIC_DURATION_MS, hand); } void ScriptingInterface::updateMaps() { diff --git a/libraries/controllers/src/controllers/ScriptingInterface.h b/libraries/controllers/src/controllers/ScriptingInterface.h index 015ec25454..713e864561 100644 --- a/libraries/controllers/src/controllers/ScriptingInterface.h +++ b/libraries/controllers/src/controllers/ScriptingInterface.h @@ -84,7 +84,10 @@ namespace controller { Q_INVOKABLE Pose getPoseValue(const int& source) const; Q_INVOKABLE Pose getPoseValue(StandardPoseChannel source, uint16_t device = 0) const; - Q_INVOKABLE bool triggerHapticPulse(unsigned int device, float strength, float duration, bool leftHand = true) const; + Q_INVOKABLE bool triggerHapticPulse(float strength, float duration, controller::Hand hand = BOTH) const; + Q_INVOKABLE bool triggerShortHapticPulse(float strength, controller::Hand hand = BOTH) const; + Q_INVOKABLE bool triggerHapticPulseOnDevice(unsigned int device, float strength, float duration, controller::Hand hand = BOTH) const; + Q_INVOKABLE bool triggerShortHapticPulseOnDevice(unsigned int device, float strength, controller::Hand hand = BOTH) const; Q_INVOKABLE QObject* newMapping(const QString& mappingName = QUuid::createUuid().toString()); Q_INVOKABLE void enableMapping(const QString& mappingName, bool enable = true); diff --git a/libraries/controllers/src/controllers/UserInputMapper.cpp b/libraries/controllers/src/controllers/UserInputMapper.cpp index c7c62ad7d9..921f78c613 100755 --- a/libraries/controllers/src/controllers/UserInputMapper.cpp +++ b/libraries/controllers/src/controllers/UserInputMapper.cpp @@ -336,10 +336,19 @@ QVector UserInputMapper::getActionNames() const { return result; } -bool UserInputMapper::triggerHapticPulse(uint16 deviceID, float strength, float duration, bool leftHand) { +bool UserInputMapper::triggerHapticPulse(float strength, float duration, controller::Hand hand) { + Locker locker(_lock); + bool toReturn = false; + for (auto device : _registeredDevices) { + toReturn = toReturn || device.second->triggerHapticPulse(strength, duration, hand); + } + return toReturn; +} + +bool UserInputMapper::triggerHapticPulseOnDevice(uint16 deviceID, float strength, float duration, controller::Hand hand) { Locker locker(_lock); if (_registeredDevices.find(deviceID) != _registeredDevices.end()) { - return _registeredDevices[deviceID]->triggerHapticPulse(strength, duration, leftHand); + return _registeredDevices[deviceID]->triggerHapticPulse(strength, duration, hand); } return false; } @@ -348,6 +357,7 @@ int actionMetaTypeId = qRegisterMetaType(); int inputMetaTypeId = qRegisterMetaType(); int inputPairMetaTypeId = qRegisterMetaType(); int poseMetaTypeId = qRegisterMetaType("Pose"); +int handMetaTypeId = qRegisterMetaType(); QScriptValue inputToScriptValue(QScriptEngine* engine, const Input& input); void inputFromScriptValue(const QScriptValue& object, Input& input); @@ -355,6 +365,8 @@ QScriptValue actionToScriptValue(QScriptEngine* engine, const Action& action); void actionFromScriptValue(const QScriptValue& object, Action& action); QScriptValue inputPairToScriptValue(QScriptEngine* engine, const Input::NamedPair& inputPair); void inputPairFromScriptValue(const QScriptValue& object, Input::NamedPair& inputPair); +QScriptValue handToScriptValue(QScriptEngine* engine, const controller::Hand& hand); +void handFromScriptValue(const QScriptValue& object, controller::Hand& hand); QScriptValue inputToScriptValue(QScriptEngine* engine, const Input& input) { QScriptValue obj = engine->newObject(); @@ -393,12 +405,21 @@ void inputPairFromScriptValue(const QScriptValue& object, Input::NamedPair& inpu inputPair.second = QString(object.property("inputName").toVariant().toString()); } +QScriptValue handToScriptValue(QScriptEngine* engine, const controller::Hand& hand) { + return engine->newVariant((int)hand); +} + +void handFromScriptValue(const QScriptValue& object, controller::Hand& hand) { + hand = Hand(object.toVariant().toInt()); +} + void UserInputMapper::registerControllerTypes(QScriptEngine* engine) { qScriptRegisterSequenceMetaType >(engine); qScriptRegisterSequenceMetaType(engine); qScriptRegisterMetaType(engine, actionToScriptValue, actionFromScriptValue); qScriptRegisterMetaType(engine, inputToScriptValue, inputFromScriptValue); qScriptRegisterMetaType(engine, inputPairToScriptValue, inputPairFromScriptValue); + qScriptRegisterMetaType(engine, handToScriptValue, handFromScriptValue); qScriptRegisterMetaType(engine, Pose::toScriptValue, Pose::fromScriptValue); } diff --git a/libraries/controllers/src/controllers/UserInputMapper.h b/libraries/controllers/src/controllers/UserInputMapper.h index b23657fff7..811b621b09 100644 --- a/libraries/controllers/src/controllers/UserInputMapper.h +++ b/libraries/controllers/src/controllers/UserInputMapper.h @@ -89,7 +89,8 @@ namespace controller { void setActionState(Action action, float value) { _actionStates[toInt(action)] = value; } void deltaActionState(Action action, float delta) { _actionStates[toInt(action)] += delta; } void setActionState(Action action, const Pose& value) { _poseStates[toInt(action)] = value; } - bool triggerHapticPulse(uint16 deviceID, float strength, float duration, bool leftHand); + bool triggerHapticPulse(float strength, float duration, controller::Hand hand); + bool triggerHapticPulseOnDevice(uint16 deviceID, float strength, float duration, controller::Hand hand); static Input makeStandardInput(controller::StandardButtonChannel button); static Input makeStandardInput(controller::StandardAxisChannel axis); @@ -200,6 +201,7 @@ Q_DECLARE_METATYPE(QVector) Q_DECLARE_METATYPE(controller::Input) Q_DECLARE_METATYPE(controller::Action) Q_DECLARE_METATYPE(QVector) +Q_DECLARE_METATYPE(controller::Hand) // Cheating. using UserInputMapper = controller::UserInputMapper; diff --git a/plugins/hifiSdl2/src/Joystick.cpp b/plugins/hifiSdl2/src/Joystick.cpp index cf7dde371b..c20670d4bb 100644 --- a/plugins/hifiSdl2/src/Joystick.cpp +++ b/plugins/hifiSdl2/src/Joystick.cpp @@ -67,7 +67,7 @@ void Joystick::handleButtonEvent(const SDL_ControllerButtonEvent& event) { } } -bool Joystick::triggerHapticPulse(float strength, float duration, bool leftHand) { +bool Joystick::triggerHapticPulse(float strength, float duration, controller::Hand hand) { if (SDL_HapticRumblePlay(_sdlHaptic, strength, duration) != 0) { return false; } diff --git a/plugins/hifiSdl2/src/Joystick.h b/plugins/hifiSdl2/src/Joystick.h index 4f785f85ce..b37d22de39 100644 --- a/plugins/hifiSdl2/src/Joystick.h +++ b/plugins/hifiSdl2/src/Joystick.h @@ -37,7 +37,7 @@ public: virtual void update(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) override; virtual void focusOutEvent() override; - bool triggerHapticPulse(float strength, float duration, bool leftHand) override; + bool triggerHapticPulse(float strength, float duration, controller::Hand hand) override; Joystick() : InputDevice("GamePad") {} ~Joystick(); diff --git a/plugins/oculus/src/OculusControllerManager.cpp b/plugins/oculus/src/OculusControllerManager.cpp index 3151db1d90..2e7044bd69 100644 --- a/plugins/oculus/src/OculusControllerManager.cpp +++ b/plugins/oculus/src/OculusControllerManager.cpp @@ -55,11 +55,6 @@ bool OculusControllerManager::activate() { userInputMapper->registerDevice(_touch); } - _leftHapticTimer.setSingleShot(true); - _rightHapticTimer.setSingleShot(true); - connect(&_leftHapticTimer, SIGNAL(timeout()), this, SLOT(stopHapticPulse(true))); - connect(&_rightHapticTimer, SIGNAL(timeout()), this, SLOT(stopHapticPulse(false))); - return true; } @@ -221,6 +216,21 @@ void OculusControllerManager::TouchDevice::update(float deltaTime, const control _buttonPressedMap.insert(pair.second); } } + + // Haptics + { + Locker locker(_lock); + if (_leftHapticDuration > 0.0f) { + _leftHapticDuration -= deltaTime; + } else { + stopHapticPulse(true); + } + if (_rightHapticDuration > 0.0f) { + _rightHapticDuration -= deltaTime; + } else { + stopHapticPulse(false); + } + } } void OculusControllerManager::TouchDevice::focusOutEvent() { @@ -239,19 +249,22 @@ void OculusControllerManager::TouchDevice::handlePose(float deltaTime, pose.velocity = toGlm(handPose.LinearVelocity); } -bool OculusControllerManager::TouchDevice::triggerHapticPulse(float strength, float duration, bool leftHand) { - auto handType = (leftHand ? ovrControllerType_LTouch : ovrControllerType_RTouch); - if (ovr_SetControllerVibration(_parent._session, handType, 1.0f, strength) != ovrSuccess) { - return false; +bool OculusControllerManager::TouchDevice::triggerHapticPulse(float strength, float duration, controller::Hand hand) { + Locker locker(_lock); + bool toReturn = true; + if (hand == controller::BOTH || hand == controller::LEFT) { + if (ovr_SetControllerVibration(_parent._session, ovrControllerType_LTouch, 1.0f, strength) != ovrSuccess) { + toReturn = false; + } + _leftHapticDuration = duration; } - - if (leftHand) { - _parent._leftHapticTimer.start(duration); - } else { - _parent._rightHapticTimer.start(duration); + if (hand == controller::BOTH || hand == controller::RIGHT) { + if (ovr_SetControllerVibration(_parent._session, ovrControllerType_RTouch, 1.0f, strength) != ovrSuccess) { + toReturn = false; + } + _rightHapticDuration = duration; } - - return true; + return toReturn; } void OculusControllerManager::TouchDevice::stopHapticPulse(bool leftHand) { diff --git a/plugins/oculus/src/OculusControllerManager.h b/plugins/oculus/src/OculusControllerManager.h index e62c5f45ea..244fe41f67 100644 --- a/plugins/oculus/src/OculusControllerManager.h +++ b/plugins/oculus/src/OculusControllerManager.h @@ -10,7 +10,6 @@ #define hifi__OculusControllerManager #include -#include #include #include @@ -68,20 +67,28 @@ private: void update(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) override; void focusOutEvent() override; - bool triggerHapticPulse(float strength, float duration, bool leftHand) override; + bool triggerHapticPulse(float strength, float duration, controller::Hand hand) override; private: void stopHapticPulse(bool leftHand); void handlePose(float deltaTime, const controller::InputCalibrationData& inputCalibrationData, ovrHandType hand, const ovrPoseStatef& handPose); int _trackedControllers { 0 }; + + // perform an action when the TouchDevice mutex is acquired. + using Locker = std::unique_lock; + template + void withLock(F&& f) { Locker locker(_lock); f(); } + + float _leftHapticDuration { 0.0f }; + float _rightHapticDuration { 0.0f }; + mutable std::recursive_mutex _lock; + friend class OculusControllerManager; }; ovrSession _session { nullptr }; ovrInputState _inputState {}; RemoteDevice::Pointer _remote; - QTimer _leftHapticTimer; - QTimer _rightHapticTimer; TouchDevice::Pointer _touch; static const QString NAME; }; diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index 39b5e620ad..27b4887edd 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -452,12 +452,13 @@ void ViveControllerManager::InputDevice::handlePoseEvent(float deltaTime, const _poseStateMap[isLeftHand ? controller::LEFT_HAND : controller::RIGHT_HAND] = avatarPose.transform(controllerToAvatar); } -bool ViveControllerManager::InputDevice::triggerHapticPulse(float strength, float duration, bool leftHand) { +bool ViveControllerManager::InputDevice::triggerHapticPulse(float strength, float duration, controller::Hand hand) { Locker locker(_lock); - if (leftHand) { + if (hand == controller::BOTH || hand == controller::LEFT) { _leftHapticStrength = strength; _leftHapticDuration = duration; - } else { + } + if (hand == controller::BOTH || hand == controller::RIGHT) { _rightHapticStrength = strength; _rightHapticDuration = duration; } @@ -481,9 +482,6 @@ void ViveControllerManager::InputDevice::hapticsHelper(float deltaTime, bool lef _system->TriggerHapticPulse(deviceIndex, 0, hapticTime); } - // Must wait 5 ms before triggering another pulse on this controller - // https://github.com/ValveSoftware/openvr/wiki/IVRSystem::TriggerHapticPulse - const float HAPTIC_RESET_TIME = 5.0f; float remainingHapticTime = duration - (hapticTime / 1000.0f + deltaTime * 1000.0f); // in milliseconds if (leftHand) { _leftHapticDuration = remainingHapticTime; diff --git a/plugins/openvr/src/ViveControllerManager.h b/plugins/openvr/src/ViveControllerManager.h index 9bdbd0370e..3a2ef1573f 100644 --- a/plugins/openvr/src/ViveControllerManager.h +++ b/plugins/openvr/src/ViveControllerManager.h @@ -48,7 +48,7 @@ public: private: class InputDevice : public controller::InputDevice { public: - InputDevice(vr::IVRSystem*& system) : controller::InputDevice("Vive"), _system(system), _leftHapticDuration(0.0f), _rightHapticDuration(0.0f) {} + InputDevice(vr::IVRSystem*& system) : controller::InputDevice("Vive"), _system(system) {} private: // Device functions controller::Input::NamedVector getAvailableInputs() const override; @@ -56,7 +56,7 @@ private: void update(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) override; void focusOutEvent() override; - bool triggerHapticPulse(float strength, float duration, bool leftHand) override; + bool triggerHapticPulse(float strength, float duration, controller::Hand hand) override; void hapticsHelper(float deltaTime, bool leftHand); void handleHandController(float deltaTime, uint32_t deviceIndex, const controller::InputCalibrationData& inputCalibrationData, bool isLeftHand); @@ -100,10 +100,10 @@ private: int _trackedControllers { 0 }; vr::IVRSystem*& _system; - float _leftHapticStrength; - float _leftHapticDuration; - float _rightHapticStrength; - float _rightHapticDuration; + float _leftHapticStrength { 0.0f }; + float _leftHapticDuration { 0.0f }; + float _rightHapticStrength { 0.0f }; + float _rightHapticDuration { 0.0f }; mutable std::recursive_mutex _lock; friend class ViveControllerManager; From cea0d74c358cbe61ecd6ad19d53ddc6f08e34b5e Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Mon, 6 Jun 2016 15:20:10 -0700 Subject: [PATCH 62/89] fix spaces and touch duration --- plugins/oculus/src/OculusControllerManager.cpp | 4 ++-- plugins/openvr/src/ViveControllerManager.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/oculus/src/OculusControllerManager.cpp b/plugins/oculus/src/OculusControllerManager.cpp index 2e7044bd69..21d97adbda 100644 --- a/plugins/oculus/src/OculusControllerManager.cpp +++ b/plugins/oculus/src/OculusControllerManager.cpp @@ -221,12 +221,12 @@ void OculusControllerManager::TouchDevice::update(float deltaTime, const control { Locker locker(_lock); if (_leftHapticDuration > 0.0f) { - _leftHapticDuration -= deltaTime; + _leftHapticDuration -= deltaTime * 1000.0f; // milliseconds } else { stopHapticPulse(true); } if (_rightHapticDuration > 0.0f) { - _rightHapticDuration -= deltaTime; + _rightHapticDuration -= deltaTime * 1000.0f; // milliseconds } else { stopHapticPulse(false); } diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index 27b4887edd..8e4b277bd7 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -477,8 +477,8 @@ void ViveControllerManager::InputDevice::hapticsHelper(float deltaTime, bool lef // Vive Controllers only support duration up to 4 ms, which is short enough that any variation feels more like strength const float MAX_HAPTIC_TIME = 3999.0f; // in microseconds - float hapticTime = strength*MAX_HAPTIC_TIME; - if (hapticTime < duration*1000.0f) { + float hapticTime = strength * MAX_HAPTIC_TIME; + if (hapticTime < duration * 1000.0f) { _system->TriggerHapticPulse(deviceIndex, 0, hapticTime); } From b59d597780fd4f3ea7789551e0634395a34aa6c1 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Mon, 6 Jun 2016 15:35:12 -0700 Subject: [PATCH 63/89] if overlapping calls, haptics take on strength and duration of call that will finish last --- plugins/oculus/src/OculusControllerManager.cpp | 10 ++++++---- plugins/oculus/src/OculusControllerManager.h | 2 ++ plugins/openvr/src/ViveControllerManager.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/plugins/oculus/src/OculusControllerManager.cpp b/plugins/oculus/src/OculusControllerManager.cpp index 21d97adbda..02ac44d77c 100644 --- a/plugins/oculus/src/OculusControllerManager.cpp +++ b/plugins/oculus/src/OculusControllerManager.cpp @@ -253,16 +253,18 @@ bool OculusControllerManager::TouchDevice::triggerHapticPulse(float strength, fl Locker locker(_lock); bool toReturn = true; if (hand == controller::BOTH || hand == controller::LEFT) { - if (ovr_SetControllerVibration(_parent._session, ovrControllerType_LTouch, 1.0f, strength) != ovrSuccess) { + _leftHapticStrength = (duration > _leftHapticDuration) ? strength : _leftHapticStrength; + if (ovr_SetControllerVibration(_parent._session, ovrControllerType_LTouch, 1.0f, _leftHapticStrength) != ovrSuccess) { toReturn = false; } - _leftHapticDuration = duration; + _leftHapticDuration = std::max(duration, _leftHapticDuration); } if (hand == controller::BOTH || hand == controller::RIGHT) { - if (ovr_SetControllerVibration(_parent._session, ovrControllerType_RTouch, 1.0f, strength) != ovrSuccess) { + _rightHapticStrength = (duration > _rightHapticDuration) ? strength : _rightHapticStrength; + if (ovr_SetControllerVibration(_parent._session, ovrControllerType_RTouch, 1.0f, _rightHapticStrength) != ovrSuccess) { toReturn = false; } - _rightHapticDuration = duration; + _rightHapticDuration = std::max(duration, _rightHapticDuration); } return toReturn; } diff --git a/plugins/oculus/src/OculusControllerManager.h b/plugins/oculus/src/OculusControllerManager.h index 244fe41f67..3c5cdeb7c6 100644 --- a/plugins/oculus/src/OculusControllerManager.h +++ b/plugins/oculus/src/OculusControllerManager.h @@ -80,7 +80,9 @@ private: void withLock(F&& f) { Locker locker(_lock); f(); } float _leftHapticDuration { 0.0f }; + float _leftHapticStrength { 0.0f }; float _rightHapticDuration { 0.0f }; + float _rightHapticStrength { 0.0f }; mutable std::recursive_mutex _lock; friend class OculusControllerManager; diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index 8e4b277bd7..7254117922 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -455,12 +455,12 @@ void ViveControllerManager::InputDevice::handlePoseEvent(float deltaTime, const bool ViveControllerManager::InputDevice::triggerHapticPulse(float strength, float duration, controller::Hand hand) { Locker locker(_lock); if (hand == controller::BOTH || hand == controller::LEFT) { - _leftHapticStrength = strength; - _leftHapticDuration = duration; + _leftHapticStrength = (duration > _leftHapticDuration) ? strength : _leftHapticStrength; + _leftHapticDuration = std::max(duration, _leftHapticDuration); } if (hand == controller::BOTH || hand == controller::RIGHT) { - _rightHapticStrength = strength; - _rightHapticDuration = duration; + _rightHapticStrength = (duration > _rightHapticDuration) ? strength : _rightHapticStrength; + _rightHapticDuration = std::max(duration, _rightHapticDuration); } return true; } From 1994eabc981ca3b212d0d9298b5b2ee9ef91b96f Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Mon, 6 Jun 2016 16:22:02 -0700 Subject: [PATCH 64/89] grip buttons on vive and touch will make you active in away.js --- scripts/system/away.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/system/away.js b/scripts/system/away.js index 2b2ea8a42b..38b0f13c00 100644 --- a/scripts/system/away.js +++ b/scripts/system/away.js @@ -265,9 +265,11 @@ eventMapping.from(Controller.Standard.RightSecondaryThumb).peek().to(goActive); eventMapping.from(Controller.Standard.LT).peek().to(goActive); eventMapping.from(Controller.Standard.LB).peek().to(goActive); eventMapping.from(Controller.Standard.LS).peek().to(goActive); +eventMapping.from(Controller.Standard.LeftGrip).peek().to(goActive); eventMapping.from(Controller.Standard.RT).peek().to(goActive); eventMapping.from(Controller.Standard.RB).peek().to(goActive); eventMapping.from(Controller.Standard.RS).peek().to(goActive); +eventMapping.from(Controller.Standard.RightGrip).peek().to(goActive); eventMapping.from(Controller.Standard.Back).peek().to(goActive); eventMapping.from(Controller.Standard.Start).peek().to(goActive); Controller.enableMapping(eventMappingName); From 8fa52fa15987067d67243e7f8d80583e6666aa6b Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Mon, 6 Jun 2016 16:48:21 -0700 Subject: [PATCH 65/89] trying to fix warning in joystick.cpp --- plugins/hifiSdl2/src/Joystick.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/hifiSdl2/src/Joystick.cpp b/plugins/hifiSdl2/src/Joystick.cpp index c20670d4bb..69c83e5d23 100644 --- a/plugins/hifiSdl2/src/Joystick.cpp +++ b/plugins/hifiSdl2/src/Joystick.cpp @@ -25,7 +25,7 @@ Joystick::Joystick(SDL_JoystickID instanceId, SDL_GameController* sdlGameControl _instanceId(instanceId) { if (!_sdlHaptic) { - qDebug(SDL_GetError()); + qDebug() << SDL_GetError(); } SDL_HapticRumbleInit(_sdlHaptic); } From 7a3cba8580ab1fcfd1bcb04b18007a69b9785a4d Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Mon, 6 Jun 2016 17:06:59 -0700 Subject: [PATCH 66/89] warning be gone --- plugins/hifiSdl2/src/Joystick.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/hifiSdl2/src/Joystick.cpp b/plugins/hifiSdl2/src/Joystick.cpp index 69c83e5d23..aa6b358d38 100644 --- a/plugins/hifiSdl2/src/Joystick.cpp +++ b/plugins/hifiSdl2/src/Joystick.cpp @@ -25,7 +25,7 @@ Joystick::Joystick(SDL_JoystickID instanceId, SDL_GameController* sdlGameControl _instanceId(instanceId) { if (!_sdlHaptic) { - qDebug() << SDL_GetError(); + qDebug() << QString(SDL_GetError()); } SDL_HapticRumbleInit(_sdlHaptic); } From 577142a4d1a3e4d693d9499abe493c5797922b5b Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Mon, 6 Jun 2016 18:41:14 -0700 Subject: [PATCH 67/89] add ping pong target and milk pail game --- .../DomainContent/Home/hoverGame/wrapper.js | 19 ++-- .../DomainContent/Home/pingPongGun/target.js | 78 +++++++++++++++ .../DomainContent/Home/reset.js | 95 +++++++++++++++++++ 3 files changed, 184 insertions(+), 8 deletions(-) create mode 100644 unpublishedScripts/DomainContent/Home/pingPongGun/target.js diff --git a/unpublishedScripts/DomainContent/Home/hoverGame/wrapper.js b/unpublishedScripts/DomainContent/Home/hoverGame/wrapper.js index d38d4d47c3..a176e359fa 100644 --- a/unpublishedScripts/DomainContent/Home/hoverGame/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/hoverGame/wrapper.js @@ -9,7 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // - +//var position = {x:1098.4813,y:461.6781,z:-71.3820} +// var dimensions = {x:1.0233,y:3.1541,z:0.8684} HoverGame = function(spawnPosition, spawnRotation) { var scriptURL = "atp:/hoverGame/hoverInner.js"; @@ -18,11 +19,7 @@ HoverGame = function(spawnPosition, spawnRotation) { type: 'Model', modelURL: 'atp:/hoverGame/hover.fbx', name: 'home_model_hoverGame_container', - dimensions: { - x: 0.2543, - y: 0.3269, - z: 0.4154 - }, + dimensions: {x:1.0233,y:3.1541,z:0.8684}, compoundShapeURL: 'atp:/hoverGame/hoverHull.obj', rotation: spawnRotation, script: scriptURL, @@ -34,7 +31,7 @@ HoverGame = function(spawnPosition, spawnRotation) { 'reset': true } }), - dynamic: true, + dynamic: false, position: spawnPosition }; @@ -60,10 +57,16 @@ HoverGame = function(spawnPosition, spawnRotation) { y:-9.8, z:0 }, - position: spawnPosition + position: spawnPosition, + userData:JSON.stringify({ + grabKey:{ + shouldCollideWith:'static' + } + }) }; var hoverContainer = Entities.addEntity(hoverContainerProps); + var hoverBall = Entities.addEntity(hoverContainerProps); function cleanup() { print('HOVER GAME CLEANUP!') diff --git a/unpublishedScripts/DomainContent/Home/pingPongGun/target.js b/unpublishedScripts/DomainContent/Home/pingPongGun/target.js new file mode 100644 index 0000000000..4898973f97 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/pingPongGun/target.js @@ -0,0 +1,78 @@ +// +// Copyright 2016 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 +// + + +(function() { + + var _this = this; + _this.COLLISION_COOLDOWN_TIME = 5000; + + var startPosition = { + x: 1100.6343, + y: 460.5366, + z: -65.2142 + }; + + var startRotation = Quat.fromPitchYawRollDegrees(3.1471, -170.4121, -0.0060) + + _this.preload = function(entityID) { + + //set our id so other methods can get it. + _this.entityID = entityID; + + //variables we will use to keep track of when to reset the cow + _this.timeSinceLastCollision = 0; + _this.shouldUntip = true; + } + + _this.collisionWithEntity = function(myID, otherID, collisionInfo) { + //we dont actually use any of the parameters above, since we don't really care what we collided with, or the details of the collision. + print('JBP TARGET COLLISION') + //5 seconds after a collision, upright the target. protect from multiple collisions in a short timespan with the 'shouldUntip' variable + if (_this.shouldUntip) { + //in Hifi, preface setTimeout with Script.setTimeout + Script.setTimeout(function() { + _this.untip(); + _this.shouldUntip = true; + }, _this.COLLISION_COOLDOWN_TIME); + } + + _this.shouldUntip = false; + + } + + _this.untip = function() { + print('JBP SHOULD UNTIP') + var props = Entities.getEntityProperties(this.entityID); + var rotation = Quat.safeEulerAngles(props.rotation) + if (rotation.x > 3 || rotation.x < -3 || rotation.z > 3 || rotation.z < -3) { + print('too much pitch or roll, fix it'); + + //we zero out the velocity and angular velocity + Entities.editEntity(_this.entityID, { + position: startPosition, + rotation: startRotation, + velocity: { + x: 0, + y: 0, + z: 0 + }, + angularVelocity: { + x: 0, + y: 0, + z: 0 + } + }); + } + + + + } + + +}); \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index 9b00bc647a..65ec95cdac 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -202,6 +202,8 @@ _this.createKineticEntities(); _this.createScriptedEntities(); _this.setupDressingRoom(); + _this.createMilkPailBalls(); + _this.createTarget(); }, 750); } }, @@ -526,6 +528,99 @@ var dais = Entities.addEntity(daisProperties); }, + createTarget: function() { + var targetProperties = { + type: 'Model', + modelURL: 'atp:/pingPongGun/Target.fbx', + shapeType: 'Compound', + compoundShapeURL: 'atp:/pingPongGun/Target.obj', + dimensions: { + x: 0.4937, + y: 0.6816, + z: 0.0778 + }, + rotation: Quat.fromPitchYawRollDegrees(3.1471, -170.4121, -0.0060), + gravity: { + x: 0, + y: -9.8, + z: 0 + }, + velocity: { + x: 0, + y: -0.1, + z: 0 + }, + position: { + x: 1100.6343, + y: 460.5366, + z: -65.2142 + }, + userData: JSON.stringify({ + grabbableKey: { + grabbable: true + }, + hifiHomeKey: { + reset: true + } + }), + density:100, + dynamic: true + } + var target = Entities.addEntity(targetProperties); + }, + + createMilkPailBalls: function() { + var locations = [{ + x: 1099.0795, + y: 459.4186, + z: -70.8603 + }, { + x: 1099.2826, + y: 459.4186, + z: -70.9094 + }, { + x: 1099.5012, + y: 459.4186, + z: -71.1000 + }]; + + var ballProperties = { + type: 'Model', + modelURL: 'atp:/static_objects/StarBall.fbx', + shapeType: 'Sphere', + dimensions: { + x: 0.1646, + y: 0.1646, + z: 0.1646 + }, + gravity: { + x: 0, + y: -9.8, + z: 0 + }, + velocity: { + x: 0, + y: -0.1, + z: 0 + }, + userData: JSON.stringify({ + grabbableKey: { + grabbable: true + }, + hifiHomeKey: { + reset: true + } + }), + dynamic: true + }; + + locations.forEach(function(location) { + ballProperties.position = location; + var ball = Entities.addEntity(ballProperties); + }); + print('HOME made milk pail balls') + }, + createTransformers: function() { var firstDollPosition = { x: 1107.6, From 14b51d6615fec72c8f60fe55537b3220520bcc1a Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Tue, 7 Jun 2016 06:50:38 -0700 Subject: [PATCH 68/89] Use common code for AVX detection --- libraries/audio/src/AudioSRC.cpp | 87 +------------------------------- 1 file changed, 2 insertions(+), 85 deletions(-) diff --git a/libraries/audio/src/AudioSRC.cpp b/libraries/audio/src/AudioSRC.cpp index fbe109803e..98de36e655 100644 --- a/libraries/audio/src/AudioSRC.cpp +++ b/libraries/audio/src/AudioSRC.cpp @@ -370,95 +370,12 @@ int AudioSRC::multirateFilter2_SSE(const float* input0, const float* input1, flo return outputFrames; } -// -// Detect AVX/AVX2 support -// - -#if defined(_MSC_VER) - -#include - -static bool cpuSupportsAVX() { - int info[4]; - int mask = (1 << 27) | (1 << 28); // OSXSAVE and AVX - - __cpuidex(info, 0x1, 0); - - bool result = false; - if ((info[2] & mask) == mask) { - - if ((_xgetbv(_XCR_XFEATURE_ENABLED_MASK) & 0x6) == 0x6) { - result = true; - } - } - return result; -} - -static bool cpuSupportsAVX2() { - int info[4]; - int mask = (1 << 5); // AVX2 - - bool result = false; - if (cpuSupportsAVX()) { - - __cpuidex(info, 0x7, 0); - - if ((info[1] & mask) == mask) { - result = true; - } - } - return result; -} - -#elif defined(__GNUC__) - -#include - -static bool cpuSupportsAVX() { - unsigned int eax, ebx, ecx, edx; - unsigned int mask = (1 << 27) | (1 << 28); // OSXSAVE and AVX - - bool result = false; - if (__get_cpuid(0x1, &eax, &ebx, &ecx, &edx) && ((ecx & mask) == mask)) { - - __asm__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(0)); - if ((eax & 0x6) == 0x6) { - result = true; - } - } - return result; -} - -static bool cpuSupportsAVX2() { - unsigned int eax, ebx, ecx, edx; - unsigned mask = (1 << 5); // AVX2 - - bool result = false; - if (cpuSupportsAVX()) { - - if (__get_cpuid(0x7, &eax, &ebx, &ecx, &edx) && ((ebx & mask) == mask)) { - result = true; - } - } - return result; -} - -#else - -static bool cpuSupportsAVX() { - return false; -} - -static bool cpuSupportsAVX2() { - return false; -} - -#endif - // // Runtime CPU dispatch // +#include "CPUDetect.h" + int AudioSRC::multirateFilter1(const float* input0, float* output0, int inputFrames) { static auto f = cpuSupportsAVX2() ? &AudioSRC::multirateFilter1_AVX2 : &AudioSRC::multirateFilter1_SSE; From 27d39eb1b09eb3be43db30985c624669a7d329b0 Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Tue, 7 Jun 2016 06:53:50 -0700 Subject: [PATCH 69/89] Lightweight functions to detect SSE3, SSSE3, SSE4.1, SSS4.2, AVX and AVX2. These are cross platform, and return false on unsupported platforms. --- libraries/shared/src/CPUDetect.h | 181 +++++++++++++++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 libraries/shared/src/CPUDetect.h diff --git a/libraries/shared/src/CPUDetect.h b/libraries/shared/src/CPUDetect.h new file mode 100644 index 0000000000..c9d2eb649b --- /dev/null +++ b/libraries/shared/src/CPUDetect.h @@ -0,0 +1,181 @@ +// +// CPUDetect.h +// libraries/shared/src +// +// Created by Ken Cooke on 6/6/16. +// Copyright 2016 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 hifi_CPUDetect_h +#define hifi_CPUDetect_h + +// +// Lightweight functions to detect SSE/AVX/AVX2 support +// + +#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__x86_64__) +#define ARCH_X86 +#endif + +#define MASK_SSE3 (1 << 0) // SSE3 +#define MASK_SSSE3 (1 << 9) // SSSE3 +#define MASK_SSE41 (1 << 19) // SSE4.1 +#define MASK_SSE42 ((1 << 20) | (1 << 23)) // SSE4.2 and POPCNT +#define MASK_AVX ((1 << 27) | (1 << 28)) // OSXSAVE and AVX +#define MASK_AVX2 (1 << 5) // AVX2 + +#if defined(ARCH_X86) && defined(_MSC_VER) + +#include + +static inline bool cpuSupportsSSE3() { + int info[4]; + + __cpuidex(info, 0x1, 0); + + return ((info[2] & MASK_SSE3) == MASK_SSE3); +} + +static inline bool cpuSupportsSSSE3() { + int info[4]; + + __cpuidex(info, 0x1, 0); + + return ((info[2] & MASK_SSSE3) == MASK_SSSE3); +} + +static inline bool cpuSupportsSSE41() { + int info[4]; + + __cpuidex(info, 0x1, 0); + + return ((info[2] & MASK_SSE41) == MASK_SSE41); +} + +static inline bool cpuSupportsSSE42() { + int info[4]; + + __cpuidex(info, 0x1, 0); + + return ((info[2] & MASK_SSE42) == MASK_SSE42); +} + +static inline bool cpuSupportsAVX() { + int info[4]; + + __cpuidex(info, 0x1, 0); + + bool result = false; + if ((info[2] & MASK_AVX) == MASK_AVX) { + + // verify OS support for YMM state + if ((_xgetbv(_XCR_XFEATURE_ENABLED_MASK) & 0x6) == 0x6) { + result = true; + } + } + return result; +} + +static inline bool cpuSupportsAVX2() { + int info[4]; + + bool result = false; + if (cpuSupportsAVX()) { + + __cpuidex(info, 0x7, 0); + + if ((info[1] & MASK_AVX2) == MASK_AVX2) { + result = true; + } + } + return result; +} + +#elif defined(ARCH_X86) && defined(__GNUC__) + +#include + +static inline bool cpuSupportsSSE3() { + unsigned int eax, ebx, ecx, edx; + + return __get_cpuid(0x1, &eax, &ebx, &ecx, &edx) && ((ecx & MASK_SSE3) == MASK_SSE3); +} + +static inline bool cpuSupportsSSSE3() { + unsigned int eax, ebx, ecx, edx; + + return __get_cpuid(0x1, &eax, &ebx, &ecx, &edx) && ((ecx & MASK_SSSE3) == MASK_SSSE3); +} + +static inline bool cpuSupportsSSE41() { + unsigned int eax, ebx, ecx, edx; + + return __get_cpuid(0x1, &eax, &ebx, &ecx, &edx) && ((ecx & MASK_SSE41) == MASK_SSE41); +} + +static inline bool cpuSupportsSSE42() { + unsigned int eax, ebx, ecx, edx; + + return __get_cpuid(0x1, &eax, &ebx, &ecx, &edx) && ((ecx & MASK_SSE42) == MASK_SSE42); +} + +static inline bool cpuSupportsAVX() { + unsigned int eax, ebx, ecx, edx; + + bool result = false; + if (__get_cpuid(0x1, &eax, &ebx, &ecx, &edx) && ((ecx & MASK_AVX) == MASK_AVX)) { + + // verify OS support for YMM state + __asm__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(0)); + if ((eax & 0x6) == 0x6) { + result = true; + } + } + return result; +} + +static inline bool cpuSupportsAVX2() { + unsigned int eax, ebx, ecx, edx; + + bool result = false; + if (cpuSupportsAVX()) { + + if (__get_cpuid(0x7, &eax, &ebx, &ecx, &edx) && ((ebx & MASK_AVX2) == MASK_AVX2)) { + result = true; + } + } + return result; +} + +#else + +static inline bool cpuSupportsSSE3() { + return false; +} + +static inline bool cpuSupportsSSSE3() { + return false; +} + +static inline bool cpuSupportsSSE41() { + return false; +} + +static inline bool cpuSupportsSSE42() { + return false; +} + +static inline bool cpuSupportsAVX() { + return false; +} + +static inline bool cpuSupportsAVX2() { + return false; +} + +#endif + +#endif // hifi_CPUDetect_h From dd97f16728575b1c0b9c703536e6df7de756a635 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Tue, 7 Jun 2016 11:42:58 -0700 Subject: [PATCH 70/89] investigating xbox failure on restart (WIP) --- .../controllers/src/controllers/UserInputMapper.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libraries/controllers/src/controllers/UserInputMapper.cpp b/libraries/controllers/src/controllers/UserInputMapper.cpp index c1ee3ce36c..e3a520e6c4 100755 --- a/libraries/controllers/src/controllers/UserInputMapper.cpp +++ b/libraries/controllers/src/controllers/UserInputMapper.cpp @@ -77,7 +77,7 @@ void UserInputMapper::registerDevice(InputDevice::Pointer device) { } const auto& deviceID = device->_deviceID; - recordDeviceOfType(device->getName()); + //recordDeviceOfType(device->getName()); qCDebug(controllers) << "Registered input device <" << device->getName() << "> deviceID = " << deviceID; @@ -134,6 +134,15 @@ void UserInputMapper::removeDevice(int deviceID) { _mappingsByDevice.erase(mappingsEntry); } + for (const auto& inputMapping : device->getAvailableInputs()) { + const auto& input = inputMapping.first; + auto endpoint = _endpointsByInput.find(input); + if (endpoint != _endpointsByInput.end()) { + _inputsByEndpoint.erase((*endpoint).second); + _endpointsByInput.erase(input); + } + } + _registeredDevices.erase(proxyEntry); emit hardwareChanged(); From ff2405437bbbda73d4caaf6df2efca9c94709be1 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Tue, 7 Jun 2016 12:19:38 -0700 Subject: [PATCH 71/89] can set strength to 0 --- .../oculus/src/OculusControllerManager.cpp | 26 +++++++++++++------ plugins/openvr/src/ViveControllerManager.cpp | 18 ++++++++++--- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/plugins/oculus/src/OculusControllerManager.cpp b/plugins/oculus/src/OculusControllerManager.cpp index 02ac44d77c..f00b943d7c 100644 --- a/plugins/oculus/src/OculusControllerManager.cpp +++ b/plugins/oculus/src/OculusControllerManager.cpp @@ -253,18 +253,28 @@ bool OculusControllerManager::TouchDevice::triggerHapticPulse(float strength, fl Locker locker(_lock); bool toReturn = true; if (hand == controller::BOTH || hand == controller::LEFT) { - _leftHapticStrength = (duration > _leftHapticDuration) ? strength : _leftHapticStrength; - if (ovr_SetControllerVibration(_parent._session, ovrControllerType_LTouch, 1.0f, _leftHapticStrength) != ovrSuccess) { - toReturn = false; + if (strength == 0.0f) { + _leftHapticStrength = 0.0f; + _leftHapticDuration = 0.0f; + } else { + _leftHapticStrength = (duration > _leftHapticDuration) ? strength : _leftHapticStrength; + if (ovr_SetControllerVibration(_parent._session, ovrControllerType_LTouch, 1.0f, _leftHapticStrength) != ovrSuccess) { + toReturn = false; + } + _leftHapticDuration = std::max(duration, _leftHapticDuration); } - _leftHapticDuration = std::max(duration, _leftHapticDuration); } if (hand == controller::BOTH || hand == controller::RIGHT) { - _rightHapticStrength = (duration > _rightHapticDuration) ? strength : _rightHapticStrength; - if (ovr_SetControllerVibration(_parent._session, ovrControllerType_RTouch, 1.0f, _rightHapticStrength) != ovrSuccess) { - toReturn = false; + if (strength == 0.0f) { + _rightHapticStrength = 0.0f; + _rightHapticDuration = 0.0f; + } else { + _rightHapticStrength = (duration > _rightHapticDuration) ? strength : _rightHapticStrength; + if (ovr_SetControllerVibration(_parent._session, ovrControllerType_RTouch, 1.0f, _rightHapticStrength) != ovrSuccess) { + toReturn = false; + } + _rightHapticDuration = std::max(duration, _rightHapticDuration); } - _rightHapticDuration = std::max(duration, _rightHapticDuration); } return toReturn; } diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index 7254117922..74c232af33 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -455,12 +455,22 @@ void ViveControllerManager::InputDevice::handlePoseEvent(float deltaTime, const bool ViveControllerManager::InputDevice::triggerHapticPulse(float strength, float duration, controller::Hand hand) { Locker locker(_lock); if (hand == controller::BOTH || hand == controller::LEFT) { - _leftHapticStrength = (duration > _leftHapticDuration) ? strength : _leftHapticStrength; - _leftHapticDuration = std::max(duration, _leftHapticDuration); + if (strength == 0.0f) { + _leftHapticStrength = 0.0f; + _leftHapticDuration = 0.0f; + } else { + _leftHapticStrength = (duration > _leftHapticDuration) ? strength : _leftHapticStrength; + _leftHapticDuration = std::max(duration, _leftHapticDuration); + } } if (hand == controller::BOTH || hand == controller::RIGHT) { - _rightHapticStrength = (duration > _rightHapticDuration) ? strength : _rightHapticStrength; - _rightHapticDuration = std::max(duration, _rightHapticDuration); + if (strength == 0.0f) { + _rightHapticStrength = 0.0f; + _rightHapticDuration = 0.0f; + } else { + _rightHapticStrength = (duration > _rightHapticDuration) ? strength : _rightHapticStrength; + _rightHapticDuration = std::max(duration, _rightHapticDuration); + } } return true; } From 2e71a635749350960c2c5d8b171b18a2391b77c0 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Tue, 7 Jun 2016 13:28:10 -0700 Subject: [PATCH 72/89] cr fixes --- plugins/hifiSdl2/src/Joystick.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/hifiSdl2/src/Joystick.cpp b/plugins/hifiSdl2/src/Joystick.cpp index aa6b358d38..e88fe8b958 100644 --- a/plugins/hifiSdl2/src/Joystick.cpp +++ b/plugins/hifiSdl2/src/Joystick.cpp @@ -25,9 +25,12 @@ Joystick::Joystick(SDL_JoystickID instanceId, SDL_GameController* sdlGameControl _instanceId(instanceId) { if (!_sdlHaptic) { - qDebug() << QString(SDL_GetError()); + qDebug() << "SDL Haptic Open Failure: " << QString(SDL_GetError()); + } else { + if (SDL_HapticRumbleInit(_sdlHaptic) != 0) { + qDebug() << "SDL Haptic Rumble Init Failure: " << QString(SDL_GetError()); + } } - SDL_HapticRumbleInit(_sdlHaptic); } Joystick::~Joystick() { @@ -35,7 +38,9 @@ Joystick::~Joystick() { } void Joystick::closeJoystick() { - SDL_HapticClose(_sdlHaptic); + if (_sdlHaptic) { + SDL_HapticClose(_sdlHaptic); + } SDL_GameControllerClose(_sdlGameController); } From 9f4289ae1b164391e4a44b81e3d790fe2088bed9 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Tue, 7 Jun 2016 13:31:42 -0700 Subject: [PATCH 73/89] add down velocity to shelfy things --- .../Home/kineticObjects/wrapper.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js b/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js index 5ddea20560..0dee32d05c 100644 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js @@ -254,6 +254,7 @@ StuffOnShelves = function(spawnLocation, spawnRotation) { print('CREATE STUFF ON SHELVES'); var created = []; + function create() { var success = Clipboard.importEntities(STUFF_ON_SHELVES_URL); if (success === true) { @@ -268,6 +269,8 @@ StuffOnShelves = function(spawnLocation, spawnRotation) { }) }; + + create(); this.cleanup = cleanup; @@ -300,11 +303,26 @@ Bricabrac = function(spawnLocation, spawnRotation) { print('HOME CREATE BRICABRAC'); var created = []; + function addVelocityDown() { + print('HOME ADDING DOWN VELOCITY TO DRESSING ROOM ITEMS') + created.forEach(function(obj) { + Entities.editEntity(obj, { + velocity: { + x: 0, + y: -0.1, + z: 0 + } + }); + }) + } + function create() { var success = Clipboard.importEntities(BRICABRAC_URL); if (success === true) { created = Clipboard.pasteEntities(spawnLocation) print('created ' + created); + addVelocityDown(); + } }; From 6573b3c71e72da122c337a9ff6ce2353cfb8bac7 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Tue, 7 Jun 2016 14:37:19 -0700 Subject: [PATCH 74/89] remove bricabrac from dressing room shelves for now --- scripts/defaultScripts.js | 2 +- .../Home/kineticObjects/wrapper.js | 68 +++++++++++-------- .../DomainContent/Home/reset.js | 10 +-- 3 files changed, 46 insertions(+), 34 deletions(-) diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index f460ddf88f..4fd17a1c6f 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -21,4 +21,4 @@ Script.load("system/controllers/handControllerPointer.js"); Script.load("system/controllers/squeezeHands.js"); Script.load("system/controllers/grab.js"); Script.load("system/dialTone.js"); -Script.load("system/attachedEntitiesManager.js"); \ No newline at end of file +// Script.load("system/attachedEntitiesManager.js"); \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js b/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js index 0dee32d05c..d4512823db 100644 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js @@ -279,32 +279,8 @@ StuffOnShelves = function(spawnLocation, spawnRotation) { HomeJunk = function(spawnLocation, spawnRotation) { print('HOME CREATE JUNK'); var created = []; - - function create() { - var success = Clipboard.importEntities(JUNK_URL); - if (success === true) { - created = Clipboard.pasteEntities(spawnLocation) - print('created ' + created); - } - }; - - function cleanup() { - created.forEach(function(obj) { - Entities.deleteEntity(obj); - }) - }; - - create(); - - this.cleanup = cleanup; -} - -Bricabrac = function(spawnLocation, spawnRotation) { - print('HOME CREATE BRICABRAC'); - var created = []; - function addVelocityDown() { - print('HOME ADDING DOWN VELOCITY TO DRESSING ROOM ITEMS') + print('HOME ADDING DOWN VELOCITY TO SHELF ITEMS') created.forEach(function(obj) { Entities.editEntity(obj, { velocity: { @@ -315,14 +291,12 @@ Bricabrac = function(spawnLocation, spawnRotation) { }); }) } - function create() { - var success = Clipboard.importEntities(BRICABRAC_URL); + var success = Clipboard.importEntities(JUNK_URL); if (success === true) { created = Clipboard.pasteEntities(spawnLocation) print('created ' + created); addVelocityDown(); - } }; @@ -337,6 +311,44 @@ Bricabrac = function(spawnLocation, spawnRotation) { this.cleanup = cleanup; } +// Bricabrac = function(spawnLocation, spawnRotation) { +// print('HOME CREATE BRICABRAC'); +// var created = []; + +// function addVelocityDown() { +// print('HOME ADDING DOWN VELOCITY TO DRESSING ROOM ITEMS') +// created.forEach(function(obj) { +// Entities.editEntity(obj, { +// velocity: { +// x: 0, +// y: -0.1, +// z: 0 +// } +// }); +// }) +// } + +// function create() { +// var success = Clipboard.importEntities(BRICABRAC_URL); +// if (success === true) { +// created = Clipboard.pasteEntities(spawnLocation) +// print('created ' + created); +// addVelocityDown(); + +// } +// }; + +// function cleanup() { +// created.forEach(function(obj) { +// Entities.deleteEntity(obj); +// }) +// }; + +// create(); + +// this.cleanup = cleanup; +// } + Bench = function(spawnLocation, spawnRotation) { print('HOME CREATE BENCH'); var created = []; diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index 65ec95cdac..7e69e1782b 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -422,11 +422,11 @@ z: -73.3 }); - var dressingRoomBricabrac = new Bricabrac({ - x: 1106.8, - y: 460.3909, - z: -72.6 - }); + // var dressingRoomBricabrac = new Bricabrac({ + // x: 1106.8, + // y: 460.3909, + // z: -72.6 + // }); var bench = new Bench({ x: 1100.1210, From c545f53c75041280d40bd7a1f1e7007c2c7e1a29 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Tue, 7 Jun 2016 14:43:23 -0700 Subject: [PATCH 75/89] target script attached in reset spawner --- unpublishedScripts/DomainContent/Home/pingPongGun/target.js | 6 ++---- unpublishedScripts/DomainContent/Home/reset.js | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/pingPongGun/target.js b/unpublishedScripts/DomainContent/Home/pingPongGun/target.js index 4898973f97..1a8ea6a25b 100644 --- a/unpublishedScripts/DomainContent/Home/pingPongGun/target.js +++ b/unpublishedScripts/DomainContent/Home/pingPongGun/target.js @@ -32,8 +32,7 @@ _this.collisionWithEntity = function(myID, otherID, collisionInfo) { //we dont actually use any of the parameters above, since we don't really care what we collided with, or the details of the collision. - print('JBP TARGET COLLISION') - //5 seconds after a collision, upright the target. protect from multiple collisions in a short timespan with the 'shouldUntip' variable + //5 seconds after a collision, upright the target. protect from multiple collisions in a short timespan with the 'shouldUntip' variable if (_this.shouldUntip) { //in Hifi, preface setTimeout with Script.setTimeout Script.setTimeout(function() { @@ -47,11 +46,10 @@ } _this.untip = function() { - print('JBP SHOULD UNTIP') var props = Entities.getEntityProperties(this.entityID); var rotation = Quat.safeEulerAngles(props.rotation) if (rotation.x > 3 || rotation.x < -3 || rotation.z > 3 || rotation.z < -3) { - print('too much pitch or roll, fix it'); + print('home target - too much pitch or roll, fix it'); //we zero out the velocity and angular velocity Entities.editEntity(_this.entityID, { diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index 7e69e1782b..cd1dcea76e 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -563,7 +563,8 @@ reset: true } }), - density:100, + script: 'atp:/pingPongGun/target.js', + density: 100, dynamic: true } var target = Entities.addEntity(targetProperties); From 5daccba235814bdf3f61ebf5e76813330aa66b69 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Tue, 7 Jun 2016 15:14:08 -0700 Subject: [PATCH 76/89] xbox controller works on restart --- libraries/controllers/src/controllers/UserInputMapper.cpp | 6 +++++- libraries/controllers/src/controllers/UserInputMapper.h | 2 +- plugins/hifiSdl2/src/Joystick.cpp | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libraries/controllers/src/controllers/UserInputMapper.cpp b/libraries/controllers/src/controllers/UserInputMapper.cpp index e3a520e6c4..9132b9d3a5 100755 --- a/libraries/controllers/src/controllers/UserInputMapper.cpp +++ b/libraries/controllers/src/controllers/UserInputMapper.cpp @@ -77,7 +77,7 @@ void UserInputMapper::registerDevice(InputDevice::Pointer device) { } const auto& deviceID = device->_deviceID; - //recordDeviceOfType(device->getName()); + recordDeviceOfType(device->getName()); qCDebug(controllers) << "Registered input device <" << device->getName() << "> deviceID = " << deviceID; @@ -126,6 +126,10 @@ void UserInputMapper::removeDevice(int deviceID) { auto device = proxyEntry->second; qCDebug(controllers) << "Unregistering input device <" << device->getName() << "> deviceID = " << deviceID; + if (!_deviceCounts.contains(device->getName())) { + _deviceCounts[device->getName()] -= 1; + } + unloadMappings(device->getDefaultMappingConfigs()); auto mappingsEntry = _mappingsByDevice.find(deviceID); diff --git a/libraries/controllers/src/controllers/UserInputMapper.h b/libraries/controllers/src/controllers/UserInputMapper.h index 9c79415b6e..2c8aabc099 100644 --- a/libraries/controllers/src/controllers/UserInputMapper.h +++ b/libraries/controllers/src/controllers/UserInputMapper.h @@ -142,7 +142,7 @@ namespace controller { std::vector _lastStandardStates = std::vector(); int recordDeviceOfType(const QString& deviceName); - QHash _deviceCounts; + QHash _deviceCounts; static float getValue(const EndpointPointer& endpoint, bool peek = false); static Pose getPose(const EndpointPointer& endpoint, bool peek = false); diff --git a/plugins/hifiSdl2/src/Joystick.cpp b/plugins/hifiSdl2/src/Joystick.cpp index a109656489..614adff7d6 100644 --- a/plugins/hifiSdl2/src/Joystick.cpp +++ b/plugins/hifiSdl2/src/Joystick.cpp @@ -64,7 +64,7 @@ void Joystick::handleButtonEvent(const SDL_ControllerButtonEvent& event) { controller::Input::NamedVector Joystick::getAvailableInputs() const { using namespace controller; - static const Input::NamedVector availableInputs{ + const Input::NamedVector availableInputs{ makePair(A, "A"), makePair(B, "B"), makePair(X, "X"), From 545dda0a9887652942e6368da1be64a7ace3b441 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Tue, 7 Jun 2016 15:15:42 -0700 Subject: [PATCH 77/89] whoops --- libraries/controllers/src/controllers/UserInputMapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/controllers/src/controllers/UserInputMapper.cpp b/libraries/controllers/src/controllers/UserInputMapper.cpp index 9132b9d3a5..9dbad89a9b 100755 --- a/libraries/controllers/src/controllers/UserInputMapper.cpp +++ b/libraries/controllers/src/controllers/UserInputMapper.cpp @@ -126,7 +126,7 @@ void UserInputMapper::removeDevice(int deviceID) { auto device = proxyEntry->second; qCDebug(controllers) << "Unregistering input device <" << device->getName() << "> deviceID = " << deviceID; - if (!_deviceCounts.contains(device->getName())) { + if (_deviceCounts.contains(device->getName())) { _deviceCounts[device->getName()] -= 1; } From a87483dfff3bdedb0b6c74e5e3aa27c20c437ba8 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 8 Jun 2016 10:55:14 +1200 Subject: [PATCH 78/89] Fix colors of buttons in Asset Browser dialog --- interface/resources/qml/AssetServer.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/interface/resources/qml/AssetServer.qml b/interface/resources/qml/AssetServer.qml index 370bc92d81..6d2e8e7ba0 100644 --- a/interface/resources/qml/AssetServer.qml +++ b/interface/resources/qml/AssetServer.qml @@ -341,7 +341,7 @@ Window { HifiControls.GlyphButton { glyph: hifi.glyphs.reload - color: hifi.buttons.white + color: hifi.buttons.black colorScheme: root.colorScheme width: hifi.dimensions.controlLineHeight @@ -349,8 +349,8 @@ Window { } HifiControls.Button { - text: "ADD TO WORLD" - color: hifi.buttons.white + text: "Add To World" + color: hifi.buttons.black colorScheme: root.colorScheme width: 120 @@ -360,8 +360,8 @@ Window { } HifiControls.Button { - text: "RENAME" - color: hifi.buttons.white + text: "Rename" + color: hifi.buttons.black colorScheme: root.colorScheme width: 80 @@ -372,7 +372,7 @@ Window { HifiControls.Button { id: deleteButton - text: "DELETE" + text: "Delete" color: hifi.buttons.red colorScheme: root.colorScheme width: 80 From 30d8ae36e8db11d17f7e4ea237ed89771630d221 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Tue, 7 Jun 2016 16:55:32 -0700 Subject: [PATCH 79/89] Added MyAvatar.characterControllerEnabled property --- interface/src/avatar/MyAvatar.cpp | 26 ++++++++++++++++++++------ interface/src/avatar/MyAvatar.h | 4 ++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 0f723d29e3..3495a05962 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -234,7 +234,7 @@ QByteArray MyAvatar::toByteArray(bool cullSmallChanges, bool sendAll) { void MyAvatar::reset(bool andRecenter, bool andReload, bool andHead) { if (QThread::currentThread() != thread()) { - QMetaObject::invokeMethod(this, "reset", Q_ARG(bool, andRecenter)); + QMetaObject::invokeMethod(this, "reset", Q_ARG(bool, andRecenter), Q_ARG(bool, andReload), Q_ARG(bool, andHead)); return; } @@ -1816,6 +1816,16 @@ void MyAvatar::updateMotionBehaviorFromMenu() { _motionBehaviors &= ~AVATAR_MOTION_SCRIPTED_MOTOR_ENABLED; } + setCharacterControllerEnabled(menu->isOptionChecked(MenuOption::EnableCharacterController)); +} + +void MyAvatar::setCharacterControllerEnabled(bool enabled) { + + if (QThread::currentThread() != thread()) { + QMetaObject::invokeMethod(this, "setCharacterControllerEnabled", Q_ARG(bool, enabled)); + return; + } + bool ghostingAllowed = true; EntityTreeRenderer* entityTreeRenderer = qApp->getEntities(); if (entityTreeRenderer) { @@ -1824,12 +1834,16 @@ void MyAvatar::updateMotionBehaviorFromMenu() { ghostingAllowed = zone->getGhostingAllowed(); } } - bool checked = menu->isOptionChecked(MenuOption::EnableCharacterController); - if (!ghostingAllowed) { - checked = true; - } + _characterController.setEnabled(ghostingAllowed ? enabled : true); +} - _characterController.setEnabled(checked); +bool MyAvatar::getCharacterControllerEnabled() { + if (QThread::currentThread() != thread()) { + bool result; + QMetaObject::invokeMethod(this, "getCharacterControllerEnabled", Qt::BlockingQueuedConnection, Q_RETURN_ARG(bool, result)); + return result; + } + return _characterController.isEnabled(); } void MyAvatar::clearDriveKeys() { diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index a938aea675..05afe39a32 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -84,6 +84,7 @@ class MyAvatar : public Avatar { Q_PROPERTY(float energy READ getEnergy WRITE setEnergy) Q_PROPERTY(bool hmdLeanRecenterEnabled READ getHMDLeanRecenterEnabled WRITE setHMDLeanRecenterEnabled) + Q_PROPERTY(bool characterControllerEnabled READ getCharacterControllerEnabled WRITE setCharacterControllerEnabled) public: explicit MyAvatar(RigPointer rig); @@ -265,6 +266,9 @@ public: controller::Pose getLeftHandControllerPoseInAvatarFrame() const; controller::Pose getRightHandControllerPoseInAvatarFrame() const; + Q_INVOKABLE void setCharacterControllerEnabled(bool enabled); + Q_INVOKABLE bool getCharacterControllerEnabled(); + public slots: void increaseSize(); void decreaseSize(); From 2c1d20bd1af4abf59a30f86125f5b2c24210b769 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Tue, 7 Jun 2016 17:12:24 -0700 Subject: [PATCH 80/89] removed _deviceCounts, cache joystick available inputs, added deadzone to gamepad thumbsticks --- interface/resources/controllers/xbox.json | 8 +- .../src/controllers/UserInputMapper.cpp | 14 --- .../src/controllers/UserInputMapper.h | 3 - plugins/hifiSdl2/src/Joystick.cpp | 94 ++++++++++--------- plugins/hifiSdl2/src/Joystick.h | 2 + 5 files changed, 54 insertions(+), 67 deletions(-) diff --git a/interface/resources/controllers/xbox.json b/interface/resources/controllers/xbox.json index 8c341dff83..fdac70ff33 100644 --- a/interface/resources/controllers/xbox.json +++ b/interface/resources/controllers/xbox.json @@ -1,14 +1,14 @@ { "name": "XBox to Standard", "channels": [ - { "from": "GamePad.LY", "to": "Standard.LY" }, - { "from": "GamePad.LX", "to": "Standard.LX" }, + { "from": "GamePad.LY", "filters": { "type": "deadZone", "min": 0.05 }, "to": "Standard.LY" }, + { "from": "GamePad.LX", "filters": { "type": "deadZone", "min": 0.05 }, "to": "Standard.LX" }, { "from": "GamePad.LT", "to": "Standard.LT" }, { "from": "GamePad.LB", "to": "Standard.LB" }, { "from": "GamePad.LS", "to": "Standard.LS" }, - { "from": "GamePad.RY", "to": "Standard.RY" }, - { "from": "GamePad.RX", "to": "Standard.RX" }, + { "from": "GamePad.RY", "filters": { "type": "deadZone", "min": 0.05 }, "to": "Standard.RY" }, + { "from": "GamePad.RX", "filters": { "type": "deadZone", "min": 0.05 }, "to": "Standard.RX" }, { "from": "GamePad.RT", "to": "Standard.RT" }, { "from": "GamePad.RB", "to": "Standard.RB" }, { "from": "GamePad.RS", "to": "Standard.RS" }, diff --git a/libraries/controllers/src/controllers/UserInputMapper.cpp b/libraries/controllers/src/controllers/UserInputMapper.cpp index 9dbad89a9b..4df460cbea 100755 --- a/libraries/controllers/src/controllers/UserInputMapper.cpp +++ b/libraries/controllers/src/controllers/UserInputMapper.cpp @@ -62,14 +62,6 @@ namespace controller { UserInputMapper::~UserInputMapper() { } -int UserInputMapper::recordDeviceOfType(const QString& deviceName) { - if (!_deviceCounts.contains(deviceName)) { - _deviceCounts[deviceName] = 0; - } - _deviceCounts[deviceName] += 1; - return _deviceCounts[deviceName]; -} - void UserInputMapper::registerDevice(InputDevice::Pointer device) { Locker locker(_lock); if (device->_deviceID == Input::INVALID_DEVICE) { @@ -77,8 +69,6 @@ void UserInputMapper::registerDevice(InputDevice::Pointer device) { } const auto& deviceID = device->_deviceID; - recordDeviceOfType(device->getName()); - qCDebug(controllers) << "Registered input device <" << device->getName() << "> deviceID = " << deviceID; for (const auto& inputMapping : device->getAvailableInputs()) { @@ -126,10 +116,6 @@ void UserInputMapper::removeDevice(int deviceID) { auto device = proxyEntry->second; qCDebug(controllers) << "Unregistering input device <" << device->getName() << "> deviceID = " << deviceID; - if (_deviceCounts.contains(device->getName())) { - _deviceCounts[device->getName()] -= 1; - } - unloadMappings(device->getDefaultMappingConfigs()); auto mappingsEntry = _mappingsByDevice.find(deviceID); diff --git a/libraries/controllers/src/controllers/UserInputMapper.h b/libraries/controllers/src/controllers/UserInputMapper.h index 2c8aabc099..f752b05b9f 100644 --- a/libraries/controllers/src/controllers/UserInputMapper.h +++ b/libraries/controllers/src/controllers/UserInputMapper.h @@ -141,9 +141,6 @@ namespace controller { std::vector _poseStates = std::vector(toInt(Action::NUM_ACTIONS)); std::vector _lastStandardStates = std::vector(); - int recordDeviceOfType(const QString& deviceName); - QHash _deviceCounts; - static float getValue(const EndpointPointer& endpoint, bool peek = false); static Pose getPose(const EndpointPointer& endpoint, bool peek = false); diff --git a/plugins/hifiSdl2/src/Joystick.cpp b/plugins/hifiSdl2/src/Joystick.cpp index 614adff7d6..7233bf3079 100644 --- a/plugins/hifiSdl2/src/Joystick.cpp +++ b/plugins/hifiSdl2/src/Joystick.cpp @@ -64,53 +64,55 @@ void Joystick::handleButtonEvent(const SDL_ControllerButtonEvent& event) { controller::Input::NamedVector Joystick::getAvailableInputs() const { using namespace controller; - const Input::NamedVector availableInputs{ - makePair(A, "A"), - makePair(B, "B"), - makePair(X, "X"), - makePair(Y, "Y"), - // DPad - makePair(DU, "DU"), - makePair(DD, "DD"), - makePair(DL, "DL"), - makePair(DR, "DR"), - // Bumpers - makePair(LB, "LB"), - makePair(RB, "RB"), - // Stick press - makePair(LS, "LS"), - makePair(RS, "RS"), - // Center buttons - makePair(START, "Start"), - makePair(BACK, "Back"), - // Analog sticks - makePair(LX, "LX"), - makePair(LY, "LY"), - makePair(RX, "RX"), - makePair(RY, "RY"), - - // Triggers - makePair(LT, "LT"), - makePair(RT, "RT"), + if (_availableInputs.length() == 0) { + _availableInputs = { + makePair(A, "A"), + makePair(B, "B"), + makePair(X, "X"), + makePair(Y, "Y"), + // DPad + makePair(DU, "DU"), + makePair(DD, "DD"), + makePair(DL, "DL"), + makePair(DR, "DR"), + // Bumpers + makePair(LB, "LB"), + makePair(RB, "RB"), + // Stick press + makePair(LS, "LS"), + makePair(RS, "RS"), + // Center buttons + makePair(START, "Start"), + makePair(BACK, "Back"), + // Analog sticks + makePair(LX, "LX"), + makePair(LY, "LY"), + makePair(RX, "RX"), + makePair(RY, "RY"), - // Aliases, PlayStation style names - makePair(LB, "L1"), - makePair(RB, "R1"), - makePair(LT, "L2"), - makePair(RT, "R2"), - makePair(LS, "L3"), - makePair(RS, "R3"), - makePair(BACK, "Select"), - makePair(A, "Cross"), - makePair(B, "Circle"), - makePair(X, "Square"), - makePair(Y, "Triangle"), - makePair(DU, "Up"), - makePair(DD, "Down"), - makePair(DL, "Left"), - makePair(DR, "Right"), - }; - return availableInputs; + // Triggers + makePair(LT, "LT"), + makePair(RT, "RT"), + + // Aliases, PlayStation style names + makePair(LB, "L1"), + makePair(RB, "R1"), + makePair(LT, "L2"), + makePair(RT, "R2"), + makePair(LS, "L3"), + makePair(RS, "R3"), + makePair(BACK, "Select"), + makePair(A, "Cross"), + makePair(B, "Circle"), + makePair(X, "Square"), + makePair(Y, "Triangle"), + makePair(DU, "Up"), + makePair(DD, "Down"), + makePair(DL, "Left"), + makePair(DR, "Right"), + }; + } + return _availableInputs; } QString Joystick::getDefaultMappingConfig() const { diff --git a/plugins/hifiSdl2/src/Joystick.h b/plugins/hifiSdl2/src/Joystick.h index e2eaeaef8b..fb4d205689 100644 --- a/plugins/hifiSdl2/src/Joystick.h +++ b/plugins/hifiSdl2/src/Joystick.h @@ -53,6 +53,8 @@ private: SDL_GameController* _sdlGameController; SDL_Joystick* _sdlJoystick; SDL_JoystickID _instanceId; + + mutable controller::Input::NamedVector _availableInputs; }; #endif // hifi_Joystick_h From 65e2cdbbf366a75b5cc70f36014e314392585947 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Wed, 8 Jun 2016 13:44:53 -0700 Subject: [PATCH 81/89] clear dead code --- scripts/defaultScripts.js | 1 - scripts/system/attachedEntitiesManager.js | 20 -------------------- 2 files changed, 21 deletions(-) diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index 4fd17a1c6f..2a050d183e 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -21,4 +21,3 @@ Script.load("system/controllers/handControllerPointer.js"); Script.load("system/controllers/squeezeHands.js"); Script.load("system/controllers/grab.js"); Script.load("system/dialTone.js"); -// Script.load("system/attachedEntitiesManager.js"); \ No newline at end of file diff --git a/scripts/system/attachedEntitiesManager.js b/scripts/system/attachedEntitiesManager.js index fcd48b664c..ee852d8d65 100644 --- a/scripts/system/attachedEntitiesManager.js +++ b/scripts/system/attachedEntitiesManager.js @@ -86,10 +86,6 @@ function AttachedEntitiesManager() { if (channel !== 'Hifi-Object-Manipulation') { return; } - // if (sender !== MyAvatar.sessionUUID) { - // print('wearablesManager got message from wrong sender'); - // return; - // } var parsedMessage = null; @@ -116,11 +112,6 @@ function AttachedEntitiesManager() { this.handleEntityRelease = function(grabbedEntity, releasedFromJoint) { // if this is still equipped, just rewrite the position information. var grabData = getEntityCustomData('grabKey', grabbedEntity, {}); - // if ("refCount" in grabData && grabData.refCount > 0) { - // // for adjusting things in your other hand - // manager.updateRelativeOffsets(grabbedEntity); - // return; - // } var allowedJoints = getEntityCustomData('wearable', grabbedEntity, DEFAULT_WEARABLE_DATA).joints; @@ -221,17 +212,6 @@ function AttachedEntitiesManager() { return false; } - // this.toggleLocked = function() { - // print("toggleLocked"); - // if (clothingLocked) { - // clothingLocked = false; - // toolBar.setImageURL(Script.resolvePath("assets/images/unlock.svg"), lockButton); - // } else { - // clothingLocked = true; - // toolBar.setImageURL(Script.resolvePath("assets/images/lock.svg"), lockButton); - // } - // } - // this.saveAttachedEntities = function() { // print("--- saving attached entities ---"); // saveData = []; From 9926c809179c8d98efdbce5afd497bd59b2ee63c Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Wed, 8 Jun 2016 18:15:34 -0500 Subject: [PATCH 82/89] Only check user metadata before sending --- domain-server/src/DomainMetadata.cpp | 14 +++++++++++--- domain-server/src/DomainMetadata.h | 10 ++++++++++ domain-server/src/DomainServer.cpp | 5 +++++ domain-server/src/DomainServer.h | 1 + 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/domain-server/src/DomainMetadata.cpp b/domain-server/src/DomainMetadata.cpp index 8fdbc2bbd1..26d2bb87ce 100644 --- a/domain-server/src/DomainMetadata.cpp +++ b/domain-server/src/DomainMetadata.cpp @@ -79,11 +79,11 @@ void DomainMetadata::setDescriptors(QVariantMap& settings) { _metadata[DESCRIPTORS] = descriptors; #if DEV_BUILD || PR_BUILD - qDebug() << "Regenerated domain metadata - descriptors:" << descriptors; + qDebug() << "Domain metadata descriptors set:" << descriptors; #endif } -void DomainMetadata::usersChanged() { +void DomainMetadata::updateUsers() { static const QString DEFAULT_HOSTNAME = "*"; auto nodeList = DependencyManager::get(); @@ -119,6 +119,14 @@ void DomainMetadata::usersChanged() { _metadata[USERS] = users; #if DEV_BUILD || PR_BUILD - qDebug() << "Regenerated domain metadata - users:" << users; + qDebug() << "Domain metadata users updated:" << users; +#endif +} + +void DomainMetadata::usersChanged() { + ++_tic; + +#if DEV_BUILD || PR_BUILD + qDebug() << "Domain metadata users change detected"; #endif } diff --git a/domain-server/src/DomainMetadata.h b/domain-server/src/DomainMetadata.h index e2f4674afc..7d58d43182 100644 --- a/domain-server/src/DomainMetadata.h +++ b/domain-server/src/DomainMetadata.h @@ -11,6 +11,8 @@ #ifndef hifi_DomainMetadata_h #define hifi_DomainMetadata_h +#include + #include #include @@ -39,17 +41,25 @@ Q_OBJECT public: DomainMetadata(); + // Returns the last set metadata + // If connected users have changed, metadata may need to be updated + // this should be checked by storing tic = getTic() between calls + // and testing it for equality before the next get (tic == getTic()) QJsonObject get() { return QJsonObject::fromVariantMap(_metadata); } QJsonObject getUsers() { return QJsonObject::fromVariantMap(_metadata[USERS].toMap()); } QJsonObject getDescriptors() { return QJsonObject::fromVariantMap(_metadata[DESCRIPTORS].toMap()); } + uint32_t getTic() { return _tic; } + void setDescriptors(QVariantMap& settings); + void updateUsers(); public slots: void usersChanged(); protected: QVariantMap _metadata; + uint32_t _tic{ 0 }; }; #endif // hifi_DomainMetadata_h diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 88c4e215b2..0f5498a575 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1101,6 +1101,11 @@ void DomainServer::sendHeartbeatToMetaverse(const QString& networkAddress) { // Add the metadata to the heartbeat static const QString DOMAIN_HEARTBEAT_KEY = "heartbeat"; + auto tic = _metadata.getTic(); + if (_metadataTic != tic) { + _metadataTic = tic; + _metadata.updateUsers(); + } domainObject[DOMAIN_HEARTBEAT_KEY] = _metadata.getUsers(); QString domainUpdateJSON = QString("{\"domain\":%1}").arg(QString(QJsonDocument(domainObject).toJson(QJsonDocument::Compact))); diff --git a/domain-server/src/DomainServer.h b/domain-server/src/DomainServer.h index acda550ce5..8b8409ff0a 100644 --- a/domain-server/src/DomainServer.h +++ b/domain-server/src/DomainServer.h @@ -171,6 +171,7 @@ private: DomainServerSettingsManager _settingsManager; DomainMetadata _metadata; + uint32_t _metadataTic{ 0 }; HifiSockAddr _iceServerSocket; std::unique_ptr _iceServerHeartbeatPacket; From 5352bd4b76bc711d999897a47589632147d868a5 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 9 Jun 2016 17:15:17 +1200 Subject: [PATCH 83/89] Fix height of Load Defaults button --- interface/resources/qml/hifi/dialogs/RunningScripts.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/resources/qml/hifi/dialogs/RunningScripts.qml b/interface/resources/qml/hifi/dialogs/RunningScripts.qml index cbbbec5bff..94b8c1905f 100644 --- a/interface/resources/qml/hifi/dialogs/RunningScripts.qml +++ b/interface/resources/qml/hifi/dialogs/RunningScripts.qml @@ -261,6 +261,7 @@ Window { HifiControls.Button { text: "Load Defaults" color: hifi.buttons.black + height: 26 onClicked: loadDefaults() } } From ff8d4883b10eafd167d96f6c63b9817bc848a96e Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Wed, 8 Jun 2016 14:56:18 -0700 Subject: [PATCH 84/89] Attempt to get better logging from pure virtual call crashes --- interface/src/CrashReporter.cpp | 44 +++++++++++++++++++++-- interface/src/FileLogger.cpp | 4 +++ interface/src/FileLogger.h | 1 + libraries/shared/src/GenericQueueThread.h | 27 ++++++++++++-- 4 files changed, 70 insertions(+), 6 deletions(-) diff --git a/interface/src/CrashReporter.cpp b/interface/src/CrashReporter.cpp index 1fd534ffac..d683c5e4df 100644 --- a/interface/src/CrashReporter.cpp +++ b/interface/src/CrashReporter.cpp @@ -10,15 +10,20 @@ // -#ifdef HAS_BUGSPLAT #include "CrashReporter.h" +#ifdef _WIN32 +#include #include #include +#include #include - #include +#include "Application.h" + + +#pragma comment(lib, "Dbghelp.lib") // SetUnhandledExceptionFilter can be overridden by the CRT at the point that an error occurs. More information // can be found here: http://www.codeproject.com/Articles/154686/SetUnhandledExceptionFilter-and-the-C-C-Runtime-Li @@ -77,13 +82,43 @@ BOOL redirectLibraryFunctionToFunction(char* library, char* function, void* fn) return bRet; } +void printStackTrace(ULONG framesToSkip = 1) { + QString result; + unsigned int i; + void * stack[100]; + unsigned short frames; + SYMBOL_INFO * symbol; + HANDLE process; + + process = GetCurrentProcess(); + SymInitialize(process, NULL, TRUE); + frames = CaptureStackBackTrace(framesToSkip, 100, stack, NULL); + symbol = (SYMBOL_INFO *)calloc(sizeof(SYMBOL_INFO) + 256 * sizeof(char), 1); + symbol->MaxNameLen = 255; + symbol->SizeOfStruct = sizeof(SYMBOL_INFO); + + for (i = 0; i < frames; i++) { + SymFromAddr(process, (DWORD64)(stack[i]), 0, symbol); + qWarning() << QString("%1: %2 - 0x%0X").arg(QString::number(frames - i - 1), QString(symbol->Name), QString::number(symbol->Address, 16)); + } + + free(symbol); + + // Try to force the log to sync to the filesystem + auto app = qApp; + if (app && app->getLogger()) { + app->getLogger()->sync(); + } +} void handleSignal(int signal) { // Throw so BugSplat can handle throw(signal); } -void handlePureVirtualCall() { +void __cdecl handlePureVirtualCall() { + qWarning() << "Pure virtual function call detected"; + printStackTrace(2); // Throw so BugSplat can handle throw("ERROR: Pure virtual call"); } @@ -107,6 +142,8 @@ _purecall_handler __cdecl noop_set_purecall_handler(_purecall_handler pNew) { return nullptr; } +#ifdef HAS_BUGSPLAT + static const DWORD BUG_SPLAT_FLAGS = MDSF_PREVENTHIJACKING | MDSF_USEGUARDMEMORY; CrashReporter::CrashReporter(QString bugSplatDatabase, QString bugSplatApplicationName, QString version) @@ -133,3 +170,4 @@ CrashReporter::CrashReporter(QString bugSplatDatabase, QString bugSplatApplicati } } #endif +#endif \ No newline at end of file diff --git a/interface/src/FileLogger.cpp b/interface/src/FileLogger.cpp index f5f7ce6ebe..50f7d15d6b 100644 --- a/interface/src/FileLogger.cpp +++ b/interface/src/FileLogger.cpp @@ -115,3 +115,7 @@ QString FileLogger::getLogData() { } return result; } + +void FileLogger::sync() { + _persistThreadInstance->waitIdle(); +} diff --git a/interface/src/FileLogger.h b/interface/src/FileLogger.h index e9bae63a73..28ac6fba40 100644 --- a/interface/src/FileLogger.h +++ b/interface/src/FileLogger.h @@ -28,6 +28,7 @@ public: virtual void addMessage(const QString&) override; virtual QString getLogData() override; virtual void locateLog() override; + void sync(); signals: void rollingLogFile(QString newFilename); diff --git a/libraries/shared/src/GenericQueueThread.h b/libraries/shared/src/GenericQueueThread.h index 28fcdb0ed6..7c1bdccaa7 100644 --- a/libraries/shared/src/GenericQueueThread.h +++ b/libraries/shared/src/GenericQueueThread.h @@ -12,9 +12,10 @@ #include -#include -#include -#include +#include +#include +#include +#include #include "GenericThread.h" #include "NumericalConstants.h" @@ -35,6 +36,25 @@ public: _hasItems.wakeAll(); } + void waitIdle(uint32_t maxWaitMs = UINT32_MAX) { + QElapsedTimer timer; + timer.start(); + + // FIXME this will work as long as the thread doing the wait + // is the only thread which can add work to the queue. + // It would be better if instead we had a queue empty condition to wait on + // that would ensure that we get woken as soon as we're idle the very + // first time the queue was empty. + while (timer.elapsed() < maxWaitMs) { + lock(); + if (!_items.size()) { + unlock(); + return; + } + unlock(); + } + } + protected: virtual void queueItemInternal(const T& t) { _items.push_back(t); @@ -44,6 +64,7 @@ protected: return MSECS_PER_SECOND; } + virtual bool process() { lock(); if (!_items.size()) { From 1aae22f5a59246e795801aa09ecf07bd93ee50af Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Thu, 9 Jun 2016 09:35:19 -0700 Subject: [PATCH 85/89] Optimized MyAvatar.getCharacterControllerEnabled() Instead of doing a blocking queued invokeMethod, it just calls into CharacterController.isEnabled() which is now thread-safe. --- interface/src/avatar/MyAvatar.cpp | 11 +++-------- libraries/physics/src/CharacterController.h | 6 ++++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 3495a05962..d5c481164c 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1253,13 +1253,13 @@ void MyAvatar::prepareForPhysicsSimulation() { void MyAvatar::harvestResultsFromPhysicsSimulation(float deltaTime) { glm::vec3 position = getPosition(); glm::quat orientation = getOrientation(); - if (_characterController.isEnabled()) { + if (_characterController.isEnabledAndReady()) { _characterController.getPositionAndOrientation(position, orientation); } nextAttitude(position, orientation); _bodySensorMatrix = _follow.postPhysicsUpdate(*this, _bodySensorMatrix); - if (_characterController.isEnabled()) { + if (_characterController.isEnabledAndReady()) { setVelocity(_characterController.getLinearVelocity() + _characterController.getFollowVelocity()); } else { setVelocity(getVelocity() + _characterController.getFollowVelocity()); @@ -1642,7 +1642,7 @@ void MyAvatar::updatePosition(float deltaTime) { vec3 velocity = getVelocity(); const float MOVING_SPEED_THRESHOLD_SQUARED = 0.0001f; // 0.01 m/s - if (!_characterController.isEnabled()) { + if (!_characterController.isEnabledAndReady()) { // _characterController is not in physics simulation but it can still compute its target velocity updateMotors(); _characterController.computeNewVelocity(deltaTime, velocity); @@ -1838,11 +1838,6 @@ void MyAvatar::setCharacterControllerEnabled(bool enabled) { } bool MyAvatar::getCharacterControllerEnabled() { - if (QThread::currentThread() != thread()) { - bool result; - QMetaObject::invokeMethod(this, "getCharacterControllerEnabled", Qt::BlockingQueuedConnection, Q_RETURN_ARG(bool, result)); - return result; - } return _characterController.isEnabled(); } diff --git a/libraries/physics/src/CharacterController.h b/libraries/physics/src/CharacterController.h index 2191f46d55..586ea175e6 100644 --- a/libraries/physics/src/CharacterController.h +++ b/libraries/physics/src/CharacterController.h @@ -14,6 +14,7 @@ #include #include +#include #include #include @@ -105,8 +106,9 @@ public: void setLocalBoundingBox(const glm::vec3& corner, const glm::vec3& scale); + bool isEnabled() const { return _enabled; } // thread-safe void setEnabled(bool enabled); - bool isEnabled() const { return _enabled && _dynamicsWorld; } + bool isEnabledAndReady() const { return _enabled && _dynamicsWorld; } bool getRigidBodyLocation(glm::vec3& avatarRigidBodyPosition, glm::quat& avatarRigidBodyRotation); @@ -167,7 +169,7 @@ protected: btQuaternion _followAngularDisplacement; btVector3 _linearAcceleration; - bool _enabled; + std::atomic_bool _enabled; State _state; bool _isPushingUp; From eee1ba09062216b0032110f5b1e6583a3ee4510c Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 9 Jun 2016 10:19:38 -0700 Subject: [PATCH 86/89] trying to get buildability --- interface/src/CrashReporter.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/interface/src/CrashReporter.cpp b/interface/src/CrashReporter.cpp index d683c5e4df..fce472e311 100644 --- a/interface/src/CrashReporter.cpp +++ b/interface/src/CrashReporter.cpp @@ -10,17 +10,16 @@ // +#include "Application.h" #include "CrashReporter.h" #ifdef _WIN32 -#include #include #include #include #include #include -#include "Application.h" #pragma comment(lib, "Dbghelp.lib") @@ -170,4 +169,4 @@ CrashReporter::CrashReporter(QString bugSplatDatabase, QString bugSplatApplicati } } #endif -#endif \ No newline at end of file +#endif From cd7c6be5906019c64a25876b33fd460f7e9eeefa Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 9 Jun 2016 12:25:21 -0700 Subject: [PATCH 87/89] Fix formatting --- interface/src/CrashReporter.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/interface/src/CrashReporter.cpp b/interface/src/CrashReporter.cpp index fce472e311..596c34ca92 100644 --- a/interface/src/CrashReporter.cpp +++ b/interface/src/CrashReporter.cpp @@ -82,21 +82,15 @@ BOOL redirectLibraryFunctionToFunction(char* library, char* function, void* fn) } void printStackTrace(ULONG framesToSkip = 1) { - QString result; - unsigned int i; - void * stack[100]; - unsigned short frames; - SYMBOL_INFO * symbol; - HANDLE process; - - process = GetCurrentProcess(); + HANDLE process = GetCurrentProcess(); SymInitialize(process, NULL, TRUE); - frames = CaptureStackBackTrace(framesToSkip, 100, stack, NULL); - symbol = (SYMBOL_INFO *)calloc(sizeof(SYMBOL_INFO) + 256 * sizeof(char), 1); + void* stack[100]; + uint16_t frames = CaptureStackBackTrace(framesToSkip, 100, stack, NULL); + SYMBOL_INFO* symbol = (SYMBOL_INFO *)calloc(sizeof(SYMBOL_INFO) + 256 * sizeof(char), 1); symbol->MaxNameLen = 255; symbol->SizeOfStruct = sizeof(SYMBOL_INFO); - for (i = 0; i < frames; i++) { + for (uint16_t i = 0; i < frames; ++i) { SymFromAddr(process, (DWORD64)(stack[i]), 0, symbol); qWarning() << QString("%1: %2 - 0x%0X").arg(QString::number(frames - i - 1), QString(symbol->Name), QString::number(symbol->Address, 16)); } From d7079fce8c78dc51af64f9f6646b7d2473cef00f Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Thu, 9 Jun 2016 15:07:24 -0700 Subject: [PATCH 88/89] Use shared CPUDetect.h for CPU detection --- libraries/audio/src/AudioHRTF.cpp | 53 ++----------------------------- 1 file changed, 2 insertions(+), 51 deletions(-) diff --git a/libraries/audio/src/AudioHRTF.cpp b/libraries/audio/src/AudioHRTF.cpp index 7fadf073a1..89c929011a 100644 --- a/libraries/audio/src/AudioHRTF.cpp +++ b/libraries/audio/src/AudioHRTF.cpp @@ -119,61 +119,12 @@ static void FIR_1x4_SSE(float* src, float* dst0, float* dst1, float* dst2, float } } -// -// Detect AVX/AVX2 support -// - -#if defined(_MSC_VER) - -#include - -static bool cpuSupportsAVX() { - int info[4]; - int mask = (1 << 27) | (1 << 28); // OSXSAVE and AVX - - __cpuidex(info, 0x1, 0); - - bool result = false; - if ((info[2] & mask) == mask) { - - if ((_xgetbv(_XCR_XFEATURE_ENABLED_MASK) & 0x6) == 0x6) { - result = true; - } - } - return result; -} - -#elif defined(__GNUC__) - -#include - -static bool cpuSupportsAVX() { - unsigned int eax, ebx, ecx, edx; - unsigned int mask = (1 << 27) | (1 << 28); // OSXSAVE and AVX - - bool result = false; - if (__get_cpuid(0x1, &eax, &ebx, &ecx, &edx) && ((ecx & mask) == mask)) { - - __asm__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(0)); - if ((eax & 0x6) == 0x6) { - result = true; - } - } - return result; -} - -#else - -static bool cpuSupportsAVX() { - return false; -} - -#endif - // // Runtime CPU dispatch // +#include "CPUDetect.h" + typedef void FIR_1x4_t(float* src, float* dst0, float* dst1, float* dst2, float* dst3, float coef[4][HRTF_TAPS], int numFrames); FIR_1x4_t FIR_1x4_AVX; // separate compilation with VEX-encoding enabled From dd0d594524975d11ba6dac6152a4adf35dcdfcb8 Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Thu, 9 Jun 2016 16:31:09 -0700 Subject: [PATCH 89/89] cleanup --- libraries/audio/src/AudioHRTF.cpp | 8 +++----- libraries/audio/src/AudioHRTF.h | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/libraries/audio/src/AudioHRTF.cpp b/libraries/audio/src/AudioHRTF.cpp index 89c929011a..e7cf4436c6 100644 --- a/libraries/audio/src/AudioHRTF.cpp +++ b/libraries/audio/src/AudioHRTF.cpp @@ -10,7 +10,6 @@ // #include -#include #include #include @@ -125,13 +124,12 @@ static void FIR_1x4_SSE(float* src, float* dst0, float* dst1, float* dst2, float #include "CPUDetect.h" -typedef void FIR_1x4_t(float* src, float* dst0, float* dst1, float* dst2, float* dst3, float coef[4][HRTF_TAPS], int numFrames); -FIR_1x4_t FIR_1x4_AVX; // separate compilation with VEX-encoding enabled +void FIR_1x4_AVX(float* src, float* dst0, float* dst1, float* dst2, float* dst3, float coef[4][HRTF_TAPS], int numFrames); static void FIR_1x4(float* src, float* dst0, float* dst1, float* dst2, float* dst3, float coef[4][HRTF_TAPS], int numFrames) { - static FIR_1x4_t* f = cpuSupportsAVX() ? FIR_1x4_AVX : FIR_1x4_SSE; // init on first call - (*f)(src, dst0, dst1, dst2, dst3, coef, numFrames); // dispatch + static auto f = cpuSupportsAVX() ? FIR_1x4_AVX : FIR_1x4_SSE; + (*f)(src, dst0, dst1, dst2, dst3, coef, numFrames); // dispatch } // 4 channel planar to interleaved diff --git a/libraries/audio/src/AudioHRTF.h b/libraries/audio/src/AudioHRTF.h index f92f9c1602..d3b6237d0c 100644 --- a/libraries/audio/src/AudioHRTF.h +++ b/libraries/audio/src/AudioHRTF.h @@ -32,7 +32,7 @@ public: // input: mono source // output: interleaved stereo mix buffer (accumulates into existing output) // index: HRTF subject index - // azimuth: clockwise panning angle [0, 360] in degrees + // azimuth: clockwise panning angle in radians // gain: gain factor for distance attenuation // numFrames: must be HRTF_BLOCK in this version //