mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 08:14:48 +02:00
committing some temp debug stuff to help git diff
(will remove this stuff later)
This commit is contained in:
parent
49eee89c19
commit
e4c68bf31c
9 changed files with 34 additions and 24 deletions
|
@ -181,4 +181,4 @@ endif ()
|
|||
|
||||
if (ANDROID OR DESKTOP_GVR)
|
||||
add_subdirectory(gvr-interface)
|
||||
endif ()
|
||||
endif ()
|
||||
|
|
|
@ -48,6 +48,7 @@ EntityTreeRenderer::EntityTreeRenderer(bool wantScripts, AbstractViewStateInterf
|
|||
_displayModelElementProxy(false),
|
||||
_dontDoPrecisionPicking(false)
|
||||
{
|
||||
std::cout << "adebug " << (void*)(this) << " EntityTreeRenderer ctor" << std::endl; // adebug
|
||||
REGISTER_ENTITY_TYPE_WITH_FACTORY(Model, RenderableModelEntityItem::factory)
|
||||
REGISTER_ENTITY_TYPE_WITH_FACTORY(Box, RenderableBoxEntityItem::factory)
|
||||
REGISTER_ENTITY_TYPE_WITH_FACTORY(Sphere, RenderableSphereEntityItem::factory)
|
||||
|
@ -480,7 +481,6 @@ void EntityTreeRenderer::renderProxies(const EntityItem* entity, RenderArgs* arg
|
|||
|
||||
maxCube.scale((float) TREE_SCALE);
|
||||
minCube.scale((float) TREE_SCALE);
|
||||
entityBox.scale((float) TREE_SCALE);
|
||||
|
||||
glm::vec3 maxCenter = maxCube.calcCenter();
|
||||
glm::vec3 minCenter = minCube.calcCenter();
|
||||
|
@ -672,10 +672,16 @@ RayToEntityIntersectionResult EntityTreeRenderer::findRayIntersectionWorker(cons
|
|||
(void**)&intersectedEntity, lockType, &result.accurate,
|
||||
precisionPicking);
|
||||
if (result.intersects && intersectedEntity) {
|
||||
std::cout << "adebug " << (void*)(this) << " EntityTreeRenderer's tree = " << (void*)(_tree) << std::endl; // adebug
|
||||
int foo = 0;
|
||||
result.entityID = intersectedEntity->getEntityItemID();
|
||||
foo = 1;
|
||||
result.properties = intersectedEntity->getProperties();
|
||||
foo = 2;
|
||||
result.intersection = ray.origin + (ray.direction * result.distance);
|
||||
foo = 3;
|
||||
result.entity = intersectedEntity;
|
||||
std::cout << "adebug foo = " << foo << std::endl; // adebug
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -41,6 +41,7 @@ EntityItemProperties BoxEntityItem::getProperties() const {
|
|||
properties._glowLevel = getGlowLevel();
|
||||
properties._glowLevelChanged = false;
|
||||
|
||||
std::cout << "adebug end of BoxEntityItem::getProperties()" << std::endl; // adebug
|
||||
return properties;
|
||||
}
|
||||
|
||||
|
|
|
@ -795,6 +795,7 @@ quint64 EntityItem::getExpiry() const {
|
|||
}
|
||||
|
||||
EntityItemProperties EntityItem::getProperties() const {
|
||||
std::cout << "adebug EntityItem::getProperties" << std::endl; // adebug
|
||||
EntityItemProperties properties;
|
||||
properties._id = getID();
|
||||
properties._idSet = true;
|
||||
|
@ -824,6 +825,7 @@ EntityItemProperties EntityItem::getProperties() const {
|
|||
|
||||
properties._defaultSettings = false;
|
||||
|
||||
std::cout << "adebug about to delete properties" << std::endl; // adebug
|
||||
return properties;
|
||||
}
|
||||
|
||||
|
@ -1017,31 +1019,27 @@ const float MIN_SPIN_DELTA = 0.0003f;
|
|||
|
||||
void EntityItem::updatePositionInDomainUnits(const glm::vec3& value) {
|
||||
glm::vec3 position = value * (float)TREE_SCALE;
|
||||
if (glm::distance(_position, position) > MIN_POSITION_DELTA) {
|
||||
_position = position;
|
||||
_dirtyFlags |= EntityItem::DIRTY_POSITION;
|
||||
}
|
||||
updatePositionInMeters(position);
|
||||
}
|
||||
|
||||
void EntityItem::updatePositionInMeters(const glm::vec3& value) {
|
||||
if (glm::distance(_position, value) > MIN_POSITION_DELTA) {
|
||||
_position = value;
|
||||
_dirtyFlags |= EntityItem::DIRTY_POSITION;
|
||||
std::cout << "adebug updatePositionInMeters = " << _position << std::endl; // adebug
|
||||
}
|
||||
}
|
||||
|
||||
void EntityItem::updateDimensionsInDomainUnits(const glm::vec3& value) {
|
||||
glm::vec3 dimensions = value * (float)TREE_SCALE;
|
||||
if (glm::distance(_dimensions, dimensions) > MIN_DIMENSIONS_DELTA) {
|
||||
_dimensions = glm::abs(dimensions);
|
||||
_dirtyFlags |= (EntityItem::DIRTY_SHAPE | EntityItem::DIRTY_MASS);
|
||||
}
|
||||
updateDimensionsInMeters(dimensions);
|
||||
}
|
||||
|
||||
void EntityItem::updateDimensionsInMeters(const glm::vec3& value) {
|
||||
if (glm::distance(_dimensions, value) > MIN_DIMENSIONS_DELTA) {
|
||||
_dimensions = value;
|
||||
_dirtyFlags |= (EntityItem::DIRTY_SHAPE | EntityItem::DIRTY_MASS);
|
||||
std::cout << "adebug updateDimensionsInMeters = " << value << std::endl; // adebug
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1078,14 +1076,7 @@ void EntityItem::updateMass(float mass) {
|
|||
|
||||
void EntityItem::updateVelocityInDomainUnits(const glm::vec3& value) {
|
||||
glm::vec3 velocity = value * (float)TREE_SCALE;
|
||||
if (glm::distance(_velocity, velocity) > MIN_VELOCITY_DELTA) {
|
||||
if (glm::length(velocity) < MIN_VELOCITY_DELTA) {
|
||||
_velocity = ENTITY_ITEM_ZERO_VEC3;
|
||||
} else {
|
||||
_velocity = velocity;
|
||||
}
|
||||
_dirtyFlags |= EntityItem::DIRTY_VELOCITY;
|
||||
}
|
||||
updateVelocityInMeters(velocity);
|
||||
}
|
||||
|
||||
void EntityItem::updateVelocityInMeters(const glm::vec3& value) {
|
||||
|
@ -1108,10 +1099,7 @@ void EntityItem::updateDamping(float value) {
|
|||
|
||||
void EntityItem::updateGravityInDomainUnits(const glm::vec3& value) {
|
||||
glm::vec3 gravity = value * (float) TREE_SCALE;
|
||||
if (glm::distance(_gravity, gravity) > MIN_GRAVITY_DELTA) {
|
||||
_gravity = gravity;
|
||||
_dirtyFlags |= EntityItem::DIRTY_VELOCITY;
|
||||
}
|
||||
updateGravityInMeters(gravity);
|
||||
}
|
||||
|
||||
void EntityItem::updateGravityInMeters(const glm::vec3& value) {
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <OctreeElement.h> // for OctreeElement::AppendState
|
||||
#include <OctreePacketData.h>
|
||||
#include <ShapeInfo.h>
|
||||
#include <StreamUtils.h> // adebug
|
||||
|
||||
#include "EntityItemID.h"
|
||||
#include "EntityItemProperties.h"
|
||||
|
@ -151,14 +152,16 @@ public:
|
|||
/// set position in domain scale units (0.0 - 1.0)
|
||||
void setPositionInDomainUnits(const glm::vec3& value)
|
||||
{ setPositionInMeters(glm::clamp(value, 0.0f, 1.0f) * (float)TREE_SCALE); }
|
||||
void setPositionInMeters(const glm::vec3& value) { _position = value; }
|
||||
void setPositionInMeters(const glm::vec3& value) {
|
||||
_position = value;
|
||||
std::cout << "adebug setPosition = " << _position << std::endl; // adebug
|
||||
}
|
||||
|
||||
glm::vec3 getCenterInDomainUnits() const { return getCenterInMeters() / (float) TREE_SCALE; }
|
||||
glm::vec3 getCenterInMeters() const;
|
||||
|
||||
glm::vec3 getDimensionsInDomainUnits() const { return _dimensions / (float)TREE_SCALE; } /// get dimensions in domain scale units (0.0 - 1.0)
|
||||
const glm::vec3& getDimensionsInMeters() const { return _dimensions; } /// get dimensions in meters
|
||||
float getLargestDimensionInDomainUnits() const { return glm::length(_dimensions); } /// get the largest possible dimension
|
||||
|
||||
/// set dimensions in domain scale units (0.0 - 1.0)
|
||||
virtual void setDimensionsInDomainUnits(const glm::vec3& value) { _dimensions = glm::abs(value) * (float)TREE_SCALE; }
|
||||
|
|
|
@ -80,6 +80,7 @@ EntityItemProperties::EntityItemProperties() :
|
|||
}
|
||||
|
||||
EntityItemProperties::~EntityItemProperties() {
|
||||
std::cout << "adebug delete properties" << std::endl; // adebug
|
||||
}
|
||||
|
||||
void EntityItemProperties::setSittingPoints(const QVector<SittingPoint>& sittingPoints) {
|
||||
|
|
|
@ -22,9 +22,15 @@ EntityTreeElement::EntityTreeElement(unsigned char* octalCode) : OctreeElement()
|
|||
};
|
||||
|
||||
EntityTreeElement::~EntityTreeElement() {
|
||||
int bar = 0;
|
||||
_octreeMemoryUsage -= sizeof(EntityTreeElement);
|
||||
bar = 1;
|
||||
std::cout << "adebug EntityTreeElement " << (void*)(this) << " deletes old entityItems = " << (void*)(_entityItems) << std::endl; // adebug
|
||||
delete _entityItems;
|
||||
bar = 2;
|
||||
_entityItems = NULL;
|
||||
bar = 3;
|
||||
std::cout << "adebug bar = " << bar << std::endl; // adebug
|
||||
}
|
||||
|
||||
// This will be called primarily on addChildAt(), which means we're adding a child of our
|
||||
|
@ -39,6 +45,7 @@ OctreeElement* EntityTreeElement::createNewElement(unsigned char* octalCode) {
|
|||
void EntityTreeElement::init(unsigned char* octalCode) {
|
||||
OctreeElement::init(octalCode);
|
||||
_entityItems = new QList<EntityItem*>;
|
||||
std::cout << "adebug EntityTreeElement " << (void*)(this) << " gets new entityItems = " << (void*)(_entityItems) << std::endl; // adebug
|
||||
_octreeMemoryUsage += sizeof(EntityTreeElement);
|
||||
}
|
||||
|
||||
|
|
|
@ -73,6 +73,7 @@ public:
|
|||
class EntityTreeElement : public OctreeElement {
|
||||
friend class EntityTree; // to allow createElement to new us...
|
||||
|
||||
EntityTreeElement();
|
||||
EntityTreeElement(unsigned char* octalCode = NULL);
|
||||
|
||||
virtual OctreeElement* createNewElement(unsigned char* octalCode = NULL);
|
||||
|
|
|
@ -22,11 +22,13 @@ OctreeRenderer::OctreeRenderer() :
|
|||
_managedTree(false),
|
||||
_viewFrustum(NULL)
|
||||
{
|
||||
std::cout << "adebug " << (void*)(this) << " OctreeRenderer() _tree = " << (void*)(_tree) << std::endl; // adebug
|
||||
}
|
||||
|
||||
void OctreeRenderer::init() {
|
||||
if (!_tree) {
|
||||
_tree = createTree();
|
||||
std::cout << "adebug " << (void*)(this) << " init _tree = " << (void*)(_tree) << std::endl; // adebug
|
||||
_managedTree = true;
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +45,7 @@ void OctreeRenderer::setTree(Octree* newTree) {
|
|||
_managedTree = false;
|
||||
}
|
||||
_tree = newTree;
|
||||
std::cout << "adebug " << (void*)(this) << " setTree() _tree = " << (void*)(_tree) << std::endl; // adebug
|
||||
}
|
||||
|
||||
void OctreeRenderer::processDatagram(const QByteArray& dataByteArray, const SharedNodePointer& sourceNode) {
|
||||
|
|
Loading…
Reference in a new issue