mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 19:55:07 +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;
|
||||
}
|
||||
|
||||
void ModelUploader::populateBasicMapping(QVariantHash& mapping, QString filename, FBXGeometry geometry) {
|
||||
void ModelUploader::populateBasicMapping(QVariantHash& mapping, QString filename, const FBXGeometry& geometry) {
|
||||
if (!mapping.contains(NAME_FIELD)) {
|
||||
mapping.insert(NAME_FIELD, QFileInfo(filename).baseName());
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ private:
|
|||
ModelUploader(ModelType type);
|
||||
~ModelUploader();
|
||||
|
||||
void populateBasicMapping(QVariantHash& mapping, QString filename, FBXGeometry geometry);
|
||||
void populateBasicMapping(QVariantHash& mapping, QString filename, const FBXGeometry& geometry);
|
||||
bool zip();
|
||||
bool addTextures(const QString& texdir, const FBXGeometry& geometry);
|
||||
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;
|
||||
|
||||
// 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) {
|
||||
if (_lastSimulated == 0) {
|
||||
_lastSimulated = now;
|
||||
|
@ -654,7 +643,6 @@ void EntityItem::simulate(const quint64& now) {
|
|||
qDebug() << " timeElapsed=" << timeElapsed;
|
||||
qDebug() << " hasVelocity=" << hasVelocity();
|
||||
qDebug() << " hasGravity=" << hasGravity();
|
||||
qDebug() << " isRestingOnSurface=" << isRestingOnSurface();
|
||||
qDebug() << " hasAngularVelocity=" << hasAngularVelocity();
|
||||
qDebug() << " getAngularVelocity=" << getAngularVelocity();
|
||||
qDebug() << " isMortal=" << isMortal();
|
||||
|
@ -662,11 +650,10 @@ void EntityItem::simulate(const quint64& now) {
|
|||
qDebug() << " getLifetime()=" << getLifetime();
|
||||
|
||||
|
||||
if (hasVelocity() || (hasGravity() && !isRestingOnSurface())) {
|
||||
if (hasVelocity() || hasGravity()) {
|
||||
qDebug() << " MOVING...=";
|
||||
qDebug() << " hasVelocity=" << hasVelocity();
|
||||
qDebug() << " hasGravity=" << hasGravity();
|
||||
qDebug() << " isRestingOnSurface=" << isRestingOnSurface();
|
||||
qDebug() << " hasAngularVelocity=" << hasAngularVelocity();
|
||||
qDebug() << " getAngularVelocity=" << getAngularVelocity();
|
||||
}
|
||||
|
@ -756,7 +743,6 @@ void EntityItem::simulateKinematicMotion(float timeElapsed) {
|
|||
qDebug() << " old position:" << position;
|
||||
qDebug() << " old velocity:" << velocity;
|
||||
qDebug() << " old getAABox:" << getAABox();
|
||||
qDebug() << " getDistanceToBottomOfEntity():" << getDistanceToBottomOfEntity() * (float)TREE_SCALE << " in meters";
|
||||
qDebug() << " newPosition:" << newPosition;
|
||||
qDebug() << " glm::distance(newPosition, position):" << glm::distance(newPosition, position);
|
||||
#endif
|
||||
|
@ -911,11 +897,6 @@ float EntityItem::getSize() const {
|
|||
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?
|
||||
glm::vec3 EntityItem::getCenter() const {
|
||||
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)
|
||||
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
|
||||
|
||||
/// 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
|
||||
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; }
|
||||
void setDamping(float value) { _damping = value; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue