MCPcopy Create free account
hub / github.com/axmolengine/axmol / createWithCollider

Method createWithCollider

core/physics3d/PhysicsMeshRenderer.cpp:54–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54PhysicsMeshRenderer* 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
74Physics3DObject* PhysicsMeshRenderer::getPhysicsObj() const
75{

Callers

nothing calls this directly

Calls 6

createFunction · 0.85
setModelTextureMethod · 0.80
addComponentMethod · 0.80
autoreleaseMethod · 0.80
initWithFileMethod · 0.45
getBoundingBoxMethod · 0.45

Tested by

no test coverage detected