| 87 | } |
| 88 | |
| 89 | NpConstraint::NpConstraint(PxRigidActor* actor0, PxRigidActor* actor1, PxConstraintConnector& connector, const PxConstraintShaderTable& shaders, PxU32 dataSize) |
| 90 | : PxConstraint(PxConcreteType::eCONSTRAINT, PxBaseFlag::eOWNS_MEMORY) |
| 91 | , mActor0 (actor0) |
| 92 | , mActor1 (actor1) |
| 93 | , mConstraint (connector, shaders, dataSize) |
| 94 | , mIsDirty (true) |
| 95 | { |
| 96 | |
| 97 | mConstraint.setFlags(shaders.flag); |
| 98 | if(actor0) |
| 99 | NpActor::getFromPxActor(*actor0).addConnector(NpConnectorType::eConstraint, this, "PxConstraint: Add to rigid actor 0: Constraint already added"); |
| 100 | if(actor1) |
| 101 | NpActor::getFromPxActor(*actor1).addConnector(NpConnectorType::eConstraint, this, "PxConstraint: Add to rigid actor 1: Constraint already added"); |
| 102 | |
| 103 | NpScene* s = getSceneFromActors(actor0, actor1); |
| 104 | if (s) |
| 105 | { |
| 106 | s->addToConstraintList(*this); |
| 107 | s->getScene().addConstraint(mConstraint); |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | |
| 112 | NpConstraint::~NpConstraint() |
nothing calls this directly
no test coverage detected