mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 15:17:42 +02:00
Merge branch 'master' into flickable_web_pages
This commit is contained in:
commit
34c091114d
8 changed files with 83 additions and 31 deletions
|
@ -3,7 +3,7 @@ This is a stand-alone guide for creating your first High Fidelity build for Wind
|
||||||
## Building High Fidelity
|
## Building High Fidelity
|
||||||
Note: We are now using Visual Studio 2017 and Qt 5.9.1. If you are upgrading from Visual Studio 2013 and Qt 5.6.2, do a clean uninstall of those versions before going through this guide.
|
Note: We are now using Visual Studio 2017 and Qt 5.9.1. If you are upgrading from Visual Studio 2013 and Qt 5.6.2, do a clean uninstall of those versions before going through this guide.
|
||||||
|
|
||||||
Note: The prerequisites will require about 10 GB of space on your drive.
|
Note: The prerequisites will require about 10 GB of space on your drive. You will also need a system with at least 8GB of main memory.
|
||||||
|
|
||||||
### Step 1. Visual Studio 2017
|
### Step 1. Visual Studio 2017
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ find_package(Qt5LinguistTools REQUIRED)
|
||||||
find_package(Qt5LinguistToolsMacros)
|
find_package(Qt5LinguistToolsMacros)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -bigobj")
|
||||||
add_definitions(-D_USE_MATH_DEFINES) # apparently needed to get M_PI and other defines from cmath/math.h
|
add_definitions(-D_USE_MATH_DEFINES) # apparently needed to get M_PI and other defines from cmath/math.h
|
||||||
add_definitions(-DWINDOWS_LEAN_AND_MEAN) # needed to make sure windows doesn't go to crazy with its defines
|
add_definitions(-DWINDOWS_LEAN_AND_MEAN) # needed to make sure windows doesn't go to crazy with its defines
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -216,17 +216,12 @@ int main(int argc, const char* argv[]) {
|
||||||
SandboxUtils::runLocalSandbox(serverContentPath, true, noUpdater);
|
SandboxUtils::runLocalSandbox(serverContentPath, true, noUpdater);
|
||||||
}
|
}
|
||||||
|
|
||||||
// to enable WebGL rendering
|
// Extend argv to enable WebGL rendering
|
||||||
char* additionalCommandLineArg = (char*)"--ignore-gpu-blacklist";
|
std::vector<const char*> argvExtended(&argv[0], &argv[argc]);
|
||||||
int newArgc = argc + 1;
|
argvExtended.push_back("--ignore-gpu-blacklist");
|
||||||
char** newArgv = new char*[newArgc];
|
int argcExtended = (int)argvExtended.size();
|
||||||
for (int i = 0; i < argc; ++i) {
|
|
||||||
newArgv[i] = (char*)argv[i];
|
|
||||||
}
|
|
||||||
newArgv[argc] = additionalCommandLineArg;
|
|
||||||
|
|
||||||
Application app(newArgc, const_cast<char**>(newArgv), startupTime, runningMarkerExisted);
|
Application app(argcExtended, const_cast<char**>(argvExtended.data()), startupTime, runningMarkerExisted);
|
||||||
delete[] newArgv;
|
|
||||||
|
|
||||||
// If we failed the OpenGLVersion check, log it.
|
// If we failed the OpenGLVersion check, log it.
|
||||||
if (override) {
|
if (override) {
|
||||||
|
|
|
@ -262,7 +262,7 @@ public:
|
||||||
glm::vec3 getRegistrationPoint() const; /// registration point as ratio of entity
|
glm::vec3 getRegistrationPoint() const; /// registration point as ratio of entity
|
||||||
|
|
||||||
/// registration point as ratio of entity
|
/// registration point as ratio of entity
|
||||||
void setRegistrationPoint(const glm::vec3& value);
|
virtual void setRegistrationPoint(const glm::vec3& value);
|
||||||
|
|
||||||
bool hasAngularVelocity() const { return getAngularVelocity() != ENTITY_ITEM_ZERO_VEC3; }
|
bool hasAngularVelocity() const { return getAngularVelocity() != ENTITY_ITEM_ZERO_VEC3; }
|
||||||
bool hasLocalAngularVelocity() const { return getLocalAngularVelocity() != ENTITY_ITEM_ZERO_VEC3; }
|
bool hasLocalAngularVelocity() const { return getLocalAngularVelocity() != ENTITY_ITEM_ZERO_VEC3; }
|
||||||
|
|
|
@ -92,13 +92,12 @@ bool PolyLineEntityItem::appendPoint(const glm::vec3& point) {
|
||||||
qCDebug(entities) << "MAX POINTS REACHED!";
|
qCDebug(entities) << "MAX POINTS REACHED!";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
glm::vec3 halfBox = getDimensions() * 0.5f;
|
|
||||||
if ((point.x < -halfBox.x || point.x > halfBox.x) || (point.y < -halfBox.y || point.y > halfBox.y) || (point.z < -halfBox.z || point.z > halfBox.z)) {
|
|
||||||
qCDebug(entities) << "Point is outside entity's bounding box";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
_points << point;
|
_points << point;
|
||||||
_pointsChanged = true;
|
_pointsChanged = true;
|
||||||
|
|
||||||
|
calculateScaleAndRegistrationPoint();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,23 +140,69 @@ bool PolyLineEntityItem::setLinePoints(const QVector<glm::vec3>& points) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < points.size(); i++) {
|
|
||||||
glm::vec3 point = points.at(i);
|
|
||||||
glm::vec3 halfBox = getDimensions() * 0.5f;
|
|
||||||
if ((point.x < -halfBox.x || point.x > halfBox.x) ||
|
|
||||||
(point.y < -halfBox.y || point.y > halfBox.y) ||
|
|
||||||
(point.z < -halfBox.z || point.z > halfBox.z)) {
|
|
||||||
qCDebug(entities) << "Point is outside entity's bounding box";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_points = points;
|
_points = points;
|
||||||
|
|
||||||
|
calculateScaleAndRegistrationPoint();
|
||||||
|
|
||||||
result = true;
|
result = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PolyLineEntityItem::calculateScaleAndRegistrationPoint() {
|
||||||
|
glm::vec3 high(0.0f, 0.0f, 0.0f);
|
||||||
|
glm::vec3 low(0.0f, 0.0f, 0.0f);
|
||||||
|
for (int i = 0; i < _points.size(); i++) {
|
||||||
|
glm::vec3 point = _points.at(i);
|
||||||
|
|
||||||
|
if (point.x > high.x) {
|
||||||
|
high.x = point.x;
|
||||||
|
} else if (point.x < low.x) {
|
||||||
|
low.x = point.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (point.y > high.y) {
|
||||||
|
high.y = point.y;
|
||||||
|
} else if (point.y < low.y) {
|
||||||
|
low.y = point.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (point.z > high.z) {
|
||||||
|
high.z = point.z;
|
||||||
|
} else if (point.z < low.z) {
|
||||||
|
low.z = point.z;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const float EPSILON = 0.0001f;
|
||||||
|
if (_points.size() > 1) {
|
||||||
|
// if all the points in the Polyline are at the same place in space, use default dimension settings
|
||||||
|
if ((low - high).length() < EPSILON) {
|
||||||
|
SpatiallyNestable::setScale(glm::vec3(1.0f, 1.0f, 1.0f));
|
||||||
|
EntityItem::setRegistrationPoint(glm::vec3(0.5f));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
glm::vec3 result;
|
||||||
|
const float halfLineWidth = 0.075f; // sadly _strokeWidths() don't seem to correspond to reality, so just use a flat assumption of the stroke width
|
||||||
|
result.x = fabsf(high.x) + fabsf(low.x) + halfLineWidth;
|
||||||
|
result.y = fabsf(high.y) + fabsf(low.y) + halfLineWidth;
|
||||||
|
result.z = fabsf(high.z) + fabsf(low.z) + halfLineWidth;
|
||||||
|
SpatiallyNestable::setScale(result);
|
||||||
|
|
||||||
|
// Center the poly line in the bounding box
|
||||||
|
glm::vec3 point = _points.at(0);
|
||||||
|
glm::vec3 startPointInScaleSpace = point - low;
|
||||||
|
startPointInScaleSpace += glm::vec3(halfLineWidth * 0.5f);
|
||||||
|
glm::vec3 newRegistrationPoint = startPointInScaleSpace / result;
|
||||||
|
EntityItem::setRegistrationPoint(newRegistrationPoint);
|
||||||
|
} else {
|
||||||
|
// if Polyline has only one or fewer points, use default dimension settings
|
||||||
|
SpatiallyNestable::setScale(glm::vec3(1.0f, 1.0f, 1.0f));
|
||||||
|
EntityItem::setRegistrationPoint(glm::vec3(0.5f));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int PolyLineEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
|
int PolyLineEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
|
||||||
ReadBitstreamToTreeParams& args,
|
ReadBitstreamToTreeParams& args,
|
||||||
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
|
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
|
||||||
|
|
|
@ -81,10 +81,17 @@ class PolyLineEntityItem : public EntityItem {
|
||||||
BoxFace& face, glm::vec3& surfaceNormal,
|
BoxFace& face, glm::vec3& surfaceNormal,
|
||||||
void** intersectedObject, bool precisionPicking) const override { return false; }
|
void** intersectedObject, bool precisionPicking) const override { return false; }
|
||||||
|
|
||||||
|
// disable these external interfaces as PolyLineEntities caculate their own dimensions based on the points they contain
|
||||||
|
virtual void setRegistrationPoint(const glm::vec3& value) override {};
|
||||||
|
virtual void setScale(const glm::vec3& scale) override {};
|
||||||
|
virtual void setScale(float value) override {};
|
||||||
|
|
||||||
virtual void debugDump() const override;
|
virtual void debugDump() const override;
|
||||||
static const float DEFAULT_LINE_WIDTH;
|
static const float DEFAULT_LINE_WIDTH;
|
||||||
static const int MAX_POINTS_PER_LINE;
|
static const int MAX_POINTS_PER_LINE;
|
||||||
|
private:
|
||||||
|
void calculateScaleAndRegistrationPoint();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
rgbColor _color;
|
rgbColor _color;
|
||||||
float _lineWidth;
|
float _lineWidth;
|
||||||
|
|
|
@ -53,8 +53,12 @@ QVariant NodePermissions::toVariant(QHash<QUuid, GroupRank> groupRanks) {
|
||||||
values["permissions_id"] = _id;
|
values["permissions_id"] = _id;
|
||||||
if (_groupIDSet) {
|
if (_groupIDSet) {
|
||||||
values["group_id"] = _groupID;
|
values["group_id"] = _groupID;
|
||||||
if (groupRanks.contains(_rankID)) {
|
|
||||||
|
if (!_rankID.isNull()) {
|
||||||
values["rank_id"] = _rankID;
|
values["rank_id"] = _rankID;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (groupRanks.contains(_rankID)) {
|
||||||
values["rank_name"] = groupRanks[_rankID].name;
|
values["rank_name"] = groupRanks[_rankID].name;
|
||||||
values["rank_order"] = groupRanks[_rankID].order;
|
values["rank_order"] = groupRanks[_rankID].order;
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,8 +178,8 @@
|
||||||
type: "Row"
|
type: "Row"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "emitShouldTrail",
|
id: "emitterShouldTrail",
|
||||||
name: "Emit Should Trail",
|
name: "Emitter Should Trail",
|
||||||
type: "Boolean"
|
type: "Boolean"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue