Merge pull request #1 from AndrewMeadows/edit-model-ui

fix bug where some model shapes are momentarily incorrect
This commit is contained in:
Zander Otavka 2016-07-19 18:07:19 -07:00 committed by GitHub
commit 4a11e4accc
3 changed files with 7 additions and 8 deletions

View file

@ -347,7 +347,6 @@ void RenderableModelEntityItem::updateModelBounds() {
return;
}
bool movingOrAnimating = isMovingRelativeToParent() || isAnimatingSomething();
glm::vec3 dimensions = getDimensions();
bool success;
@ -701,11 +700,12 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& info) {
}
info.setParams(type, dimensions, _compoundShapeURL);
} else if (type >= SHAPE_TYPE_SIMPLE_HULL && type <= SHAPE_TYPE_STATIC_MESH) {
updateModelBounds();
// should never fall in here when model not fully loaded
assert(_model && _model->isLoaded());
updateModelBounds();
_model->updateGeometry();
// compute meshPart local transforms
QVector<glm::mat4> localTransforms;
const FBXGeometry& fbxGeometry = _model->getFBXGeometry();

View file

@ -69,7 +69,6 @@ static const btVector3 _unitSphereDirections[NUM_UNIT_SPHERE_DIRECTIONS] = {
// util method
btConvexHullShape* createConvexHull(const ShapeInfo::PointList& points) {
//std::cout << "adebug createConvexHull() points.size() = " << points.size() << std::endl; // adebug
assert(points.size() > 0);
btConvexHullShape* hull = new btConvexHullShape();
@ -241,7 +240,6 @@ void deleteStaticMeshArray(btTriangleIndexVertexArray* dataArray) {
btCollisionShape* ShapeFactory::createShapeFromInfo(const ShapeInfo& info) {
btCollisionShape* shape = NULL;
int type = info.getType();
//std::cout << "adebug createShapeFromInfo() type = " << type << std::endl; // adebug
switch(type) {
case SHAPE_TYPE_BOX: {
shape = new btBoxShape(glmToBullet(info.getHalfExtents()));

View file

@ -84,6 +84,7 @@ public:
bool readyToAddToScene(RenderArgs* renderArgs = nullptr) const {
return !_needsReload && isRenderable() && isActive();
}
bool needsReload() const { return _needsReload; }
bool initWhenReady(render::ScenePointer scene);
bool addToScene(std::shared_ptr<render::Scene> scene,
render::PendingChanges& pendingChanges,
@ -232,6 +233,9 @@ public:
const glm::vec3& getRegistrationPoint() const { return _registrationPoint; }
// returns 'true' if needs fullUpdate after geometry change
bool updateGeometry();
protected:
void setPupilDilation(float dilation) { _pupilDilation = dilation; }
@ -297,9 +301,6 @@ protected:
std::unordered_set<int> _cauterizeBoneSet;
bool _cauterizeBones;
// returns 'true' if needs fullUpdate after geometry change
bool updateGeometry();
virtual void initJointStates();
void setScaleInternal(const glm::vec3& scale);