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

Method getDepthInView

core/2d/Camera.cpp:387–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

385#endif
386
387float Camera::getDepthInView(const Mat4& transform) const
388{
389 Mat4 camWorldMat = getNodeToWorldTransform();
390 const Mat4& viewMat = camWorldMat.getInversed();
391 float depth = -(viewMat.m[2] * transform.m[12] + viewMat.m[6] * transform.m[13] + viewMat.m[10] * transform.m[14] +
392 viewMat.m[14]);
393 return depth;
394}
395
396void Camera::setDepth(int8_t depth)
397{

Callers 2

initMethod · 0.80
initMethod · 0.80

Calls 1

getInversedMethod · 0.45

Tested by

no test coverage detected