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; | |||||
| PHY_IPhysicsEnvironment *physEnv = GetPhysicsEnvironment(); | |||||
| 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) { | |||||
sybren: Style: `bRigidBodyJointConstraint *dat` | |||||
| /* Try to find the constraint targets in the list of group objects. */ | |||||
| bRigidBodyJointConstraint *dat = (*consit); | |||||
| vector<KX_GameObject*>::iterator memit; | |||||
Not Done Inline ActionsStyle: opening bracket on same line as for sybren: Style: opening bracket on same line as `for` | |||||
| for (memit = constobj.begin(); memit != constobj.end(); ++memit) { | |||||
| 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()) | |||||
Not Done Inline ActionsGetPhysicsEnvironment() can be moved outside the loop. sybren: `GetPhysicsEnvironment()` can be moved outside the loop. | |||||
| physEnv->SetupObjectConstraints(replica, member, dat); | |||||
| } | |||||
| } | |||||
| } | |||||
| /////////////////////////////////////////////////////////// | /////////////////////////////////////////////////////////// | ||||
| ///A small utility class, DefaultMotionState | ///A small utility class, DefaultMotionState | ||||
| /// | /// | ||||
| Context not available. | |||||
Style: bRigidBodyJointConstraint *dat