Merge branch 'master' into ping_pong_gun

This commit is contained in:
James B. Pollack 2015-10-05 10:54:21 -07:00
commit 588a256304
11 changed files with 44 additions and 28 deletions

View file

@ -264,7 +264,6 @@ var toolBar = (function () {
cameraManager.disable();
} else {
hasShownPropertiesTool = false;
cameraManager.enable();
entityListTool.setVisible(true);
gridTool.setVisible(true);
grid.setEnabled(true);
@ -675,15 +674,11 @@ function mouseMove(event) {
lastMousePosition = { x: event.x, y: event.y };
highlightEntityUnderCursor(lastMousePosition, false);
idleMouseTimerId = Script.setTimeout(handleIdleMouse, IDLE_MOUSE_TIMEOUT);
}
function handleIdleMouse() {
idleMouseTimerId = null;
if (isActive) {
highlightEntityUnderCursor(lastMousePosition, true);
}
}
function highlightEntityUnderCursor(position, accurateRay) {
@ -807,6 +802,7 @@ function mouseClickEvent(event) {
selectionDisplay.select(selectedEntityID, event);
if (Menu.isOptionChecked(MENU_AUTO_FOCUS_ON_SELECT)) {
cameraManager.enable();
cameraManager.focus(selectionManager.worldPosition,
selectionManager.worldDimensions,
Menu.isOptionChecked(MENU_EASE_ON_FOCUS));
@ -1147,6 +1143,7 @@ Controller.keyReleaseEvent.connect(function (event) {
} else if (event.text == "f") {
if (isActive) {
if (selectionManager.hasSelection()) {
cameraManager.enable();
cameraManager.focus(selectionManager.worldPosition,
selectionManager.worldDimensions,
Menu.isOptionChecked(MENU_EASE_ON_FOCUS));

View file

@ -56,7 +56,7 @@ EntityListTool = function(opts) {
var selectedIDs = [];
for (var i = 0; i < selectionManager.selections.length; i++) {
selectedIDs.push(selectionManager.selections[i].id); // ?
selectedIDs.push(selectionManager.selections[i].id);
}
var data = {
@ -77,6 +77,7 @@ EntityListTool = function(opts) {
}
selectionManager.setSelections(entityIDs);
if (data.focus) {
cameraManager.enable();
cameraManager.focus(selectionManager.worldPosition,
selectionManager.worldDimensions,
Menu.isOptionChecked(MENU_EASE_ON_FOCUS));

View file

@ -85,6 +85,11 @@
particleRadius: 0.01,
radiusSpread: 0.005,
polarFinish: 0.05,
colorStart: {
red: 50,
green: 10,
blue: 150
},
color: {
red: 170,
green: 20,
@ -155,8 +160,5 @@
if (this.paintStream) {
Entities.deleteEntity(this.paintStream);
}
this.strokes.forEach(function(stroke) {
Entities.deleteEntity(stroke);
});
}
});

View file

@ -2764,12 +2764,19 @@ void Application::cameraMenuChanged() {
}
void Application::reloadResourceCaches() {
// Clear entities out of view frustum
_viewFrustum.setPosition(glm::vec3(0.0f, 0.0f, TREE_SCALE));
_viewFrustum.setOrientation(glm::quat());
queryOctree(NodeType::EntityServer, PacketType::EntityQuery, _entityServerJurisdictions);
emptyLocalCache();
DependencyManager::get<AnimationCache>()->refreshAll();
DependencyManager::get<ModelCache>()->refreshAll();
DependencyManager::get<SoundCache>()->refreshAll();
DependencyManager::get<TextureCache>()->refreshAll();
DependencyManager::get<NodeList>()->reset(); // Force redownload of .fst models
}
void Application::rotationModeChanged() {

View file

@ -79,6 +79,7 @@ public:
glm::mat4 localToVoxelMatrix() const;
virtual ShapeType getShapeType() const;
virtual bool shouldBePhysical() const { return true; }
virtual bool isReadyToComputeShape();
virtual void computeShapeInfo(ShapeInfo& info);

View file

@ -52,6 +52,7 @@ public:
}
virtual ShapeType getShapeType() const { return SHAPE_TYPE_BOX; }
virtual bool shouldBePhysical() const { return true; }
virtual void debugDump() const;

View file

@ -334,7 +334,7 @@ public:
bool getCollisionsWillMove() const { return _collisionsWillMove; }
void setCollisionsWillMove(bool value) { _collisionsWillMove = value; }
virtual bool shouldBePhysical() const { return !_ignoreForCollisions; }
virtual bool shouldBePhysical() const { return false; }
bool getLocked() const { return _locked; }
void setLocked(bool value) { _locked = value; }

View file

@ -466,5 +466,5 @@ QString ModelEntityItem::getAnimationSettings() const {
// virtual
bool ModelEntityItem::shouldBePhysical() const {
return EntityItem::shouldBePhysical() && getShapeType() != SHAPE_TYPE_NONE;
return getShapeType() != SHAPE_TYPE_NONE;
}

View file

@ -51,6 +51,7 @@ public:
}
virtual ShapeType getShapeType() const { return SHAPE_TYPE_SPHERE; }
virtual bool shouldBePhysical() const { return true; }
virtual bool supportsDetailedRayIntersection() const { return true; }
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,

View file

@ -596,6 +596,12 @@ QString EntityMotionState::getName() {
// virtual
int16_t EntityMotionState::computeCollisionGroup() {
if (!_entity) {
return COLLISION_GROUP_STATIC;
}
if (_entity->getIgnoreForCollisions()) {
return COLLISION_GROUP_COLLISIONLESS;
}
switch (computeObjectMotionType()){
case MOTION_TYPE_STATIC:
return COLLISION_GROUP_STATIC;

View file

@ -37,11 +37,11 @@ enum MotionStateType {
// The update flags trigger two varieties of updates: "hard" which require the body to be pulled
// and re-added to the physics engine and "easy" which just updates the body properties.
const uint32_t HARD_DIRTY_PHYSICS_FLAGS = (uint32_t)(EntityItem::DIRTY_MOTION_TYPE | EntityItem::DIRTY_SHAPE);
const uint32_t HARD_DIRTY_PHYSICS_FLAGS = (uint32_t)(EntityItem::DIRTY_MOTION_TYPE | EntityItem::DIRTY_SHAPE |
EntityItem::DIRTY_COLLISION_GROUP);
const uint32_t EASY_DIRTY_PHYSICS_FLAGS = (uint32_t)(EntityItem::DIRTY_TRANSFORM | EntityItem::DIRTY_VELOCITIES |
EntityItem::DIRTY_MASS | EntityItem::DIRTY_COLLISION_GROUP |
EntityItem::DIRTY_MATERIAL | EntityItem::DIRTY_SIMULATOR_ID |
EntityItem::DIRTY_SIMULATOR_OWNERSHIP);
EntityItem::DIRTY_MASS | EntityItem::DIRTY_MATERIAL |
EntityItem::DIRTY_SIMULATOR_ID | EntityItem::DIRTY_SIMULATOR_OWNERSHIP);
// These are the set of incoming flags that the PhysicsEngine needs to hear about:
const uint32_t DIRTY_PHYSICS_FLAGS = (uint32_t)(HARD_DIRTY_PHYSICS_FLAGS | EASY_DIRTY_PHYSICS_FLAGS |