mirror of
https://github.com/lubosz/overte.git
synced 2025-04-14 14:46:55 +02:00
force locked entities to be static in bullet
This commit is contained in:
parent
6e89f7d2f9
commit
8f38ea8c6a
2 changed files with 9 additions and 0 deletions
|
@ -2767,6 +2767,11 @@ void EntityItem::setLocked(bool value) {
|
|||
withWriteLock([&] {
|
||||
_locked = value;
|
||||
});
|
||||
markDirtyFlags(Simulation::DIRTY_MOTION_TYPE);
|
||||
EntityTreePointer tree = getTree();
|
||||
if (tree) {
|
||||
tree->entityChanged(getThisPointer());
|
||||
}
|
||||
}
|
||||
|
||||
QString EntityItem::getUserData() const {
|
||||
|
|
|
@ -185,6 +185,10 @@ PhysicsMotionType EntityMotionState::computePhysicsMotionType() const {
|
|||
return MOTION_TYPE_STATIC;
|
||||
}
|
||||
|
||||
if (_entity->getLocked()) {
|
||||
return MOTION_TYPE_STATIC;
|
||||
}
|
||||
|
||||
if (_entity->getDynamic()) {
|
||||
if (!_entity->getParentID().isNull()) {
|
||||
// if something would have been dynamic but is a child of something else, force it to be kinematic, instead.
|
||||
|
|
Loading…
Reference in a new issue