mirror of
https://github.com/lubosz/overte.git
synced 2025-04-25 00:03:16 +02:00
use Hold action
use Hold action for any non-dynamic Entity with Body in phys simulation also set DIRTY_MOTION_TYPE bit, add to changed list on add/remove grab
This commit is contained in:
parent
1bdcf8f0cb
commit
de68f6ca49
1 changed files with 4 additions and 1 deletions
|
@ -3360,7 +3360,7 @@ void EntityItem::addGrab(GrabPointer grab) {
|
|||
enableNoBootstrap();
|
||||
SpatiallyNestable::addGrab(grab);
|
||||
|
||||
if (getDynamic() && getParentID().isNull()) {
|
||||
if (_physicsInfo && getParentID().isNull()) {
|
||||
EntityTreePointer entityTree = getTree();
|
||||
assert(entityTree);
|
||||
EntitySimulationPointer simulation = entityTree ? entityTree->getSimulation() : nullptr;
|
||||
|
@ -3398,11 +3398,14 @@ void EntityItem::addGrab(GrabPointer grab) {
|
|||
grab->setActionID(actionID);
|
||||
_grabActions[actionID] = action;
|
||||
simulation->addDynamic(action);
|
||||
markDirtyFlags(Simulation::DIRTY_MOTION_TYPE);
|
||||
simulation->changeEntity(getThisPointer());
|
||||
}
|
||||
}
|
||||
|
||||
void EntityItem::removeGrab(GrabPointer grab) {
|
||||
SpatiallyNestable::removeGrab(grab);
|
||||
markDirtyFlags(Simulation::DIRTY_MOTION_TYPE);
|
||||
|
||||
QUuid actionID = grab->getActionID();
|
||||
if (!actionID.isNull()) {
|
||||
|
|
Loading…
Reference in a new issue