| 551 | } |
| 552 | |
| 553 | void TSStatic::_updatePhysics() |
| 554 | { |
| 555 | SAFE_DELETE(mPhysicsRep); |
| 556 | |
| 557 | if (!PHYSICSMGR || mCollisionType == None) |
| 558 | return; |
| 559 | |
| 560 | PhysicsCollision* colShape = NULL; |
| 561 | if (mCollisionType == Bounds) |
| 562 | { |
| 563 | MatrixF offset(true); |
| 564 | offset.setPosition(mShape->center); |
| 565 | colShape = PHYSICSMGR->createCollision(); |
| 566 | colShape->addBox(getObjBox().getExtents() * 0.5f * mObjScale, offset); |
| 567 | } |
| 568 | else |
| 569 | colShape = mShape->buildColShape(mCollisionType == VisibleMesh, getScale()); |
| 570 | |
| 571 | if (colShape) |
| 572 | { |
| 573 | PhysicsWorld* world = PHYSICSMGR->getWorld(isServerObject() ? "server" : "client"); |
| 574 | mPhysicsRep = PHYSICSMGR->createBody(); |
| 575 | mPhysicsRep->init(colShape, 0, 0, this, world); |
| 576 | mPhysicsRep->setTransform(getTransform()); |
| 577 | } |
| 578 | } |
| 579 | |
| 580 | void TSStatic::onRemove() |
| 581 | { |
nothing calls this directly
no test coverage detected