mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 19:55:07 +02:00
added some debugging
This commit is contained in:
parent
f85774c687
commit
73b9c06ec0
4 changed files with 20 additions and 1 deletions
|
@ -21,6 +21,9 @@
|
|||
#include "EntityItem.h"
|
||||
#include "EntityTree.h"
|
||||
|
||||
quint64 EntityItem::lastCollisionTime = 0;
|
||||
|
||||
|
||||
void EntityItem::initFromEntityItemID(const EntityItemID& entityItemID) {
|
||||
_id = entityItemID.id;
|
||||
_creatorTokenID = entityItemID.creatorTokenID;
|
||||
|
|
|
@ -42,7 +42,6 @@ class EntityTreeElementExtraEncodeData;
|
|||
/// one directly, instead you must only construct one of it's derived classes with additional features.
|
||||
class EntityItem {
|
||||
friend class EntityTreeElement;
|
||||
|
||||
public:
|
||||
enum EntityDirtyFlags {
|
||||
DIRTY_POSITION = 0x0001,
|
||||
|
@ -55,6 +54,8 @@ public:
|
|||
DIRTY_UPDATEABLE = 0x0080,
|
||||
};
|
||||
|
||||
static quint64 lastCollisionTime;
|
||||
|
||||
DONT_ALLOW_INSTANTIATION // This class can not be instantiated directly
|
||||
|
||||
EntityItem(const EntityItemID& entityItemID);
|
||||
|
|
|
@ -99,6 +99,13 @@ void EntityMotionState::setWorldTransform(const btTransform& worldTrans) {
|
|||
|
||||
_outgoingPacketFlags = DIRTY_PHYSICS_FLAGS;
|
||||
EntityMotionState::enqueueOutgoingEntity(_entity);
|
||||
|
||||
quint64 now = usecTimestampNow();
|
||||
qDebug() << "EntityMotionState::setWorldTransform()... changed entity:" << _entity->getEntityItemID();
|
||||
qDebug() << " last edited:" << _entity->getLastEdited() << formatUsecTime(now - _entity->getLastEdited()) << "ago";
|
||||
qDebug() << " last simulated:" << _entity->getLastSimulated() << formatUsecTime(now - _entity->getLastSimulated()) << "ago";
|
||||
qDebug() << " last updated:" << _entity->getLastUpdated() << formatUsecTime(now - _entity->getLastUpdated()) << "ago";
|
||||
qDebug() << " last collision:" << EntityItem::lastCollisionTime << formatUsecTime(now - EntityItem::lastCollisionTime) << "ago";
|
||||
}
|
||||
|
||||
void EntityMotionState::updateObjectEasy(uint32_t flags, uint32_t frame) {
|
||||
|
|
|
@ -371,10 +371,18 @@ void PhysicsEngine::computeCollisionEvents() {
|
|||
if (B && B->getType() == MOTION_STATE_TYPE_ENTITY) {
|
||||
idB = static_cast<EntityMotionState*>(B)->getEntity()->getEntityItemID();
|
||||
}
|
||||
|
||||
qDebug() << "entityCollisionWithEntity()... idA:" << idA << "idB:" << idB << "*******************************";
|
||||
EntityItem::lastCollisionTime = usecTimestampNow();
|
||||
|
||||
emit entityCollisionWithEntity(idA, idB, contactItr->second);
|
||||
} else if (B && B->getType() == MOTION_STATE_TYPE_ENTITY) {
|
||||
EntityItemID idA;
|
||||
EntityItemID idB = static_cast<EntityMotionState*>(B)->getEntity()->getEntityItemID();
|
||||
|
||||
qDebug() << "entityCollisionWithEntity()... idA:" << idA << "idB:" << idB << "*******************************";
|
||||
EntityItem::lastCollisionTime = usecTimestampNow();
|
||||
|
||||
emit entityCollisionWithEntity(idA, idB, contactItr->second);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue