Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
| Context not available. | |||||
| return true; | return true; | ||||
| } | } | ||||
| void CcdPhysicsController::ReplicateConstraints(KX_GameObject *replica, std::vector<KX_GameObject*> constobj) | |||||
| { | |||||
| if (replica->GetConstraints().size() == 0 || !replica->GetPhysicsController()) | |||||
| return; | |||||
| vector<bRigidBodyJointConstraint*> constraints = replica->GetConstraints(); | |||||
| vector<bRigidBodyJointConstraint*>::iterator consit; | |||||
| /* object could have some constraints, iterate over all of theme to ensure that every constraint is recreated */ | |||||
| for (consit = constraints.begin(); consit != constraints.end(); ++consit) { | |||||
| /* try to find the constraint targets in the list of group objects */ | |||||
| bRigidBodyJointConstraint* dat = (*consit); | |||||
sybren: Style: `bRigidBodyJointConstraint *dat` | |||||
| vector<KX_GameObject*>::iterator memit; | |||||
| for (memit = constobj.begin(); memit != constobj.end(); ++memit) | |||||
| { | |||||
sybrenUnsubmitted Not Done Inline ActionsStyle: opening bracket on same line as for sybren: Style: opening bracket on same line as `for` | |||||
| KX_GameObject *member = (*memit); | |||||
| /* if the group member is the actual target for the constraint */ | |||||
| if (dat->tar->id.name+2 == member->GetName() && member->GetPhysicsController()) | |||||
| GetPhysicsEnvironment()->SetupObjectConstraints(replica, member, dat); | |||||
sybrenUnsubmitted Not Done Inline ActionsGetPhysicsEnvironment() can be moved outside the loop. sybren: `GetPhysicsEnvironment()` can be moved outside the loop. | |||||
| } | |||||
| } | |||||
| } | |||||
| /////////////////////////////////////////////////////////// | /////////////////////////////////////////////////////////// | ||||
| ///A small utility class, DefaultMotionState | ///A small utility class, DefaultMotionState | ||||
| /// | /// | ||||
| Context not available. | |||||
Style: bRigidBodyJointConstraint *dat