OrientationSensor: phương thức populateMatrix()
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Phương thức populateMatrix() của giao diện OrientationSensor điền vào ma trận mục tiêu đã cho với ma trận quay dựa trên lần đọc cảm biến mới nhất. Ma trận quay được hiển thị dưới đây.

trong đó:
- W = cos(θ/2)
- X = Vx * sin(θ/2)
- Y = Vy * sin(θ/2)
- Z = Vz * sin(θ/2)
Cú pháp
js
populateMatrix(targetMatrix)
Vì OrientationSensor là một lớp cơ sở, populateMatrix chỉ có thể được đọc từ một trong các lớp dẫn xuất của nó.
Tham số
targetMatrix-
TBD
Giá trị trả về
Không có (undefined).
Ví dụ
js
// TBD
Thông số kỹ thuật
| Specification |
|---|
| Orientation Sensor> # orientationsensor-populatematrix> |