| 52 | } |
| 53 | |
| 54 | PhysicsMeshRenderer* PhysicsMeshRenderer::createWithCollider(std::string_view modelPath, |
| 55 | Physics3DColliderDes* colliderDes, |
| 56 | const ax::Vec3& translateInPhysics, |
| 57 | const ax::Quaternion& rotInPhsyics) |
| 58 | { |
| 59 | auto ret = new PhysicsMeshRenderer(); |
| 60 | if (ret->initWithFile(modelPath)) |
| 61 | { |
| 62 | ret->setModelTexture(modelPath, hlookup::empty_sv); |
| 63 | auto obj = Physics3DCollider::create(colliderDes); |
| 64 | ret->_physicsComponent = Physics3DComponent::create(obj, translateInPhysics, rotInPhsyics); |
| 65 | ret->addComponent(ret->_physicsComponent); |
| 66 | ret->_contentSize = ret->getBoundingBox().size; |
| 67 | ret->autorelease(); |
| 68 | return ret; |
| 69 | } |
| 70 | AX_SAFE_DELETE(ret); |
| 71 | return ret; |
| 72 | } |
| 73 | |
| 74 | Physics3DObject* PhysicsMeshRenderer::getPhysicsObj() const |
| 75 | { |
nothing calls this directly
no test coverage detected