mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-17 14:48:46 +02:00
Merge pull request #6512 from AndrewMeadows/remove-debug-cruft
remove debug option for disabling physics updates
This commit is contained in:
commit
112cdaf028
6 changed files with 14 additions and 62 deletions
|
@ -19,7 +19,6 @@ var createdStereoInputMenuItem = false;
|
||||||
var DEVELOPER_MENU = "Developer";
|
var DEVELOPER_MENU = "Developer";
|
||||||
|
|
||||||
var ENTITIES_MENU = DEVELOPER_MENU + " > Entities";
|
var ENTITIES_MENU = DEVELOPER_MENU + " > Entities";
|
||||||
var COLLISION_UPDATES_TO_SERVER = "Don't send collision updates to server";
|
|
||||||
|
|
||||||
var RENDER_MENU = DEVELOPER_MENU + " > Render";
|
var RENDER_MENU = DEVELOPER_MENU + " > Render";
|
||||||
var ENTITIES_ITEM = "Entities";
|
var ENTITIES_ITEM = "Entities";
|
||||||
|
@ -66,7 +65,6 @@ function setupMenus() {
|
||||||
Menu.addMenuItem({ menuName: "Developer > Entities", menuItemName: "Don't Do Precision Picking", isCheckable: true, isChecked: false });
|
Menu.addMenuItem({ menuName: "Developer > Entities", menuItemName: "Don't Do Precision Picking", isCheckable: true, isChecked: false });
|
||||||
Menu.addMenuItem({ menuName: "Developer > Entities", menuItemName: "Disable Light Entities", isCheckable: true, isChecked: false });
|
Menu.addMenuItem({ menuName: "Developer > Entities", menuItemName: "Disable Light Entities", isCheckable: true, isChecked: false });
|
||||||
*/
|
*/
|
||||||
Menu.addMenuItem({ menuName: ENTITIES_MENU, menuItemName: COLLISION_UPDATES_TO_SERVER, isCheckable: true, isChecked: false });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Menu.menuExists(RENDER_MENU)) {
|
if (!Menu.menuExists(RENDER_MENU)) {
|
||||||
|
@ -112,11 +110,7 @@ function setupMenus() {
|
||||||
Menu.menuItemEvent.connect(function (menuItem) {
|
Menu.menuItemEvent.connect(function (menuItem) {
|
||||||
print("menuItemEvent() in JS... menuItem=" + menuItem);
|
print("menuItemEvent() in JS... menuItem=" + menuItem);
|
||||||
|
|
||||||
if (menuItem == COLLISION_UPDATES_TO_SERVER) {
|
if (menuItem == ENTITIES_ITEM) {
|
||||||
var dontSendUpdates = Menu.isOptionChecked(COLLISION_UPDATES_TO_SERVER);
|
|
||||||
print(" dontSendUpdates... checked=" + dontSendUpdates);
|
|
||||||
Entities.setSendPhysicsUpdates(!dontSendUpdates);
|
|
||||||
} else if (menuItem == ENTITIES_ITEM) {
|
|
||||||
Scene.shouldRenderEntities = Menu.isOptionChecked(ENTITIES_ITEM);
|
Scene.shouldRenderEntities = Menu.isOptionChecked(ENTITIES_ITEM);
|
||||||
} else if (menuItem == AVATARS_ITEM) {
|
} else if (menuItem == AVATARS_ITEM) {
|
||||||
Scene.shouldRenderAvatars = Menu.isOptionChecked(AVATARS_ITEM);
|
Scene.shouldRenderAvatars = Menu.isOptionChecked(AVATARS_ITEM);
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
#include "EntityActionFactoryInterface.h"
|
#include "EntityActionFactoryInterface.h"
|
||||||
|
|
||||||
|
|
||||||
bool EntityItem::_sendPhysicsUpdates = true;
|
|
||||||
int EntityItem::_maxActionsDataSize = 800;
|
int EntityItem::_maxActionsDataSize = 800;
|
||||||
quint64 EntityItem::_rememberDeletedActionTime = 20 * USECS_PER_SECOND;
|
quint64 EntityItem::_rememberDeletedActionTime = 20 * USECS_PER_SECOND;
|
||||||
|
|
||||||
|
|
|
@ -48,25 +48,6 @@ namespace render {
|
||||||
class PendingChanges;
|
class PendingChanges;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
// these thesholds determine what updates will be ignored (client and server)
|
|
||||||
const float IGNORE_POSITION_DELTA = 0.0001f;
|
|
||||||
const float IGNORE_DIMENSIONS_DELTA = 0.0005f;
|
|
||||||
const float IGNORE_ALIGNMENT_DOT = 0.99997f;
|
|
||||||
const float IGNORE_LINEAR_VELOCITY_DELTA = 0.001f;
|
|
||||||
const float IGNORE_DAMPING_DELTA = 0.001f;
|
|
||||||
const float IGNORE_GRAVITY_DELTA = 0.001f;
|
|
||||||
const float IGNORE_ANGULAR_VELOCITY_DELTA = 0.0002f;
|
|
||||||
|
|
||||||
// these thresholds determine what updates will activate the physical object
|
|
||||||
const float ACTIVATION_POSITION_DELTA = 0.005f;
|
|
||||||
const float ACTIVATION_DIMENSIONS_DELTA = 0.005f;
|
|
||||||
const float ACTIVATION_ALIGNMENT_DOT = 0.99990f;
|
|
||||||
const float ACTIVATION_LINEAR_VELOCITY_DELTA = 0.01f;
|
|
||||||
const float ACTIVATION_GRAVITY_DELTA = 0.1f;
|
|
||||||
const float ACTIVATION_ANGULAR_VELOCITY_DELTA = 0.03f;
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define DONT_ALLOW_INSTANTIATION virtual void pureVirtualFunctionPlaceHolder() = 0;
|
#define DONT_ALLOW_INSTANTIATION virtual void pureVirtualFunctionPlaceHolder() = 0;
|
||||||
#define ALLOW_INSTANTIATION virtual void pureVirtualFunctionPlaceHolder() { };
|
#define ALLOW_INSTANTIATION virtual void pureVirtualFunctionPlaceHolder() { };
|
||||||
|
|
||||||
|
@ -387,9 +368,6 @@ public:
|
||||||
EntityTreePointer getTree() const;
|
EntityTreePointer getTree() const;
|
||||||
bool wantTerseEditLogging();
|
bool wantTerseEditLogging();
|
||||||
|
|
||||||
static void setSendPhysicsUpdates(bool value) { _sendPhysicsUpdates = value; }
|
|
||||||
static bool getSendPhysicsUpdates() { return _sendPhysicsUpdates; }
|
|
||||||
|
|
||||||
glm::mat4 getEntityToWorldMatrix() const;
|
glm::mat4 getEntityToWorldMatrix() const;
|
||||||
glm::mat4 getWorldToEntityMatrix() const;
|
glm::mat4 getWorldToEntityMatrix() const;
|
||||||
glm::vec3 worldToEntity(const glm::vec3& point) const;
|
glm::vec3 worldToEntity(const glm::vec3& point) const;
|
||||||
|
@ -432,7 +410,6 @@ protected:
|
||||||
const QByteArray getActionDataInternal() const;
|
const QByteArray getActionDataInternal() const;
|
||||||
void setActionDataInternal(QByteArray actionData);
|
void setActionDataInternal(QByteArray actionData);
|
||||||
|
|
||||||
static bool _sendPhysicsUpdates;
|
|
||||||
EntityTypes::EntityType _type;
|
EntityTypes::EntityType _type;
|
||||||
QUuid _id;
|
QUuid _id;
|
||||||
quint64 _lastSimulated; // last time this entity called simulate(), this includes velocity, angular velocity,
|
quint64 _lastSimulated; // last time this entity called simulate(), this includes velocity, angular velocity,
|
||||||
|
|
|
@ -333,15 +333,6 @@ bool EntityScriptingInterface::getDrawZoneBoundaries() const {
|
||||||
return ZoneEntityItem::getDrawZoneBoundaries();
|
return ZoneEntityItem::getDrawZoneBoundaries();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityScriptingInterface::setSendPhysicsUpdates(bool value) {
|
|
||||||
EntityItem::setSendPhysicsUpdates(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool EntityScriptingInterface::getSendPhysicsUpdates() const {
|
|
||||||
return EntityItem::getSendPhysicsUpdates();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
RayToEntityIntersectionResult::RayToEntityIntersectionResult() :
|
RayToEntityIntersectionResult::RayToEntityIntersectionResult() :
|
||||||
intersects(false),
|
intersects(false),
|
||||||
accurate(true), // assume it's accurate
|
accurate(true), // assume it's accurate
|
||||||
|
|
|
@ -127,9 +127,6 @@ public slots:
|
||||||
Q_INVOKABLE void setDrawZoneBoundaries(bool value);
|
Q_INVOKABLE void setDrawZoneBoundaries(bool value);
|
||||||
Q_INVOKABLE bool getDrawZoneBoundaries() const;
|
Q_INVOKABLE bool getDrawZoneBoundaries() const;
|
||||||
|
|
||||||
Q_INVOKABLE void setSendPhysicsUpdates(bool value);
|
|
||||||
Q_INVOKABLE bool getSendPhysicsUpdates() const;
|
|
||||||
|
|
||||||
Q_INVOKABLE bool setVoxelSphere(QUuid entityID, const glm::vec3& center, float radius, int value);
|
Q_INVOKABLE bool setVoxelSphere(QUuid entityID, const glm::vec3& center, float radius, int value);
|
||||||
Q_INVOKABLE bool setVoxel(QUuid entityID, const glm::vec3& position, int value);
|
Q_INVOKABLE bool setVoxel(QUuid entityID, const glm::vec3& position, int value);
|
||||||
Q_INVOKABLE bool setAllVoxels(QUuid entityID, int value);
|
Q_INVOKABLE bool setAllVoxels(QUuid entityID, int value);
|
||||||
|
|
|
@ -492,7 +492,6 @@ void EntityMotionState::sendUpdate(OctreeEditPacketSender* packetSender, const Q
|
||||||
_nextOwnershipBid = now + USECS_BETWEEN_OWNERSHIP_BIDS;
|
_nextOwnershipBid = now + USECS_BETWEEN_OWNERSHIP_BIDS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EntityItem::getSendPhysicsUpdates()) {
|
|
||||||
EntityItemID id(_entity->getID());
|
EntityItemID id(_entity->getID());
|
||||||
EntityEditPacketSender* entityPacketSender = static_cast<EntityEditPacketSender*>(packetSender);
|
EntityEditPacketSender* entityPacketSender = static_cast<EntityEditPacketSender*>(packetSender);
|
||||||
#ifdef WANT_DEBUG
|
#ifdef WANT_DEBUG
|
||||||
|
@ -501,11 +500,6 @@ void EntityMotionState::sendUpdate(OctreeEditPacketSender* packetSender, const Q
|
||||||
|
|
||||||
entityPacketSender->queueEditEntityMessage(PacketType::EntityEdit, id, properties);
|
entityPacketSender->queueEditEntityMessage(PacketType::EntityEdit, id, properties);
|
||||||
_entity->setLastBroadcast(usecTimestampNow());
|
_entity->setLastBroadcast(usecTimestampNow());
|
||||||
} else {
|
|
||||||
#ifdef WANT_DEBUG
|
|
||||||
qCDebug(physics) << "EntityMotionState::sendUpdate()... NOT sending update as requested.";
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
_lastStep = step;
|
_lastStep = step;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue