MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _createPhysics

Method _createPhysics

Engine/source/T3D/rigidShape.cpp:758–776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

756}
757
758void RigidShape::_createPhysics()
759{
760 SAFE_DELETE(mPhysicsRep);
761
762 if (!PHYSICSMGR || !mDataBlock->enablePhysicsRep)
763 return;
764
765 TSShape* shape = mShapeInstance->getShape();
766 PhysicsCollision* colShape = NULL;
767 colShape = shape->buildColShape(false, getScale());
768
769 if (colShape)
770 {
771 PhysicsWorld* world = PHYSICSMGR->getWorld(isServerObject() ? "server" : "client");
772 mPhysicsRep = PHYSICSMGR->createBody();
773 mPhysicsRep->init(colShape, 0, PhysicsBody::BF_KINEMATIC, this, world);
774 mPhysicsRep->setTransform(getTransform());
775 }
776}
777
778//----------------------------------------------------------------------------
779void RigidShape::processTick(const Move* move)

Callers

nothing calls this directly

Calls 6

buildColShapeMethod · 0.80
getShapeMethod · 0.45
getWorldMethod · 0.45
createBodyMethod · 0.45
initMethod · 0.45
setTransformMethod · 0.45

Tested by

no test coverage detected