mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:49:27 +02:00
Merge pull request #4221 from AndrewMeadows/bispinor
proof Andrew has a working Windows build on his laptop
This commit is contained in:
commit
01f594b535
4 changed files with 3 additions and 26 deletions
|
@ -265,7 +265,7 @@ bool ModelUploader::zip() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelUploader::populateBasicMapping(QVariantHash& mapping, QString filename, FBXGeometry geometry) {
|
void ModelUploader::populateBasicMapping(QVariantHash& mapping, QString filename, const FBXGeometry& geometry) {
|
||||||
if (!mapping.contains(NAME_FIELD)) {
|
if (!mapping.contains(NAME_FIELD)) {
|
||||||
mapping.insert(NAME_FIELD, QFileInfo(filename).baseName());
|
mapping.insert(NAME_FIELD, QFileInfo(filename).baseName());
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ private:
|
||||||
ModelUploader(ModelType type);
|
ModelUploader(ModelType type);
|
||||||
~ModelUploader();
|
~ModelUploader();
|
||||||
|
|
||||||
void populateBasicMapping(QVariantHash& mapping, QString filename, FBXGeometry geometry);
|
void populateBasicMapping(QVariantHash& mapping, QString filename, const FBXGeometry& geometry);
|
||||||
bool zip();
|
bool zip();
|
||||||
bool addTextures(const QString& texdir, const FBXGeometry& geometry);
|
bool addTextures(const QString& texdir, const FBXGeometry& geometry);
|
||||||
bool addPart(const QString& path, const QString& name, bool isTexture = false);
|
bool addPart(const QString& path, const QString& name, bool isTexture = false);
|
||||||
|
|
|
@ -628,17 +628,6 @@ void EntityItem::setMass(float mass) {
|
||||||
|
|
||||||
const float ENTITY_ITEM_EPSILON_VELOCITY_LENGTH = 0.001f / (float)TREE_SCALE;
|
const float ENTITY_ITEM_EPSILON_VELOCITY_LENGTH = 0.001f / (float)TREE_SCALE;
|
||||||
|
|
||||||
// TODO: we probably want to change this to make "down" be the direction of the entity's gravity vector
|
|
||||||
// for now, this is always true DOWN even if entity has non-down gravity.
|
|
||||||
// TODO: the old code had "&& _velocity.y >= -EPSILON && _velocity.y <= EPSILON" --- what was I thinking?
|
|
||||||
bool EntityItem::isRestingOnSurface() const {
|
|
||||||
glm::vec3 downwardVelocity = glm::vec3(0.0f, _velocity.y, 0.0f);
|
|
||||||
|
|
||||||
return _position.y <= getDistanceToBottomOfEntity()
|
|
||||||
&& (glm::length(downwardVelocity) <= ENTITY_ITEM_EPSILON_VELOCITY_LENGTH)
|
|
||||||
&& _gravity.y < 0.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EntityItem::simulate(const quint64& now) {
|
void EntityItem::simulate(const quint64& now) {
|
||||||
if (_lastSimulated == 0) {
|
if (_lastSimulated == 0) {
|
||||||
_lastSimulated = now;
|
_lastSimulated = now;
|
||||||
|
@ -654,7 +643,6 @@ void EntityItem::simulate(const quint64& now) {
|
||||||
qDebug() << " timeElapsed=" << timeElapsed;
|
qDebug() << " timeElapsed=" << timeElapsed;
|
||||||
qDebug() << " hasVelocity=" << hasVelocity();
|
qDebug() << " hasVelocity=" << hasVelocity();
|
||||||
qDebug() << " hasGravity=" << hasGravity();
|
qDebug() << " hasGravity=" << hasGravity();
|
||||||
qDebug() << " isRestingOnSurface=" << isRestingOnSurface();
|
|
||||||
qDebug() << " hasAngularVelocity=" << hasAngularVelocity();
|
qDebug() << " hasAngularVelocity=" << hasAngularVelocity();
|
||||||
qDebug() << " getAngularVelocity=" << getAngularVelocity();
|
qDebug() << " getAngularVelocity=" << getAngularVelocity();
|
||||||
qDebug() << " isMortal=" << isMortal();
|
qDebug() << " isMortal=" << isMortal();
|
||||||
|
@ -662,11 +650,10 @@ void EntityItem::simulate(const quint64& now) {
|
||||||
qDebug() << " getLifetime()=" << getLifetime();
|
qDebug() << " getLifetime()=" << getLifetime();
|
||||||
|
|
||||||
|
|
||||||
if (hasVelocity() || (hasGravity() && !isRestingOnSurface())) {
|
if (hasVelocity() || hasGravity()) {
|
||||||
qDebug() << " MOVING...=";
|
qDebug() << " MOVING...=";
|
||||||
qDebug() << " hasVelocity=" << hasVelocity();
|
qDebug() << " hasVelocity=" << hasVelocity();
|
||||||
qDebug() << " hasGravity=" << hasGravity();
|
qDebug() << " hasGravity=" << hasGravity();
|
||||||
qDebug() << " isRestingOnSurface=" << isRestingOnSurface();
|
|
||||||
qDebug() << " hasAngularVelocity=" << hasAngularVelocity();
|
qDebug() << " hasAngularVelocity=" << hasAngularVelocity();
|
||||||
qDebug() << " getAngularVelocity=" << getAngularVelocity();
|
qDebug() << " getAngularVelocity=" << getAngularVelocity();
|
||||||
}
|
}
|
||||||
|
@ -756,7 +743,6 @@ void EntityItem::simulateKinematicMotion(float timeElapsed) {
|
||||||
qDebug() << " old position:" << position;
|
qDebug() << " old position:" << position;
|
||||||
qDebug() << " old velocity:" << velocity;
|
qDebug() << " old velocity:" << velocity;
|
||||||
qDebug() << " old getAABox:" << getAABox();
|
qDebug() << " old getAABox:" << getAABox();
|
||||||
qDebug() << " getDistanceToBottomOfEntity():" << getDistanceToBottomOfEntity() * (float)TREE_SCALE << " in meters";
|
|
||||||
qDebug() << " newPosition:" << newPosition;
|
qDebug() << " newPosition:" << newPosition;
|
||||||
qDebug() << " glm::distance(newPosition, position):" << glm::distance(newPosition, position);
|
qDebug() << " glm::distance(newPosition, position):" << glm::distance(newPosition, position);
|
||||||
#endif
|
#endif
|
||||||
|
@ -911,11 +897,6 @@ float EntityItem::getSize() const {
|
||||||
return glm::length(_dimensions);
|
return glm::length(_dimensions);
|
||||||
}
|
}
|
||||||
|
|
||||||
float EntityItem::getDistanceToBottomOfEntity() const {
|
|
||||||
glm::vec3 minimumPoint = getAABox().getMinimumPoint();
|
|
||||||
return getPosition().y - minimumPoint.y;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: doesn't this need to handle rotation?
|
// TODO: doesn't this need to handle rotation?
|
||||||
glm::vec3 EntityItem::getCenter() const {
|
glm::vec3 EntityItem::getCenter() const {
|
||||||
return _position + (_dimensions * (glm::vec3(0.5f,0.5f,0.5f) - _registrationPoint));
|
return _position + (_dimensions * (glm::vec3(0.5f,0.5f,0.5f) - _registrationPoint));
|
||||||
|
|
|
@ -159,7 +159,6 @@ public:
|
||||||
|
|
||||||
const glm::vec3& getDimensions() const { return _dimensions; } /// get dimensions in domain scale units (0.0 - 1.0)
|
const glm::vec3& getDimensions() const { return _dimensions; } /// get dimensions in domain scale units (0.0 - 1.0)
|
||||||
glm::vec3 getDimensionsInMeters() const { return _dimensions * (float) TREE_SCALE; } /// get dimensions in meters
|
glm::vec3 getDimensionsInMeters() const { return _dimensions * (float) TREE_SCALE; } /// get dimensions in meters
|
||||||
float getDistanceToBottomOfEntity() const; /// get the distance from the position of the entity to its "bottom" in y axis
|
|
||||||
float getLargestDimension() const { return glm::length(_dimensions); } /// get the largest possible dimension
|
float getLargestDimension() const { return glm::length(_dimensions); } /// get the largest possible dimension
|
||||||
|
|
||||||
/// set dimensions in domain scale units (0.0 - 1.0) this will also reset radius appropriately
|
/// set dimensions in domain scale units (0.0 - 1.0) this will also reset radius appropriately
|
||||||
|
@ -195,9 +194,6 @@ public:
|
||||||
void setGravityInMeters(const glm::vec3& value) { _gravity = value / (float) TREE_SCALE; } /// gravity in meters
|
void setGravityInMeters(const glm::vec3& value) { _gravity = value / (float) TREE_SCALE; } /// gravity in meters
|
||||||
bool hasGravity() const { return _gravity != ENTITY_ITEM_ZERO_VEC3; }
|
bool hasGravity() const { return _gravity != ENTITY_ITEM_ZERO_VEC3; }
|
||||||
|
|
||||||
// TODO: this should eventually be updated to support resting on collisions with other surfaces
|
|
||||||
bool isRestingOnSurface() const;
|
|
||||||
|
|
||||||
float getDamping() const { return _damping; }
|
float getDamping() const { return _damping; }
|
||||||
void setDamping(float value) { _damping = value; }
|
void setDamping(float value) { _damping = value; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue