ios - 在 iOS/Swift 中,MatrixHelper 属于哪个模块?

标签 ios swift matrix opengl-es arkit

我正在尝试遵循一些示例代码 https://medium.com/@yatchoi/getting-started-with-arkit-real-life-waypoints-1707e3cb1da2下面,我得到了 unresolved identifier 'MatrixHelper'

    let translationMatrix = MatrixHelper.translate(
        x: 0,
        y: 0,
        z: distance * -1
    )
    // Rotation matrix theta degrees
    let rotationMatrix = MatrixHelper.rotateAboutY(
        degrees: bearing * -1
    )

我需要导入什么库或包才能获得 MatrixHelper - 一些 Math 包?我用谷歌搜索了文档,但找不到任何东西。

最佳答案

我认为他只是写了一个自定义类来包装 GLKit 提供的功能。

他将该类命名为 MatrixHelper。

使用 MatrixHelper.rotateAboutY() 他调用类似的东西:

GLKMatrix4 GLKMatrix4Rotate(GLKMatrix4 matrix, float radians, float x, float y, float z);

所以MatrixHelper中使用的包是GLKit,更准确的说是GLKMatrix4

https://developer.apple.com/documentation/glkit/glkmatrix4-pce

关于ios - 在 iOS/Swift 中,MatrixHelper 属于哪个模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45442643/

相关文章:

ios - NSUserDefaults 线程在 IOS 上的扩展之间共享数据是否安全?

ios - 使使用 swift 协议(protocol)作为参数的 Objective-C 方法可公开访问

ios - 重写 func prepare(for segue : UIStoryboardSegue, sender : Any?) 不能正常工作

ios - 在 ios swift 中使用 alamofire 请求超时错误 1001?

python - 有效地计算矩阵中所有行的操作

iphone - 这三种技术中哪种技术会非常快?

ios - 更新到React Native 0.60+之后未链接动态库

swift : use of unresolved identifier

python - 如何在Python中求矩阵指数的积分

r - 创建三角矩阵