mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-13 21:36:04 +02:00
Merge pull request #4990 from AndrewMeadows/isentropic
fix crash when creating a box with edit.js
This commit is contained in:
commit
6b3c51c5b7
3 changed files with 15 additions and 8 deletions
|
@ -957,9 +957,6 @@ bool EntityItem::setProperties(const EntityItemProperties& properties) {
|
|||
#endif
|
||||
setLastEdited(now);
|
||||
somethingChangedNotification(); // notify derived classes that something has changed
|
||||
if (_created == UNKNOWN_CREATED_TIME) {
|
||||
_created = now;
|
||||
}
|
||||
if (getDirtyFlags() & (EntityItem::DIRTY_TRANSFORM | EntityItem::DIRTY_VELOCITIES)) {
|
||||
// anything that sets the transform or velocity must update _lastSimulated which is used
|
||||
// for kinematic extrapolation (e.g. we want to extrapolate forward from this moment
|
||||
|
@ -968,6 +965,16 @@ bool EntityItem::setProperties(const EntityItemProperties& properties) {
|
|||
}
|
||||
}
|
||||
|
||||
// timestamps
|
||||
quint64 timestamp = properties.getCreated();
|
||||
if (_created == UNKNOWN_CREATED_TIME && timestamp != UNKNOWN_CREATED_TIME) {
|
||||
quint64 now = usecTimestampNow();
|
||||
if (timestamp > now) {
|
||||
timestamp = now;
|
||||
}
|
||||
_created = timestamp;
|
||||
}
|
||||
|
||||
return somethingChanged;
|
||||
}
|
||||
|
||||
|
|
|
@ -93,16 +93,16 @@ void DeferredLightingEffect::init(AbstractViewStateInterface* viewState) {
|
|||
}
|
||||
|
||||
void DeferredLightingEffect::bindSimpleProgram() {
|
||||
// DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(true, true, true);
|
||||
DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(true, true, true);
|
||||
_simpleProgram.bind();
|
||||
_simpleProgram.setUniformValue(_glowIntensityLocation, DependencyManager::get<GlowEffect>()->getIntensity());
|
||||
// glDisable(GL_BLEND);
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
void DeferredLightingEffect::releaseSimpleProgram() {
|
||||
// glEnable(GL_BLEND);
|
||||
glEnable(GL_BLEND);
|
||||
_simpleProgram.release();
|
||||
// DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(true, false, false);
|
||||
DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(true, false, false);
|
||||
}
|
||||
|
||||
void DeferredLightingEffect::renderSolidSphere(float radius, int slices, int stacks, const glm::vec4& color) {
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace MeshMassPropertiesTests{
|
|||
void testParallelAxisTheorem();
|
||||
void testTetrahedron();
|
||||
void testOpenTetrahedonMesh();
|
||||
void testClosedTetrahedronMesh();
|
||||
void testClosedTetrahedronMesh();
|
||||
void testBoxAsMesh();
|
||||
void runAllTests();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue