mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 20:32:21 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into baseball
This commit is contained in:
commit
40ce2416e8
17 changed files with 217 additions and 128 deletions
|
@ -352,14 +352,14 @@ function MyController(hand) {
|
||||||
|
|
||||||
var intersection = Entities.findRayIntersection(pickRayBacked, true);
|
var intersection = Entities.findRayIntersection(pickRayBacked, true);
|
||||||
|
|
||||||
if (intersection.intersects && intersection.properties.locked === 0) {
|
if (intersection.intersects && !intersection.properties.locked) {
|
||||||
// the ray is intersecting something we can move.
|
// the ray is intersecting something we can move.
|
||||||
var intersectionDistance = Vec3.distance(pickRay.origin, intersection.intersection);
|
var intersectionDistance = Vec3.distance(pickRay.origin, intersection.intersection);
|
||||||
this.grabbedEntity = intersection.entityID;
|
this.grabbedEntity = intersection.entityID;
|
||||||
|
|
||||||
//this code will disabled the beam for the opposite hand of the one that grabbed it if the entity says so
|
//this code will disabled the beam for the opposite hand of the one that grabbed it if the entity says so
|
||||||
var grabbableData = getEntityCustomData(GRABBABLE_DATA_KEY, intersection.entityID, DEFAULT_GRABBABLE_DATA);
|
var grabbableData = getEntityCustomData(GRABBABLE_DATA_KEY, intersection.entityID, DEFAULT_GRABBABLE_DATA);
|
||||||
if (grabbableData["turnOffOppositeBeam"] === true) {
|
if (grabbableData["turnOffOppositeBeam"]) {
|
||||||
if (this.hand === RIGHT_HAND) {
|
if (this.hand === RIGHT_HAND) {
|
||||||
disabledHand = LEFT_HAND;
|
disabledHand = LEFT_HAND;
|
||||||
} else {
|
} else {
|
||||||
|
@ -369,7 +369,7 @@ function MyController(hand) {
|
||||||
disabledHand = 'none';
|
disabledHand = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (grabbableData.grabbable === false) {
|
if (!grabbableData.grabbable) {
|
||||||
this.grabbedEntity = null;
|
this.grabbedEntity = null;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -391,7 +391,7 @@ function MyController(hand) {
|
||||||
this.grabbedEntity = null;
|
this.grabbedEntity = null;
|
||||||
} else {
|
} else {
|
||||||
// the hand is far from the intersected object. go into distance-holding mode
|
// the hand is far from the intersected object. go into distance-holding mode
|
||||||
if (intersection.properties.collisionsWillMove === 1) {
|
if (intersection.properties.collisionsWillMove) {
|
||||||
this.setState(STATE_DISTANCE_HOLDING);
|
this.setState(STATE_DISTANCE_HOLDING);
|
||||||
} else {
|
} else {
|
||||||
this.setState(STATE_FAR_GRABBING_NON_COLLIDING);
|
this.setState(STATE_FAR_GRABBING_NON_COLLIDING);
|
||||||
|
@ -409,7 +409,7 @@ function MyController(hand) {
|
||||||
for (i = 0; i < nearbyEntities.length; i++) {
|
for (i = 0; i < nearbyEntities.length; i++) {
|
||||||
var grabbableDataForCandidate =
|
var grabbableDataForCandidate =
|
||||||
getEntityCustomData(GRABBABLE_DATA_KEY, nearbyEntities[i], DEFAULT_GRABBABLE_DATA);
|
getEntityCustomData(GRABBABLE_DATA_KEY, nearbyEntities[i], DEFAULT_GRABBABLE_DATA);
|
||||||
if (grabbableDataForCandidate.grabbable === false) {
|
if (!grabbableDataForCandidate.grabbable) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var propsForCandidate =
|
var propsForCandidate =
|
||||||
|
@ -427,7 +427,7 @@ function MyController(hand) {
|
||||||
}
|
}
|
||||||
if (grabbableData.wantsTrigger) {
|
if (grabbableData.wantsTrigger) {
|
||||||
this.setState(STATE_NEAR_GRABBING_NON_COLLIDING);
|
this.setState(STATE_NEAR_GRABBING_NON_COLLIDING);
|
||||||
} else if (props.locked === 0) {
|
} else if (!props.locked) {
|
||||||
this.setState(STATE_NEAR_GRABBING);
|
this.setState(STATE_NEAR_GRABBING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -446,7 +446,7 @@ function MyController(hand) {
|
||||||
this.currentObjectPosition = grabbedProperties.position;
|
this.currentObjectPosition = grabbedProperties.position;
|
||||||
this.currentObjectRotation = grabbedProperties.rotation;
|
this.currentObjectRotation = grabbedProperties.rotation;
|
||||||
this.currentObjectTime = now;
|
this.currentObjectTime = now;
|
||||||
this.handPreviousPosition = handControllerPosition;
|
this.handRelativePreviousPosition = Vec3.subtract(handControllerPosition, MyAvatar.position);
|
||||||
this.handPreviousRotation = handRotation;
|
this.handPreviousRotation = handRotation;
|
||||||
|
|
||||||
this.actionID = NULL_ACTION_ID;
|
this.actionID = NULL_ACTION_ID;
|
||||||
|
@ -523,11 +523,10 @@ function MyController(hand) {
|
||||||
this.currentAvatarOrientation = currentOrientation;
|
this.currentAvatarOrientation = currentOrientation;
|
||||||
|
|
||||||
// how far did hand move this timestep?
|
// how far did hand move this timestep?
|
||||||
var handMoved = Vec3.subtract(handControllerPosition, this.handPreviousPosition);
|
var handMoved = Vec3.subtract(handToAvatar, this.handRelativePreviousPosition);
|
||||||
this.handPreviousPosition = handControllerPosition;
|
this.handRelativePreviousPosition = handToAvatar;
|
||||||
|
|
||||||
// magnify the hand movement but not the change from avatar movement & rotation
|
// magnify the hand movement but not the change from avatar movement & rotation
|
||||||
handMoved = Vec3.subtract(handMoved, avatarDeltaPosition);
|
|
||||||
handMoved = Vec3.subtract(handMoved, handMovementFromTurning);
|
handMoved = Vec3.subtract(handMoved, handMovementFromTurning);
|
||||||
var superHandMoved = Vec3.multiply(handMoved, radius);
|
var superHandMoved = Vec3.multiply(handMoved, radius);
|
||||||
|
|
||||||
|
@ -570,7 +569,7 @@ function MyController(hand) {
|
||||||
var grabbableData = getEntityCustomData(GRABBABLE_DATA_KEY, this.grabbedEntity, DEFAULT_GRABBABLE_DATA);
|
var grabbableData = getEntityCustomData(GRABBABLE_DATA_KEY, this.grabbedEntity, DEFAULT_GRABBABLE_DATA);
|
||||||
|
|
||||||
var turnOffOtherHand = grabbableData["turnOffOtherHand"];
|
var turnOffOtherHand = grabbableData["turnOffOtherHand"];
|
||||||
if (turnOffOtherHand === true) {
|
if (turnOffOtherHand) {
|
||||||
//don't activate the second hand grab because the script is handling the second hand logic
|
//don't activate the second hand grab because the script is handling the second hand logic
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -783,11 +782,11 @@ function MyController(hand) {
|
||||||
// we haven't been touched before, but either right or left is touching us now
|
// we haven't been touched before, but either right or left is touching us now
|
||||||
_this.allTouchedIDs[id] = true;
|
_this.allTouchedIDs[id] = true;
|
||||||
_this.startTouch(id);
|
_this.startTouch(id);
|
||||||
} else if ((leftIsTouching || rightIsTouching) && _this.allTouchedIDs[id] === true) {
|
} else if ((leftIsTouching || rightIsTouching) && _this.allTouchedIDs[id]) {
|
||||||
// we have been touched before and are still being touched
|
// we have been touched before and are still being touched
|
||||||
// continue touch
|
// continue touch
|
||||||
_this.continueTouch(id);
|
_this.continueTouch(id);
|
||||||
} else if (_this.allTouchedIDs[id] === true) {
|
} else if (_this.allTouchedIDs[id]) {
|
||||||
delete _this.allTouchedIDs[id];
|
delete _this.allTouchedIDs[id];
|
||||||
_this.stopTouch(id);
|
_this.stopTouch(id);
|
||||||
|
|
||||||
|
|
10
examples/controllers/rightClickExample.js
Normal file
10
examples/controllers/rightClickExample.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
var MAPPING_NAME = "com.highfidelity.rightClickExample";
|
||||||
|
var mapping = Controller.newMapping(MAPPING_NAME);
|
||||||
|
mapping.from(Controller.Hardware.Keyboard.RightMouseClicked).to(function (value) {
|
||||||
|
print("Keyboard.RightMouseClicked");
|
||||||
|
});
|
||||||
|
Controller.enableMapping(MAPPING_NAME);
|
||||||
|
|
||||||
|
Script.scriptEnding.connect(function () {
|
||||||
|
Controller.disableMapping(MAPPING_NAME);
|
||||||
|
});
|
|
@ -2,7 +2,7 @@ set(TARGET_NAME interface)
|
||||||
project(${TARGET_NAME})
|
project(${TARGET_NAME})
|
||||||
|
|
||||||
# set a default root dir for each of our optional externals if it was not passed
|
# set a default root dir for each of our optional externals if it was not passed
|
||||||
set(OPTIONAL_EXTERNALS "LeapMotion" "RtMidi" "RSSDK" "iViewHMD")
|
set(OPTIONAL_EXTERNALS "LeapMotion" "RtMidi" "RSSDK")
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
list(APPEND OPTIONAL_EXTERNALS "3DConnexionClient")
|
list(APPEND OPTIONAL_EXTERNALS "3DConnexionClient")
|
||||||
|
|
|
@ -13,17 +13,12 @@
|
||||||
{ "from": "Hydra.RB", "to": "Standard.RB" },
|
{ "from": "Hydra.RB", "to": "Standard.RB" },
|
||||||
{ "from": "Hydra.RS", "to": "Standard.RS" },
|
{ "from": "Hydra.RS", "to": "Standard.RS" },
|
||||||
|
|
||||||
{ "from": "Hydra.L0", "to": "Standard.Back" },
|
{ "from": [ "Hydra.L3", "Hydra.L4" ], "to": "Standard.LeftPrimaryThumb" },
|
||||||
{ "from": "Hydra.L1", "to": "Standard.DL" },
|
{ "from": [ "Hydra.L1", "Hydra.L2" ], "to": "Standard.LeftSecondaryThumb" },
|
||||||
{ "from": "Hydra.L2", "to": "Standard.DD" },
|
|
||||||
{ "from": "Hydra.L3", "to": "Standard.DR" },
|
{ "from": [ "Hydra.R3", "Hydra.R4" ], "to": "Standard.RightPrimaryThumb" },
|
||||||
{ "from": "Hydra.L4", "to": "Standard.DU" },
|
{ "from": [ "Hydra.R1", "Hydra.R2" ], "to": "Standard.RightSecondaryThumb" },
|
||||||
|
|
||||||
{ "from": "Hydra.R0", "to": "Standard.Start" },
|
|
||||||
{ "from": "Hydra.R1", "to": "Standard.X" },
|
|
||||||
{ "from": "Hydra.R2", "to": "Standard.A" },
|
|
||||||
{ "from": "Hydra.R3", "to": "Standard.B" },
|
|
||||||
{ "from": "Hydra.R4", "to": "Standard.Y" },
|
|
||||||
|
|
||||||
{ "from": "Hydra.LeftHand", "to": "Standard.LeftHand" },
|
{ "from": "Hydra.LeftHand", "to": "Standard.LeftHand" },
|
||||||
{ "from": "Hydra.RightHand", "to": "Standard.RightHand" }
|
{ "from": "Hydra.RightHand", "to": "Standard.RightHand" }
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
"name": "Standard to Action",
|
"name": "Standard to Action",
|
||||||
"channels": [
|
"channels": [
|
||||||
{ "from": "Standard.LY", "to": "Actions.TranslateZ" },
|
{ "from": "Standard.LY", "to": "Actions.TranslateZ" },
|
||||||
{ "from": "Standard.LX", "to": "Actions.TranslateX" },
|
|
||||||
|
|
||||||
{ "from": "Standard.RX",
|
{ "from": "Standard.LX",
|
||||||
"when": [ "Application.InHMD", "Application.ComfortMode" ],
|
"when": [ "Application.InHMD", "Application.ComfortMode" ],
|
||||||
"to": "Actions.StepYaw",
|
"to": "Actions.StepYaw",
|
||||||
"filters":
|
"filters":
|
||||||
|
@ -14,8 +13,9 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ "from": "Standard.LX", "to": "Actions.Yaw" },
|
||||||
|
|
||||||
{ "from": "Standard.RX", "to": "Actions.Yaw" },
|
{ "from": "Standard.RX", "to": "Actions.TranslateX" },
|
||||||
{ "from": "Standard.RY", "filters": "invert", "to": "Actions.TranslateY" },
|
{ "from": "Standard.RY", "filters": "invert", "to": "Actions.TranslateY" },
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,7 @@ namespace render {
|
||||||
avatarPtr->setDisplayingLookatTarget(renderLookAtTarget);
|
avatarPtr->setDisplayingLookatTarget(renderLookAtTarget);
|
||||||
|
|
||||||
if (avatarPtr->isInitialized() && args) {
|
if (avatarPtr->isInitialized() && args) {
|
||||||
|
PROFILE_RANGE_BATCH(*args->_batch, "renderAvatarPayload");
|
||||||
avatarPtr->render(args, qApp->getCamera()->getPosition());
|
avatarPtr->render(args, qApp->getCamera()->getPosition());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -334,6 +335,7 @@ void Avatar::render(RenderArgs* renderArgs, const glm::vec3& cameraPosition) {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& batch = *renderArgs->_batch;
|
auto& batch = *renderArgs->_batch;
|
||||||
|
PROFILE_RANGE_BATCH(batch, __FUNCTION__);
|
||||||
|
|
||||||
if (glm::distance(DependencyManager::get<AvatarManager>()->getMyAvatar()->getPosition(), _position) < 10.0f) {
|
if (glm::distance(DependencyManager::get<AvatarManager>()->getMyAvatar()->getPosition(), _position) < 10.0f) {
|
||||||
auto geometryCache = DependencyManager::get<GeometryCache>();
|
auto geometryCache = DependencyManager::get<GeometryCache>();
|
||||||
|
@ -360,6 +362,7 @@ void Avatar::render(RenderArgs* renderArgs, const glm::vec3& cameraPosition) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (havePosition && haveRotation) {
|
if (havePosition && haveRotation) {
|
||||||
|
PROFILE_RANGE_BATCH(batch, __FUNCTION__":leftHandPointer");
|
||||||
Transform pointerTransform;
|
Transform pointerTransform;
|
||||||
pointerTransform.setTranslation(position);
|
pointerTransform.setTranslation(position);
|
||||||
pointerTransform.setRotation(rotation);
|
pointerTransform.setRotation(rotation);
|
||||||
|
@ -383,6 +386,7 @@ void Avatar::render(RenderArgs* renderArgs, const glm::vec3& cameraPosition) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (havePosition && haveRotation) {
|
if (havePosition && haveRotation) {
|
||||||
|
PROFILE_RANGE_BATCH(batch, __FUNCTION__":rightHandPointer");
|
||||||
Transform pointerTransform;
|
Transform pointerTransform;
|
||||||
pointerTransform.setTranslation(position);
|
pointerTransform.setTranslation(position);
|
||||||
pointerTransform.setRotation(rotation);
|
pointerTransform.setRotation(rotation);
|
||||||
|
@ -455,6 +459,7 @@ void Avatar::render(RenderArgs* renderArgs, const glm::vec3& cameraPosition) {
|
||||||
|
|
||||||
bool renderBounding = Menu::getInstance()->isOptionChecked(MenuOption::RenderBoundingCollisionShapes);
|
bool renderBounding = Menu::getInstance()->isOptionChecked(MenuOption::RenderBoundingCollisionShapes);
|
||||||
if (renderBounding && shouldRenderHead(renderArgs) && _skeletonModel.isRenderable()) {
|
if (renderBounding && shouldRenderHead(renderArgs) && _skeletonModel.isRenderable()) {
|
||||||
|
PROFILE_RANGE_BATCH(batch, __FUNCTION__":skeletonBoundingCollisionShapes");
|
||||||
_skeletonModel.renderBoundingCollisionShapes(*renderArgs->_batch, 0.7f);
|
_skeletonModel.renderBoundingCollisionShapes(*renderArgs->_batch, 0.7f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -464,6 +469,7 @@ void Avatar::render(RenderArgs* renderArgs, const glm::vec3& cameraPosition) {
|
||||||
static const float INDICATOR_RADIUS = 0.03f;
|
static const float INDICATOR_RADIUS = 0.03f;
|
||||||
static const glm::vec4 LOOK_AT_INDICATOR_COLOR = { 0.8f, 0.0f, 0.0f, 0.75f };
|
static const glm::vec4 LOOK_AT_INDICATOR_COLOR = { 0.8f, 0.0f, 0.0f, 0.75f };
|
||||||
glm::vec3 position = glm::vec3(_position.x, getDisplayNamePosition().y + INDICATOR_OFFSET, _position.z);
|
glm::vec3 position = glm::vec3(_position.x, getDisplayNamePosition().y + INDICATOR_OFFSET, _position.z);
|
||||||
|
PROFILE_RANGE_BATCH(batch, __FUNCTION__":renderFocusIndicator");
|
||||||
Transform transform;
|
Transform transform;
|
||||||
transform.setTranslation(position);
|
transform.setTranslation(position);
|
||||||
transform.postScale(INDICATOR_RADIUS);
|
transform.postScale(INDICATOR_RADIUS);
|
||||||
|
@ -472,6 +478,7 @@ void Avatar::render(RenderArgs* renderArgs, const glm::vec3& cameraPosition) {
|
||||||
|
|
||||||
// If the avatar is looking at me, indicate that they are
|
// If the avatar is looking at me, indicate that they are
|
||||||
if (getHead()->isLookingAtMe() && Menu::getInstance()->isOptionChecked(MenuOption::ShowWhosLookingAtMe)) {
|
if (getHead()->isLookingAtMe() && Menu::getInstance()->isOptionChecked(MenuOption::ShowWhosLookingAtMe)) {
|
||||||
|
PROFILE_RANGE_BATCH(batch, __FUNCTION__":renderLookingAtMe");
|
||||||
const glm::vec3 LOOKING_AT_ME_COLOR = { 1.0f, 1.0f, 1.0f };
|
const glm::vec3 LOOKING_AT_ME_COLOR = { 1.0f, 1.0f, 1.0f };
|
||||||
const float LOOKING_AT_ME_ALPHA_START = 0.8f;
|
const float LOOKING_AT_ME_ALPHA_START = 0.8f;
|
||||||
const float LOOKING_AT_ME_DURATION = 0.5f; // seconds
|
const float LOOKING_AT_ME_DURATION = 0.5f; // seconds
|
||||||
|
@ -517,6 +524,7 @@ void Avatar::render(RenderArgs* renderArgs, const glm::vec3& cameraPosition) {
|
||||||
const float MIN_VOICE_SPHERE_DISTANCE = 12.0f;
|
const float MIN_VOICE_SPHERE_DISTANCE = 12.0f;
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::BlueSpeechSphere)
|
if (Menu::getInstance()->isOptionChecked(MenuOption::BlueSpeechSphere)
|
||||||
&& distanceToTarget > MIN_VOICE_SPHERE_DISTANCE) {
|
&& distanceToTarget > MIN_VOICE_SPHERE_DISTANCE) {
|
||||||
|
PROFILE_RANGE_BATCH(batch, __FUNCTION__":renderVoiceSphere");
|
||||||
|
|
||||||
// render voice intensity sphere for avatars that are farther away
|
// render voice intensity sphere for avatars that are farther away
|
||||||
const float MAX_SPHERE_ANGLE = 10.0f * RADIANS_PER_DEGREE;
|
const float MAX_SPHERE_ANGLE = 10.0f * RADIANS_PER_DEGREE;
|
||||||
|
@ -684,6 +692,7 @@ void Avatar::renderBillboard(RenderArgs* renderArgs) {
|
||||||
glm::vec2 texCoordBottomRight(1.0f, 1.0f);
|
glm::vec2 texCoordBottomRight(1.0f, 1.0f);
|
||||||
|
|
||||||
gpu::Batch& batch = *renderArgs->_batch;
|
gpu::Batch& batch = *renderArgs->_batch;
|
||||||
|
PROFILE_RANGE_BATCH(batch, __FUNCTION__);
|
||||||
batch.setResourceTexture(0, _billboardTexture->getGPUTexture());
|
batch.setResourceTexture(0, _billboardTexture->getGPUTexture());
|
||||||
DependencyManager::get<DeferredLightingEffect>()->bindSimpleProgram(batch, true);
|
DependencyManager::get<DeferredLightingEffect>()->bindSimpleProgram(batch, true);
|
||||||
DependencyManager::get<GeometryCache>()->renderQuad(batch, topLeft, bottomRight, texCoordTopLeft, texCoordBottomRight,
|
DependencyManager::get<GeometryCache>()->renderQuad(batch, topLeft, bottomRight, texCoordTopLeft, texCoordBottomRight,
|
||||||
|
@ -766,6 +775,8 @@ Transform Avatar::calculateDisplayNameTransform(const ViewFrustum& frustum, cons
|
||||||
}
|
}
|
||||||
|
|
||||||
void Avatar::renderDisplayName(gpu::Batch& batch, const ViewFrustum& frustum, const glm::vec3& textPosition) const {
|
void Avatar::renderDisplayName(gpu::Batch& batch, const ViewFrustum& frustum, const glm::vec3& textPosition) const {
|
||||||
|
PROFILE_RANGE_BATCH(batch, __FUNCTION__);
|
||||||
|
|
||||||
bool shouldShowReceiveStats = DependencyManager::get<AvatarManager>()->shouldShowReceiveStats() && !isMyAvatar();
|
bool shouldShowReceiveStats = DependencyManager::get<AvatarManager>()->shouldShowReceiveStats() && !isMyAvatar();
|
||||||
|
|
||||||
// If we have nothing to draw, or it's totally transparent, or it's too close or behind the camera, return
|
// If we have nothing to draw, or it's totally transparent, or it's too close or behind the camera, return
|
||||||
|
@ -816,17 +827,24 @@ void Avatar::renderDisplayName(gpu::Batch& batch, const ViewFrustum& frustum, co
|
||||||
// Test on extent above insures abs(height) > 0.0f
|
// Test on extent above insures abs(height) > 0.0f
|
||||||
textTransform.postScale(1.0f / height);
|
textTransform.postScale(1.0f / height);
|
||||||
batch.setModelTransform(textTransform);
|
batch.setModelTransform(textTransform);
|
||||||
|
|
||||||
DependencyManager::get<DeferredLightingEffect>()->bindSimpleProgram(batch, false, true, true, true);
|
{
|
||||||
DependencyManager::get<GeometryCache>()->renderBevelCornersRect(batch, left, bottom, width, height,
|
PROFILE_RANGE_BATCH(batch, __FUNCTION__":renderBevelCornersRect");
|
||||||
bevelDistance, backgroundColor);
|
DependencyManager::get<DeferredLightingEffect>()->bindSimpleProgram(batch, false, true, true, true);
|
||||||
|
DependencyManager::get<GeometryCache>()->renderBevelCornersRect(batch, left, bottom, width, height,
|
||||||
|
bevelDistance, backgroundColor);
|
||||||
|
}
|
||||||
|
|
||||||
// Render actual name
|
// Render actual name
|
||||||
QByteArray nameUTF8 = renderedDisplayName.toLocal8Bit();
|
QByteArray nameUTF8 = renderedDisplayName.toLocal8Bit();
|
||||||
|
|
||||||
// Render text slightly in front to avoid z-fighting
|
// Render text slightly in front to avoid z-fighting
|
||||||
textTransform.postTranslate(glm::vec3(0.0f, 0.0f, SLIGHTLY_IN_FRONT * renderer->getFontSize()));
|
textTransform.postTranslate(glm::vec3(0.0f, 0.0f, SLIGHTLY_IN_FRONT * renderer->getFontSize()));
|
||||||
batch.setModelTransform(textTransform);
|
batch.setModelTransform(textTransform);
|
||||||
renderer->draw(batch, text_x, -text_y, nameUTF8.data(), textColor);
|
{
|
||||||
|
PROFILE_RANGE_BATCH(batch, __FUNCTION__":renderText");
|
||||||
|
renderer->draw(batch, text_x, -text_y, nameUTF8.data(), textColor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1089,6 +1107,7 @@ void Avatar::renderJointConnectingCone(gpu::Batch& batch, glm::vec3 position1, g
|
||||||
points << p1a << p1b << p2a << p1b << p2a << p2b;
|
points << p1a << p1b << p2a << p1b << p2a << p2b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PROFILE_RANGE_BATCH(batch, __FUNCTION__);
|
||||||
// TODO: this is really inefficient constantly recreating these vertices buffers. It would be
|
// TODO: this is really inefficient constantly recreating these vertices buffers. It would be
|
||||||
// better if the avatars cached these buffers for each of the joints they are rendering
|
// better if the avatars cached these buffers for each of the joints they are rendering
|
||||||
geometryCache->updateVertices(_jointConesID, points, color);
|
geometryCache->updateVertices(_jointConesID, points, color);
|
||||||
|
|
|
@ -55,6 +55,9 @@ Input::NamedVector StandardController::getAvailableInputs() const {
|
||||||
makePair(LS, "LS"),
|
makePair(LS, "LS"),
|
||||||
makePair(RS, "RS"),
|
makePair(RS, "RS"),
|
||||||
|
|
||||||
|
makePair(LS_TOUCH, "LSTouch"),
|
||||||
|
makePair(RS_TOUCH, "RSTouch"),
|
||||||
|
|
||||||
// Center buttons
|
// Center buttons
|
||||||
makePair(START, "Start"),
|
makePair(START, "Start"),
|
||||||
makePair(BACK, "Back"),
|
makePair(BACK, "Back"),
|
||||||
|
@ -69,26 +72,41 @@ Input::NamedVector StandardController::getAvailableInputs() const {
|
||||||
makePair(LT, "LT"),
|
makePair(LT, "LT"),
|
||||||
makePair(RT, "RT"),
|
makePair(RT, "RT"),
|
||||||
|
|
||||||
|
|
||||||
// Finger abstractions
|
// Finger abstractions
|
||||||
makePair(LEFT_PRIMARY_THUMB, "LeftPrimaryThumb"),
|
makePair(LEFT_PRIMARY_THUMB, "LeftPrimaryThumb"),
|
||||||
makePair(LEFT_SECONDARY_THUMB, "LeftSecondaryThumb"),
|
makePair(LEFT_SECONDARY_THUMB, "LeftSecondaryThumb"),
|
||||||
|
makePair(LEFT_THUMB_UP, "LeftThumbUp"),
|
||||||
makePair(RIGHT_PRIMARY_THUMB, "RightPrimaryThumb"),
|
makePair(RIGHT_PRIMARY_THUMB, "RightPrimaryThumb"),
|
||||||
makePair(RIGHT_SECONDARY_THUMB, "RightSecondaryThumb"),
|
makePair(RIGHT_SECONDARY_THUMB, "RightSecondaryThumb"),
|
||||||
|
makePair(RIGHT_THUMB_UP, "RightThumbUp"),
|
||||||
|
|
||||||
|
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_INDEX_POINT, "LeftIndexPoint"),
|
||||||
|
makePair(RIGHT_INDEX_POINT, "RightIndexPoint"),
|
||||||
|
|
||||||
makePair(LEFT_PRIMARY_INDEX, "LeftPrimaryIndex"),
|
makePair(LEFT_PRIMARY_INDEX, "LeftPrimaryIndex"),
|
||||||
makePair(LEFT_SECONDARY_INDEX, "LeftSecondaryIndex"),
|
makePair(LEFT_SECONDARY_INDEX, "LeftSecondaryIndex"),
|
||||||
makePair(RIGHT_PRIMARY_INDEX, "RightPrimaryIndex"),
|
makePair(RIGHT_PRIMARY_INDEX, "RightPrimaryIndex"),
|
||||||
makePair(RIGHT_SECONDARY_INDEX, "RightSecondaryIndex"),
|
makePair(RIGHT_SECONDARY_INDEX, "RightSecondaryIndex"),
|
||||||
|
|
||||||
|
makePair(LEFT_PRIMARY_INDEX_TOUCH, "LeftPrimaryIndexTouch"),
|
||||||
|
makePair(LEFT_SECONDARY_INDEX_TOUCH, "LeftSecondaryIndexTouch"),
|
||||||
|
makePair(RIGHT_PRIMARY_INDEX_TOUCH, "RightPrimaryIndexTouch"),
|
||||||
|
makePair(RIGHT_SECONDARY_INDEX_TOUCH, "RightSecondaryIndexTouch"),
|
||||||
|
|
||||||
makePair(LEFT_GRIP, "LeftGrip"),
|
makePair(LEFT_GRIP, "LeftGrip"),
|
||||||
|
makePair(LEFT_GRIP_TOUCH, "LeftGripTouch"),
|
||||||
makePair(RIGHT_GRIP, "RightGrip"),
|
makePair(RIGHT_GRIP, "RightGrip"),
|
||||||
|
makePair(RIGHT_GRIP_TOUCH, "RightGripTouch"),
|
||||||
|
|
||||||
// Poses
|
// Poses
|
||||||
makePair(LEFT_HAND, "LeftHand"),
|
makePair(LEFT_HAND, "LeftHand"),
|
||||||
makePair(RIGHT_HAND, "RightHand"),
|
makePair(RIGHT_HAND, "RightHand"),
|
||||||
|
|
||||||
|
|
||||||
// Aliases, PlayStation style names
|
// Aliases, PlayStation style names
|
||||||
makePair(LB, "L1"),
|
makePair(LB, "L1"),
|
||||||
makePair(RB, "R1"),
|
makePair(RB, "R1"),
|
||||||
|
|
|
@ -39,16 +39,33 @@ namespace controller {
|
||||||
// These don't map to SDL types
|
// These don't map to SDL types
|
||||||
LEFT_PRIMARY_THUMB,
|
LEFT_PRIMARY_THUMB,
|
||||||
LEFT_SECONDARY_THUMB,
|
LEFT_SECONDARY_THUMB,
|
||||||
|
LEFT_PRIMARY_THUMB_TOUCH,
|
||||||
|
LEFT_SECONDARY_THUMB_TOUCH,
|
||||||
|
LS_TOUCH,
|
||||||
|
LEFT_THUMB_UP,
|
||||||
|
|
||||||
RIGHT_PRIMARY_THUMB,
|
RIGHT_PRIMARY_THUMB,
|
||||||
RIGHT_SECONDARY_THUMB,
|
RIGHT_SECONDARY_THUMB,
|
||||||
|
RIGHT_PRIMARY_THUMB_TOUCH,
|
||||||
|
RIGHT_SECONDARY_THUMB_TOUCH,
|
||||||
|
RS_TOUCH,
|
||||||
|
RIGHT_THUMB_UP,
|
||||||
|
|
||||||
LEFT_PRIMARY_INDEX,
|
LEFT_PRIMARY_INDEX,
|
||||||
LEFT_SECONDARY_INDEX,
|
LEFT_SECONDARY_INDEX,
|
||||||
|
LEFT_PRIMARY_INDEX_TOUCH,
|
||||||
|
LEFT_SECONDARY_INDEX_TOUCH,
|
||||||
|
LEFT_INDEX_POINT,
|
||||||
RIGHT_PRIMARY_INDEX,
|
RIGHT_PRIMARY_INDEX,
|
||||||
RIGHT_SECONDARY_INDEX,
|
RIGHT_SECONDARY_INDEX,
|
||||||
|
RIGHT_PRIMARY_INDEX_TOUCH,
|
||||||
|
RIGHT_SECONDARY_INDEX_TOUCH,
|
||||||
|
RIGHT_INDEX_POINT,
|
||||||
|
|
||||||
LEFT_GRIP,
|
LEFT_GRIP,
|
||||||
|
LEFT_GRIP_TOUCH,
|
||||||
RIGHT_GRIP,
|
RIGHT_GRIP,
|
||||||
|
RIGHT_GRIP_TOUCH,
|
||||||
|
|
||||||
NUM_STANDARD_BUTTONS
|
NUM_STANDARD_BUTTONS
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "Logging.h"
|
#include "Logging.h"
|
||||||
|
|
||||||
#include "impl/conditionals/AndConditional.h"
|
#include "impl/conditionals/AndConditional.h"
|
||||||
|
#include "impl/conditionals/NotConditional.h"
|
||||||
#include "impl/conditionals/EndpointConditional.h"
|
#include "impl/conditionals/EndpointConditional.h"
|
||||||
#include "impl/conditionals/ScriptConditional.h"
|
#include "impl/conditionals/ScriptConditional.h"
|
||||||
|
|
||||||
|
@ -676,7 +677,7 @@ Mapping::Pointer UserInputMapper::newMapping(const QString& mappingName) {
|
||||||
|
|
||||||
void UserInputMapper::enableMapping(const QString& mappingName, bool enable) {
|
void UserInputMapper::enableMapping(const QString& mappingName, bool enable) {
|
||||||
Locker locker(_lock);
|
Locker locker(_lock);
|
||||||
qCDebug(controllers) << "Attempting to enable mapping " << mappingName;
|
qCDebug(controllers) << "Attempting to " << (enable ? "enable" : "disable") << " mapping " << mappingName;
|
||||||
auto iterator = _mappingsByName.find(mappingName);
|
auto iterator = _mappingsByName.find(mappingName);
|
||||||
if (_mappingsByName.end() == iterator) {
|
if (_mappingsByName.end() == iterator) {
|
||||||
qCWarning(controllers) << "Request to enable / disable unknown mapping " << mappingName;
|
qCWarning(controllers) << "Request to enable / disable unknown mapping " << mappingName;
|
||||||
|
@ -826,13 +827,31 @@ Conditional::Pointer UserInputMapper::parseConditional(const QJsonValue& value)
|
||||||
return std::make_shared<AndConditional>(children);
|
return std::make_shared<AndConditional>(children);
|
||||||
} else if (value.isString()) {
|
} else if (value.isString()) {
|
||||||
// Support "when" : "GamePad.RB"
|
// Support "when" : "GamePad.RB"
|
||||||
auto input = findDeviceInput(value.toString());
|
auto conditionalToken = value.toString();
|
||||||
|
|
||||||
|
// Detect for modifier case (Not...)
|
||||||
|
QString conditionalModifier;
|
||||||
|
const QString JSON_CONDITIONAL_MODIFIER_NOT("!");
|
||||||
|
if (conditionalToken.startsWith(JSON_CONDITIONAL_MODIFIER_NOT)) {
|
||||||
|
conditionalModifier = JSON_CONDITIONAL_MODIFIER_NOT;
|
||||||
|
conditionalToken = conditionalToken.right(conditionalToken.size() - conditionalModifier.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
auto input = findDeviceInput(conditionalToken);
|
||||||
auto endpoint = endpointFor(input);
|
auto endpoint = endpointFor(input);
|
||||||
if (!endpoint) {
|
if (!endpoint) {
|
||||||
return Conditional::Pointer();
|
return Conditional::Pointer();
|
||||||
}
|
}
|
||||||
|
auto conditional = std::make_shared<EndpointConditional>(endpoint);
|
||||||
|
|
||||||
return std::make_shared<EndpointConditional>(endpoint);
|
if (!conditionalModifier.isEmpty()) {
|
||||||
|
if (conditionalModifier == JSON_CONDITIONAL_MODIFIER_NOT) {
|
||||||
|
return std::make_shared<NotConditional>(conditional);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default and conditional behavior
|
||||||
|
return conditional;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Conditional::parse(value);
|
return Conditional::parse(value);
|
||||||
|
|
|
@ -6,10 +6,16 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
// NOTE: we don't need to include this header unless/until we add additional symbols.
|
|
||||||
// By removing this header we prevent these warnings on windows:
|
#include "NotConditional.h"
|
||||||
//
|
|
||||||
// warning LNK4221: This object file does not define any previously undefined public symbols,
|
using namespace controller;
|
||||||
// so it will not be used by any link operation that consumes this library
|
|
||||||
//
|
bool NotConditional::satisfied() {
|
||||||
//#include "NotConditional.h"
|
if (_operand) {
|
||||||
|
return (!_operand->satisfied());
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,5 +12,19 @@
|
||||||
|
|
||||||
#include "../Conditional.h"
|
#include "../Conditional.h"
|
||||||
|
|
||||||
|
namespace controller {
|
||||||
|
|
||||||
|
class NotConditional : public Conditional {
|
||||||
|
public:
|
||||||
|
using Pointer = std::shared_ptr<NotConditional>;
|
||||||
|
|
||||||
|
NotConditional(Conditional::Pointer operand) : _operand(operand) { }
|
||||||
|
|
||||||
|
virtual bool satisfied() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Conditional::Pointer _operand;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -22,6 +22,14 @@ ProfileRange::ProfileRange(const char *name) {
|
||||||
ProfileRange::~ProfileRange() {
|
ProfileRange::~ProfileRange() {
|
||||||
nvtxRangePop();
|
nvtxRangePop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ProfileRangeBatch::ProfileRangeBatch(gpu::Batch& batch, const char *name) : _batch(batch) {
|
||||||
|
_batch.pushProfileRange(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
ProfileRangeBatch::~ProfileRangeBatch() {
|
||||||
|
_batch.popProfileRange();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ADD_COMMAND(call) _commands.push_back(COMMAND_##call); _commandOffsets.push_back(_params.size());
|
#define ADD_COMMAND(call) _commands.push_back(COMMAND_##call); _commandOffsets.push_back(_params.size());
|
||||||
|
@ -391,3 +399,17 @@ QDebug& operator<<(QDebug& debug, const Batch::CacheState& cacheState) {
|
||||||
|
|
||||||
return debug;
|
return debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Debugging
|
||||||
|
void Batch::pushProfileRange(const char* name) {
|
||||||
|
#if defined(NSIGHT_FOUND)
|
||||||
|
ADD_COMMAND(pushProfileRange);
|
||||||
|
_params.push_back(_profileRanges.cache(name));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void Batch::popProfileRange() {
|
||||||
|
#if defined(NSIGHT_FOUND)
|
||||||
|
ADD_COMMAND(popProfileRange);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
|
@ -229,6 +229,10 @@ public:
|
||||||
// Reset the stage caches and states
|
// Reset the stage caches and states
|
||||||
void resetStages();
|
void resetStages();
|
||||||
|
|
||||||
|
// Debugging
|
||||||
|
void pushProfileRange(const char* name);
|
||||||
|
void popProfileRange();
|
||||||
|
|
||||||
// TODO: As long as we have gl calls explicitely issued from interface
|
// TODO: As long as we have gl calls explicitely issued from interface
|
||||||
// code, we need to be able to record and batch these calls. THe long
|
// code, we need to be able to record and batch these calls. THe long
|
||||||
// term strategy is to get rid of any GL calls in favor of the HIFI GPU API
|
// term strategy is to get rid of any GL calls in favor of the HIFI GPU API
|
||||||
|
@ -324,6 +328,9 @@ public:
|
||||||
|
|
||||||
COMMAND_glColor4f,
|
COMMAND_glColor4f,
|
||||||
|
|
||||||
|
COMMAND_pushProfileRange,
|
||||||
|
COMMAND_popProfileRange,
|
||||||
|
|
||||||
NUM_COMMANDS,
|
NUM_COMMANDS,
|
||||||
};
|
};
|
||||||
typedef std::vector<Command> Commands;
|
typedef std::vector<Command> Commands;
|
||||||
|
@ -389,6 +396,7 @@ public:
|
||||||
typedef Cache<PipelinePointer>::Vector PipelineCaches;
|
typedef Cache<PipelinePointer>::Vector PipelineCaches;
|
||||||
typedef Cache<FramebufferPointer>::Vector FramebufferCaches;
|
typedef Cache<FramebufferPointer>::Vector FramebufferCaches;
|
||||||
typedef Cache<QueryPointer>::Vector QueryCaches;
|
typedef Cache<QueryPointer>::Vector QueryCaches;
|
||||||
|
typedef Cache<std::string>::Vector ProfileRangeCaches;
|
||||||
typedef Cache<std::function<void()>>::Vector LambdaCache;
|
typedef Cache<std::function<void()>>::Vector LambdaCache;
|
||||||
|
|
||||||
// Cache Data in a byte array if too big to fit in Param
|
// Cache Data in a byte array if too big to fit in Param
|
||||||
|
@ -416,6 +424,7 @@ public:
|
||||||
FramebufferCaches _framebuffers;
|
FramebufferCaches _framebuffers;
|
||||||
QueryCaches _queries;
|
QueryCaches _queries;
|
||||||
LambdaCache _lambdas;
|
LambdaCache _lambdas;
|
||||||
|
ProfileRangeCaches _profileRanges;
|
||||||
|
|
||||||
NamedBatchDataMap _namedData;
|
NamedBatchDataMap _namedData;
|
||||||
|
|
||||||
|
@ -429,6 +438,25 @@ protected:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(NSIGHT_FOUND)
|
||||||
|
|
||||||
|
class ProfileRangeBatch {
|
||||||
|
public:
|
||||||
|
ProfileRangeBatch(gpu::Batch& batch, const char *name);
|
||||||
|
~ProfileRangeBatch();
|
||||||
|
|
||||||
|
private:
|
||||||
|
gpu::Batch& _batch;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define PROFILE_RANGE_BATCH(batch, name) ProfileRangeBatch profileRangeThis(batch, name);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define PROFILE_RANGE_BATCH(batch, name)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
QDebug& operator<<(QDebug& debug, const gpu::Batch::CacheState& cacheState);
|
QDebug& operator<<(QDebug& debug, const gpu::Batch::CacheState& cacheState);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -15,6 +15,11 @@
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <glm/gtc/type_ptr.hpp>
|
#include <glm/gtc/type_ptr.hpp>
|
||||||
|
|
||||||
|
#if defined(NSIGHT_FOUND)
|
||||||
|
#include "nvToolsExt.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
using namespace gpu;
|
using namespace gpu;
|
||||||
|
|
||||||
GLBackend::CommandCall GLBackend::_commandCalls[Batch::NUM_COMMANDS] =
|
GLBackend::CommandCall GLBackend::_commandCalls[Batch::NUM_COMMANDS] =
|
||||||
|
@ -69,6 +74,9 @@ GLBackend::CommandCall GLBackend::_commandCalls[Batch::NUM_COMMANDS] =
|
||||||
(&::gpu::GLBackend::do_glUniformMatrix4fv),
|
(&::gpu::GLBackend::do_glUniformMatrix4fv),
|
||||||
|
|
||||||
(&::gpu::GLBackend::do_glColor4f),
|
(&::gpu::GLBackend::do_glColor4f),
|
||||||
|
|
||||||
|
(&::gpu::GLBackend::do_pushProfileRange),
|
||||||
|
(&::gpu::GLBackend::do_popProfileRange),
|
||||||
};
|
};
|
||||||
|
|
||||||
void GLBackend::init() {
|
void GLBackend::init() {
|
||||||
|
@ -710,3 +718,17 @@ void GLBackend::do_glColor4f(Batch& batch, uint32 paramOffset) {
|
||||||
}
|
}
|
||||||
(void) CHECK_GL_ERROR();
|
(void) CHECK_GL_ERROR();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GLBackend::do_pushProfileRange(Batch& batch, uint32 paramOffset) {
|
||||||
|
#if defined(NSIGHT_FOUND)
|
||||||
|
auto name = batch._profileRanges.get(batch._params[paramOffset]._uint);
|
||||||
|
nvtxRangePush(name.c_str());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void GLBackend::do_popProfileRange(Batch& batch, uint32 paramOffset) {
|
||||||
|
#if defined(NSIGHT_FOUND)
|
||||||
|
nvtxRangePop();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
|
@ -479,6 +479,9 @@ protected:
|
||||||
|
|
||||||
void do_glColor4f(Batch& batch, uint32 paramOffset);
|
void do_glColor4f(Batch& batch, uint32 paramOffset);
|
||||||
|
|
||||||
|
void do_pushProfileRange(Batch& batch, uint32 paramOffset);
|
||||||
|
void do_popProfileRange(Batch& batch, uint32 paramOffset);
|
||||||
|
|
||||||
typedef void (GLBackend::*CommandCall)(Batch&, uint32);
|
typedef void (GLBackend::*CommandCall)(Batch&, uint32);
|
||||||
static CommandCall _commandCalls[Batch::NUM_COMMANDS];
|
static CommandCall _commandCalls[Batch::NUM_COMMANDS];
|
||||||
};
|
};
|
||||||
|
|
|
@ -114,7 +114,6 @@
|
||||||
createTargets();
|
createTargets();
|
||||||
createTargetResetter();
|
createTargetResetter();
|
||||||
|
|
||||||
createBasketballHoop();
|
|
||||||
createBasketballRack();
|
createBasketballRack();
|
||||||
createBasketballResetter();
|
createBasketballResetter();
|
||||||
|
|
||||||
|
@ -130,14 +129,11 @@
|
||||||
z: 503.49
|
z: 503.49
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
createSprayCan({
|
createSprayCan({
|
||||||
x: 549.7,
|
x: 549.7,
|
||||||
y: 495.6,
|
y: 495.6,
|
||||||
z: 503.91
|
z: 503.91
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteAllToys() {
|
function deleteAllToys() {
|
||||||
|
@ -930,45 +926,6 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createBasketballHoop() {
|
|
||||||
var position = {
|
|
||||||
x: 539.23,
|
|
||||||
y: 496.13,
|
|
||||||
z: 475.89
|
|
||||||
};
|
|
||||||
var rotation = Quat.fromPitchYawRollDegrees(0, 58.49, 0);
|
|
||||||
|
|
||||||
var hoopURL = "http://hifi-public.s3.amazonaws.com/models/basketball_hoop/basketball_hoop.fbx";
|
|
||||||
var hoopCollisionHullURL = "http://hifi-public.s3.amazonaws.com/models/basketball_hoop/basketball_hoop_collision_hull.obj";
|
|
||||||
|
|
||||||
var hoop = Entities.addEntity({
|
|
||||||
type: "Model",
|
|
||||||
modelURL: hoopURL,
|
|
||||||
position: position,
|
|
||||||
rotation: rotation,
|
|
||||||
shapeType: 'compound',
|
|
||||||
gravity: {
|
|
||||||
x: 0,
|
|
||||||
y: -9.8,
|
|
||||||
z: 0
|
|
||||||
},
|
|
||||||
dimensions: {
|
|
||||||
x: 1.89,
|
|
||||||
y: 3.99,
|
|
||||||
z: 3.79
|
|
||||||
},
|
|
||||||
compoundShapeURL: hoopCollisionHullURL,
|
|
||||||
userData: JSON.stringify({
|
|
||||||
resetMe: {
|
|
||||||
resetMe: true
|
|
||||||
},
|
|
||||||
grabbableKey: {
|
|
||||||
grabbable: false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function createWand(position) {
|
function createWand(position) {
|
||||||
var WAND_MODEL = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/models/wand/wand.fbx';
|
var WAND_MODEL = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/models/wand/wand.fbx';
|
||||||
var WAND_COLLISION_SHAPE = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/models/wand/actual_no_top_collision_hull.obj';
|
var WAND_COLLISION_SHAPE = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/models/wand/actual_no_top_collision_hull.obj';
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
//per script
|
//per script
|
||||||
|
|
||||||
|
|
||||||
/*global deleteAllToys, createAllToys, createGates, createPingPongBallGun, createFire, createPottedPlant, createCombinedArmChair, createBasketballHoop, createBasketBall, createSprayCan, createDoll, createWand, createDice, createCat, deleteAllToys, createFlashlight, createBlocks, createMagballs, createLights */
|
/*global deleteAllToys, createAllToys, createGates, createPingPongBallGun, createFire, createPottedPlant, createCombinedArmChair, createBasketBall, createSprayCan, createDoll, createWand, createDice, createCat, deleteAllToys, createFlashlight, createBlocks, createMagballs, createLights */
|
||||||
var utilitiesScript = Script.resolvePath("../examples/libraries/utils.js");
|
var utilitiesScript = Script.resolvePath("../examples/libraries/utils.js");
|
||||||
Script.include(utilitiesScript);
|
Script.include(utilitiesScript);
|
||||||
|
|
||||||
|
@ -87,7 +87,6 @@ MasterReset = function() {
|
||||||
createTargets();
|
createTargets();
|
||||||
createTargetResetter();
|
createTargetResetter();
|
||||||
|
|
||||||
createBasketballHoop();
|
|
||||||
createBasketballRack();
|
createBasketballRack();
|
||||||
createBasketballResetter();
|
createBasketballResetter();
|
||||||
|
|
||||||
|
@ -908,45 +907,6 @@ MasterReset = function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createBasketballHoop() {
|
|
||||||
var position = {
|
|
||||||
x: 539.23,
|
|
||||||
y: 496.13,
|
|
||||||
z: 475.89
|
|
||||||
};
|
|
||||||
var rotation = Quat.fromPitchYawRollDegrees(0, 58.49, 0);
|
|
||||||
|
|
||||||
var hoopURL = "http://hifi-public.s3.amazonaws.com/models/basketball_hoop/basketball_hoop.fbx";
|
|
||||||
var hoopCollisionHullURL = "http://hifi-public.s3.amazonaws.com/models/basketball_hoop/basketball_hoop_collision_hull.obj";
|
|
||||||
|
|
||||||
var hoop = Entities.addEntity({
|
|
||||||
type: "Model",
|
|
||||||
modelURL: hoopURL,
|
|
||||||
position: position,
|
|
||||||
rotation: rotation,
|
|
||||||
shapeType: 'compound',
|
|
||||||
gravity: {
|
|
||||||
x: 0,
|
|
||||||
y: -9.8,
|
|
||||||
z: 0
|
|
||||||
},
|
|
||||||
dimensions: {
|
|
||||||
x: 1.89,
|
|
||||||
y: 3.99,
|
|
||||||
z: 3.79
|
|
||||||
},
|
|
||||||
compoundShapeURL: hoopCollisionHullURL,
|
|
||||||
userData: JSON.stringify({
|
|
||||||
resetMe: {
|
|
||||||
resetMe: true
|
|
||||||
},
|
|
||||||
grabbableKey: {
|
|
||||||
grabbable: false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function createWand(position) {
|
function createWand(position) {
|
||||||
var WAND_MODEL = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/models/wand/wand.fbx';
|
var WAND_MODEL = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/models/wand/wand.fbx';
|
||||||
var WAND_COLLISION_SHAPE = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/models/wand/actual_no_top_collision_hull.obj';
|
var WAND_COLLISION_SHAPE = 'http://hifi-public.s3.amazonaws.com/james/bubblewand/models/wand/actual_no_top_collision_hull.obj';
|
||||||
|
|
Loading…
Reference in a new issue