Exemple #1
0
void VRPhysics::setConstraint(VRPhysics* p, OSG::VRConstraint* c, OSG::VRConstraint* cs) {
    if (body == 0) return;
    if (p->body == 0) return;
    Lock lock(mtx());

    if (joints.count(p) == 0) joints[p] = new VRPhysicsJoint(p, c, cs);
    else {
        joints[p]->constraint = c;
        joints[p]->spring = cs;
    }
    if (p->joints2.count(this) == 0) p->joints2[this] = joints[p];
    updateConstraint(p);
}
Exemple #2
0
bool Enumerator::update(Solver& s, bool disjoint) {
	EnumeratorConstraint* c = constraint(s);
	uint32 gUpdates;
	if (!c || c->updates() == (gUpdates = updates_)) {
		return true;
	}
	bool ret   = true;
	if (optimize()) {
		ret      = c->minimize()->integrateNext(s);
		disjoint = true; // enforced by minimize constraint
	}
	if (ret && (ret = updateConstraint(s, disjoint)) == true) {
		c->setUpdates(gUpdates);
	}
	return ret;
}
void QgsEditorWidgetWrapper::updateConstraint( const QgsFeature &ft, QgsFieldConstraints::ConstraintOrigin constraintOrigin )
{
  updateConstraint( layer(), mFieldIdx, ft, constraintOrigin );
}
Exemple #4
0
void VRPhysics::updateConstraints() {
    if (body == 0) return;
    for (auto j : joints) updateConstraint(j.first);
    for (auto j : joints2) j.first->updateConstraint(this);
}