MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / getCollisionBBox

Method getCollisionBBox

src/logic/visuals/ModelVisual.cpp:563–581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

561}
562
563void ModelVisual::getCollisionBBox(Math::float3* bb)
564{
565 bb[0] = Math::float3(getMeshLib().getBBoxMin().v);
566 bb[1] = Math::float3(getMeshLib().getBBoxMax().v);
567
568 // These can be in various places...
569 if (bb[0].lengthSquared() == 0.0f && bb[1].lengthSquared() == 0.0f)
570 {
571 bb[0] = Math::float3(getMeshLib().getBBoxCollisionMin().v);
572 bb[1] = Math::float3(getMeshLib().getBBoxCollisionMax().v);
573
574 if (bb[0].lengthSquared() == 0.0f && bb[1].lengthSquared() == 0.0f)
575 {
576 const ZenLoad::zCModelMeshLib& zLib = m_World.getSkeletalMeshAllocator().getMeshLib(m_MainMeshHandle);
577 bb[0] = Math::float3(zLib.getBBoxMin().v);
578 bb[1] = Math::float3(zLib.getBBoxMax().v);
579 }
580 }
581}
582
583Math::float3 ModelVisual::getModelRoot()
584{

Callers 1

onVisualChangedMethod · 0.80

Calls 1

lengthSquaredMethod · 0.80

Tested by

no test coverage detected