VRPose.linearAcceleration
Deprecated
Avoid using this feature in new projects. Development of the WebVR API halted in favor of WebXR. This feature may be a candidate for removal from web standards or browsers. >
Consider using the following features instead: WebXR. >
鿍æº: ãã®æ©è½ã¯æ¨æºåããã¦ãã¾ããã鿍æºã®æ©è½ã¯ãã©ã¦ã¶ã¼ã®å¯¾å¿ãéãããå°æ¥çã«å¤æ´ã¾ãã¯åé¤ãããå¯è½æ§ããããããæ¬çªç°å¢ã§ã®ä½¿ç¨ã¯æ¨å¥¨ããã¾ããããã ããæ¨æºã®é¸æè¢ãåå¨ããªãç¹å®ã®ã±ã¼ã¹ã§ã¯ãæå¹ãªä»£æ¿ææ®µã¨ãªãå ´åãããã¾ãã
linearAcceleration 㯠VRPose ã¤ã³ã¿ã¼ãã§ã¤ã¹ã®èªã¿åãå°ç¨ããããã£ã§ãç¾å¨ã® VRPose.timestamp ã«ããã VRDisplay ã®ç´ç·å é度ãã¯ãã«ã表ãé
åããã¡ã¼ãã«/ç§/ç§åä½ã§è¿ãã¾ãã
ã¡ã¢: ãã®ããããã£ã¯å¤ã WebVR API ã®ä¸é¨ã§ããããã㯠WebXR æ©å¨ API ã«ç½®ãæãããã¾ããã
è¨ãæããã°ã xãyãz è»¸ã«æ²¿ã£ãã»ã³ãµã¼ã®ç¾å¨ã®å é度ã§ãã
å¤
Float32Array ã§ããã¾ãã¯ãVRã»ã³ãµã¼ãç´ç·å é度ãã¼ã¿ãæä¾ã§ããªãå ´å㯠null ã§ãã
ä¾
// rendering loop for a VR scene
function drawVRScene() {
// WebVR: Request the next frame of the animation
vrSceneFrame = vrDisplay.requestAnimationFrame(drawVRScene);
// Populate frameData with the data of the next frame to display
vrDisplay.getFrameData(frameData);
// Retrieve the linear acceleration values for use in rendering
// curFramePose is a VRPose object
const curFramePose = frameData.pose;
const linAcc = curFramePose.linearAcceleration;
const lax = linAcc[0];
const lay = linAcc[1];
const laz = linAcc[2];
// render the scene
// â¦
// WebVR: submit the rendered frame to the VR display
vrDisplay.submitFrame();
}
仿§æ¸
ãã®ããããã£ã¯å¤ã WebVR API ã®ä¸é¨ã§ããããã㯠WebXR æ©å¨ API ã§ç½®ãæ¯ãããã¾ãããæ¨æºè¦æ ¼ã«ãªãè¦è¾¼ã¿ã¯ããã¾ããã
ãã¹ã¦ã®ãã©ã¦ã¶ã¼ãæ°ãã WebXR API ãå®è£ ããã¾ã§ã A-FrameãBabylon.jsãThree.js ãªã©ã®ãã¬ã¼ã ã¯ã¼ã¯ã使ç¨ããããããªãã£ã«ã使ç¨ãããã¨ãããã¹ã¦ã®ãã©ã¦ã¶ã¼ã§åä½ãã WebXR ã¢ããªãéçºããä¸ã§æ¨å¥¨ããã¾ãã[1]